diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/_meta.json b/sdk/recoveryservices/azure-mgmt-recoveryservices/_meta.json index 5bdb8f34d062..dd7ee766dd33 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/_meta.json +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.2", + "autorest": "3.7.2", "use": [ - "@autorest/python@5.8.1", - "@autorest/modelerfour@4.19.2" + "@autorest/python@5.12.0", + "@autorest/modelerfour@4.19.3" ], - "commit": "7f530e3727f746e26f5b5ece8a5874daf10cc56f", + "commit": "85eb3e7dbe23e025b9c838bef309f11a05768f10", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/recoveryservices/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", + "autorest_command": "autorest specification/recoveryservices/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/recoveryservices/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/__init__.py index 725e4b43f358..c56abeb90c96 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/__init__.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/__init__.py @@ -12,8 +12,7 @@ __version__ = VERSION __all__ = ['RecoveryServicesClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_configuration.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_configuration.py index ec9dc244ebca..284c18a20e53 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_configuration.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_configuration.py @@ -6,18 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential @@ -35,20 +33,19 @@ class RecoveryServicesClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(RecoveryServicesClientConfiguration, self).__init__(**kwargs) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(RecoveryServicesClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-03-01" + self.api_version = "2022-01-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-recoveryservices/{}'.format(VERSION)) self._configure(**kwargs) @@ -68,4 +65,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_metadata.json b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_metadata.json index 3b046a3a96f7..22dbf24e8936 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_metadata.json +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_metadata.json @@ -1,17 +1,17 @@ { - "chosen_version": "2021-03-01", - "total_api_version_list": ["2021-03-01"], + "chosen_version": "2022-01-01", + "total_api_version_list": ["2022-01-01"], "client": { "name": "RecoveryServicesClient", "filename": "_recovery_services_client", "description": "Recovery Services Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"RecoveryServicesClientConfiguration\"], \"._operations_mixin\": [\"RecoveryServicesClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"RecoveryServicesClientConfiguration\"], \"._operations_mixin\": [\"RecoveryServicesClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"RecoveryServicesClientConfiguration\"], \"._operations_mixin\": [\"RecoveryServicesClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"RecoveryServicesClientConfiguration\"], \"._operations_mixin\": [\"RecoveryServicesClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -54,7 +54,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -74,7 +74,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -91,11 +91,10 @@ "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "vault_certificates": "VaultCertificatesOperations", @@ -109,12 +108,12 @@ "usages": "UsagesOperations" }, "operation_mixins": { - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}}", "operations": { "get_operation_status" : { "sync": { - "signature": "def get_operation_status(\n self,\n resource_group_name, # type: str\n vault_name, # type: str\n operation_id, # type: str\n **kwargs # type: Any\n):\n", + "signature": "def get_operation_status(\n self,\n resource_group_name, # type: str\n vault_name, # type: str\n operation_id, # type: str\n **kwargs # type: Any\n):\n # type: (...) -\u003e \"_models.OperationResource\"\n", "doc": "\"\"\"Gets the operation status for a resource.\n\n:param resource_group_name: The name of the resource group where the recovery services vault is\n present.\n:type resource_group_name: str\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\n:param operation_id:\n:type operation_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OperationResource, or the result of cls(response)\n:rtype: ~azure.mgmt.recoveryservices.models.OperationResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { @@ -126,7 +125,7 @@ }, "get_operation_result" : { "sync": { - "signature": "def get_operation_result(\n self,\n resource_group_name, # type: str\n vault_name, # type: str\n operation_id, # type: str\n **kwargs # type: Any\n):\n", + "signature": "def get_operation_result(\n self,\n resource_group_name, # type: str\n vault_name, # type: str\n operation_id, # type: str\n **kwargs # type: Any\n):\n # type: (...) -\u003e Optional[\"_models.Vault\"]\n", "doc": "\"\"\"Gets the operation result for a resource.\n\n:param resource_group_name: The name of the resource group where the recovery services vault is\n present.\n:type resource_group_name: str\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\n:param operation_id:\n:type operation_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Vault, or the result of cls(response)\n:rtype: ~azure.mgmt.recoveryservices.models.Vault or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_patch.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_recovery_services_client.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_recovery_services_client.py index ff2b62b6031f..82ef43393480 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_recovery_services_client.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_recovery_services_client.py @@ -6,31 +6,20 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import RecoveryServicesClientConfiguration +from .operations import Operations, PrivateLinkResourcesOperations, RecoveryServicesClientOperationsMixin, RecoveryServicesOperations, RegisteredIdentitiesOperations, ReplicationUsagesOperations, UsagesOperations, VaultCertificatesOperations, VaultExtendedInfoOperations, VaultsOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - from azure.core.credentials import TokenCredential - from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from ._configuration import RecoveryServicesClientConfiguration -from .operations import VaultCertificatesOperations -from .operations import RegisteredIdentitiesOperations -from .operations import ReplicationUsagesOperations -from .operations import PrivateLinkResourcesOperations -from .operations import RecoveryServicesOperations -from .operations import VaultsOperations -from .operations import Operations -from .operations import VaultExtendedInfoOperations -from .operations import RecoveryServicesClientOperationsMixin -from .operations import UsagesOperations -from . import models - class RecoveryServicesClient(RecoveryServicesClientOperationsMixin): """Recovery Services Client. @@ -38,11 +27,13 @@ class RecoveryServicesClient(RecoveryServicesClientOperationsMixin): :ivar vault_certificates: VaultCertificatesOperations operations :vartype vault_certificates: azure.mgmt.recoveryservices.operations.VaultCertificatesOperations :ivar registered_identities: RegisteredIdentitiesOperations operations - :vartype registered_identities: azure.mgmt.recoveryservices.operations.RegisteredIdentitiesOperations + :vartype registered_identities: + azure.mgmt.recoveryservices.operations.RegisteredIdentitiesOperations :ivar replication_usages: ReplicationUsagesOperations operations :vartype replication_usages: azure.mgmt.recoveryservices.operations.ReplicationUsagesOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.recoveryservices.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.recoveryservices.operations.PrivateLinkResourcesOperations :ivar recovery_services: RecoveryServicesOperations operations :vartype recovery_services: azure.mgmt.recoveryservices.operations.RecoveryServicesOperations :ivar vaults: VaultsOperations operations @@ -50,71 +41,70 @@ class RecoveryServicesClient(RecoveryServicesClientOperationsMixin): :ivar operations: Operations operations :vartype operations: azure.mgmt.recoveryservices.operations.Operations :ivar vault_extended_info: VaultExtendedInfoOperations operations - :vartype vault_extended_info: azure.mgmt.recoveryservices.operations.VaultExtendedInfoOperations + :vartype vault_extended_info: + azure.mgmt.recoveryservices.operations.VaultExtendedInfoOperations :ivar usages: UsagesOperations operations :vartype usages: azure.mgmt.recoveryservices.operations.UsagesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription Id. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = RecoveryServicesClientConfiguration(credential, subscription_id, **kwargs) + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = RecoveryServicesClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - - self.vault_certificates = VaultCertificatesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.registered_identities = RegisteredIdentitiesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_usages = ReplicationUsagesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.recovery_services = RecoveryServicesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.vaults = VaultsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.vault_extended_info = VaultExtendedInfoOperations( - self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + self._serialize.client_side_validation = False + self.vault_certificates = VaultCertificatesOperations(self._client, self._config, self._serialize, self._deserialize) + self.registered_identities = RegisteredIdentitiesOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_usages = ReplicationUsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.recovery_services = RecoveryServicesOperations(self._client, self._config, self._serialize, self._deserialize) + self.vaults = VaultsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.vault_extended_info = VaultExtendedInfoOperations(self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: Any + ) -> HttpResponse: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.HttpResponse """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_vendor.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# 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.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_version.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_version.py index 48944bf3938a..e5754a47ce68 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_version.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/__init__.py index 1134d60092da..4cf117717d2c 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/__init__.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/__init__.py @@ -8,3 +8,8 @@ from ._recovery_services_client import RecoveryServicesClient __all__ = ['RecoveryServicesClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_configuration.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_configuration.py index 3a503e36d9d2..b872a1902030 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_configuration.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -37,15 +37,15 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(RecoveryServicesClientConfiguration, self).__init__(**kwargs) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(RecoveryServicesClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-03-01" + self.api_version = "2022-01-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-recoveryservices/{}'.format(VERSION)) self._configure(**kwargs) @@ -64,4 +64,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_patch.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_recovery_services_client.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_recovery_services_client.py index 5e0a35fddd93..8c39bcc3efc8 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_recovery_services_client.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/_recovery_services_client.py @@ -6,111 +6,108 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import RecoveryServicesClientConfiguration +from .operations import Operations, PrivateLinkResourcesOperations, RecoveryServicesClientOperationsMixin, RecoveryServicesOperations, RegisteredIdentitiesOperations, ReplicationUsagesOperations, UsagesOperations, VaultCertificatesOperations, VaultExtendedInfoOperations, VaultsOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import RecoveryServicesClientConfiguration -from .operations import VaultCertificatesOperations -from .operations import RegisteredIdentitiesOperations -from .operations import ReplicationUsagesOperations -from .operations import PrivateLinkResourcesOperations -from .operations import RecoveryServicesOperations -from .operations import VaultsOperations -from .operations import Operations -from .operations import VaultExtendedInfoOperations -from .operations import RecoveryServicesClientOperationsMixin -from .operations import UsagesOperations -from .. import models - - class RecoveryServicesClient(RecoveryServicesClientOperationsMixin): """Recovery Services Client. :ivar vault_certificates: VaultCertificatesOperations operations - :vartype vault_certificates: azure.mgmt.recoveryservices.aio.operations.VaultCertificatesOperations + :vartype vault_certificates: + azure.mgmt.recoveryservices.aio.operations.VaultCertificatesOperations :ivar registered_identities: RegisteredIdentitiesOperations operations - :vartype registered_identities: azure.mgmt.recoveryservices.aio.operations.RegisteredIdentitiesOperations + :vartype registered_identities: + azure.mgmt.recoveryservices.aio.operations.RegisteredIdentitiesOperations :ivar replication_usages: ReplicationUsagesOperations operations - :vartype replication_usages: azure.mgmt.recoveryservices.aio.operations.ReplicationUsagesOperations + :vartype replication_usages: + azure.mgmt.recoveryservices.aio.operations.ReplicationUsagesOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: azure.mgmt.recoveryservices.aio.operations.PrivateLinkResourcesOperations + :vartype private_link_resources: + azure.mgmt.recoveryservices.aio.operations.PrivateLinkResourcesOperations :ivar recovery_services: RecoveryServicesOperations operations - :vartype recovery_services: azure.mgmt.recoveryservices.aio.operations.RecoveryServicesOperations + :vartype recovery_services: + azure.mgmt.recoveryservices.aio.operations.RecoveryServicesOperations :ivar vaults: VaultsOperations operations :vartype vaults: azure.mgmt.recoveryservices.aio.operations.VaultsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.recoveryservices.aio.operations.Operations :ivar vault_extended_info: VaultExtendedInfoOperations operations - :vartype vault_extended_info: azure.mgmt.recoveryservices.aio.operations.VaultExtendedInfoOperations + :vartype vault_extended_info: + azure.mgmt.recoveryservices.aio.operations.VaultExtendedInfoOperations :ivar usages: UsagesOperations operations :vartype usages: azure.mgmt.recoveryservices.aio.operations.UsagesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription Id. :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - base_url: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = RecoveryServicesClientConfiguration(credential, subscription_id, **kwargs) + self._config = RecoveryServicesClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.vault_certificates = VaultCertificatesOperations(self._client, self._config, self._serialize, self._deserialize) + self.registered_identities = RegisteredIdentitiesOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_usages = ReplicationUsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.recovery_services = RecoveryServicesOperations(self._client, self._config, self._serialize, self._deserialize) + self.vaults = VaultsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.vault_extended_info = VaultExtendedInfoOperations(self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) + - self.vault_certificates = VaultCertificatesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.registered_identities = RegisteredIdentitiesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_usages = ReplicationUsagesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.recovery_services = RecoveryServicesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.vaults = VaultsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.vault_extended_info = VaultExtendedInfoOperations( - self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.AsyncHttpResponse """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_operations.py index 16f63fd27350..ef756f3e71c3 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -48,8 +54,10 @@ def list( """Returns the list of available operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ClientDiscoveryResponse or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.ClientDiscoveryResponse] + :return: An iterator like instance of either ClientDiscoveryResponse or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.ClientDiscoveryResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ClientDiscoveryResponse"] @@ -57,30 +65,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ClientDiscoveryResponse', pipeline_response) + deserialized = self._deserialize("ClientDiscoveryResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -98,6 +103,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_private_link_resources_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_private_link_resources_operations.py index 3363b616ff72..da2d32292b3f 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_private_link_resources_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_private_link_resources_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -57,8 +63,10 @@ def list( :param vault_name: The name of the recovery services vault. :type vault_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResources or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.PrivateLinkResources] + :return: An iterator like instance of either PrivateLinkResources or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.PrivateLinkResources] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResources"] @@ -66,36 +74,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('PrivateLinkResources', pipeline_response) + deserialized = self._deserialize("PrivateLinkResources", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,11 +118,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -146,28 +153,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'privateLinkResourceName': self._serialize.url("private_link_resource_name", private_link_resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + private_link_resource_name=private_link_resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -181,4 +178,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources/{privateLinkResourceName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_client_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_client_operations.py index b603043fea7d..a8b7b3431828 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_client_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_client_operations.py @@ -5,21 +5,26 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._recovery_services_client_operations import build_get_operation_result_request, build_get_operation_status_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class RecoveryServicesClientOperationsMixin: + @distributed_trace_async async def get_operation_status( self, resource_group_name: str, @@ -46,28 +51,18 @@ async def get_operation_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_operation_status.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_operation_status_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + operation_id=operation_id, + template_url=self.get_operation_status.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -81,8 +76,11 @@ async def get_operation_status( return cls(pipeline_response, deserialized, {}) return deserialized + get_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationStatus/{operationId}'} # type: ignore + + @distributed_trace_async async def get_operation_result( self, resource_group_name: str, @@ -109,28 +107,18 @@ async def get_operation_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_operation_result.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_operation_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + operation_id=operation_id, + template_url=self.get_operation_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -146,4 +134,6 @@ async def get_operation_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_operation_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationResults/{operationId}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_operations.py index 0978a7d532c9..19cab53af7c9 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_recovery_services_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._recovery_services_operations import build_check_name_availability_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def check_name_availability( self, resource_group_name: str, @@ -48,8 +53,10 @@ async def check_name_availability( **kwargs: Any ) -> "_models.CheckNameAvailabilityResult": """API to check for resource name availability. - A name is available if no other resource exists that has the same SubscriptionId, Resource Name and Type - or if one or more such resources exist, each of these must be GC'd and their time of deletion be more than 24 Hours Ago. + A name is available if no other resource exists that has the same SubscriptionId, Resource Name + and Type + or if one or more such resources exist, each of these must be GC'd and their time of deletion + be more than 24 Hours Ago. API to check for resource name availability. A name is available if no other resource exists that has the same SubscriptionId, Resource Name @@ -74,32 +81,22 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.check_name_availability.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(input, 'CheckNameAvailabilityParameters') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_check_name_availability_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.check_name_availability.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'CheckNameAvailabilityParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -113,4 +110,6 @@ async def check_name_availability( return cls(pipeline_response, deserialized, {}) return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/locations/{location}/checkNameAvailability'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_registered_identities_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_registered_identities_operations.py index 846fcadfa908..d2be44a7e3ae 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_registered_identities_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_registered_identities_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._registered_identities_operations import build_delete_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -66,26 +71,18 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'identityName': self._serialize.url("identity_name", identity_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + identity_name=identity_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -97,3 +94,4 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/registeredIdentities/{identityName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_replication_usages_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_replication_usages_operations.py index e16b030a5fd5..73edf0c8a806 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_replication_usages_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_replication_usages_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._replication_usages_operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, resource_group_name: str, @@ -55,8 +61,10 @@ def list( :param vault_name: The name of the recovery services vault. :type vault_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ReplicationUsageList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.ReplicationUsageList] + :return: An iterator like instance of either ReplicationUsageList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.ReplicationUsageList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationUsageList"] @@ -64,36 +72,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ReplicationUsageList', pipeline_response) + deserialized = self._deserialize("ReplicationUsageList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -111,6 +116,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_usages_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_usages_operations.py index 24da06a76228..303d3c705160 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_usages_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_usages_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._usages_operations import build_list_by_vaults_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_vaults( self, resource_group_name: str, @@ -56,7 +62,8 @@ def list_by_vaults( :type vault_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VaultUsageList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.VaultUsageList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservices.models.VaultUsageList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.VaultUsageList"] @@ -64,36 +71,33 @@ def list_by_vaults( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_vaults.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_vaults_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.list_by_vaults.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_vaults_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('VaultUsageList', pipeline_response) + deserialized = self._deserialize("VaultUsageList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -111,6 +115,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_certificates_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_certificates_operations.py index c7e33d926362..9369214af1a4 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_certificates_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_certificates_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._vault_certificates_operations import build_create_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def create( self, resource_group_name: str, @@ -69,33 +74,23 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(certificate_request, 'CertificateRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + certificate_name=certificate_name, + content_type=content_type, + json=_json, + template_url=self.create.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(certificate_request, 'CertificateRequest') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -109,4 +104,6 @@ async def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/certificates/{certificateName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_extended_info_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_extended_info_operations.py index fe0a956e1885..e71094adae74 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_extended_info_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vault_extended_info_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._vault_extended_info_operations import build_create_or_update_request, build_get_request, build_update_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def get( self, resource_group_name: str, @@ -63,27 +68,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -97,8 +92,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo'} # type: ignore + + @distributed_trace_async async def create_or_update( self, resource_group_name: str, @@ -114,7 +112,8 @@ async def create_or_update( :param vault_name: The name of the recovery services vault. :type vault_name: str :param resource_extended_info_details: Details of ResourceExtendedInfo. - :type resource_extended_info_details: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource + :type resource_extended_info_details: + ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource :keyword callable cls: A custom type or function that will be passed the direct response :return: VaultExtendedInfoResource, or the result of cls(response) :rtype: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource @@ -125,32 +124,22 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -164,8 +153,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo'} # type: ignore + + @distributed_trace_async async def update( self, resource_group_name: str, @@ -181,7 +173,8 @@ async def update( :param vault_name: The name of the recovery services vault. :type vault_name: str :param resource_extended_info_details: Details of ResourceExtendedInfo. - :type resource_extended_info_details: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource + :type resource_extended_info_details: + ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource :keyword callable cls: A custom type or function that will be passed the direct response :return: VaultExtendedInfoResource, or the result of cls(response) :rtype: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource @@ -192,32 +185,22 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -231,4 +214,6 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vaults_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vaults_operations.py index e3cda9ae0bc6..94bd46a3cfb9 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vaults_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/aio/operations/_vaults_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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._vaults_operations import build_create_or_update_request_initial, build_delete_request, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_id_request, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_subscription_id( self, **kwargs: Any @@ -59,34 +65,29 @@ def list_by_subscription_id( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_subscription_id.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_subscription_id_request( + subscription_id=self._config.subscription_id, + template_url=self.list_by_subscription_id.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_subscription_id_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('VaultList', pipeline_response) + deserialized = self._deserialize("VaultList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,11 +105,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_subscription_id.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/vaults'} # type: ignore + @distributed_trace def list_by_resource_group( self, resource_group_name: str, @@ -129,35 +132,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('VaultList', pipeline_response) + deserialized = self._deserialize("VaultList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -175,11 +174,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -203,27 +204,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -237,8 +228,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + async def _create_or_update_initial( self, resource_group_name: str, @@ -251,32 +244,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(vault, 'Vault') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(vault, 'Vault') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -294,8 +277,11 @@ async def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, resource_group_name: str, @@ -314,15 +300,18 @@ async def begin_create_or_update( :type vault: ~azure.mgmt.recoveryservices.models.Vault :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. + :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. + :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 Vault or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservices.models.Vault] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Vault"] lro_delay = kwargs.pop( 'polling_interval', @@ -334,27 +323,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, vault_name=vault_name, vault=vault, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Vault', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -366,8 +349,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -391,27 +376,17 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -424,6 +399,7 @@ async def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + async def _update_initial( self, resource_group_name: str, @@ -436,32 +412,22 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(vault, 'PatchVault') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(vault, 'PatchVault') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -477,8 +443,11 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, resource_group_name: str, @@ -497,15 +466,18 @@ async def begin_update( :type vault: ~azure.mgmt.recoveryservices.models.PatchVault :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. + :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. + :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 Vault or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservices.models.Vault] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Vault"] lro_delay = kwargs.pop( 'polling_interval', @@ -517,27 +489,21 @@ async def begin_update( resource_group_name=resource_group_name, vault_name=vault_name, vault=vault, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Vault', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -549,4 +515,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/__init__.py index 5d0519244be4..571d302b7c4f 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/__init__.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/__init__.py @@ -6,108 +6,64 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import CertificateRequest - from ._models_py3 import CheckNameAvailabilityParameters - from ._models_py3 import CheckNameAvailabilityResult - from ._models_py3 import ClientDiscoveryDisplay - from ._models_py3 import ClientDiscoveryForLogSpecification - from ._models_py3 import ClientDiscoveryForProperties - from ._models_py3 import ClientDiscoveryForServiceSpecification - from ._models_py3 import ClientDiscoveryResponse - from ._models_py3 import ClientDiscoveryValueForSingleApi - from ._models_py3 import CmkKekIdentity - from ._models_py3 import CmkKeyVaultProperties - from ._models_py3 import Error - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import IdentityData - from ._models_py3 import JobsSummary - from ._models_py3 import MonitoringSummary - from ._models_py3 import NameInfo - from ._models_py3 import OperationResource - from ._models_py3 import PatchTrackedResource - from ._models_py3 import PatchVault - from ._models_py3 import PrivateEndpoint - from ._models_py3 import PrivateEndpointConnection - from ._models_py3 import PrivateEndpointConnectionVaultProperties - from ._models_py3 import PrivateLinkResource - from ._models_py3 import PrivateLinkResources - from ._models_py3 import PrivateLinkServiceConnectionState - from ._models_py3 import RawCertificateData - from ._models_py3 import ReplicationUsage - from ._models_py3 import ReplicationUsageList - from ._models_py3 import Resource - from ._models_py3 import ResourceCertificateAndAadDetails - from ._models_py3 import ResourceCertificateAndAcsDetails - from ._models_py3 import ResourceCertificateDetails - from ._models_py3 import Sku - from ._models_py3 import SystemData - from ._models_py3 import TrackedResource - from ._models_py3 import UpgradeDetails - from ._models_py3 import UserIdentity - from ._models_py3 import Vault - from ._models_py3 import VaultCertificateResponse - from ._models_py3 import VaultExtendedInfoResource - from ._models_py3 import VaultList - from ._models_py3 import VaultProperties - from ._models_py3 import VaultPropertiesEncryption - from ._models_py3 import VaultUsage - from ._models_py3 import VaultUsageList -except (SyntaxError, ImportError): - from ._models import CertificateRequest # type: ignore - from ._models import CheckNameAvailabilityParameters # type: ignore - from ._models import CheckNameAvailabilityResult # type: ignore - from ._models import ClientDiscoveryDisplay # type: ignore - from ._models import ClientDiscoveryForLogSpecification # type: ignore - from ._models import ClientDiscoveryForProperties # type: ignore - from ._models import ClientDiscoveryForServiceSpecification # type: ignore - from ._models import ClientDiscoveryResponse # type: ignore - from ._models import ClientDiscoveryValueForSingleApi # type: ignore - from ._models import CmkKekIdentity # type: ignore - from ._models import CmkKeyVaultProperties # type: ignore - from ._models import Error # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import IdentityData # type: ignore - from ._models import JobsSummary # type: ignore - from ._models import MonitoringSummary # type: ignore - from ._models import NameInfo # type: ignore - from ._models import OperationResource # type: ignore - from ._models import PatchTrackedResource # type: ignore - from ._models import PatchVault # type: ignore - from ._models import PrivateEndpoint # type: ignore - from ._models import PrivateEndpointConnection # type: ignore - from ._models import PrivateEndpointConnectionVaultProperties # type: ignore - from ._models import PrivateLinkResource # type: ignore - from ._models import PrivateLinkResources # type: ignore - from ._models import PrivateLinkServiceConnectionState # type: ignore - from ._models import RawCertificateData # type: ignore - from ._models import ReplicationUsage # type: ignore - from ._models import ReplicationUsageList # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceCertificateAndAadDetails # type: ignore - from ._models import ResourceCertificateAndAcsDetails # type: ignore - from ._models import ResourceCertificateDetails # type: ignore - from ._models import Sku # type: ignore - from ._models import SystemData # type: ignore - from ._models import TrackedResource # type: ignore - from ._models import UpgradeDetails # type: ignore - from ._models import UserIdentity # type: ignore - from ._models import Vault # type: ignore - from ._models import VaultCertificateResponse # type: ignore - from ._models import VaultExtendedInfoResource # type: ignore - from ._models import VaultList # type: ignore - from ._models import VaultProperties # type: ignore - from ._models import VaultPropertiesEncryption # type: ignore - from ._models import VaultUsage # type: ignore - from ._models import VaultUsageList # type: ignore +from ._models_py3 import CertificateRequest +from ._models_py3 import CheckNameAvailabilityParameters +from ._models_py3 import CheckNameAvailabilityResult +from ._models_py3 import ClientDiscoveryDisplay +from ._models_py3 import ClientDiscoveryForLogSpecification +from ._models_py3 import ClientDiscoveryForProperties +from ._models_py3 import ClientDiscoveryForServiceSpecification +from ._models_py3 import ClientDiscoveryResponse +from ._models_py3 import ClientDiscoveryValueForSingleApi +from ._models_py3 import CmkKekIdentity +from ._models_py3 import CmkKeyVaultProperties +from ._models_py3 import Error +from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import IdentityData +from ._models_py3 import JobsSummary +from ._models_py3 import MonitoringSummary +from ._models_py3 import NameInfo +from ._models_py3 import OperationResource +from ._models_py3 import PatchTrackedResource +from ._models_py3 import PatchVault +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionVaultProperties +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResources +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import RawCertificateData +from ._models_py3 import ReplicationUsage +from ._models_py3 import ReplicationUsageList +from ._models_py3 import Resource +from ._models_py3 import ResourceCertificateAndAadDetails +from ._models_py3 import ResourceCertificateAndAcsDetails +from ._models_py3 import ResourceCertificateDetails +from ._models_py3 import Sku +from ._models_py3 import SystemData +from ._models_py3 import TrackedResource +from ._models_py3 import UpgradeDetails +from ._models_py3 import UserIdentity +from ._models_py3 import Vault +from ._models_py3 import VaultCertificateResponse +from ._models_py3 import VaultExtendedInfoResource +from ._models_py3 import VaultList +from ._models_py3 import VaultProperties +from ._models_py3 import VaultPropertiesEncryption +from ._models_py3 import VaultPropertiesMoveDetails +from ._models_py3 import VaultUsage +from ._models_py3 import VaultUsageList + from ._recovery_services_client_enums import ( AuthType, + BackupStorageVersion, CreatedByType, InfrastructureEncryptionState, PrivateEndpointConnectionStatus, ProvisioningState, ResourceIdentityType, + ResourceMoveState, SkuName, TriggerType, UsagesUnit, @@ -160,14 +116,17 @@ 'VaultList', 'VaultProperties', 'VaultPropertiesEncryption', + 'VaultPropertiesMoveDetails', 'VaultUsage', 'VaultUsageList', 'AuthType', + 'BackupStorageVersion', 'CreatedByType', 'InfrastructureEncryptionState', 'PrivateEndpointConnectionStatus', 'ProvisioningState', 'ResourceIdentityType', + 'ResourceMoveState', 'SkuName', 'TriggerType', 'UsagesUnit', diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models.py deleted file mode 100644 index 943a1bba909f..000000000000 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models.py +++ /dev/null @@ -1,1699 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class CertificateRequest(msrest.serialization.Model): - """Details of the certificate to be uploaded to the vault. - - :param properties: Raw certificate data. - :type properties: ~azure.mgmt.recoveryservices.models.RawCertificateData - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'RawCertificateData'}, - } - - def __init__( - self, - **kwargs - ): - super(CertificateRequest, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class CheckNameAvailabilityParameters(msrest.serialization.Model): - """Resource Name availability input parameters - Resource type and resource name. - - :param type: Describes the Resource type: Microsoft.RecoveryServices/Vaults. - :type type: str - :param name: Resource name for which availability needs to be checked. - :type name: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CheckNameAvailabilityParameters, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.name = kwargs.get('name', None) - - -class CheckNameAvailabilityResult(msrest.serialization.Model): - """Response for check name availability API. Resource provider will set availability as true | false. - - :param name_available: - :type name_available: bool - :param reason: - :type reason: str - :param message: - :type message: str - """ - - _attribute_map = { - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CheckNameAvailabilityResult, self).__init__(**kwargs) - self.name_available = kwargs.get('name_available', None) - self.reason = kwargs.get('reason', None) - self.message = kwargs.get('message', None) - - -class ClientDiscoveryDisplay(msrest.serialization.Model): - """Localized display information of an operation. - - :param provider: Name of the provider for display purposes. - :type provider: str - :param resource: ResourceType for which this Operation can be performed. - :type resource: str - :param operation: Operations Name itself. - :type operation: str - :param description: Description of the operation having details of what operation is about. - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ClientDiscoveryDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class ClientDiscoveryForLogSpecification(msrest.serialization.Model): - """Class to represent shoebox log specification in json client discovery. - - :param name: Name of the log. - :type name: str - :param display_name: Localized display name. - :type display_name: str - :param blob_duration: Blobs created in customer storage account per hour. - :type blob_duration: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ClientDiscoveryForLogSpecification, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.blob_duration = kwargs.get('blob_duration', None) - - -class ClientDiscoveryForProperties(msrest.serialization.Model): - """Class to represent shoebox properties in json client discovery. - - :param service_specification: Operation properties. - :type service_specification: - ~azure.mgmt.recoveryservices.models.ClientDiscoveryForServiceSpecification - """ - - _attribute_map = { - 'service_specification': {'key': 'serviceSpecification', 'type': 'ClientDiscoveryForServiceSpecification'}, - } - - def __init__( - self, - **kwargs - ): - super(ClientDiscoveryForProperties, self).__init__(**kwargs) - self.service_specification = kwargs.get('service_specification', None) - - -class ClientDiscoveryForServiceSpecification(msrest.serialization.Model): - """Class to represent shoebox service specification in json client discovery. - - :param log_specifications: List of log specifications of this operation. - :type log_specifications: - list[~azure.mgmt.recoveryservices.models.ClientDiscoveryForLogSpecification] - """ - - _attribute_map = { - 'log_specifications': {'key': 'logSpecifications', 'type': '[ClientDiscoveryForLogSpecification]'}, - } - - def __init__( - self, - **kwargs - ): - super(ClientDiscoveryForServiceSpecification, self).__init__(**kwargs) - self.log_specifications = kwargs.get('log_specifications', None) - - -class ClientDiscoveryResponse(msrest.serialization.Model): - """Operations List response which contains list of available APIs. - - :param value: List of available operations. - :type value: list[~azure.mgmt.recoveryservices.models.ClientDiscoveryValueForSingleApi] - :param next_link: Link to the next chunk of the response. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ClientDiscoveryValueForSingleApi]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ClientDiscoveryResponse, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ClientDiscoveryValueForSingleApi(msrest.serialization.Model): - """Available operation details. - - :param name: Name of the Operation. - :type name: str - :param display: Contains the localized display information for this particular operation. - :type display: ~azure.mgmt.recoveryservices.models.ClientDiscoveryDisplay - :param origin: The intended executor of the operation;governs the display of the operation in - the RBAC UX and the audit logs UX. - :type origin: str - :param properties: ShoeBox properties for the given operation. - :type properties: ~azure.mgmt.recoveryservices.models.ClientDiscoveryForProperties - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'ClientDiscoveryDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ClientDiscoveryForProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ClientDiscoveryValueForSingleApi, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.properties = kwargs.get('properties', None) - - -class CmkKekIdentity(msrest.serialization.Model): - """The details of the identity used for CMK. - - :param use_system_assigned_identity: Indicate that system assigned identity should be used. - Mutually exclusive with 'userAssignedIdentity' field. - :type use_system_assigned_identity: bool - :param user_assigned_identity: The user assigned identity to be used to grant permissions in - case the type of identity used is UserAssigned. - :type user_assigned_identity: str - """ - - _attribute_map = { - 'use_system_assigned_identity': {'key': 'useSystemAssignedIdentity', 'type': 'bool'}, - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CmkKekIdentity, self).__init__(**kwargs) - self.use_system_assigned_identity = kwargs.get('use_system_assigned_identity', None) - self.user_assigned_identity = kwargs.get('user_assigned_identity', None) - - -class CmkKeyVaultProperties(msrest.serialization.Model): - """The properties of the Key Vault which hosts CMK. - - :param key_uri: The key uri of the Customer Managed Key. - :type key_uri: str - """ - - _attribute_map = { - 'key_uri': {'key': 'keyUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CmkKeyVaultProperties, self).__init__(**kwargs) - self.key_uri = kwargs.get('key_uri', None) - - -class Error(msrest.serialization.Model): - """The resource management error response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.recoveryservices.models.ErrorAdditionalInfo] - :ivar code: The error code. - :vartype code: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.recoveryservices.models.Error] - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - """ - - _validation = { - 'additional_info': {'readonly': True}, - 'code': {'readonly': True}, - 'details': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - } - - _attribute_map = { - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - 'code': {'key': 'code', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[Error]'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Error, self).__init__(**kwargs) - self.additional_info = None - self.code = None - self.details = None - self.message = None - self.target = None - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar info: The additional info. - :vartype info: any - :ivar type: The additional info type. - :vartype type: str - """ - - _validation = { - 'info': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'info': {'key': 'info', 'type': 'object'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.info = None - self.type = None - - -class IdentityData(msrest.serialization.Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :param type: Required. The type of managed identity used. The type 'SystemAssigned, - UserAssigned' includes both an implicitly created identity and a set of user-assigned - identities. The type 'None' will remove any identities. Possible values include: - "SystemAssigned", "None", "UserAssigned", "SystemAssigned, UserAssigned". - :type type: str or ~azure.mgmt.recoveryservices.models.ResourceIdentityType - :param user_assigned_identities: The list of user-assigned identities associated with the - resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, ~azure.mgmt.recoveryservices.models.UserIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentity}'}, - } - - def __init__( - self, - **kwargs - ): - super(IdentityData, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class JobsSummary(msrest.serialization.Model): - """Summary of the replication job data for this vault. - - :param failed_jobs: Count of failed jobs. - :type failed_jobs: int - :param suspended_jobs: Count of suspended jobs. - :type suspended_jobs: int - :param in_progress_jobs: Count of in-progress jobs. - :type in_progress_jobs: int - """ - - _attribute_map = { - 'failed_jobs': {'key': 'failedJobs', 'type': 'int'}, - 'suspended_jobs': {'key': 'suspendedJobs', 'type': 'int'}, - 'in_progress_jobs': {'key': 'inProgressJobs', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(JobsSummary, self).__init__(**kwargs) - self.failed_jobs = kwargs.get('failed_jobs', None) - self.suspended_jobs = kwargs.get('suspended_jobs', None) - self.in_progress_jobs = kwargs.get('in_progress_jobs', None) - - -class MonitoringSummary(msrest.serialization.Model): - """Summary of the replication monitoring data for this vault. - - :param un_healthy_vm_count: Count of unhealthy VMs. - :type un_healthy_vm_count: int - :param un_healthy_provider_count: Count of unhealthy replication providers. - :type un_healthy_provider_count: int - :param events_count: Count of all critical warnings. - :type events_count: int - :param deprecated_provider_count: Count of all deprecated recovery service providers. - :type deprecated_provider_count: int - :param supported_provider_count: Count of all the supported recovery service providers. - :type supported_provider_count: int - :param unsupported_provider_count: Count of all the unsupported recovery service providers. - :type unsupported_provider_count: int - """ - - _attribute_map = { - 'un_healthy_vm_count': {'key': 'unHealthyVmCount', 'type': 'int'}, - 'un_healthy_provider_count': {'key': 'unHealthyProviderCount', 'type': 'int'}, - 'events_count': {'key': 'eventsCount', 'type': 'int'}, - 'deprecated_provider_count': {'key': 'deprecatedProviderCount', 'type': 'int'}, - 'supported_provider_count': {'key': 'supportedProviderCount', 'type': 'int'}, - 'unsupported_provider_count': {'key': 'unsupportedProviderCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(MonitoringSummary, self).__init__(**kwargs) - self.un_healthy_vm_count = kwargs.get('un_healthy_vm_count', None) - self.un_healthy_provider_count = kwargs.get('un_healthy_provider_count', None) - self.events_count = kwargs.get('events_count', None) - self.deprecated_provider_count = kwargs.get('deprecated_provider_count', None) - self.supported_provider_count = kwargs.get('supported_provider_count', None) - self.unsupported_provider_count = kwargs.get('unsupported_provider_count', None) - - -class NameInfo(msrest.serialization.Model): - """The name of usage. - - :param value: Value of usage. - :type value: str - :param localized_value: Localized value of usage. - :type localized_value: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NameInfo, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.localized_value = kwargs.get('localized_value', None) - - -class OperationResource(msrest.serialization.Model): - """Operation Resource. - - :param end_time: End time of the operation. - :type end_time: ~datetime.datetime - :param error: Required if status == failed or status == canceled. This is the OData v4 error - format, used by the RPC and will go into the v2.2 Azure REST API guidelines. - :type error: ~azure.mgmt.recoveryservices.models.Error - :param id: It should match what is used to GET the operation result. - :type id: str - :param name: It must match the last segment of the "id" field, and will typically be a GUID / - system generated value. - :type name: str - :param status: The status of the operation. (InProgress/Success/Failed/Cancelled). - :type status: str - :param start_time: Start time of the operation. - :type start_time: ~datetime.datetime - """ - - _attribute_map = { - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'error': {'key': 'error', 'type': 'Error'}, - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationResource, self).__init__(**kwargs) - self.end_time = kwargs.get('end_time', None) - self.error = kwargs.get('error', None) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.status = kwargs.get('status', None) - self.start_time = kwargs.get('start_time', None) - - -class Resource(msrest.serialization.Model): - """ARM Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id represents the complete path to the resource. - :vartype id: str - :ivar name: Resource name associated with the resource. - :vartype name: str - :ivar type: Resource type represents the complete path of the form - Namespace/ResourceType/ResourceType/... - :vartype type: str - :param etag: Optional ETag. - :type etag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.etag = kwargs.get('etag', None) - - -class PatchTrackedResource(Resource): - """Tracked resource with location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id represents the complete path to the resource. - :vartype id: str - :ivar name: Resource name associated with the resource. - :vartype name: str - :ivar type: Resource type represents the complete path of the form - Namespace/ResourceType/ResourceType/... - :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(PatchTrackedResource, self).__init__(**kwargs) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - - -class PatchVault(PatchTrackedResource): - """Patch Resource information, as returned by the resource provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id represents the complete path to the resource. - :vartype id: str - :ivar name: Resource name associated with the resource. - :vartype name: str - :ivar type: Resource type represents the complete path of the form - Namespace/ResourceType/ResourceType/... - :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param properties: Properties of the vault. - :type properties: ~azure.mgmt.recoveryservices.models.VaultProperties - :param sku: Identifies the unique system identifier for each Azure resource. - :type sku: ~azure.mgmt.recoveryservices.models.Sku - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.recoveryservices.models.IdentityData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'VaultProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'IdentityData'}, - } - - def __init__( - self, - **kwargs - ): - super(PatchVault, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.identity = kwargs.get('identity', None) - - -class PrivateEndpoint(msrest.serialization.Model): - """The Private Endpoint network resource that is linked to the Private Endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Gets or sets id. - :vartype id: str - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpoint, self).__init__(**kwargs) - self.id = None - - -class PrivateEndpointConnection(msrest.serialization.Model): - """Private Endpoint Connection Response Properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: Gets or sets provisioning state of the private endpoint connection. - Possible values include: "Succeeded", "Deleting", "Failed", "Pending". - :vartype provisioning_state: str or ~azure.mgmt.recoveryservices.models.ProvisioningState - :ivar private_endpoint: The Private Endpoint network resource that is linked to the Private - Endpoint connection. - :vartype private_endpoint: ~azure.mgmt.recoveryservices.models.PrivateEndpoint - :ivar private_link_service_connection_state: Gets or sets private link service connection - state. - :vartype private_link_service_connection_state: - ~azure.mgmt.recoveryservices.models.PrivateLinkServiceConnectionState - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'private_endpoint': {'readonly': True}, - 'private_link_service_connection_state': {'readonly': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpoint'}, - 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnection, self).__init__(**kwargs) - self.provisioning_state = None - self.private_endpoint = None - self.private_link_service_connection_state = None - - -class PrivateEndpointConnectionVaultProperties(msrest.serialization.Model): - """Information to be stored in Vault properties as an element of privateEndpointConnections List. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Format of id - subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.[Service]/{resource}/{resourceName}/privateEndpointConnections/{connectionName}. - :vartype id: str - :ivar properties: Private Endpoint Connection Response Properties. - :vartype properties: ~azure.mgmt.recoveryservices.models.PrivateEndpointConnection - """ - - _validation = { - 'id': {'readonly': True}, - 'properties': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnection'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateEndpointConnectionVaultProperties, self).__init__(**kwargs) - self.id = None - self.properties = None - - -class PrivateLinkResource(msrest.serialization.Model): - """Information of the private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified identifier of the resource. - :vartype id: str - :ivar name: Name of the resource. - :vartype name: str - :ivar type: e.g. Microsoft.RecoveryServices/vaults/privateLinkResources. - :vartype type: str - :ivar group_id: e.g. f9ad6492-33d4-4690-9999-6bfd52a0d081 (Backup) or - f9ad6492-33d4-4690-9999-6bfd52a0d082 (SiteRecovery). - :vartype group_id: str - :ivar required_members: [backup-ecs1, backup-prot1, backup-prot1b, backup-prot1c, backup-id1]. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource Private link DNS zone name. - :vartype required_zone_names: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, - 'required_zone_names': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.group_id = None - self.required_members = None - self.required_zone_names = None - - -class PrivateLinkResources(msrest.serialization.Model): - """Class which represent the stamps associated with the vault. - - :param value: A collection of private link resources. - :type value: list[~azure.mgmt.recoveryservices.models.PrivateLinkResource] - :param next_link: Link to the next chunk of the response. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResources, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """Gets or sets private link service connection state. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar status: Gets or sets the status. Possible values include: "Pending", "Approved", - "Rejected", "Disconnected". - :vartype status: str or ~azure.mgmt.recoveryservices.models.PrivateEndpointConnectionStatus - :ivar description: Gets or sets description. - :vartype description: str - :ivar actions_required: Gets or sets actions required. - :vartype actions_required: str - """ - - _validation = { - 'status': {'readonly': True}, - 'description': {'readonly': True}, - 'actions_required': {'readonly': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = None - self.description = None - self.actions_required = None - - -class RawCertificateData(msrest.serialization.Model): - """Raw certificate data. - - :param auth_type: Specifies the authentication type. Possible values include: "Invalid", "ACS", - "AAD", "AccessControlService", "AzureActiveDirectory". - :type auth_type: str or ~azure.mgmt.recoveryservices.models.AuthType - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray - """ - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(RawCertificateData, self).__init__(**kwargs) - self.auth_type = kwargs.get('auth_type', None) - self.certificate = kwargs.get('certificate', None) - - -class ReplicationUsage(msrest.serialization.Model): - """Replication usages of a vault. - - :param monitoring_summary: Summary of the replication monitoring data for this vault. - :type monitoring_summary: ~azure.mgmt.recoveryservices.models.MonitoringSummary - :param jobs_summary: Summary of the replication jobs data for this vault. - :type jobs_summary: ~azure.mgmt.recoveryservices.models.JobsSummary - :param protected_item_count: Number of replication protected items for this vault. - :type protected_item_count: int - :param recovery_plan_count: Number of replication recovery plans for this vault. - :type recovery_plan_count: int - :param registered_servers_count: Number of servers registered to this vault. - :type registered_servers_count: int - :param recovery_services_provider_auth_type: The authentication type of recovery service - providers in the vault. - :type recovery_services_provider_auth_type: int - """ - - _attribute_map = { - 'monitoring_summary': {'key': 'monitoringSummary', 'type': 'MonitoringSummary'}, - 'jobs_summary': {'key': 'jobsSummary', 'type': 'JobsSummary'}, - 'protected_item_count': {'key': 'protectedItemCount', 'type': 'int'}, - 'recovery_plan_count': {'key': 'recoveryPlanCount', 'type': 'int'}, - 'registered_servers_count': {'key': 'registeredServersCount', 'type': 'int'}, - 'recovery_services_provider_auth_type': {'key': 'recoveryServicesProviderAuthType', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationUsage, self).__init__(**kwargs) - self.monitoring_summary = kwargs.get('monitoring_summary', None) - self.jobs_summary = kwargs.get('jobs_summary', None) - self.protected_item_count = kwargs.get('protected_item_count', None) - self.recovery_plan_count = kwargs.get('recovery_plan_count', None) - self.registered_servers_count = kwargs.get('registered_servers_count', None) - self.recovery_services_provider_auth_type = kwargs.get('recovery_services_provider_auth_type', None) - - -class ReplicationUsageList(msrest.serialization.Model): - """Replication usages for vault. - - :param value: The list of replication usages for the given vault. - :type value: list[~azure.mgmt.recoveryservices.models.ReplicationUsage] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ReplicationUsage]'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationUsageList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class ResourceCertificateDetails(msrest.serialization.Model): - """Certificate details representing the Vault credentials. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ResourceCertificateAndAcsDetails, ResourceCertificateAndAadDetails. - - All required parameters must be populated in order to send to Azure. - - :param auth_type: Required. This property will be used as the discriminator for deciding the - specific types in the polymorphic chain of types.Constant filled by server. - :type auth_type: str - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray - :param friendly_name: Certificate friendly name. - :type friendly_name: str - :param issuer: Certificate issuer. - :type issuer: str - :param resource_id: Resource ID of the vault. - :type resource_id: long - :param subject: Certificate Subject Name. - :type subject: str - :param thumbprint: Certificate thumbprint. - :type thumbprint: str - :param valid_from: Certificate Validity start Date time. - :type valid_from: ~datetime.datetime - :param valid_to: Certificate Validity End Date time. - :type valid_to: ~datetime.datetime - """ - - _validation = { - 'auth_type': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'bytearray'}, - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'issuer': {'key': 'issuer', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'long'}, - 'subject': {'key': 'subject', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - 'valid_from': {'key': 'validFrom', 'type': 'iso-8601'}, - 'valid_to': {'key': 'validTo', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'auth_type': {'AccessControlService': 'ResourceCertificateAndAcsDetails', 'AzureActiveDirectory': 'ResourceCertificateAndAadDetails'} - } - - def __init__( - self, - **kwargs - ): - super(ResourceCertificateDetails, self).__init__(**kwargs) - self.auth_type = None # type: Optional[str] - self.certificate = kwargs.get('certificate', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.issuer = kwargs.get('issuer', None) - self.resource_id = kwargs.get('resource_id', None) - self.subject = kwargs.get('subject', None) - self.thumbprint = kwargs.get('thumbprint', None) - self.valid_from = kwargs.get('valid_from', None) - self.valid_to = kwargs.get('valid_to', None) - - -class ResourceCertificateAndAadDetails(ResourceCertificateDetails): - """Certificate details representing the Vault credentials for AAD. - - All required parameters must be populated in order to send to Azure. - - :param auth_type: Required. This property will be used as the discriminator for deciding the - specific types in the polymorphic chain of types.Constant filled by server. - :type auth_type: str - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray - :param friendly_name: Certificate friendly name. - :type friendly_name: str - :param issuer: Certificate issuer. - :type issuer: str - :param resource_id: Resource ID of the vault. - :type resource_id: long - :param subject: Certificate Subject Name. - :type subject: str - :param thumbprint: Certificate thumbprint. - :type thumbprint: str - :param valid_from: Certificate Validity start Date time. - :type valid_from: ~datetime.datetime - :param valid_to: Certificate Validity End Date time. - :type valid_to: ~datetime.datetime - :param aad_authority: Required. AAD tenant authority. - :type aad_authority: str - :param aad_tenant_id: Required. AAD tenant Id. - :type aad_tenant_id: str - :param service_principal_client_id: Required. AAD service principal clientId. - :type service_principal_client_id: str - :param service_principal_object_id: Required. AAD service principal ObjectId. - :type service_principal_object_id: str - :param azure_management_endpoint_audience: Required. Azure Management Endpoint Audience. - :type azure_management_endpoint_audience: str - :param service_resource_id: Service Resource Id. - :type service_resource_id: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'aad_authority': {'required': True}, - 'aad_tenant_id': {'required': True}, - 'service_principal_client_id': {'required': True}, - 'service_principal_object_id': {'required': True}, - 'azure_management_endpoint_audience': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'bytearray'}, - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'issuer': {'key': 'issuer', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'long'}, - 'subject': {'key': 'subject', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - 'valid_from': {'key': 'validFrom', 'type': 'iso-8601'}, - 'valid_to': {'key': 'validTo', 'type': 'iso-8601'}, - 'aad_authority': {'key': 'aadAuthority', 'type': 'str'}, - 'aad_tenant_id': {'key': 'aadTenantId', 'type': 'str'}, - 'service_principal_client_id': {'key': 'servicePrincipalClientId', 'type': 'str'}, - 'service_principal_object_id': {'key': 'servicePrincipalObjectId', 'type': 'str'}, - 'azure_management_endpoint_audience': {'key': 'azureManagementEndpointAudience', 'type': 'str'}, - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceCertificateAndAadDetails, self).__init__(**kwargs) - self.auth_type = 'AzureActiveDirectory' # type: str - self.aad_authority = kwargs['aad_authority'] - self.aad_tenant_id = kwargs['aad_tenant_id'] - self.service_principal_client_id = kwargs['service_principal_client_id'] - self.service_principal_object_id = kwargs['service_principal_object_id'] - self.azure_management_endpoint_audience = kwargs['azure_management_endpoint_audience'] - self.service_resource_id = kwargs.get('service_resource_id', None) - - -class ResourceCertificateAndAcsDetails(ResourceCertificateDetails): - """Certificate details representing the Vault credentials for ACS. - - All required parameters must be populated in order to send to Azure. - - :param auth_type: Required. This property will be used as the discriminator for deciding the - specific types in the polymorphic chain of types.Constant filled by server. - :type auth_type: str - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray - :param friendly_name: Certificate friendly name. - :type friendly_name: str - :param issuer: Certificate issuer. - :type issuer: str - :param resource_id: Resource ID of the vault. - :type resource_id: long - :param subject: Certificate Subject Name. - :type subject: str - :param thumbprint: Certificate thumbprint. - :type thumbprint: str - :param valid_from: Certificate Validity start Date time. - :type valid_from: ~datetime.datetime - :param valid_to: Certificate Validity End Date time. - :type valid_to: ~datetime.datetime - :param global_acs_namespace: Required. ACS namespace name - tenant for our service. - :type global_acs_namespace: str - :param global_acs_host_name: Required. Acs mgmt host name to connect to. - :type global_acs_host_name: str - :param global_acs_rp_realm: Required. Global ACS namespace RP realm. - :type global_acs_rp_realm: str - """ - - _validation = { - 'auth_type': {'required': True}, - 'global_acs_namespace': {'required': True}, - 'global_acs_host_name': {'required': True}, - 'global_acs_rp_realm': {'required': True}, - } - - _attribute_map = { - 'auth_type': {'key': 'authType', 'type': 'str'}, - 'certificate': {'key': 'certificate', 'type': 'bytearray'}, - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'issuer': {'key': 'issuer', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'long'}, - 'subject': {'key': 'subject', 'type': 'str'}, - 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, - 'valid_from': {'key': 'validFrom', 'type': 'iso-8601'}, - 'valid_to': {'key': 'validTo', 'type': 'iso-8601'}, - 'global_acs_namespace': {'key': 'globalAcsNamespace', 'type': 'str'}, - 'global_acs_host_name': {'key': 'globalAcsHostName', 'type': 'str'}, - 'global_acs_rp_realm': {'key': 'globalAcsRPRealm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceCertificateAndAcsDetails, self).__init__(**kwargs) - self.auth_type = 'AccessControlService' # type: str - self.global_acs_namespace = kwargs['global_acs_namespace'] - self.global_acs_host_name = kwargs['global_acs_host_name'] - self.global_acs_rp_realm = kwargs['global_acs_rp_realm'] - - -class Sku(msrest.serialization.Model): - """Identifies the unique system identifier for each Azure resource. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The Sku name. Possible values include: "Standard", "RS0". - :type name: str or ~azure.mgmt.recoveryservices.models.SkuName - :param tier: The Sku tier. - :type tier: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Sku, self).__init__(**kwargs) - self.name = kwargs['name'] - self.tier = kwargs.get('tier', None) - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType - :param last_modified_at: The type of identity that last modified the resource. - :type last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class TrackedResource(Resource): - """Tracked resource with location. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id represents the complete path to the resource. - :vartype id: str - :ivar name: Resource name associated with the resource. - :vartype name: str - :ivar type: Resource type represents the complete path of the form - Namespace/ResourceType/ResourceType/... - :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TrackedResource, self).__init__(**kwargs) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class UpgradeDetails(msrest.serialization.Model): - """Details for upgrading vault. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar operation_id: ID of the vault upgrade operation. - :vartype operation_id: str - :ivar start_time_utc: UTC time at which the upgrade operation has started. - :vartype start_time_utc: ~datetime.datetime - :ivar last_updated_time_utc: UTC time at which the upgrade operation status was last updated. - :vartype last_updated_time_utc: ~datetime.datetime - :ivar end_time_utc: UTC time at which the upgrade operation has ended. - :vartype end_time_utc: ~datetime.datetime - :ivar status: Status of the vault upgrade operation. Possible values include: "Unknown", - "InProgress", "Upgraded", "Failed". - :vartype status: str or ~azure.mgmt.recoveryservices.models.VaultUpgradeState - :ivar message: Message to the user containing information about the upgrade operation. - :vartype message: str - :ivar trigger_type: The way the vault upgrade was triggered. Possible values include: - "UserTriggered", "ForcedUpgrade". - :vartype trigger_type: str or ~azure.mgmt.recoveryservices.models.TriggerType - :ivar upgraded_resource_id: Resource ID of the upgraded vault. - :vartype upgraded_resource_id: str - :ivar previous_resource_id: Resource ID of the vault before the upgrade. - :vartype previous_resource_id: str - """ - - _validation = { - 'operation_id': {'readonly': True}, - 'start_time_utc': {'readonly': True}, - 'last_updated_time_utc': {'readonly': True}, - 'end_time_utc': {'readonly': True}, - 'status': {'readonly': True}, - 'message': {'readonly': True}, - 'trigger_type': {'readonly': True}, - 'upgraded_resource_id': {'readonly': True}, - 'previous_resource_id': {'readonly': True}, - } - - _attribute_map = { - 'operation_id': {'key': 'operationId', 'type': 'str'}, - 'start_time_utc': {'key': 'startTimeUtc', 'type': 'iso-8601'}, - 'last_updated_time_utc': {'key': 'lastUpdatedTimeUtc', 'type': 'iso-8601'}, - 'end_time_utc': {'key': 'endTimeUtc', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'trigger_type': {'key': 'triggerType', 'type': 'str'}, - 'upgraded_resource_id': {'key': 'upgradedResourceId', 'type': 'str'}, - 'previous_resource_id': {'key': 'previousResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UpgradeDetails, self).__init__(**kwargs) - self.operation_id = None - self.start_time_utc = None - self.last_updated_time_utc = None - self.end_time_utc = None - self.status = None - self.message = None - self.trigger_type = None - self.upgraded_resource_id = None - self.previous_resource_id = None - - -class UserIdentity(msrest.serialization.Model): - """A resource identity that is managed by the user of the service. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the user-assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the user-assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UserIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class Vault(TrackedResource): - """Resource information, as returned by the resource provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource Id represents the complete path to the resource. - :vartype id: str - :ivar name: Resource name associated with the resource. - :vartype name: str - :ivar type: Resource type represents the complete path of the form - Namespace/ResourceType/ResourceType/... - :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.recoveryservices.models.IdentityData - :param properties: Properties of the vault. - :type properties: ~azure.mgmt.recoveryservices.models.VaultProperties - :param sku: Identifies the unique system identifier for each Azure resource. - :type sku: ~azure.mgmt.recoveryservices.models.Sku - :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.recoveryservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'IdentityData'}, - 'properties': {'key': 'properties', 'type': 'VaultProperties'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(Vault, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.properties = kwargs.get('properties', None) - self.sku = kwargs.get('sku', None) - self.system_data = None - - -class VaultCertificateResponse(msrest.serialization.Model): - """Certificate corresponding to a vault that can be used by clients to register themselves with the vault. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Resource name associated with the resource. - :vartype name: str - :ivar type: Resource type represents the complete path of the form - Namespace/ResourceType/ResourceType/... - :vartype type: str - :ivar id: Resource Id represents the complete path to the resource. - :vartype id: str - :param properties: Certificate details representing the Vault credentials. - :type properties: ~azure.mgmt.recoveryservices.models.ResourceCertificateDetails - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'id': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ResourceCertificateDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(VaultCertificateResponse, self).__init__(**kwargs) - self.name = None - self.type = None - self.id = None - self.properties = kwargs.get('properties', None) - - -class VaultExtendedInfoResource(Resource): - """Vault extended information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id represents the complete path to the resource. - :vartype id: str - :ivar name: Resource name associated with the resource. - :vartype name: str - :ivar type: Resource type represents the complete path of the form - Namespace/ResourceType/ResourceType/... - :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param integrity_key: Integrity key. - :type integrity_key: str - :param encryption_key: Encryption key. - :type encryption_key: str - :param encryption_key_thumbprint: Encryption key thumbprint. - :type encryption_key_thumbprint: str - :param algorithm: Algorithm for Vault ExtendedInfo. - :type algorithm: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'integrity_key': {'key': 'properties.integrityKey', 'type': 'str'}, - 'encryption_key': {'key': 'properties.encryptionKey', 'type': 'str'}, - 'encryption_key_thumbprint': {'key': 'properties.encryptionKeyThumbprint', 'type': 'str'}, - 'algorithm': {'key': 'properties.algorithm', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VaultExtendedInfoResource, self).__init__(**kwargs) - self.integrity_key = kwargs.get('integrity_key', None) - self.encryption_key = kwargs.get('encryption_key', None) - self.encryption_key_thumbprint = kwargs.get('encryption_key_thumbprint', None) - self.algorithm = kwargs.get('algorithm', None) - - -class VaultList(msrest.serialization.Model): - """The response model for a list of Vaults. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: - :type value: list[~azure.mgmt.recoveryservices.models.Vault] - :ivar next_link: - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Vault]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VaultList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class VaultProperties(msrest.serialization.Model): - """Properties of the vault. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: Provisioning State. - :vartype provisioning_state: str - :param upgrade_details: Details for upgrading vault. - :type upgrade_details: ~azure.mgmt.recoveryservices.models.UpgradeDetails - :ivar private_endpoint_connections: List of private endpoint connection. - :vartype private_endpoint_connections: - list[~azure.mgmt.recoveryservices.models.PrivateEndpointConnectionVaultProperties] - :ivar private_endpoint_state_for_backup: Private endpoint state for backup. Possible values - include: "None", "Enabled". - :vartype private_endpoint_state_for_backup: str or - ~azure.mgmt.recoveryservices.models.VaultPrivateEndpointState - :ivar private_endpoint_state_for_site_recovery: Private endpoint state for site recovery. - Possible values include: "None", "Enabled". - :vartype private_endpoint_state_for_site_recovery: str or - ~azure.mgmt.recoveryservices.models.VaultPrivateEndpointState - :param encryption: Customer Managed Key details of the resource. - :type encryption: ~azure.mgmt.recoveryservices.models.VaultPropertiesEncryption - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'private_endpoint_state_for_backup': {'readonly': True}, - 'private_endpoint_state_for_site_recovery': {'readonly': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'upgrade_details': {'key': 'upgradeDetails', 'type': 'UpgradeDetails'}, - 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnectionVaultProperties]'}, - 'private_endpoint_state_for_backup': {'key': 'privateEndpointStateForBackup', 'type': 'str'}, - 'private_endpoint_state_for_site_recovery': {'key': 'privateEndpointStateForSiteRecovery', 'type': 'str'}, - 'encryption': {'key': 'encryption', 'type': 'VaultPropertiesEncryption'}, - } - - def __init__( - self, - **kwargs - ): - super(VaultProperties, self).__init__(**kwargs) - self.provisioning_state = None - self.upgrade_details = kwargs.get('upgrade_details', None) - self.private_endpoint_connections = None - self.private_endpoint_state_for_backup = None - self.private_endpoint_state_for_site_recovery = None - self.encryption = kwargs.get('encryption', None) - - -class VaultPropertiesEncryption(msrest.serialization.Model): - """Customer Managed Key details of the resource. - - :param key_vault_properties: The properties of the Key Vault which hosts CMK. - :type key_vault_properties: ~azure.mgmt.recoveryservices.models.CmkKeyVaultProperties - :param kek_identity: The details of the identity used for CMK. - :type kek_identity: ~azure.mgmt.recoveryservices.models.CmkKekIdentity - :param infrastructure_encryption: Enabling/Disabling the Double Encryption state. Possible - values include: "Enabled", "Disabled". - :type infrastructure_encryption: str or - ~azure.mgmt.recoveryservices.models.InfrastructureEncryptionState - """ - - _attribute_map = { - 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'CmkKeyVaultProperties'}, - 'kek_identity': {'key': 'kekIdentity', 'type': 'CmkKekIdentity'}, - 'infrastructure_encryption': {'key': 'infrastructureEncryption', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VaultPropertiesEncryption, self).__init__(**kwargs) - self.key_vault_properties = kwargs.get('key_vault_properties', None) - self.kek_identity = kwargs.get('kek_identity', None) - self.infrastructure_encryption = kwargs.get('infrastructure_encryption', None) - - -class VaultUsage(msrest.serialization.Model): - """Usages of a vault. - - :param unit: Unit of the usage. Possible values include: "Count", "Bytes", "Seconds", - "Percent", "CountPerSecond", "BytesPerSecond". - :type unit: str or ~azure.mgmt.recoveryservices.models.UsagesUnit - :param quota_period: Quota period of usage. - :type quota_period: str - :param next_reset_time: Next reset time of usage. - :type next_reset_time: ~datetime.datetime - :param current_value: Current value of usage. - :type current_value: long - :param limit: Limit of usage. - :type limit: long - :param name: Name of usage. - :type name: ~azure.mgmt.recoveryservices.models.NameInfo - """ - - _attribute_map = { - 'unit': {'key': 'unit', 'type': 'str'}, - 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, - 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'NameInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(VaultUsage, self).__init__(**kwargs) - self.unit = kwargs.get('unit', None) - self.quota_period = kwargs.get('quota_period', None) - self.next_reset_time = kwargs.get('next_reset_time', None) - self.current_value = kwargs.get('current_value', None) - self.limit = kwargs.get('limit', None) - self.name = kwargs.get('name', None) - - -class VaultUsageList(msrest.serialization.Model): - """Usage for vault. - - :param value: The list of usages for the given vault. - :type value: list[~azure.mgmt.recoveryservices.models.VaultUsage] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VaultUsage]'}, - } - - def __init__( - self, - **kwargs - ): - super(VaultUsageList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models_py3.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models_py3.py index 51c474475d05..69a1fa778ffb 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models_py3.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_models_py3.py @@ -17,8 +17,8 @@ class CertificateRequest(msrest.serialization.Model): """Details of the certificate to be uploaded to the vault. - :param properties: Raw certificate data. - :type properties: ~azure.mgmt.recoveryservices.models.RawCertificateData + :ivar properties: Raw certificate data. + :vartype properties: ~azure.mgmt.recoveryservices.models.RawCertificateData """ _attribute_map = { @@ -31,6 +31,10 @@ def __init__( properties: Optional["RawCertificateData"] = None, **kwargs ): + """ + :keyword properties: Raw certificate data. + :paramtype properties: ~azure.mgmt.recoveryservices.models.RawCertificateData + """ super(CertificateRequest, self).__init__(**kwargs) self.properties = properties @@ -38,10 +42,10 @@ def __init__( class CheckNameAvailabilityParameters(msrest.serialization.Model): """Resource Name availability input parameters - Resource type and resource name. - :param type: Describes the Resource type: Microsoft.RecoveryServices/Vaults. - :type type: str - :param name: Resource name for which availability needs to be checked. - :type name: str + :ivar type: Describes the Resource type: Microsoft.RecoveryServices/Vaults. + :vartype type: str + :ivar name: Resource name for which availability needs to be checked. + :vartype name: str """ _attribute_map = { @@ -56,6 +60,12 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword type: Describes the Resource type: Microsoft.RecoveryServices/Vaults. + :paramtype type: str + :keyword name: Resource name for which availability needs to be checked. + :paramtype name: str + """ super(CheckNameAvailabilityParameters, self).__init__(**kwargs) self.type = type self.name = name @@ -64,12 +74,12 @@ def __init__( class CheckNameAvailabilityResult(msrest.serialization.Model): """Response for check name availability API. Resource provider will set availability as true | false. - :param name_available: - :type name_available: bool - :param reason: - :type reason: str - :param message: - :type message: str + :ivar name_available: + :vartype name_available: bool + :ivar reason: + :vartype reason: str + :ivar message: + :vartype message: str """ _attribute_map = { @@ -86,6 +96,14 @@ def __init__( message: Optional[str] = None, **kwargs ): + """ + :keyword name_available: + :paramtype name_available: bool + :keyword reason: + :paramtype reason: str + :keyword message: + :paramtype message: str + """ super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.name_available = name_available self.reason = reason @@ -95,14 +113,14 @@ def __init__( class ClientDiscoveryDisplay(msrest.serialization.Model): """Localized display information of an operation. - :param provider: Name of the provider for display purposes. - :type provider: str - :param resource: ResourceType for which this Operation can be performed. - :type resource: str - :param operation: Operations Name itself. - :type operation: str - :param description: Description of the operation having details of what operation is about. - :type description: str + :ivar provider: Name of the provider for display purposes. + :vartype provider: str + :ivar resource: ResourceType for which this Operation can be performed. + :vartype resource: str + :ivar operation: Operations Name itself. + :vartype operation: str + :ivar description: Description of the operation having details of what operation is about. + :vartype description: str """ _attribute_map = { @@ -121,6 +139,16 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword provider: Name of the provider for display purposes. + :paramtype provider: str + :keyword resource: ResourceType for which this Operation can be performed. + :paramtype resource: str + :keyword operation: Operations Name itself. + :paramtype operation: str + :keyword description: Description of the operation having details of what operation is about. + :paramtype description: str + """ super(ClientDiscoveryDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -131,12 +159,12 @@ def __init__( class ClientDiscoveryForLogSpecification(msrest.serialization.Model): """Class to represent shoebox log specification in json client discovery. - :param name: Name of the log. - :type name: str - :param display_name: Localized display name. - :type display_name: str - :param blob_duration: Blobs created in customer storage account per hour. - :type blob_duration: str + :ivar name: Name of the log. + :vartype name: str + :ivar display_name: Localized display name. + :vartype display_name: str + :ivar blob_duration: Blobs created in customer storage account per hour. + :vartype blob_duration: str """ _attribute_map = { @@ -153,6 +181,14 @@ def __init__( blob_duration: Optional[str] = None, **kwargs ): + """ + :keyword name: Name of the log. + :paramtype name: str + :keyword display_name: Localized display name. + :paramtype display_name: str + :keyword blob_duration: Blobs created in customer storage account per hour. + :paramtype blob_duration: str + """ super(ClientDiscoveryForLogSpecification, self).__init__(**kwargs) self.name = name self.display_name = display_name @@ -162,8 +198,8 @@ def __init__( class ClientDiscoveryForProperties(msrest.serialization.Model): """Class to represent shoebox properties in json client discovery. - :param service_specification: Operation properties. - :type service_specification: + :ivar service_specification: Operation properties. + :vartype service_specification: ~azure.mgmt.recoveryservices.models.ClientDiscoveryForServiceSpecification """ @@ -177,6 +213,11 @@ def __init__( service_specification: Optional["ClientDiscoveryForServiceSpecification"] = None, **kwargs ): + """ + :keyword service_specification: Operation properties. + :paramtype service_specification: + ~azure.mgmt.recoveryservices.models.ClientDiscoveryForServiceSpecification + """ super(ClientDiscoveryForProperties, self).__init__(**kwargs) self.service_specification = service_specification @@ -184,8 +225,8 @@ def __init__( class ClientDiscoveryForServiceSpecification(msrest.serialization.Model): """Class to represent shoebox service specification in json client discovery. - :param log_specifications: List of log specifications of this operation. - :type log_specifications: + :ivar log_specifications: List of log specifications of this operation. + :vartype log_specifications: list[~azure.mgmt.recoveryservices.models.ClientDiscoveryForLogSpecification] """ @@ -199,6 +240,11 @@ def __init__( log_specifications: Optional[List["ClientDiscoveryForLogSpecification"]] = None, **kwargs ): + """ + :keyword log_specifications: List of log specifications of this operation. + :paramtype log_specifications: + list[~azure.mgmt.recoveryservices.models.ClientDiscoveryForLogSpecification] + """ super(ClientDiscoveryForServiceSpecification, self).__init__(**kwargs) self.log_specifications = log_specifications @@ -206,10 +252,10 @@ def __init__( class ClientDiscoveryResponse(msrest.serialization.Model): """Operations List response which contains list of available APIs. - :param value: List of available operations. - :type value: list[~azure.mgmt.recoveryservices.models.ClientDiscoveryValueForSingleApi] - :param next_link: Link to the next chunk of the response. - :type next_link: str + :ivar value: List of available operations. + :vartype value: list[~azure.mgmt.recoveryservices.models.ClientDiscoveryValueForSingleApi] + :ivar next_link: Link to the next chunk of the response. + :vartype next_link: str """ _attribute_map = { @@ -224,6 +270,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of available operations. + :paramtype value: list[~azure.mgmt.recoveryservices.models.ClientDiscoveryValueForSingleApi] + :keyword next_link: Link to the next chunk of the response. + :paramtype next_link: str + """ super(ClientDiscoveryResponse, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -232,15 +284,15 @@ def __init__( class ClientDiscoveryValueForSingleApi(msrest.serialization.Model): """Available operation details. - :param name: Name of the Operation. - :type name: str - :param display: Contains the localized display information for this particular operation. - :type display: ~azure.mgmt.recoveryservices.models.ClientDiscoveryDisplay - :param origin: The intended executor of the operation;governs the display of the operation in + :ivar name: Name of the Operation. + :vartype name: str + :ivar display: Contains the localized display information for this particular operation. + :vartype display: ~azure.mgmt.recoveryservices.models.ClientDiscoveryDisplay + :ivar origin: The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX. - :type origin: str - :param properties: ShoeBox properties for the given operation. - :type properties: ~azure.mgmt.recoveryservices.models.ClientDiscoveryForProperties + :vartype origin: str + :ivar properties: ShoeBox properties for the given operation. + :vartype properties: ~azure.mgmt.recoveryservices.models.ClientDiscoveryForProperties """ _attribute_map = { @@ -259,6 +311,17 @@ def __init__( properties: Optional["ClientDiscoveryForProperties"] = None, **kwargs ): + """ + :keyword name: Name of the Operation. + :paramtype name: str + :keyword display: Contains the localized display information for this particular operation. + :paramtype display: ~azure.mgmt.recoveryservices.models.ClientDiscoveryDisplay + :keyword origin: The intended executor of the operation;governs the display of the operation in + the RBAC UX and the audit logs UX. + :paramtype origin: str + :keyword properties: ShoeBox properties for the given operation. + :paramtype properties: ~azure.mgmt.recoveryservices.models.ClientDiscoveryForProperties + """ super(ClientDiscoveryValueForSingleApi, self).__init__(**kwargs) self.name = name self.display = display @@ -269,12 +332,12 @@ def __init__( class CmkKekIdentity(msrest.serialization.Model): """The details of the identity used for CMK. - :param use_system_assigned_identity: Indicate that system assigned identity should be used. + :ivar use_system_assigned_identity: Indicate that system assigned identity should be used. Mutually exclusive with 'userAssignedIdentity' field. - :type use_system_assigned_identity: bool - :param user_assigned_identity: The user assigned identity to be used to grant permissions in + :vartype use_system_assigned_identity: bool + :ivar user_assigned_identity: The user assigned identity to be used to grant permissions in case the type of identity used is UserAssigned. - :type user_assigned_identity: str + :vartype user_assigned_identity: str """ _attribute_map = { @@ -289,6 +352,14 @@ def __init__( user_assigned_identity: Optional[str] = None, **kwargs ): + """ + :keyword use_system_assigned_identity: Indicate that system assigned identity should be used. + Mutually exclusive with 'userAssignedIdentity' field. + :paramtype use_system_assigned_identity: bool + :keyword user_assigned_identity: The user assigned identity to be used to grant permissions in + case the type of identity used is UserAssigned. + :paramtype user_assigned_identity: str + """ super(CmkKekIdentity, self).__init__(**kwargs) self.use_system_assigned_identity = use_system_assigned_identity self.user_assigned_identity = user_assigned_identity @@ -297,8 +368,8 @@ def __init__( class CmkKeyVaultProperties(msrest.serialization.Model): """The properties of the Key Vault which hosts CMK. - :param key_uri: The key uri of the Customer Managed Key. - :type key_uri: str + :ivar key_uri: The key uri of the Customer Managed Key. + :vartype key_uri: str """ _attribute_map = { @@ -311,6 +382,10 @@ def __init__( key_uri: Optional[str] = None, **kwargs ): + """ + :keyword key_uri: The key uri of the Customer Managed Key. + :paramtype key_uri: str + """ super(CmkKeyVaultProperties, self).__init__(**kwargs) self.key_uri = key_uri @@ -352,6 +427,8 @@ def __init__( self, **kwargs ): + """ + """ super(Error, self).__init__(**kwargs) self.additional_info = None self.code = None @@ -385,6 +462,8 @@ def __init__( self, **kwargs ): + """ + """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.info = None self.type = None @@ -401,15 +480,15 @@ class IdentityData(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :param type: Required. The type of managed identity used. The type 'SystemAssigned, + :ivar type: Required. The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. Possible values include: "SystemAssigned", "None", "UserAssigned", "SystemAssigned, UserAssigned". - :type type: str or ~azure.mgmt.recoveryservices.models.ResourceIdentityType - :param user_assigned_identities: The list of user-assigned identities associated with the + :vartype type: str or ~azure.mgmt.recoveryservices.models.ResourceIdentityType + :ivar user_assigned_identities: The list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, ~azure.mgmt.recoveryservices.models.UserIdentity] + :vartype user_assigned_identities: dict[str, ~azure.mgmt.recoveryservices.models.UserIdentity] """ _validation = { @@ -432,6 +511,18 @@ def __init__( user_assigned_identities: Optional[Dict[str, "UserIdentity"]] = None, **kwargs ): + """ + :keyword type: Required. The type of managed identity used. The type 'SystemAssigned, + UserAssigned' includes both an implicitly created identity and a set of user-assigned + identities. The type 'None' will remove any identities. Possible values include: + "SystemAssigned", "None", "UserAssigned", "SystemAssigned, UserAssigned". + :paramtype type: str or ~azure.mgmt.recoveryservices.models.ResourceIdentityType + :keyword user_assigned_identities: The list of user-assigned identities associated with the + resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.recoveryservices.models.UserIdentity] + """ super(IdentityData, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -442,12 +533,12 @@ def __init__( class JobsSummary(msrest.serialization.Model): """Summary of the replication job data for this vault. - :param failed_jobs: Count of failed jobs. - :type failed_jobs: int - :param suspended_jobs: Count of suspended jobs. - :type suspended_jobs: int - :param in_progress_jobs: Count of in-progress jobs. - :type in_progress_jobs: int + :ivar failed_jobs: Count of failed jobs. + :vartype failed_jobs: int + :ivar suspended_jobs: Count of suspended jobs. + :vartype suspended_jobs: int + :ivar in_progress_jobs: Count of in-progress jobs. + :vartype in_progress_jobs: int """ _attribute_map = { @@ -464,6 +555,14 @@ def __init__( in_progress_jobs: Optional[int] = None, **kwargs ): + """ + :keyword failed_jobs: Count of failed jobs. + :paramtype failed_jobs: int + :keyword suspended_jobs: Count of suspended jobs. + :paramtype suspended_jobs: int + :keyword in_progress_jobs: Count of in-progress jobs. + :paramtype in_progress_jobs: int + """ super(JobsSummary, self).__init__(**kwargs) self.failed_jobs = failed_jobs self.suspended_jobs = suspended_jobs @@ -473,18 +572,18 @@ def __init__( class MonitoringSummary(msrest.serialization.Model): """Summary of the replication monitoring data for this vault. - :param un_healthy_vm_count: Count of unhealthy VMs. - :type un_healthy_vm_count: int - :param un_healthy_provider_count: Count of unhealthy replication providers. - :type un_healthy_provider_count: int - :param events_count: Count of all critical warnings. - :type events_count: int - :param deprecated_provider_count: Count of all deprecated recovery service providers. - :type deprecated_provider_count: int - :param supported_provider_count: Count of all the supported recovery service providers. - :type supported_provider_count: int - :param unsupported_provider_count: Count of all the unsupported recovery service providers. - :type unsupported_provider_count: int + :ivar un_healthy_vm_count: Count of unhealthy VMs. + :vartype un_healthy_vm_count: int + :ivar un_healthy_provider_count: Count of unhealthy replication providers. + :vartype un_healthy_provider_count: int + :ivar events_count: Count of all critical warnings. + :vartype events_count: int + :ivar deprecated_provider_count: Count of all deprecated recovery service providers. + :vartype deprecated_provider_count: int + :ivar supported_provider_count: Count of all the supported recovery service providers. + :vartype supported_provider_count: int + :ivar unsupported_provider_count: Count of all the unsupported recovery service providers. + :vartype unsupported_provider_count: int """ _attribute_map = { @@ -507,6 +606,20 @@ def __init__( unsupported_provider_count: Optional[int] = None, **kwargs ): + """ + :keyword un_healthy_vm_count: Count of unhealthy VMs. + :paramtype un_healthy_vm_count: int + :keyword un_healthy_provider_count: Count of unhealthy replication providers. + :paramtype un_healthy_provider_count: int + :keyword events_count: Count of all critical warnings. + :paramtype events_count: int + :keyword deprecated_provider_count: Count of all deprecated recovery service providers. + :paramtype deprecated_provider_count: int + :keyword supported_provider_count: Count of all the supported recovery service providers. + :paramtype supported_provider_count: int + :keyword unsupported_provider_count: Count of all the unsupported recovery service providers. + :paramtype unsupported_provider_count: int + """ super(MonitoringSummary, self).__init__(**kwargs) self.un_healthy_vm_count = un_healthy_vm_count self.un_healthy_provider_count = un_healthy_provider_count @@ -519,10 +632,10 @@ def __init__( class NameInfo(msrest.serialization.Model): """The name of usage. - :param value: Value of usage. - :type value: str - :param localized_value: Localized value of usage. - :type localized_value: str + :ivar value: Value of usage. + :vartype value: str + :ivar localized_value: Localized value of usage. + :vartype localized_value: str """ _attribute_map = { @@ -537,6 +650,12 @@ def __init__( localized_value: Optional[str] = None, **kwargs ): + """ + :keyword value: Value of usage. + :paramtype value: str + :keyword localized_value: Localized value of usage. + :paramtype localized_value: str + """ super(NameInfo, self).__init__(**kwargs) self.value = value self.localized_value = localized_value @@ -545,20 +664,20 @@ def __init__( class OperationResource(msrest.serialization.Model): """Operation Resource. - :param end_time: End time of the operation. - :type end_time: ~datetime.datetime - :param error: Required if status == failed or status == canceled. This is the OData v4 error + :ivar end_time: End time of the operation. + :vartype end_time: ~datetime.datetime + :ivar error: Required if status == failed or status == canceled. This is the OData v4 error format, used by the RPC and will go into the v2.2 Azure REST API guidelines. - :type error: ~azure.mgmt.recoveryservices.models.Error - :param id: It should match what is used to GET the operation result. - :type id: str - :param name: It must match the last segment of the "id" field, and will typically be a GUID / + :vartype error: ~azure.mgmt.recoveryservices.models.Error + :ivar id: It should match what is used to GET the operation result. + :vartype id: str + :ivar name: It must match the last segment of the "id" field, and will typically be a GUID / system generated value. - :type name: str - :param status: The status of the operation. (InProgress/Success/Failed/Cancelled). - :type status: str - :param start_time: Start time of the operation. - :type start_time: ~datetime.datetime + :vartype name: str + :ivar status: The status of the operation. (InProgress/Success/Failed/Cancelled). + :vartype status: str + :ivar start_time: Start time of the operation. + :vartype start_time: ~datetime.datetime """ _attribute_map = { @@ -581,6 +700,22 @@ def __init__( start_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword end_time: End time of the operation. + :paramtype end_time: ~datetime.datetime + :keyword error: Required if status == failed or status == canceled. This is the OData v4 error + format, used by the RPC and will go into the v2.2 Azure REST API guidelines. + :paramtype error: ~azure.mgmt.recoveryservices.models.Error + :keyword id: It should match what is used to GET the operation result. + :paramtype id: str + :keyword name: It must match the last segment of the "id" field, and will typically be a GUID / + system generated value. + :paramtype name: str + :keyword status: The status of the operation. (InProgress/Success/Failed/Cancelled). + :paramtype status: str + :keyword start_time: Start time of the operation. + :paramtype start_time: ~datetime.datetime + """ super(OperationResource, self).__init__(**kwargs) self.end_time = end_time self.error = error @@ -602,8 +737,8 @@ class Resource(msrest.serialization.Model): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str + :ivar etag: Optional ETag. + :vartype etag: str """ _validation = { @@ -625,6 +760,10 @@ def __init__( etag: Optional[str] = None, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -644,12 +783,12 @@ class PatchTrackedResource(Resource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar etag: Optional ETag. + :vartype etag: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -675,6 +814,14 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(PatchTrackedResource, self).__init__(etag=etag, **kwargs) self.location = location self.tags = tags @@ -692,18 +839,18 @@ class PatchVault(PatchTrackedResource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param properties: Properties of the vault. - :type properties: ~azure.mgmt.recoveryservices.models.VaultProperties - :param sku: Identifies the unique system identifier for each Azure resource. - :type sku: ~azure.mgmt.recoveryservices.models.Sku - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.recoveryservices.models.IdentityData + :ivar etag: Optional ETag. + :vartype etag: str + :ivar location: Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Properties of the vault. + :vartype properties: ~azure.mgmt.recoveryservices.models.VaultProperties + :ivar sku: Identifies the unique system identifier for each Azure resource. + :vartype sku: ~azure.mgmt.recoveryservices.models.Sku + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.recoveryservices.models.IdentityData """ _validation = { @@ -735,6 +882,20 @@ def __init__( identity: Optional["IdentityData"] = None, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword location: Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword properties: Properties of the vault. + :paramtype properties: ~azure.mgmt.recoveryservices.models.VaultProperties + :keyword sku: Identifies the unique system identifier for each Azure resource. + :paramtype sku: ~azure.mgmt.recoveryservices.models.Sku + :keyword identity: Identity for the resource. + :paramtype identity: ~azure.mgmt.recoveryservices.models.IdentityData + """ super(PatchVault, self).__init__(etag=etag, location=location, tags=tags, **kwargs) self.properties = properties self.sku = sku @@ -762,6 +923,8 @@ def __init__( self, **kwargs ): + """ + """ super(PrivateEndpoint, self).__init__(**kwargs) self.id = None @@ -799,6 +962,8 @@ def __init__( self, **kwargs ): + """ + """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.provisioning_state = None self.private_endpoint = None @@ -815,25 +980,43 @@ class PrivateEndpointConnectionVaultProperties(msrest.serialization.Model): :vartype id: str :ivar properties: Private Endpoint Connection Response Properties. :vartype properties: ~azure.mgmt.recoveryservices.models.PrivateEndpointConnection + :ivar name: The name of the private Endpoint Connection. + :vartype name: str + :ivar type: The type, which will be of the format, + Microsoft.RecoveryServices/vaults/privateEndpointConnections. + :vartype type: str + :ivar location: The location of the private Endpoint connection. + :vartype location: str """ _validation = { 'id': {'readonly': True}, 'properties': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnection'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, } def __init__( self, **kwargs ): + """ + """ super(PrivateEndpointConnectionVaultProperties, self).__init__(**kwargs) self.id = None self.properties = None + self.name = None + self.type = None + self.location = None class PrivateLinkResource(msrest.serialization.Model): @@ -878,6 +1061,8 @@ def __init__( self, **kwargs ): + """ + """ super(PrivateLinkResource, self).__init__(**kwargs) self.id = None self.name = None @@ -890,10 +1075,10 @@ def __init__( class PrivateLinkResources(msrest.serialization.Model): """Class which represent the stamps associated with the vault. - :param value: A collection of private link resources. - :type value: list[~azure.mgmt.recoveryservices.models.PrivateLinkResource] - :param next_link: Link to the next chunk of the response. - :type next_link: str + :ivar value: A collection of private link resources. + :vartype value: list[~azure.mgmt.recoveryservices.models.PrivateLinkResource] + :ivar next_link: Link to the next chunk of the response. + :vartype next_link: str """ _attribute_map = { @@ -908,6 +1093,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: A collection of private link resources. + :paramtype value: list[~azure.mgmt.recoveryservices.models.PrivateLinkResource] + :keyword next_link: Link to the next chunk of the response. + :paramtype next_link: str + """ super(PrivateLinkResources, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -943,6 +1134,8 @@ def __init__( self, **kwargs ): + """ + """ super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = None self.description = None @@ -952,11 +1145,11 @@ def __init__( class RawCertificateData(msrest.serialization.Model): """Raw certificate data. - :param auth_type: Specifies the authentication type. Possible values include: "Invalid", "ACS", + :ivar auth_type: Specifies the authentication type. Possible values include: "Invalid", "ACS", "AAD", "AccessControlService", "AzureActiveDirectory". - :type auth_type: str or ~azure.mgmt.recoveryservices.models.AuthType - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray + :vartype auth_type: str or ~azure.mgmt.recoveryservices.models.AuthType + :ivar certificate: The base64 encoded certificate raw data string. + :vartype certificate: bytearray """ _attribute_map = { @@ -971,6 +1164,13 @@ def __init__( certificate: Optional[bytearray] = None, **kwargs ): + """ + :keyword auth_type: Specifies the authentication type. Possible values include: "Invalid", + "ACS", "AAD", "AccessControlService", "AzureActiveDirectory". + :paramtype auth_type: str or ~azure.mgmt.recoveryservices.models.AuthType + :keyword certificate: The base64 encoded certificate raw data string. + :paramtype certificate: bytearray + """ super(RawCertificateData, self).__init__(**kwargs) self.auth_type = auth_type self.certificate = certificate @@ -979,19 +1179,19 @@ def __init__( class ReplicationUsage(msrest.serialization.Model): """Replication usages of a vault. - :param monitoring_summary: Summary of the replication monitoring data for this vault. - :type monitoring_summary: ~azure.mgmt.recoveryservices.models.MonitoringSummary - :param jobs_summary: Summary of the replication jobs data for this vault. - :type jobs_summary: ~azure.mgmt.recoveryservices.models.JobsSummary - :param protected_item_count: Number of replication protected items for this vault. - :type protected_item_count: int - :param recovery_plan_count: Number of replication recovery plans for this vault. - :type recovery_plan_count: int - :param registered_servers_count: Number of servers registered to this vault. - :type registered_servers_count: int - :param recovery_services_provider_auth_type: The authentication type of recovery service + :ivar monitoring_summary: Summary of the replication monitoring data for this vault. + :vartype monitoring_summary: ~azure.mgmt.recoveryservices.models.MonitoringSummary + :ivar jobs_summary: Summary of the replication jobs data for this vault. + :vartype jobs_summary: ~azure.mgmt.recoveryservices.models.JobsSummary + :ivar protected_item_count: Number of replication protected items for this vault. + :vartype protected_item_count: int + :ivar recovery_plan_count: Number of replication recovery plans for this vault. + :vartype recovery_plan_count: int + :ivar registered_servers_count: Number of servers registered to this vault. + :vartype registered_servers_count: int + :ivar recovery_services_provider_auth_type: The authentication type of recovery service providers in the vault. - :type recovery_services_provider_auth_type: int + :vartype recovery_services_provider_auth_type: int """ _attribute_map = { @@ -1014,6 +1214,21 @@ def __init__( recovery_services_provider_auth_type: Optional[int] = None, **kwargs ): + """ + :keyword monitoring_summary: Summary of the replication monitoring data for this vault. + :paramtype monitoring_summary: ~azure.mgmt.recoveryservices.models.MonitoringSummary + :keyword jobs_summary: Summary of the replication jobs data for this vault. + :paramtype jobs_summary: ~azure.mgmt.recoveryservices.models.JobsSummary + :keyword protected_item_count: Number of replication protected items for this vault. + :paramtype protected_item_count: int + :keyword recovery_plan_count: Number of replication recovery plans for this vault. + :paramtype recovery_plan_count: int + :keyword registered_servers_count: Number of servers registered to this vault. + :paramtype registered_servers_count: int + :keyword recovery_services_provider_auth_type: The authentication type of recovery service + providers in the vault. + :paramtype recovery_services_provider_auth_type: int + """ super(ReplicationUsage, self).__init__(**kwargs) self.monitoring_summary = monitoring_summary self.jobs_summary = jobs_summary @@ -1026,8 +1241,8 @@ def __init__( class ReplicationUsageList(msrest.serialization.Model): """Replication usages for vault. - :param value: The list of replication usages for the given vault. - :type value: list[~azure.mgmt.recoveryservices.models.ReplicationUsage] + :ivar value: The list of replication usages for the given vault. + :vartype value: list[~azure.mgmt.recoveryservices.models.ReplicationUsage] """ _attribute_map = { @@ -1040,6 +1255,10 @@ def __init__( value: Optional[List["ReplicationUsage"]] = None, **kwargs ): + """ + :keyword value: The list of replication usages for the given vault. + :paramtype value: list[~azure.mgmt.recoveryservices.models.ReplicationUsage] + """ super(ReplicationUsageList, self).__init__(**kwargs) self.value = value @@ -1052,25 +1271,25 @@ class ResourceCertificateDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param auth_type: Required. This property will be used as the discriminator for deciding the + :ivar auth_type: Required. This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.Constant filled by server. - :type auth_type: str - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray - :param friendly_name: Certificate friendly name. - :type friendly_name: str - :param issuer: Certificate issuer. - :type issuer: str - :param resource_id: Resource ID of the vault. - :type resource_id: long - :param subject: Certificate Subject Name. - :type subject: str - :param thumbprint: Certificate thumbprint. - :type thumbprint: str - :param valid_from: Certificate Validity start Date time. - :type valid_from: ~datetime.datetime - :param valid_to: Certificate Validity End Date time. - :type valid_to: ~datetime.datetime + :vartype auth_type: str + :ivar certificate: The base64 encoded certificate raw data string. + :vartype certificate: bytearray + :ivar friendly_name: Certificate friendly name. + :vartype friendly_name: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar resource_id: Resource ID of the vault. + :vartype resource_id: long + :ivar subject: Certificate Subject Name. + :vartype subject: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid_from: Certificate Validity start Date time. + :vartype valid_from: ~datetime.datetime + :ivar valid_to: Certificate Validity End Date time. + :vartype valid_to: ~datetime.datetime """ _validation = { @@ -1106,6 +1325,24 @@ def __init__( valid_to: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword certificate: The base64 encoded certificate raw data string. + :paramtype certificate: bytearray + :keyword friendly_name: Certificate friendly name. + :paramtype friendly_name: str + :keyword issuer: Certificate issuer. + :paramtype issuer: str + :keyword resource_id: Resource ID of the vault. + :paramtype resource_id: long + :keyword subject: Certificate Subject Name. + :paramtype subject: str + :keyword thumbprint: Certificate thumbprint. + :paramtype thumbprint: str + :keyword valid_from: Certificate Validity start Date time. + :paramtype valid_from: ~datetime.datetime + :keyword valid_to: Certificate Validity End Date time. + :paramtype valid_to: ~datetime.datetime + """ super(ResourceCertificateDetails, self).__init__(**kwargs) self.auth_type = None # type: Optional[str] self.certificate = certificate @@ -1123,37 +1360,37 @@ class ResourceCertificateAndAadDetails(ResourceCertificateDetails): All required parameters must be populated in order to send to Azure. - :param auth_type: Required. This property will be used as the discriminator for deciding the + :ivar auth_type: Required. This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.Constant filled by server. - :type auth_type: str - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray - :param friendly_name: Certificate friendly name. - :type friendly_name: str - :param issuer: Certificate issuer. - :type issuer: str - :param resource_id: Resource ID of the vault. - :type resource_id: long - :param subject: Certificate Subject Name. - :type subject: str - :param thumbprint: Certificate thumbprint. - :type thumbprint: str - :param valid_from: Certificate Validity start Date time. - :type valid_from: ~datetime.datetime - :param valid_to: Certificate Validity End Date time. - :type valid_to: ~datetime.datetime - :param aad_authority: Required. AAD tenant authority. - :type aad_authority: str - :param aad_tenant_id: Required. AAD tenant Id. - :type aad_tenant_id: str - :param service_principal_client_id: Required. AAD service principal clientId. - :type service_principal_client_id: str - :param service_principal_object_id: Required. AAD service principal ObjectId. - :type service_principal_object_id: str - :param azure_management_endpoint_audience: Required. Azure Management Endpoint Audience. - :type azure_management_endpoint_audience: str - :param service_resource_id: Service Resource Id. - :type service_resource_id: str + :vartype auth_type: str + :ivar certificate: The base64 encoded certificate raw data string. + :vartype certificate: bytearray + :ivar friendly_name: Certificate friendly name. + :vartype friendly_name: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar resource_id: Resource ID of the vault. + :vartype resource_id: long + :ivar subject: Certificate Subject Name. + :vartype subject: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid_from: Certificate Validity start Date time. + :vartype valid_from: ~datetime.datetime + :ivar valid_to: Certificate Validity End Date time. + :vartype valid_to: ~datetime.datetime + :ivar aad_authority: Required. AAD tenant authority. + :vartype aad_authority: str + :ivar aad_tenant_id: Required. AAD tenant Id. + :vartype aad_tenant_id: str + :ivar service_principal_client_id: Required. AAD service principal clientId. + :vartype service_principal_client_id: str + :ivar service_principal_object_id: Required. AAD service principal ObjectId. + :vartype service_principal_object_id: str + :ivar azure_management_endpoint_audience: Required. Azure Management Endpoint Audience. + :vartype azure_management_endpoint_audience: str + :ivar service_resource_id: Service Resource Id. + :vartype service_resource_id: str """ _validation = { @@ -1202,6 +1439,36 @@ def __init__( service_resource_id: Optional[str] = None, **kwargs ): + """ + :keyword certificate: The base64 encoded certificate raw data string. + :paramtype certificate: bytearray + :keyword friendly_name: Certificate friendly name. + :paramtype friendly_name: str + :keyword issuer: Certificate issuer. + :paramtype issuer: str + :keyword resource_id: Resource ID of the vault. + :paramtype resource_id: long + :keyword subject: Certificate Subject Name. + :paramtype subject: str + :keyword thumbprint: Certificate thumbprint. + :paramtype thumbprint: str + :keyword valid_from: Certificate Validity start Date time. + :paramtype valid_from: ~datetime.datetime + :keyword valid_to: Certificate Validity End Date time. + :paramtype valid_to: ~datetime.datetime + :keyword aad_authority: Required. AAD tenant authority. + :paramtype aad_authority: str + :keyword aad_tenant_id: Required. AAD tenant Id. + :paramtype aad_tenant_id: str + :keyword service_principal_client_id: Required. AAD service principal clientId. + :paramtype service_principal_client_id: str + :keyword service_principal_object_id: Required. AAD service principal ObjectId. + :paramtype service_principal_object_id: str + :keyword azure_management_endpoint_audience: Required. Azure Management Endpoint Audience. + :paramtype azure_management_endpoint_audience: str + :keyword service_resource_id: Service Resource Id. + :paramtype service_resource_id: str + """ super(ResourceCertificateAndAadDetails, self).__init__(certificate=certificate, friendly_name=friendly_name, issuer=issuer, resource_id=resource_id, subject=subject, thumbprint=thumbprint, valid_from=valid_from, valid_to=valid_to, **kwargs) self.auth_type = 'AzureActiveDirectory' # type: str self.aad_authority = aad_authority @@ -1217,31 +1484,31 @@ class ResourceCertificateAndAcsDetails(ResourceCertificateDetails): All required parameters must be populated in order to send to Azure. - :param auth_type: Required. This property will be used as the discriminator for deciding the + :ivar auth_type: Required. This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types.Constant filled by server. - :type auth_type: str - :param certificate: The base64 encoded certificate raw data string. - :type certificate: bytearray - :param friendly_name: Certificate friendly name. - :type friendly_name: str - :param issuer: Certificate issuer. - :type issuer: str - :param resource_id: Resource ID of the vault. - :type resource_id: long - :param subject: Certificate Subject Name. - :type subject: str - :param thumbprint: Certificate thumbprint. - :type thumbprint: str - :param valid_from: Certificate Validity start Date time. - :type valid_from: ~datetime.datetime - :param valid_to: Certificate Validity End Date time. - :type valid_to: ~datetime.datetime - :param global_acs_namespace: Required. ACS namespace name - tenant for our service. - :type global_acs_namespace: str - :param global_acs_host_name: Required. Acs mgmt host name to connect to. - :type global_acs_host_name: str - :param global_acs_rp_realm: Required. Global ACS namespace RP realm. - :type global_acs_rp_realm: str + :vartype auth_type: str + :ivar certificate: The base64 encoded certificate raw data string. + :vartype certificate: bytearray + :ivar friendly_name: Certificate friendly name. + :vartype friendly_name: str + :ivar issuer: Certificate issuer. + :vartype issuer: str + :ivar resource_id: Resource ID of the vault. + :vartype resource_id: long + :ivar subject: Certificate Subject Name. + :vartype subject: str + :ivar thumbprint: Certificate thumbprint. + :vartype thumbprint: str + :ivar valid_from: Certificate Validity start Date time. + :vartype valid_from: ~datetime.datetime + :ivar valid_to: Certificate Validity End Date time. + :vartype valid_to: ~datetime.datetime + :ivar global_acs_namespace: Required. ACS namespace name - tenant for our service. + :vartype global_acs_namespace: str + :ivar global_acs_host_name: Required. Acs mgmt host name to connect to. + :vartype global_acs_host_name: str + :ivar global_acs_rp_realm: Required. Global ACS namespace RP realm. + :vartype global_acs_rp_realm: str """ _validation = { @@ -1282,6 +1549,30 @@ def __init__( valid_to: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword certificate: The base64 encoded certificate raw data string. + :paramtype certificate: bytearray + :keyword friendly_name: Certificate friendly name. + :paramtype friendly_name: str + :keyword issuer: Certificate issuer. + :paramtype issuer: str + :keyword resource_id: Resource ID of the vault. + :paramtype resource_id: long + :keyword subject: Certificate Subject Name. + :paramtype subject: str + :keyword thumbprint: Certificate thumbprint. + :paramtype thumbprint: str + :keyword valid_from: Certificate Validity start Date time. + :paramtype valid_from: ~datetime.datetime + :keyword valid_to: Certificate Validity End Date time. + :paramtype valid_to: ~datetime.datetime + :keyword global_acs_namespace: Required. ACS namespace name - tenant for our service. + :paramtype global_acs_namespace: str + :keyword global_acs_host_name: Required. Acs mgmt host name to connect to. + :paramtype global_acs_host_name: str + :keyword global_acs_rp_realm: Required. Global ACS namespace RP realm. + :paramtype global_acs_rp_realm: str + """ super(ResourceCertificateAndAcsDetails, self).__init__(certificate=certificate, friendly_name=friendly_name, issuer=issuer, resource_id=resource_id, subject=subject, thumbprint=thumbprint, valid_from=valid_from, valid_to=valid_to, **kwargs) self.auth_type = 'AccessControlService' # type: str self.global_acs_namespace = global_acs_namespace @@ -1294,10 +1585,16 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The Sku name. Possible values include: "Standard", "RS0". - :type name: str or ~azure.mgmt.recoveryservices.models.SkuName - :param tier: The Sku tier. - :type tier: str + :ivar name: Required. The Sku name. Possible values include: "Standard", "RS0". + :vartype name: str or ~azure.mgmt.recoveryservices.models.SkuName + :ivar tier: The Sku tier. + :vartype tier: str + :ivar family: The sku family. + :vartype family: str + :ivar size: The sku size. + :vartype size: str + :ivar capacity: The sku capacity. + :vartype capacity: str """ _validation = { @@ -1307,6 +1604,9 @@ class Sku(msrest.serialization.Model): _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'str'}, } def __init__( @@ -1314,30 +1614,48 @@ def __init__( *, name: Union[str, "SkuName"], tier: Optional[str] = None, + family: Optional[str] = None, + size: Optional[str] = None, + capacity: Optional[str] = None, **kwargs ): + """ + :keyword name: Required. The Sku name. Possible values include: "Standard", "RS0". + :paramtype name: str or ~azure.mgmt.recoveryservices.models.SkuName + :keyword tier: The Sku tier. + :paramtype tier: str + :keyword family: The sku family. + :paramtype family: str + :keyword size: The sku size. + :paramtype size: str + :keyword capacity: The sku capacity. + :paramtype capacity: str + """ super(Sku, self).__init__(**kwargs) self.name = name self.tier = tier + self.family = family + self.size = size + self.capacity = capacity class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType - :param last_modified_at: The type of identity that last modified the resource. - :type last_modified_at: ~datetime.datetime + :vartype last_modified_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -1360,6 +1678,22 @@ def __init__( last_modified_at: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or ~azure.mgmt.recoveryservices.models.CreatedByType + :keyword last_modified_at: The type of identity that last modified the resource. + :paramtype last_modified_at: ~datetime.datetime + """ super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type @@ -1383,12 +1717,12 @@ class TrackedResource(Resource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar etag: Optional ETag. + :vartype etag: str + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _validation = { @@ -1415,6 +1749,14 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(TrackedResource, self).__init__(etag=etag, **kwargs) self.location = location self.tags = tags @@ -1475,6 +1817,8 @@ def __init__( self, **kwargs ): + """ + """ super(UpgradeDetails, self).__init__(**kwargs) self.operation_id = None self.start_time_utc = None @@ -1512,6 +1856,8 @@ def __init__( self, **kwargs ): + """ + """ super(UserIdentity, self).__init__(**kwargs) self.principal_id = None self.client_id = None @@ -1531,18 +1877,18 @@ class Vault(TrackedResource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.recoveryservices.models.IdentityData - :param properties: Properties of the vault. - :type properties: ~azure.mgmt.recoveryservices.models.VaultProperties - :param sku: Identifies the unique system identifier for each Azure resource. - :type sku: ~azure.mgmt.recoveryservices.models.Sku + :ivar etag: Optional ETag. + :vartype etag: str + :ivar location: Required. Resource location. + :vartype location: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.recoveryservices.models.IdentityData + :ivar properties: Properties of the vault. + :vartype properties: ~azure.mgmt.recoveryservices.models.VaultProperties + :ivar sku: Identifies the unique system identifier for each Azure resource. + :vartype sku: ~azure.mgmt.recoveryservices.models.Sku :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.recoveryservices.models.SystemData """ @@ -1579,6 +1925,20 @@ def __init__( sku: Optional["Sku"] = None, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword location: Required. Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword identity: Identity for the resource. + :paramtype identity: ~azure.mgmt.recoveryservices.models.IdentityData + :keyword properties: Properties of the vault. + :paramtype properties: ~azure.mgmt.recoveryservices.models.VaultProperties + :keyword sku: Identifies the unique system identifier for each Azure resource. + :paramtype sku: ~azure.mgmt.recoveryservices.models.Sku + """ super(Vault, self).__init__(etag=etag, location=location, tags=tags, **kwargs) self.identity = identity self.properties = properties @@ -1598,8 +1958,8 @@ class VaultCertificateResponse(msrest.serialization.Model): :vartype type: str :ivar id: Resource Id represents the complete path to the resource. :vartype id: str - :param properties: Certificate details representing the Vault credentials. - :type properties: ~azure.mgmt.recoveryservices.models.ResourceCertificateDetails + :ivar properties: Certificate details representing the Vault credentials. + :vartype properties: ~azure.mgmt.recoveryservices.models.ResourceCertificateDetails """ _validation = { @@ -1621,6 +1981,10 @@ def __init__( properties: Optional["ResourceCertificateDetails"] = None, **kwargs ): + """ + :keyword properties: Certificate details representing the Vault credentials. + :paramtype properties: ~azure.mgmt.recoveryservices.models.ResourceCertificateDetails + """ super(VaultCertificateResponse, self).__init__(**kwargs) self.name = None self.type = None @@ -1640,16 +2004,16 @@ class VaultExtendedInfoResource(Resource): :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str - :param etag: Optional ETag. - :type etag: str - :param integrity_key: Integrity key. - :type integrity_key: str - :param encryption_key: Encryption key. - :type encryption_key: str - :param encryption_key_thumbprint: Encryption key thumbprint. - :type encryption_key_thumbprint: str - :param algorithm: Algorithm for Vault ExtendedInfo. - :type algorithm: str + :ivar etag: Optional ETag. + :vartype etag: str + :ivar integrity_key: Integrity key. + :vartype integrity_key: str + :ivar encryption_key: Encryption key. + :vartype encryption_key: str + :ivar encryption_key_thumbprint: Encryption key thumbprint. + :vartype encryption_key_thumbprint: str + :ivar algorithm: Algorithm for Vault ExtendedInfo. + :vartype algorithm: str """ _validation = { @@ -1679,6 +2043,18 @@ def __init__( algorithm: Optional[str] = None, **kwargs ): + """ + :keyword etag: Optional ETag. + :paramtype etag: str + :keyword integrity_key: Integrity key. + :paramtype integrity_key: str + :keyword encryption_key: Encryption key. + :paramtype encryption_key: str + :keyword encryption_key_thumbprint: Encryption key thumbprint. + :paramtype encryption_key_thumbprint: str + :keyword algorithm: Algorithm for Vault ExtendedInfo. + :paramtype algorithm: str + """ super(VaultExtendedInfoResource, self).__init__(etag=etag, **kwargs) self.integrity_key = integrity_key self.encryption_key = encryption_key @@ -1691,8 +2067,8 @@ class VaultList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param value: - :type value: list[~azure.mgmt.recoveryservices.models.Vault] + :ivar value: + :vartype value: list[~azure.mgmt.recoveryservices.models.Vault] :ivar next_link: :vartype next_link: str """ @@ -1712,6 +2088,10 @@ def __init__( value: Optional[List["Vault"]] = None, **kwargs ): + """ + :keyword value: + :paramtype value: list[~azure.mgmt.recoveryservices.models.Vault] + """ super(VaultList, self).__init__(**kwargs) self.value = value self.next_link = None @@ -1724,8 +2104,8 @@ class VaultProperties(msrest.serialization.Model): :ivar provisioning_state: Provisioning State. :vartype provisioning_state: str - :param upgrade_details: Details for upgrading vault. - :type upgrade_details: ~azure.mgmt.recoveryservices.models.UpgradeDetails + :ivar upgrade_details: Details for upgrading vault. + :vartype upgrade_details: ~azure.mgmt.recoveryservices.models.UpgradeDetails :ivar private_endpoint_connections: List of private endpoint connection. :vartype private_endpoint_connections: list[~azure.mgmt.recoveryservices.models.PrivateEndpointConnectionVaultProperties] @@ -1737,8 +2117,18 @@ class VaultProperties(msrest.serialization.Model): Possible values include: "None", "Enabled". :vartype private_endpoint_state_for_site_recovery: str or ~azure.mgmt.recoveryservices.models.VaultPrivateEndpointState - :param encryption: Customer Managed Key details of the resource. - :type encryption: ~azure.mgmt.recoveryservices.models.VaultPropertiesEncryption + :ivar encryption: Customer Managed Key details of the resource. + :vartype encryption: ~azure.mgmt.recoveryservices.models.VaultPropertiesEncryption + :ivar move_details: The details of the latest move operation performed on the Azure Resource. + :vartype move_details: ~azure.mgmt.recoveryservices.models.VaultPropertiesMoveDetails + :ivar move_state: The State of the Resource after the move operation. Possible values include: + "Unknown", "InProgress", "PrepareFailed", "CommitFailed", "PrepareTimedout", "CommitTimedout", + "MoveSucceeded", "Failure", "CriticalFailure", "PartialSuccess". + :vartype move_state: str or ~azure.mgmt.recoveryservices.models.ResourceMoveState + :ivar backup_storage_version: Backup storage version. Possible values include: "V1", "V2", + "Unassigned". + :vartype backup_storage_version: str or + ~azure.mgmt.recoveryservices.models.BackupStorageVersion """ _validation = { @@ -1746,6 +2136,8 @@ class VaultProperties(msrest.serialization.Model): 'private_endpoint_connections': {'readonly': True}, 'private_endpoint_state_for_backup': {'readonly': True}, 'private_endpoint_state_for_site_recovery': {'readonly': True}, + 'move_state': {'readonly': True}, + 'backup_storage_version': {'readonly': True}, } _attribute_map = { @@ -1755,6 +2147,9 @@ class VaultProperties(msrest.serialization.Model): 'private_endpoint_state_for_backup': {'key': 'privateEndpointStateForBackup', 'type': 'str'}, 'private_endpoint_state_for_site_recovery': {'key': 'privateEndpointStateForSiteRecovery', 'type': 'str'}, 'encryption': {'key': 'encryption', 'type': 'VaultPropertiesEncryption'}, + 'move_details': {'key': 'moveDetails', 'type': 'VaultPropertiesMoveDetails'}, + 'move_state': {'key': 'moveState', 'type': 'str'}, + 'backup_storage_version': {'key': 'backupStorageVersion', 'type': 'str'}, } def __init__( @@ -1762,8 +2157,18 @@ def __init__( *, upgrade_details: Optional["UpgradeDetails"] = None, encryption: Optional["VaultPropertiesEncryption"] = None, + move_details: Optional["VaultPropertiesMoveDetails"] = None, **kwargs ): + """ + :keyword upgrade_details: Details for upgrading vault. + :paramtype upgrade_details: ~azure.mgmt.recoveryservices.models.UpgradeDetails + :keyword encryption: Customer Managed Key details of the resource. + :paramtype encryption: ~azure.mgmt.recoveryservices.models.VaultPropertiesEncryption + :keyword move_details: The details of the latest move operation performed on the Azure + Resource. + :paramtype move_details: ~azure.mgmt.recoveryservices.models.VaultPropertiesMoveDetails + """ super(VaultProperties, self).__init__(**kwargs) self.provisioning_state = None self.upgrade_details = upgrade_details @@ -1771,18 +2176,21 @@ def __init__( self.private_endpoint_state_for_backup = None self.private_endpoint_state_for_site_recovery = None self.encryption = encryption + self.move_details = move_details + self.move_state = None + self.backup_storage_version = None class VaultPropertiesEncryption(msrest.serialization.Model): """Customer Managed Key details of the resource. - :param key_vault_properties: The properties of the Key Vault which hosts CMK. - :type key_vault_properties: ~azure.mgmt.recoveryservices.models.CmkKeyVaultProperties - :param kek_identity: The details of the identity used for CMK. - :type kek_identity: ~azure.mgmt.recoveryservices.models.CmkKekIdentity - :param infrastructure_encryption: Enabling/Disabling the Double Encryption state. Possible + :ivar key_vault_properties: The properties of the Key Vault which hosts CMK. + :vartype key_vault_properties: ~azure.mgmt.recoveryservices.models.CmkKeyVaultProperties + :ivar kek_identity: The details of the identity used for CMK. + :vartype kek_identity: ~azure.mgmt.recoveryservices.models.CmkKekIdentity + :ivar infrastructure_encryption: Enabling/Disabling the Double Encryption state. Possible values include: "Enabled", "Disabled". - :type infrastructure_encryption: str or + :vartype infrastructure_encryption: str or ~azure.mgmt.recoveryservices.models.InfrastructureEncryptionState """ @@ -1800,28 +2208,85 @@ def __init__( infrastructure_encryption: Optional[Union[str, "InfrastructureEncryptionState"]] = None, **kwargs ): + """ + :keyword key_vault_properties: The properties of the Key Vault which hosts CMK. + :paramtype key_vault_properties: ~azure.mgmt.recoveryservices.models.CmkKeyVaultProperties + :keyword kek_identity: The details of the identity used for CMK. + :paramtype kek_identity: ~azure.mgmt.recoveryservices.models.CmkKekIdentity + :keyword infrastructure_encryption: Enabling/Disabling the Double Encryption state. Possible + values include: "Enabled", "Disabled". + :paramtype infrastructure_encryption: str or + ~azure.mgmt.recoveryservices.models.InfrastructureEncryptionState + """ super(VaultPropertiesEncryption, self).__init__(**kwargs) self.key_vault_properties = key_vault_properties self.kek_identity = kek_identity self.infrastructure_encryption = infrastructure_encryption +class VaultPropertiesMoveDetails(msrest.serialization.Model): + """The details of the latest move operation performed on the Azure Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar operation_id: OperationId of the Resource Move Operation. + :vartype operation_id: str + :ivar start_time_utc: Start Time of the Resource Move Operation. + :vartype start_time_utc: ~datetime.datetime + :ivar completion_time_utc: End Time of the Resource Move Operation. + :vartype completion_time_utc: ~datetime.datetime + :ivar source_resource_id: Source Resource of the Resource Move Operation. + :vartype source_resource_id: str + :ivar target_resource_id: Target Resource of the Resource Move Operation. + :vartype target_resource_id: str + """ + + _validation = { + 'operation_id': {'readonly': True}, + 'start_time_utc': {'readonly': True}, + 'completion_time_utc': {'readonly': True}, + 'source_resource_id': {'readonly': True}, + 'target_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'start_time_utc': {'key': 'startTimeUtc', 'type': 'iso-8601'}, + 'completion_time_utc': {'key': 'completionTimeUtc', 'type': 'iso-8601'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(VaultPropertiesMoveDetails, self).__init__(**kwargs) + self.operation_id = None + self.start_time_utc = None + self.completion_time_utc = None + self.source_resource_id = None + self.target_resource_id = None + + class VaultUsage(msrest.serialization.Model): """Usages of a vault. - :param unit: Unit of the usage. Possible values include: "Count", "Bytes", "Seconds", - "Percent", "CountPerSecond", "BytesPerSecond". - :type unit: str or ~azure.mgmt.recoveryservices.models.UsagesUnit - :param quota_period: Quota period of usage. - :type quota_period: str - :param next_reset_time: Next reset time of usage. - :type next_reset_time: ~datetime.datetime - :param current_value: Current value of usage. - :type current_value: long - :param limit: Limit of usage. - :type limit: long - :param name: Name of usage. - :type name: ~azure.mgmt.recoveryservices.models.NameInfo + :ivar unit: Unit of the usage. Possible values include: "Count", "Bytes", "Seconds", "Percent", + "CountPerSecond", "BytesPerSecond". + :vartype unit: str or ~azure.mgmt.recoveryservices.models.UsagesUnit + :ivar quota_period: Quota period of usage. + :vartype quota_period: str + :ivar next_reset_time: Next reset time of usage. + :vartype next_reset_time: ~datetime.datetime + :ivar current_value: Current value of usage. + :vartype current_value: long + :ivar limit: Limit of usage. + :vartype limit: long + :ivar name: Name of usage. + :vartype name: ~azure.mgmt.recoveryservices.models.NameInfo """ _attribute_map = { @@ -1844,6 +2309,21 @@ def __init__( name: Optional["NameInfo"] = None, **kwargs ): + """ + :keyword unit: Unit of the usage. Possible values include: "Count", "Bytes", "Seconds", + "Percent", "CountPerSecond", "BytesPerSecond". + :paramtype unit: str or ~azure.mgmt.recoveryservices.models.UsagesUnit + :keyword quota_period: Quota period of usage. + :paramtype quota_period: str + :keyword next_reset_time: Next reset time of usage. + :paramtype next_reset_time: ~datetime.datetime + :keyword current_value: Current value of usage. + :paramtype current_value: long + :keyword limit: Limit of usage. + :paramtype limit: long + :keyword name: Name of usage. + :paramtype name: ~azure.mgmt.recoveryservices.models.NameInfo + """ super(VaultUsage, self).__init__(**kwargs) self.unit = unit self.quota_period = quota_period @@ -1856,8 +2336,8 @@ def __init__( class VaultUsageList(msrest.serialization.Model): """Usage for vault. - :param value: The list of usages for the given vault. - :type value: list[~azure.mgmt.recoveryservices.models.VaultUsage] + :ivar value: The list of usages for the given vault. + :vartype value: list[~azure.mgmt.recoveryservices.models.VaultUsage] """ _attribute_map = { @@ -1870,5 +2350,9 @@ def __init__( value: Optional[List["VaultUsage"]] = None, **kwargs ): + """ + :keyword value: The list of usages for the given vault. + :paramtype value: list[~azure.mgmt.recoveryservices.models.VaultUsage] + """ super(VaultUsageList, self).__init__(**kwargs) self.value = value diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_recovery_services_client_enums.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_recovery_services_client_enums.py index 3d8cf64858d6..a6b2243410f1 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_recovery_services_client_enums.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/_recovery_services_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class AuthType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AuthType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies the authentication type. """ @@ -36,7 +21,15 @@ class AuthType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ACCESS_CONTROL_SERVICE = "AccessControlService" AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory" -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class BackupStorageVersion(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Backup storage version + """ + + V1 = "V1" + V2 = "V2" + UNASSIGNED = "Unassigned" + +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -45,14 +38,14 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class InfrastructureEncryptionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class InfrastructureEncryptionState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Enabling/Disabling the Double Encryption state """ ENABLED = "Enabled" DISABLED = "Disabled" -class PrivateEndpointConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PrivateEndpointConnectionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Gets or sets the status. """ @@ -61,7 +54,7 @@ class PrivateEndpointConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, s REJECTED = "Rejected" DISCONNECTED = "Disconnected" -class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Gets or sets provisioning state of the private endpoint connection. """ @@ -70,7 +63,7 @@ class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): FAILED = "Failed" PENDING = "Pending" -class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. @@ -81,21 +74,36 @@ class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): USER_ASSIGNED = "UserAssigned" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" -class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceMoveState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The State of the Resource after the move operation + """ + + UNKNOWN = "Unknown" + IN_PROGRESS = "InProgress" + PREPARE_FAILED = "PrepareFailed" + COMMIT_FAILED = "CommitFailed" + PREPARE_TIMEDOUT = "PrepareTimedout" + COMMIT_TIMEDOUT = "CommitTimedout" + MOVE_SUCCEEDED = "MoveSucceeded" + FAILURE = "Failure" + CRITICAL_FAILURE = "CriticalFailure" + PARTIAL_SUCCESS = "PartialSuccess" + +class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The Sku name. """ STANDARD = "Standard" RS0 = "RS0" -class TriggerType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TriggerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The way the vault upgrade was triggered. """ USER_TRIGGERED = "UserTriggered" FORCED_UPGRADE = "ForcedUpgrade" -class UsagesUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class UsagesUnit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Unit of the usage. """ @@ -106,14 +114,14 @@ class UsagesUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): COUNT_PER_SECOND = "CountPerSecond" BYTES_PER_SECOND = "BytesPerSecond" -class VaultPrivateEndpointState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class VaultPrivateEndpointState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Private endpoint state for backup. """ NONE = "None" ENABLED = "Enabled" -class VaultUpgradeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class VaultUpgradeState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Status of the vault upgrade operation. """ diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_operations.py index 18b502e794c5..f8dff58bedee 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_operations.py @@ -5,23 +5,50 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.RecoveryServices/operations') + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,16 +72,18 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ClientDiscoveryResponse"] + **kwargs: Any + ) -> Iterable["_models.ClientDiscoveryResponse"]: """Returns the list of available operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ClientDiscoveryResponse or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservices.models.ClientDiscoveryResponse] + :return: An iterator like instance of either ClientDiscoveryResponse or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservices.models.ClientDiscoveryResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ClientDiscoveryResponse"] @@ -62,30 +91,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ClientDiscoveryResponse', pipeline_response) + deserialized = self._deserialize("ClientDiscoveryResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -103,6 +129,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_private_link_resources_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_private_link_resources_operations.py index f5e0df8c83c0..5f355546435d 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_private_link_resources_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_private_link_resources_operations.py @@ -5,23 +5,97 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + vault_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + vault_name: str, + private_link_resource_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources/{privateLinkResourceName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "privateLinkResourceName": _SERIALIZER.url("private_link_resource_name", private_link_resource_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class PrivateLinkResourcesOperations(object): """PrivateLinkResourcesOperations operations. @@ -45,13 +119,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - vault_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PrivateLinkResources"] + resource_group_name: str, + vault_name: str, + **kwargs: Any + ) -> Iterable["_models.PrivateLinkResources"]: """Returns the list of private link resources that need to be created for Backup and SiteRecovery. Returns the list of private link resources that need to be created for Backup and SiteRecovery. @@ -62,7 +136,8 @@ def list( :param vault_name: The name of the recovery services vault. :type vault_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PrivateLinkResources or the result of cls(response) + :return: An iterator like instance of either PrivateLinkResources or the result of + cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservices.models.PrivateLinkResources] :raises: ~azure.core.exceptions.HttpResponseError """ @@ -71,36 +146,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('PrivateLinkResources', pipeline_response) + deserialized = self._deserialize("PrivateLinkResources", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,19 +190,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - vault_name, # type: str - private_link_resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PrivateLinkResource" + resource_group_name: str, + vault_name: str, + private_link_resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResource": """Returns a specified private link resource that need to be created for Backup and SiteRecovery. Returns a specified private link resource that need to be created for Backup and SiteRecovery. @@ -152,28 +225,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'privateLinkResourceName': self._serialize.url("private_link_resource_name", private_link_resource_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + private_link_resource_name=private_link_resource_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,4 +250,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources/{privateLinkResourceName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_client_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_client_operations.py index c0239cfaa7aa..a26c53eb3306 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_client_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_client_operations.py @@ -5,33 +5,109 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_operation_status_request( + subscription_id: str, + resource_group_name: str, + vault_name: str, + operation_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationStatus/{operationId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_operation_result_request( + subscription_id: str, + resource_group_name: str, + vault_name: str, + operation_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationResults/{operationId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class RecoveryServicesClientOperationsMixin(object): + @distributed_trace def get_operation_status( self, - resource_group_name, # type: str - vault_name, # type: str - operation_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.OperationResource" + resource_group_name: str, + vault_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.OperationResource": """Gets the operation status for a resource. :param resource_group_name: The name of the resource group where the recovery services vault is @@ -51,28 +127,18 @@ def get_operation_status( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_operation_status.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_get_operation_status_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + operation_id=operation_id, + template_url=self.get_operation_status.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -86,16 +152,18 @@ def get_operation_status( return cls(pipeline_response, deserialized, {}) return deserialized + get_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationStatus/{operationId}'} # type: ignore + + @distributed_trace def get_operation_result( self, - resource_group_name, # type: str - vault_name, # type: str - operation_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Vault"] + resource_group_name: str, + vault_name: str, + operation_id: str, + **kwargs: Any + ) -> Optional["_models.Vault"]: """Gets the operation result for a resource. :param resource_group_name: The name of the resource group where the recovery services vault is @@ -115,28 +183,18 @@ def get_operation_result( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get_operation_result.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_operation_result_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + operation_id=operation_id, + template_url=self.get_operation_result.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -152,4 +210,6 @@ def get_operation_result( return cls(pipeline_response, deserialized, {}) return deserialized + get_operation_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/operationResults/{operationId}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_operations.py index a3654fbec496..b4d9df07a00f 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_recovery_services_operations.py @@ -5,22 +5,69 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_check_name_availability_request( + subscription_id: str, + resource_group_name: str, + location: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/locations/{location}/checkNameAvailability') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "location": _SERIALIZER.url("location", location, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class RecoveryServicesOperations(object): """RecoveryServicesOperations operations. @@ -44,17 +91,19 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def check_name_availability( self, - resource_group_name, # type: str - location, # type: str - input, # type: "_models.CheckNameAvailabilityParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.CheckNameAvailabilityResult" + resource_group_name: str, + location: str, + input: "_models.CheckNameAvailabilityParameters", + **kwargs: Any + ) -> "_models.CheckNameAvailabilityResult": """API to check for resource name availability. - A name is available if no other resource exists that has the same SubscriptionId, Resource Name and Type - or if one or more such resources exist, each of these must be GC'd and their time of deletion be more than 24 Hours Ago. + A name is available if no other resource exists that has the same SubscriptionId, Resource Name + and Type + or if one or more such resources exist, each of these must be GC'd and their time of deletion + be more than 24 Hours Ago. API to check for resource name availability. A name is available if no other resource exists that has the same SubscriptionId, Resource Name @@ -79,32 +128,22 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.check_name_availability.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(input, 'CheckNameAvailabilityParameters') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_check_name_availability_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + location=location, + content_type=content_type, + json=_json, + template_url=self.check_name_availability.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'CheckNameAvailabilityParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -118,4 +157,6 @@ def check_name_availability( return cls(pipeline_response, deserialized, {}) return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/locations/{location}/checkNameAvailability'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_registered_identities_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_registered_identities_operations.py index 55f19f9d9eba..d01e362e8c8f 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_registered_identities_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_registered_identities_operations.py @@ -5,22 +5,55 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + vault_name: str, + identity_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/registeredIdentities/{identityName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "identityName": _SERIALIZER.url("identity_name", identity_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) class RegisteredIdentitiesOperations(object): """RegisteredIdentitiesOperations operations. @@ -44,14 +77,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def delete( self, - resource_group_name, # type: str - vault_name, # type: str - identity_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + vault_name: str, + identity_name: str, + **kwargs: Any + ) -> None: """Unregisters the given container from your Recovery Services vault. :param resource_group_name: The name of the resource group where the recovery services vault is @@ -71,26 +104,18 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'identityName': self._serialize.url("identity_name", identity_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + identity_name=identity_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -102,3 +127,4 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/registeredIdentities/{identityName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_replication_usages_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_replication_usages_operations.py index 5a84fb7c3be7..b543cd31ffe3 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_replication_usages_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_replication_usages_operations.py @@ -5,23 +5,60 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + subscription_id: str, + resource_group_name: str, + vault_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/replicationUsages') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationUsagesOperations(object): """ReplicationUsagesOperations operations. @@ -45,13 +82,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - resource_group_name, # type: str - vault_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ReplicationUsageList"] + resource_group_name: str, + vault_name: str, + **kwargs: Any + ) -> Iterable["_models.ReplicationUsageList"]: """Fetches the replication usages of the vault. :param resource_group_name: The name of the resource group where the recovery services vault is @@ -60,7 +97,8 @@ def list( :param vault_name: The name of the recovery services vault. :type vault_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ReplicationUsageList or the result of cls(response) + :return: An iterator like instance of either ReplicationUsageList or the result of + cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservices.models.ReplicationUsageList] :raises: ~azure.core.exceptions.HttpResponseError """ @@ -69,36 +107,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ReplicationUsageList', pipeline_response) + deserialized = self._deserialize("ReplicationUsageList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -116,6 +151,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_usages_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_usages_operations.py index 28005deeed8f..ea314941ba6d 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_usages_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_usages_operations.py @@ -5,23 +5,60 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_vaults_request( + subscription_id: str, + resource_group_name: str, + vault_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/usages') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class UsagesOperations(object): """UsagesOperations operations. @@ -45,13 +82,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_vaults( self, - resource_group_name, # type: str - vault_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.VaultUsageList"] + resource_group_name: str, + vault_name: str, + **kwargs: Any + ) -> Iterable["_models.VaultUsageList"]: """Fetches the usages of the vault. :param resource_group_name: The name of the resource group where the recovery services vault is @@ -69,36 +106,33 @@ def list_by_vaults( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_vaults.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_vaults_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.list_by_vaults.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_vaults_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('VaultUsageList', pipeline_response) + deserialized = self._deserialize("VaultUsageList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -116,6 +150,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_certificates_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_certificates_operations.py index 0951d6c98503..e92df530f510 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_certificates_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_certificates_operations.py @@ -5,22 +5,71 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_create_request( + subscription_id: str, + resource_group_name: str, + vault_name: str, + certificate_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/certificates/{certificateName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "certificateName": _SERIALIZER.url("certificate_name", certificate_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class VaultCertificatesOperations(object): """VaultCertificatesOperations operations. @@ -44,15 +93,15 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def create( self, - resource_group_name, # type: str - vault_name, # type: str - certificate_name, # type: str - certificate_request, # type: "_models.CertificateRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.VaultCertificateResponse" + resource_group_name: str, + vault_name: str, + certificate_name: str, + certificate_request: "_models.CertificateRequest", + **kwargs: Any + ) -> "_models.VaultCertificateResponse": """Uploads a certificate for a resource. :param resource_group_name: The name of the resource group where the recovery services vault is @@ -74,33 +123,23 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(certificate_request, 'CertificateRequest') + + request = build_create_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + certificate_name=certificate_name, + content_type=content_type, + json=_json, + template_url=self.create.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(certificate_request, 'CertificateRequest') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -114,4 +153,6 @@ def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/certificates/{certificateName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_extended_info_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_extended_info_operations.py index 90b8efbeef70..a12d6ecf6b09 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_extended_info_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vault_extended_info_operations.py @@ -5,22 +5,148 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + subscription_id: str, + resource_group_name: str, + vault_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + subscription_id: str, + resource_group_name: str, + vault_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_request( + subscription_id: str, + resource_group_name: str, + vault_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class VaultExtendedInfoOperations(object): """VaultExtendedInfoOperations operations. @@ -44,13 +170,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get( self, - resource_group_name, # type: str - vault_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VaultExtendedInfoResource" + resource_group_name: str, + vault_name: str, + **kwargs: Any + ) -> "_models.VaultExtendedInfoResource": """Get the vault extended info. :param resource_group_name: The name of the resource group where the recovery services vault is @@ -68,27 +194,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -102,16 +218,18 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo'} # type: ignore + + @distributed_trace def create_or_update( self, - resource_group_name, # type: str - vault_name, # type: str - resource_extended_info_details, # type: "_models.VaultExtendedInfoResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.VaultExtendedInfoResource" + resource_group_name: str, + vault_name: str, + resource_extended_info_details: "_models.VaultExtendedInfoResource", + **kwargs: Any + ) -> "_models.VaultExtendedInfoResource": """Create vault extended info. :param resource_group_name: The name of the resource group where the recovery services vault is @@ -120,7 +238,8 @@ def create_or_update( :param vault_name: The name of the recovery services vault. :type vault_name: str :param resource_extended_info_details: Details of ResourceExtendedInfo. - :type resource_extended_info_details: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource + :type resource_extended_info_details: + ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource :keyword callable cls: A custom type or function that will be passed the direct response :return: VaultExtendedInfoResource, or the result of cls(response) :rtype: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource @@ -131,32 +250,22 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') + + request = build_create_or_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -170,16 +279,18 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo'} # type: ignore + + @distributed_trace def update( self, - resource_group_name, # type: str - vault_name, # type: str - resource_extended_info_details, # type: "_models.VaultExtendedInfoResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.VaultExtendedInfoResource" + resource_group_name: str, + vault_name: str, + resource_extended_info_details: "_models.VaultExtendedInfoResource", + **kwargs: Any + ) -> "_models.VaultExtendedInfoResource": """Update vault extended info. :param resource_group_name: The name of the resource group where the recovery services vault is @@ -188,7 +299,8 @@ def update( :param vault_name: The name of the recovery services vault. :type vault_name: str :param resource_extended_info_details: Details of ResourceExtendedInfo. - :type resource_extended_info_details: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource + :type resource_extended_info_details: + ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource :keyword callable cls: A custom type or function that will be passed the direct response :return: VaultExtendedInfoResource, or the result of cls(response) :rtype: ~azure.mgmt.recoveryservices.models.VaultExtendedInfoResource @@ -199,32 +311,22 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(resource_extended_info_details, 'VaultExtendedInfoResource') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -238,4 +340,6 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vaults_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vaults_operations.py index 3f4945c53fb7..f31d2cc1dcb4 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vaults_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/_vaults_operations.py @@ -5,25 +5,250 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_subscription_id_request( + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/vaults') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id: str, + resource_group_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + vault_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id: str, + resource_group_name: str, + vault_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request( + subscription_id: str, + resource_group_name: str, + vault_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + vault_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class VaultsOperations(object): """VaultsOperations operations. @@ -47,11 +272,11 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_subscription_id( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.VaultList"] + **kwargs: Any + ) -> Iterable["_models.VaultList"]: """Fetches all the resources of the specified type in the subscription. :keyword callable cls: A custom type or function that will be passed the direct response @@ -64,34 +289,29 @@ def list_by_subscription_id( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_subscription_id.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_subscription_id_request( + subscription_id=self._config.subscription_id, + template_url=self.list_by_subscription_id.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_subscription_id_request( + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('VaultList', pipeline_response) + deserialized = self._deserialize("VaultList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,17 +329,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_subscription_id.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/vaults'} # type: ignore + @distributed_trace def list_by_resource_group( self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.VaultList"] + resource_group_name: str, + **kwargs: Any + ) -> Iterable["_models.VaultList"]: """Retrieve a list of Vaults. :param resource_group_name: The name of the resource group where the recovery services vault is @@ -135,35 +356,31 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('VaultList', pipeline_response) + deserialized = self._deserialize("VaultList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -181,18 +398,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults'} # type: ignore + @distributed_trace def get( self, - resource_group_name, # type: str - vault_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Vault" + resource_group_name: str, + vault_name: str, + **kwargs: Any + ) -> "_models.Vault": """Get the Vault details. :param resource_group_name: The name of the resource group where the recovery services vault is @@ -210,27 +428,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,47 +452,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + def _create_or_update_initial( self, - resource_group_name, # type: str - vault_name, # type: str - vault, # type: "_models.Vault" - **kwargs # type: Any - ): - # type: (...) -> "_models.Vault" + resource_group_name: str, + vault_name: str, + vault: "_models.Vault", + **kwargs: Any + ) -> "_models.Vault": cls = kwargs.pop('cls', None) # type: ClsType["_models.Vault"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(vault, 'Vault') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(vault, 'Vault') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -302,16 +501,18 @@ def _create_or_update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, - resource_group_name, # type: str - vault_name, # type: str - vault, # type: "_models.Vault" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Vault"] + resource_group_name: str, + vault_name: str, + vault: "_models.Vault", + **kwargs: Any + ) -> LROPoller["_models.Vault"]: """Creates or updates a Recovery Services vault. :param resource_group_name: The name of the resource group where the recovery services vault is @@ -323,15 +524,18 @@ def begin_create_or_update( :type vault: ~azure.mgmt.recoveryservices.models.Vault :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. + :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. + :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 Vault or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservices.models.Vault] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Vault"] lro_delay = kwargs.pop( 'polling_interval', @@ -343,27 +547,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, vault_name=vault_name, vault=vault, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Vault', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -375,15 +573,16 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + @distributed_trace def delete( self, - resource_group_name, # type: str - vault_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + resource_group_name: str, + vault_name: str, + **kwargs: Any + ) -> None: """Deletes a vault. :param resource_group_name: The name of the resource group where the recovery services vault is @@ -401,27 +600,17 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self.delete.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -434,45 +623,35 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + def _update_initial( self, - resource_group_name, # type: str - vault_name, # type: str - vault, # type: "_models.PatchVault" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Vault"] + resource_group_name: str, + vault_name: str, + vault: "_models.PatchVault", + **kwargs: Any + ) -> Optional["_models.Vault"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Vault"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(vault, 'PatchVault') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(vault, 'PatchVault') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -488,16 +667,18 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore + + @distributed_trace def begin_update( self, - resource_group_name, # type: str - vault_name, # type: str - vault, # type: "_models.PatchVault" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Vault"] + resource_group_name: str, + vault_name: str, + vault: "_models.PatchVault", + **kwargs: Any + ) -> LROPoller["_models.Vault"]: """Updates the vault. :param resource_group_name: The name of the resource group where the recovery services vault is @@ -509,15 +690,18 @@ def begin_update( :type vault: ~azure.mgmt.recoveryservices.models.PatchVault :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. + :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. + :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 Vault or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservices.models.Vault] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Vault"] lro_delay = kwargs.pop( 'polling_interval', @@ -529,27 +713,21 @@ def begin_update( resource_group_name=resource_group_name, vault_name=vault_name, vault=vault, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Vault', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -561,4 +739,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/_meta.json b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/_meta.json index 8ea981ec8a1a..1e8a10b76790 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/_meta.json +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.5", + "autorest": "3.7.2", "use": [ - "@autorest/python@5.8.4", - "@autorest/modelerfour@4.19.2" + "@autorest/python@5.12.0", + "@autorest/modelerfour@4.19.3" ], - "commit": "4cec1770664631fced06a1d83d79ebc3d2ca74db", + "commit": "85eb3e7dbe23e025b9c838bef309f11a05768f10", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/recoveryservicessiterecovery/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "autorest_command": "autorest specification/recoveryservicessiterecovery/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/recoveryservicessiterecovery/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/__init__.py index 8e4538226839..c1d75438c389 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/__init__.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/__init__.py @@ -12,8 +12,7 @@ __version__ = VERSION __all__ = ['SiteRecoveryManagementClient'] -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_configuration.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_configuration.py index 0b7120693ba3..dc71901f1ada 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_configuration.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_configuration.py @@ -6,18 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential @@ -39,13 +37,13 @@ class SiteRecoveryManagementClientConfiguration(Configuration): def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - resource_group_name, # type: str - resource_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + credential: "TokenCredential", + subscription_id: str, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + super(SiteRecoveryManagementClientConfiguration, self).__init__(**kwargs) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -54,13 +52,12 @@ def __init__( raise ValueError("Parameter 'resource_group_name' must not be None.") if resource_name is None: raise ValueError("Parameter 'resource_name' must not be None.") - super(SiteRecoveryManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id self.resource_group_name = resource_group_name self.resource_name = resource_name - self.api_version = "2021-06-01" + self.api_version = "2022-01-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-recoveryservicessiterecovery/{}'.format(VERSION)) self._configure(**kwargs) @@ -80,4 +77,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_metadata.json b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_metadata.json index 45ba43c83df4..a7b95739310d 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_metadata.json +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_metadata.json @@ -1,17 +1,17 @@ { - "chosen_version": "2021-06-01", - "total_api_version_list": ["2021-06-01"], + "chosen_version": "2022-01-01", + "total_api_version_list": ["2022-01-01"], "client": { "name": "SiteRecoveryManagementClient", "filename": "_site_recovery_management_client", "description": "SiteRecoveryManagementClient.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, + "host_value": "\"https://management.azure.com\"", + "parameterized_host_template": null, "azure_arm": true, "has_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SiteRecoveryManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SiteRecoveryManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SiteRecoveryManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SiteRecoveryManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -78,7 +78,7 @@ "required": false }, "base_url": { - "signature": "base_url=None, # type: Optional[str]", + "signature": "base_url=\"https://management.azure.com\", # type: str", "description": "Service URL", "docstring_type": "str", "required": false @@ -98,7 +98,7 @@ "required": false }, "base_url": { - "signature": "base_url: Optional[str] = None,", + "signature": "base_url: str = \"https://management.azure.com\",", "description": "Service URL", "docstring_type": "str", "required": false @@ -115,15 +115,15 @@ "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", "replication_alert_settings": "ReplicationAlertSettingsOperations", + "replication_appliances": "ReplicationAppliancesOperations", "replication_eligibility_results": "ReplicationEligibilityResultsOperations", "replication_events": "ReplicationEventsOperations", "replication_fabrics": "ReplicationFabricsOperations", diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_patch.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_site_recovery_management_client.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_site_recovery_management_client.py index 92cacd11a8e4..2979907724db 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_site_recovery_management_client.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_site_recovery_management_client.py @@ -6,212 +6,197 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from copy import deepcopy +from typing import Any, Optional, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from msrest import Deserializer, Serializer +from . import models +from ._configuration import SiteRecoveryManagementClientConfiguration +from .operations import MigrationRecoveryPointsOperations, Operations, RecoveryPointsOperations, ReplicationAlertSettingsOperations, ReplicationAppliancesOperations, ReplicationEligibilityResultsOperations, ReplicationEventsOperations, ReplicationFabricsOperations, ReplicationJobsOperations, ReplicationLogicalNetworksOperations, ReplicationMigrationItemsOperations, ReplicationNetworkMappingsOperations, ReplicationNetworksOperations, ReplicationPoliciesOperations, ReplicationProtectableItemsOperations, ReplicationProtectedItemsOperations, ReplicationProtectionContainerMappingsOperations, ReplicationProtectionContainersOperations, ReplicationProtectionIntentsOperations, ReplicationRecoveryPlansOperations, ReplicationRecoveryServicesProvidersOperations, ReplicationStorageClassificationMappingsOperations, ReplicationStorageClassificationsOperations, ReplicationVaultHealthOperations, ReplicationVaultSettingOperations, ReplicationvCentersOperations, SupportedOperatingSystemsOperations, TargetComputeSizesOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - from azure.core.credentials import TokenCredential - from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from ._configuration import SiteRecoveryManagementClientConfiguration -from .operations import Operations -from .operations import ReplicationAlertSettingsOperations -from .operations import ReplicationEligibilityResultsOperations -from .operations import ReplicationEventsOperations -from .operations import ReplicationFabricsOperations -from .operations import ReplicationLogicalNetworksOperations -from .operations import ReplicationNetworksOperations -from .operations import ReplicationNetworkMappingsOperations -from .operations import ReplicationProtectionContainersOperations -from .operations import ReplicationMigrationItemsOperations -from .operations import MigrationRecoveryPointsOperations -from .operations import ReplicationProtectableItemsOperations -from .operations import ReplicationProtectedItemsOperations -from .operations import RecoveryPointsOperations -from .operations import TargetComputeSizesOperations -from .operations import ReplicationProtectionContainerMappingsOperations -from .operations import ReplicationRecoveryServicesProvidersOperations -from .operations import ReplicationStorageClassificationsOperations -from .operations import ReplicationStorageClassificationMappingsOperations -from .operations import ReplicationvCentersOperations -from .operations import ReplicationJobsOperations -from .operations import ReplicationPoliciesOperations -from .operations import ReplicationProtectionIntentsOperations -from .operations import ReplicationRecoveryPlansOperations -from .operations import SupportedOperatingSystemsOperations -from .operations import ReplicationVaultHealthOperations -from .operations import ReplicationVaultSettingOperations -from . import models - -class SiteRecoveryManagementClient(object): +class SiteRecoveryManagementClient: """SiteRecoveryManagementClient. :ivar operations: Operations operations :vartype operations: azure.mgmt.recoveryservicessiterecovery.operations.Operations :ivar replication_alert_settings: ReplicationAlertSettingsOperations operations - :vartype replication_alert_settings: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationAlertSettingsOperations + :vartype replication_alert_settings: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationAlertSettingsOperations + :ivar replication_appliances: ReplicationAppliancesOperations operations + :vartype replication_appliances: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationAppliancesOperations :ivar replication_eligibility_results: ReplicationEligibilityResultsOperations operations - :vartype replication_eligibility_results: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationEligibilityResultsOperations + :vartype replication_eligibility_results: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationEligibilityResultsOperations :ivar replication_events: ReplicationEventsOperations operations - :vartype replication_events: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationEventsOperations + :vartype replication_events: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationEventsOperations :ivar replication_fabrics: ReplicationFabricsOperations operations - :vartype replication_fabrics: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationFabricsOperations + :vartype replication_fabrics: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationFabricsOperations :ivar replication_logical_networks: ReplicationLogicalNetworksOperations operations - :vartype replication_logical_networks: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationLogicalNetworksOperations + :vartype replication_logical_networks: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationLogicalNetworksOperations :ivar replication_networks: ReplicationNetworksOperations operations - :vartype replication_networks: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationNetworksOperations + :vartype replication_networks: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationNetworksOperations :ivar replication_network_mappings: ReplicationNetworkMappingsOperations operations - :vartype replication_network_mappings: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationNetworkMappingsOperations + :vartype replication_network_mappings: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationNetworkMappingsOperations :ivar replication_protection_containers: ReplicationProtectionContainersOperations operations - :vartype replication_protection_containers: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationProtectionContainersOperations + :vartype replication_protection_containers: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationProtectionContainersOperations :ivar replication_migration_items: ReplicationMigrationItemsOperations operations - :vartype replication_migration_items: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationMigrationItemsOperations + :vartype replication_migration_items: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationMigrationItemsOperations :ivar migration_recovery_points: MigrationRecoveryPointsOperations operations - :vartype migration_recovery_points: azure.mgmt.recoveryservicessiterecovery.operations.MigrationRecoveryPointsOperations + :vartype migration_recovery_points: + azure.mgmt.recoveryservicessiterecovery.operations.MigrationRecoveryPointsOperations :ivar replication_protectable_items: ReplicationProtectableItemsOperations operations - :vartype replication_protectable_items: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationProtectableItemsOperations + :vartype replication_protectable_items: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationProtectableItemsOperations :ivar replication_protected_items: ReplicationProtectedItemsOperations operations - :vartype replication_protected_items: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationProtectedItemsOperations + :vartype replication_protected_items: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationProtectedItemsOperations :ivar recovery_points: RecoveryPointsOperations operations - :vartype recovery_points: azure.mgmt.recoveryservicessiterecovery.operations.RecoveryPointsOperations + :vartype recovery_points: + azure.mgmt.recoveryservicessiterecovery.operations.RecoveryPointsOperations :ivar target_compute_sizes: TargetComputeSizesOperations operations - :vartype target_compute_sizes: azure.mgmt.recoveryservicessiterecovery.operations.TargetComputeSizesOperations - :ivar replication_protection_container_mappings: ReplicationProtectionContainerMappingsOperations operations - :vartype replication_protection_container_mappings: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationProtectionContainerMappingsOperations - :ivar replication_recovery_services_providers: ReplicationRecoveryServicesProvidersOperations operations - :vartype replication_recovery_services_providers: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationRecoveryServicesProvidersOperations - :ivar replication_storage_classifications: ReplicationStorageClassificationsOperations operations - :vartype replication_storage_classifications: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationStorageClassificationsOperations - :ivar replication_storage_classification_mappings: ReplicationStorageClassificationMappingsOperations operations - :vartype replication_storage_classification_mappings: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationStorageClassificationMappingsOperations + :vartype target_compute_sizes: + azure.mgmt.recoveryservicessiterecovery.operations.TargetComputeSizesOperations + :ivar replication_protection_container_mappings: + ReplicationProtectionContainerMappingsOperations operations + :vartype replication_protection_container_mappings: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationProtectionContainerMappingsOperations + :ivar replication_recovery_services_providers: ReplicationRecoveryServicesProvidersOperations + operations + :vartype replication_recovery_services_providers: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationRecoveryServicesProvidersOperations + :ivar replication_storage_classifications: ReplicationStorageClassificationsOperations + operations + :vartype replication_storage_classifications: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationStorageClassificationsOperations + :ivar replication_storage_classification_mappings: + ReplicationStorageClassificationMappingsOperations operations + :vartype replication_storage_classification_mappings: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationStorageClassificationMappingsOperations :ivar replicationv_centers: ReplicationvCentersOperations operations - :vartype replicationv_centers: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationvCentersOperations + :vartype replicationv_centers: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationvCentersOperations :ivar replication_jobs: ReplicationJobsOperations operations - :vartype replication_jobs: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationJobsOperations + :vartype replication_jobs: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationJobsOperations :ivar replication_policies: ReplicationPoliciesOperations operations - :vartype replication_policies: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationPoliciesOperations + :vartype replication_policies: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationPoliciesOperations :ivar replication_protection_intents: ReplicationProtectionIntentsOperations operations - :vartype replication_protection_intents: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationProtectionIntentsOperations + :vartype replication_protection_intents: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationProtectionIntentsOperations :ivar replication_recovery_plans: ReplicationRecoveryPlansOperations operations - :vartype replication_recovery_plans: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationRecoveryPlansOperations + :vartype replication_recovery_plans: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationRecoveryPlansOperations :ivar supported_operating_systems: SupportedOperatingSystemsOperations operations - :vartype supported_operating_systems: azure.mgmt.recoveryservicessiterecovery.operations.SupportedOperatingSystemsOperations + :vartype supported_operating_systems: + azure.mgmt.recoveryservicessiterecovery.operations.SupportedOperatingSystemsOperations :ivar replication_vault_health: ReplicationVaultHealthOperations operations - :vartype replication_vault_health: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationVaultHealthOperations + :vartype replication_vault_health: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationVaultHealthOperations :ivar replication_vault_setting: ReplicationVaultSettingOperations operations - :vartype replication_vault_setting: azure.mgmt.recoveryservicessiterecovery.operations.ReplicationVaultSettingOperations + :vartype replication_vault_setting: + azure.mgmt.recoveryservicessiterecovery.operations.ReplicationVaultSettingOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription Id. :type subscription_id: str - :param resource_group_name: The name of the resource group where the recovery services vault is present. + :param resource_group_name: The name of the resource group where the recovery services vault is + present. :type resource_group_name: str :param resource_name: The name of the recovery services vault. :type resource_name: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - resource_group_name, # type: str - resource_name, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = SiteRecoveryManagementClientConfiguration(credential, subscription_id, resource_group_name, resource_name, **kwargs) + credential: "TokenCredential", + subscription_id: str, + resource_group_name: str, + resource_name: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = SiteRecoveryManagementClientConfiguration(credential=credential, subscription_id=subscription_id, resource_group_name=resource_group_name, resource_name=resource_name, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_alert_settings = ReplicationAlertSettingsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_eligibility_results = ReplicationEligibilityResultsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_events = ReplicationEventsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_fabrics = ReplicationFabricsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_logical_networks = ReplicationLogicalNetworksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_networks = ReplicationNetworksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_network_mappings = ReplicationNetworkMappingsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_protection_containers = ReplicationProtectionContainersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_migration_items = ReplicationMigrationItemsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.migration_recovery_points = MigrationRecoveryPointsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_protectable_items = ReplicationProtectableItemsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_protected_items = ReplicationProtectedItemsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.recovery_points = RecoveryPointsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.target_compute_sizes = TargetComputeSizesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_protection_container_mappings = ReplicationProtectionContainerMappingsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_recovery_services_providers = ReplicationRecoveryServicesProvidersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_storage_classifications = ReplicationStorageClassificationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_storage_classification_mappings = ReplicationStorageClassificationMappingsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replicationv_centers = ReplicationvCentersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_jobs = ReplicationJobsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_policies = ReplicationPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_protection_intents = ReplicationProtectionIntentsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_recovery_plans = ReplicationRecoveryPlansOperations( - self._client, self._config, self._serialize, self._deserialize) - self.supported_operating_systems = SupportedOperatingSystemsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_vault_health = ReplicationVaultHealthOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_vault_setting = ReplicationVaultSettingOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse + self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.replication_alert_settings = ReplicationAlertSettingsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_appliances = ReplicationAppliancesOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_eligibility_results = ReplicationEligibilityResultsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_events = ReplicationEventsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_fabrics = ReplicationFabricsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_logical_networks = ReplicationLogicalNetworksOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_networks = ReplicationNetworksOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_network_mappings = ReplicationNetworkMappingsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_protection_containers = ReplicationProtectionContainersOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_migration_items = ReplicationMigrationItemsOperations(self._client, self._config, self._serialize, self._deserialize) + self.migration_recovery_points = MigrationRecoveryPointsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_protectable_items = ReplicationProtectableItemsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_protected_items = ReplicationProtectedItemsOperations(self._client, self._config, self._serialize, self._deserialize) + self.recovery_points = RecoveryPointsOperations(self._client, self._config, self._serialize, self._deserialize) + self.target_compute_sizes = TargetComputeSizesOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_protection_container_mappings = ReplicationProtectionContainerMappingsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_recovery_services_providers = ReplicationRecoveryServicesProvidersOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_storage_classifications = ReplicationStorageClassificationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_storage_classification_mappings = ReplicationStorageClassificationMappingsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replicationv_centers = ReplicationvCentersOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_jobs = ReplicationJobsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_policies = ReplicationPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_protection_intents = ReplicationProtectionIntentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_recovery_plans = ReplicationRecoveryPlansOperations(self._client, self._config, self._serialize, self._deserialize) + self.supported_operating_systems = SupportedOperatingSystemsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_vault_health = ReplicationVaultHealthOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_vault_setting = ReplicationVaultSettingOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request, # type: HttpRequest + **kwargs: Any + ) -> HttpResponse: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse + :rtype: ~azure.core.rest.HttpResponse """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) def close(self): # type: () -> None diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_vendor.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# 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.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/__init__.py index 273ec3e44ae1..827170c41759 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/__init__.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/__init__.py @@ -8,3 +8,8 @@ from ._site_recovery_management_client import SiteRecoveryManagementClient __all__ = ['SiteRecoveryManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/_configuration.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/_configuration.py index 7906d61801df..17e8f5927eca 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/_configuration.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/_configuration.py @@ -10,7 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION @@ -43,6 +43,7 @@ def __init__( resource_name: str, **kwargs: Any ) -> None: + super(SiteRecoveryManagementClientConfiguration, self).__init__(**kwargs) if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -51,13 +52,12 @@ def __init__( raise ValueError("Parameter 'resource_group_name' must not be None.") if resource_name is None: raise ValueError("Parameter 'resource_name' must not be None.") - super(SiteRecoveryManagementClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id self.resource_group_name = resource_group_name self.resource_name = resource_name - self.api_version = "2021-06-01" + self.api_version = "2022-01-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-recoveryservicessiterecovery/{}'.format(VERSION)) self._configure(**kwargs) @@ -76,4 +76,4 @@ def _configure( self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/_patch.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/_site_recovery_management_client.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/_site_recovery_management_client.py index fde008e5a625..bb1693068a62 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/_site_recovery_management_client.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/_site_recovery_management_client.py @@ -6,114 +6,124 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Optional, TYPE_CHECKING +from copy import deepcopy +from typing import Any, Awaitable, Optional, TYPE_CHECKING -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer +from .. import models +from ._configuration import SiteRecoveryManagementClientConfiguration +from .operations import MigrationRecoveryPointsOperations, Operations, RecoveryPointsOperations, ReplicationAlertSettingsOperations, ReplicationAppliancesOperations, ReplicationEligibilityResultsOperations, ReplicationEventsOperations, ReplicationFabricsOperations, ReplicationJobsOperations, ReplicationLogicalNetworksOperations, ReplicationMigrationItemsOperations, ReplicationNetworkMappingsOperations, ReplicationNetworksOperations, ReplicationPoliciesOperations, ReplicationProtectableItemsOperations, ReplicationProtectedItemsOperations, ReplicationProtectionContainerMappingsOperations, ReplicationProtectionContainersOperations, ReplicationProtectionIntentsOperations, ReplicationRecoveryPlansOperations, ReplicationRecoveryServicesProvidersOperations, ReplicationStorageClassificationMappingsOperations, ReplicationStorageClassificationsOperations, ReplicationVaultHealthOperations, ReplicationVaultSettingOperations, ReplicationvCentersOperations, SupportedOperatingSystemsOperations, TargetComputeSizesOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import SiteRecoveryManagementClientConfiguration -from .operations import Operations -from .operations import ReplicationAlertSettingsOperations -from .operations import ReplicationEligibilityResultsOperations -from .operations import ReplicationEventsOperations -from .operations import ReplicationFabricsOperations -from .operations import ReplicationLogicalNetworksOperations -from .operations import ReplicationNetworksOperations -from .operations import ReplicationNetworkMappingsOperations -from .operations import ReplicationProtectionContainersOperations -from .operations import ReplicationMigrationItemsOperations -from .operations import MigrationRecoveryPointsOperations -from .operations import ReplicationProtectableItemsOperations -from .operations import ReplicationProtectedItemsOperations -from .operations import RecoveryPointsOperations -from .operations import TargetComputeSizesOperations -from .operations import ReplicationProtectionContainerMappingsOperations -from .operations import ReplicationRecoveryServicesProvidersOperations -from .operations import ReplicationStorageClassificationsOperations -from .operations import ReplicationStorageClassificationMappingsOperations -from .operations import ReplicationvCentersOperations -from .operations import ReplicationJobsOperations -from .operations import ReplicationPoliciesOperations -from .operations import ReplicationProtectionIntentsOperations -from .operations import ReplicationRecoveryPlansOperations -from .operations import SupportedOperatingSystemsOperations -from .operations import ReplicationVaultHealthOperations -from .operations import ReplicationVaultSettingOperations -from .. import models - - -class SiteRecoveryManagementClient(object): +class SiteRecoveryManagementClient: """SiteRecoveryManagementClient. :ivar operations: Operations operations :vartype operations: azure.mgmt.recoveryservicessiterecovery.aio.operations.Operations :ivar replication_alert_settings: ReplicationAlertSettingsOperations operations - :vartype replication_alert_settings: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationAlertSettingsOperations + :vartype replication_alert_settings: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationAlertSettingsOperations + :ivar replication_appliances: ReplicationAppliancesOperations operations + :vartype replication_appliances: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationAppliancesOperations :ivar replication_eligibility_results: ReplicationEligibilityResultsOperations operations - :vartype replication_eligibility_results: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationEligibilityResultsOperations + :vartype replication_eligibility_results: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationEligibilityResultsOperations :ivar replication_events: ReplicationEventsOperations operations - :vartype replication_events: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationEventsOperations + :vartype replication_events: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationEventsOperations :ivar replication_fabrics: ReplicationFabricsOperations operations - :vartype replication_fabrics: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationFabricsOperations + :vartype replication_fabrics: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationFabricsOperations :ivar replication_logical_networks: ReplicationLogicalNetworksOperations operations - :vartype replication_logical_networks: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationLogicalNetworksOperations + :vartype replication_logical_networks: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationLogicalNetworksOperations :ivar replication_networks: ReplicationNetworksOperations operations - :vartype replication_networks: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationNetworksOperations + :vartype replication_networks: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationNetworksOperations :ivar replication_network_mappings: ReplicationNetworkMappingsOperations operations - :vartype replication_network_mappings: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationNetworkMappingsOperations + :vartype replication_network_mappings: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationNetworkMappingsOperations :ivar replication_protection_containers: ReplicationProtectionContainersOperations operations - :vartype replication_protection_containers: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationProtectionContainersOperations + :vartype replication_protection_containers: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationProtectionContainersOperations :ivar replication_migration_items: ReplicationMigrationItemsOperations operations - :vartype replication_migration_items: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationMigrationItemsOperations + :vartype replication_migration_items: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationMigrationItemsOperations :ivar migration_recovery_points: MigrationRecoveryPointsOperations operations - :vartype migration_recovery_points: azure.mgmt.recoveryservicessiterecovery.aio.operations.MigrationRecoveryPointsOperations + :vartype migration_recovery_points: + azure.mgmt.recoveryservicessiterecovery.aio.operations.MigrationRecoveryPointsOperations :ivar replication_protectable_items: ReplicationProtectableItemsOperations operations - :vartype replication_protectable_items: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationProtectableItemsOperations + :vartype replication_protectable_items: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationProtectableItemsOperations :ivar replication_protected_items: ReplicationProtectedItemsOperations operations - :vartype replication_protected_items: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationProtectedItemsOperations + :vartype replication_protected_items: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationProtectedItemsOperations :ivar recovery_points: RecoveryPointsOperations operations - :vartype recovery_points: azure.mgmt.recoveryservicessiterecovery.aio.operations.RecoveryPointsOperations + :vartype recovery_points: + azure.mgmt.recoveryservicessiterecovery.aio.operations.RecoveryPointsOperations :ivar target_compute_sizes: TargetComputeSizesOperations operations - :vartype target_compute_sizes: azure.mgmt.recoveryservicessiterecovery.aio.operations.TargetComputeSizesOperations - :ivar replication_protection_container_mappings: ReplicationProtectionContainerMappingsOperations operations - :vartype replication_protection_container_mappings: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationProtectionContainerMappingsOperations - :ivar replication_recovery_services_providers: ReplicationRecoveryServicesProvidersOperations operations - :vartype replication_recovery_services_providers: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationRecoveryServicesProvidersOperations - :ivar replication_storage_classifications: ReplicationStorageClassificationsOperations operations - :vartype replication_storage_classifications: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationStorageClassificationsOperations - :ivar replication_storage_classification_mappings: ReplicationStorageClassificationMappingsOperations operations - :vartype replication_storage_classification_mappings: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationStorageClassificationMappingsOperations + :vartype target_compute_sizes: + azure.mgmt.recoveryservicessiterecovery.aio.operations.TargetComputeSizesOperations + :ivar replication_protection_container_mappings: + ReplicationProtectionContainerMappingsOperations operations + :vartype replication_protection_container_mappings: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationProtectionContainerMappingsOperations + :ivar replication_recovery_services_providers: ReplicationRecoveryServicesProvidersOperations + operations + :vartype replication_recovery_services_providers: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationRecoveryServicesProvidersOperations + :ivar replication_storage_classifications: ReplicationStorageClassificationsOperations + operations + :vartype replication_storage_classifications: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationStorageClassificationsOperations + :ivar replication_storage_classification_mappings: + ReplicationStorageClassificationMappingsOperations operations + :vartype replication_storage_classification_mappings: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationStorageClassificationMappingsOperations :ivar replicationv_centers: ReplicationvCentersOperations operations - :vartype replicationv_centers: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationvCentersOperations + :vartype replicationv_centers: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationvCentersOperations :ivar replication_jobs: ReplicationJobsOperations operations - :vartype replication_jobs: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationJobsOperations + :vartype replication_jobs: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationJobsOperations :ivar replication_policies: ReplicationPoliciesOperations operations - :vartype replication_policies: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationPoliciesOperations + :vartype replication_policies: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationPoliciesOperations :ivar replication_protection_intents: ReplicationProtectionIntentsOperations operations - :vartype replication_protection_intents: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationProtectionIntentsOperations + :vartype replication_protection_intents: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationProtectionIntentsOperations :ivar replication_recovery_plans: ReplicationRecoveryPlansOperations operations - :vartype replication_recovery_plans: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationRecoveryPlansOperations + :vartype replication_recovery_plans: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationRecoveryPlansOperations :ivar supported_operating_systems: SupportedOperatingSystemsOperations operations - :vartype supported_operating_systems: azure.mgmt.recoveryservicessiterecovery.aio.operations.SupportedOperatingSystemsOperations + :vartype supported_operating_systems: + azure.mgmt.recoveryservicessiterecovery.aio.operations.SupportedOperatingSystemsOperations :ivar replication_vault_health: ReplicationVaultHealthOperations operations - :vartype replication_vault_health: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationVaultHealthOperations + :vartype replication_vault_health: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationVaultHealthOperations :ivar replication_vault_setting: ReplicationVaultSettingOperations operations - :vartype replication_vault_setting: azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationVaultSettingOperations + :vartype replication_vault_setting: + azure.mgmt.recoveryservicessiterecovery.aio.operations.ReplicationVaultSettingOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription Id. :type subscription_id: str - :param resource_group_name: The name of the resource group where the recovery services vault is present. + :param resource_group_name: The name of the resource group where the recovery services vault is + present. :type resource_group_name: str :param resource_name: The name of the recovery services vault. :type resource_name: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. """ def __init__( @@ -122,92 +132,71 @@ def __init__( subscription_id: str, resource_group_name: str, resource_name: str, - base_url: Optional[str] = None, + base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = SiteRecoveryManagementClientConfiguration(credential, subscription_id, resource_group_name, resource_name, **kwargs) + self._config = SiteRecoveryManagementClientConfiguration(credential=credential, subscription_id=subscription_id, resource_group_name=resource_group_name, resource_name=resource_name, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.replication_alert_settings = ReplicationAlertSettingsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_appliances = ReplicationAppliancesOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_eligibility_results = ReplicationEligibilityResultsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_events = ReplicationEventsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_fabrics = ReplicationFabricsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_logical_networks = ReplicationLogicalNetworksOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_networks = ReplicationNetworksOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_network_mappings = ReplicationNetworkMappingsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_protection_containers = ReplicationProtectionContainersOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_migration_items = ReplicationMigrationItemsOperations(self._client, self._config, self._serialize, self._deserialize) + self.migration_recovery_points = MigrationRecoveryPointsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_protectable_items = ReplicationProtectableItemsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_protected_items = ReplicationProtectedItemsOperations(self._client, self._config, self._serialize, self._deserialize) + self.recovery_points = RecoveryPointsOperations(self._client, self._config, self._serialize, self._deserialize) + self.target_compute_sizes = TargetComputeSizesOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_protection_container_mappings = ReplicationProtectionContainerMappingsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_recovery_services_providers = ReplicationRecoveryServicesProvidersOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_storage_classifications = ReplicationStorageClassificationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_storage_classification_mappings = ReplicationStorageClassificationMappingsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replicationv_centers = ReplicationvCentersOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_jobs = ReplicationJobsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_policies = ReplicationPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_protection_intents = ReplicationProtectionIntentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_recovery_plans = ReplicationRecoveryPlansOperations(self._client, self._config, self._serialize, self._deserialize) + self.supported_operating_systems = SupportedOperatingSystemsOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_vault_health = ReplicationVaultHealthOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_vault_setting = ReplicationVaultSettingOperations(self._client, self._config, self._serialize, self._deserialize) + - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_alert_settings = ReplicationAlertSettingsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_eligibility_results = ReplicationEligibilityResultsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_events = ReplicationEventsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_fabrics = ReplicationFabricsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_logical_networks = ReplicationLogicalNetworksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_networks = ReplicationNetworksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_network_mappings = ReplicationNetworkMappingsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_protection_containers = ReplicationProtectionContainersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_migration_items = ReplicationMigrationItemsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.migration_recovery_points = MigrationRecoveryPointsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_protectable_items = ReplicationProtectableItemsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_protected_items = ReplicationProtectedItemsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.recovery_points = RecoveryPointsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.target_compute_sizes = TargetComputeSizesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_protection_container_mappings = ReplicationProtectionContainerMappingsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_recovery_services_providers = ReplicationRecoveryServicesProvidersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_storage_classifications = ReplicationStorageClassificationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_storage_classification_mappings = ReplicationStorageClassificationMappingsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replicationv_centers = ReplicationvCentersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_jobs = ReplicationJobsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_policies = ReplicationPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_protection_intents = ReplicationProtectionIntentsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_recovery_plans = ReplicationRecoveryPlansOperations( - self._client, self._config, self._serialize, self._deserialize) - self.supported_operating_systems = SupportedOperatingSystemsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_vault_health = ReplicationVaultHealthOperations( - self._client, self._config, self._serialize, self._deserialize) - self.replication_vault_setting = ReplicationVaultSettingOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + :rtype: ~azure.core.rest.AsyncHttpResponse """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/__init__.py index baa6aa965187..09aaae1400a4 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/__init__.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/__init__.py @@ -8,6 +8,7 @@ from ._operations import Operations from ._replication_alert_settings_operations import ReplicationAlertSettingsOperations +from ._replication_appliances_operations import ReplicationAppliancesOperations from ._replication_eligibility_results_operations import ReplicationEligibilityResultsOperations from ._replication_events_operations import ReplicationEventsOperations from ._replication_fabrics_operations import ReplicationFabricsOperations @@ -37,6 +38,7 @@ __all__ = [ 'Operations', 'ReplicationAlertSettingsOperations', + 'ReplicationAppliancesOperations', 'ReplicationEligibilityResultsOperations', 'ReplicationEventsOperations', 'ReplicationFabricsOperations', diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_migration_recovery_points_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_migration_recovery_points_operations.py index 0036b8030ede..7209868854fb 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_migration_recovery_points_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_migration_recovery_points_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._migration_recovery_points_operations import build_get_request, build_list_by_replication_migration_items_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_migration_items( self, fabric_name: str, @@ -59,8 +65,10 @@ def list_by_replication_migration_items( :param migration_item_name: Migration item name. :type migration_item_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MigrationRecoveryPointCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.MigrationRecoveryPointCollection] + :return: An iterator like instance of either MigrationRecoveryPointCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.MigrationRecoveryPointCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationRecoveryPointCollection"] @@ -68,39 +76,39 @@ def list_by_replication_migration_items( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_migration_items.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_migration_items_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + template_url=self.list_by_replication_migration_items.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_migration_items_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('MigrationRecoveryPointCollection', pipeline_response) + deserialized = self._deserialize("MigrationRecoveryPointCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,11 +126,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_replication_migration_items.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -153,31 +163,21 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - 'migrationRecoveryPointName': self._serialize.url("migration_recovery_point_name", migration_recovery_point_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + migration_recovery_point_name=migration_recovery_point_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -191,4 +191,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints/{migrationRecoveryPointName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_operations.py index 04b8090d6dfe..ca99cb789ec7 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._operations import build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -50,8 +56,10 @@ def list( Operation to return the list of available operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationsDiscoveryCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.OperationsDiscoveryCollection] + :return: An iterator like instance of either OperationsDiscoveryCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.OperationsDiscoveryCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsDiscoveryCollection"] @@ -59,35 +67,31 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationsDiscoveryCollection', pipeline_response) + deserialized = self._deserialize("OperationsDiscoveryCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -105,6 +109,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_recovery_points_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_recovery_points_operations.py index 1a27a91dd1a9..5d3043e473dc 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_recovery_points_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_recovery_points_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._recovery_points_operations import build_get_request, build_list_by_replication_protected_items_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_protected_items( self, fabric_name: str, @@ -59,8 +65,10 @@ def list_by_replication_protected_items( :param replicated_protected_item_name: The replication protected item name. :type replicated_protected_item_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RecoveryPointCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointCollection] + :return: An iterator like instance of either RecoveryPointCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPointCollection"] @@ -68,39 +76,39 @@ def list_by_replication_protected_items( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_protected_items.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protected_items_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=self.list_by_replication_protected_items.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protected_items_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('RecoveryPointCollection', pipeline_response) + deserialized = self._deserialize("RecoveryPointCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,11 +126,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_replication_protected_items.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -153,31 +163,21 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - 'recoveryPointName': self._serialize.url("recovery_point_name", recovery_point_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + recovery_point_name=recovery_point_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -191,4 +191,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints/{recoveryPointName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_alert_settings_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_alert_settings_operations.py index 943e0351e9ac..1afe7f3b3aa1 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_alert_settings_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_alert_settings_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._replication_alert_settings_operations import build_create_request, build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -51,7 +57,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AlertCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.AlertCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.AlertCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertCollection"] @@ -59,36 +66,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('AlertCollection', pipeline_response) + deserialized = self._deserialize("AlertCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -106,11 +110,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings'} # type: ignore + @distributed_trace_async async def get( self, alert_setting_name: str, @@ -132,28 +138,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'alertSettingName': self._serialize.url("alert_setting_name", alert_setting_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + alert_setting_name=alert_setting_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -167,8 +163,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}'} # type: ignore + + @distributed_trace_async async def create( self, alert_setting_name: str, @@ -193,33 +192,23 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'alertSettingName': self._serialize.url("alert_setting_name", alert_setting_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(request, 'ConfigureAlertRequest') + + request = build_create_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + alert_setting_name=alert_setting_name, + content_type=content_type, + json=_json, + template_url=self.create.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request, 'ConfigureAlertRequest') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -233,4 +222,6 @@ async def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_appliances_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_appliances_operations.py new file mode 100644 index 000000000000..37c754d4783e --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_appliances_operations.py @@ -0,0 +1,122 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._replication_appliances_operations import build_list_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ReplicationAppliancesOperations: + """ReplicationAppliancesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.recoveryservicessiterecovery.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.ApplianceCollection"]: + """Gets the list of appliances. + + Gets the list of Azure Site Recovery appliances for the vault. + + :param filter: OData filter options. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplianceCollection or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ApplianceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplianceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ApplianceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAppliances'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_eligibility_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_eligibility_results_operations.py index caff37fad293..e78d749df500 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_eligibility_results_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_eligibility_results_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._replication_eligibility_results_operations import build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def list( self, virtual_machine_name: str, @@ -61,27 +66,17 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_list_request( + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + virtual_machine_name=virtual_machine_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -95,8 +90,11 @@ async def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults'} # type: ignore + + @distributed_trace_async async def get( self, virtual_machine_name: str, @@ -118,27 +116,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + virtual_machine_name=virtual_machine_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -152,4 +140,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_events_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_events_operations.py index c3aa4afcc3a5..aa0bb70159f2 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_events_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_events_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._replication_events_operations import build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, filter: Optional[str] = None, @@ -54,7 +60,8 @@ def list( :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EventCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.EventCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.EventCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.EventCollection"] @@ -62,38 +69,35 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('EventCollection', pipeline_response) + deserialized = self._deserialize("EventCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -111,11 +115,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents'} # type: ignore + @distributed_trace_async async def get( self, event_name: str, @@ -137,28 +143,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'eventName': self._serialize.url("event_name", event_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + event_name=event_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -172,4 +168,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents/{eventName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_fabrics_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_fabrics_operations.py index 09373f6446c9..de6f81e895ac 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_fabrics_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_fabrics_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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._replication_fabrics_operations import build_check_consistency_request_initial, build_create_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_migrate_to_aad_request_initial, build_purge_request_initial, build_reassociate_gateway_request_initial, build_renew_certificate_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,7 +59,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either FabricCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.FabricCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.FabricCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.FabricCollection"] @@ -61,36 +68,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('FabricCollection', pipeline_response) + deserialized = self._deserialize("FabricCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -108,11 +112,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -137,30 +143,19 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + filter=filter, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -174,8 +169,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}'} # type: ignore + async def _create_initial( self, fabric_name: str, @@ -187,33 +184,23 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(input, 'FabricCreationInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'FabricCreationInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -229,8 +216,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, fabric_name: str, @@ -247,15 +237,20 @@ async def begin_create( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.FabricCreationInput :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. + :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 Fabric or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] - :raises ~azure.core.exceptions.HttpResponseError: + :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 Fabric or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Fabric"] lro_delay = kwargs.pop( 'polling_interval', @@ -266,28 +261,21 @@ async def begin_create( raw_result = await self._create_initial( fabric_name=fabric_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Fabric', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -299,6 +287,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}'} # type: ignore async def _purge_initial( @@ -311,26 +300,18 @@ async def _purge_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._purge_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_purge_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self._purge_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -343,6 +324,8 @@ async def _purge_initial( _purge_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}'} # type: ignore + + @distributed_trace_async async def begin_purge( self, fabric_name: str, @@ -356,15 +339,17 @@ async def begin_purge( :type fabric_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -377,22 +362,14 @@ async def begin_purge( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -404,6 +381,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}'} # type: ignore async def _check_consistency_initial( @@ -416,28 +394,18 @@ async def _check_consistency_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._check_consistency_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_check_consistency_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self._check_consistency_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -453,8 +421,11 @@ async def _check_consistency_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _check_consistency_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency'} # type: ignore + + @distributed_trace_async async def begin_check_consistency( self, fabric_name: str, @@ -468,15 +439,19 @@ async def begin_check_consistency( :type fabric_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. + :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 Fabric or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] - :raises ~azure.core.exceptions.HttpResponseError: + :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 Fabric or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Fabric"] lro_delay = kwargs.pop( 'polling_interval', @@ -489,25 +464,17 @@ async def begin_check_consistency( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Fabric', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -519,6 +486,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_check_consistency.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency'} # type: ignore async def _migrate_to_aad_initial( @@ -531,26 +499,18 @@ async def _migrate_to_aad_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._migrate_to_aad_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_migrate_to_aad_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self._migrate_to_aad_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -563,6 +523,8 @@ async def _migrate_to_aad_initial( _migrate_to_aad_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad'} # type: ignore + + @distributed_trace_async async def begin_migrate_to_aad( self, fabric_name: str, @@ -576,15 +538,17 @@ async def begin_migrate_to_aad( :type fabric_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -597,22 +561,14 @@ async def begin_migrate_to_aad( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -624,6 +580,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_to_aad.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad'} # type: ignore async def _reassociate_gateway_initial( @@ -637,33 +594,23 @@ async def _reassociate_gateway_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reassociate_gateway_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(failover_process_server_request, 'FailoverProcessServerRequest') + + request = build_reassociate_gateway_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + content_type=content_type, + json=_json, + template_url=self._reassociate_gateway_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(failover_process_server_request, 'FailoverProcessServerRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -679,8 +626,11 @@ async def _reassociate_gateway_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _reassociate_gateway_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway'} # type: ignore + + @distributed_trace_async async def begin_reassociate_gateway( self, fabric_name: str, @@ -694,18 +644,24 @@ async def begin_reassociate_gateway( :param fabric_name: The name of the fabric containing the process server. :type fabric_name: str :param failover_process_server_request: The input to the failover process server operation. - :type failover_process_server_request: ~azure.mgmt.recoveryservicessiterecovery.models.FailoverProcessServerRequest + :type failover_process_server_request: + ~azure.mgmt.recoveryservicessiterecovery.models.FailoverProcessServerRequest :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. + :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 Fabric or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] - :raises ~azure.core.exceptions.HttpResponseError: + :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 Fabric or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Fabric"] lro_delay = kwargs.pop( 'polling_interval', @@ -716,28 +672,21 @@ async def begin_reassociate_gateway( raw_result = await self._reassociate_gateway_initial( fabric_name=fabric_name, failover_process_server_request=failover_process_server_request, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Fabric', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -749,6 +698,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reassociate_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway'} # type: ignore async def _delete_initial( @@ -761,26 +711,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -793,6 +735,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/remove'} # type: ignore + + @distributed_trace_async async def begin_delete( self, fabric_name: str, @@ -806,15 +750,17 @@ async def begin_delete( :type fabric_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -827,22 +773,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -854,6 +792,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/remove'} # type: ignore async def _renew_certificate_initial( @@ -867,33 +806,23 @@ async def _renew_certificate_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._renew_certificate_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(renew_certificate, 'RenewCertificateInput') + + request = build_renew_certificate_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + content_type=content_type, + json=_json, + template_url=self._renew_certificate_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(renew_certificate, 'RenewCertificateInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -909,8 +838,11 @@ async def _renew_certificate_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _renew_certificate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate'} # type: ignore + + @distributed_trace_async async def begin_renew_certificate( self, fabric_name: str, @@ -927,15 +859,20 @@ async def begin_renew_certificate( :type renew_certificate: ~azure.mgmt.recoveryservicessiterecovery.models.RenewCertificateInput :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. + :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 Fabric or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] - :raises ~azure.core.exceptions.HttpResponseError: + :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 Fabric or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Fabric"] lro_delay = kwargs.pop( 'polling_interval', @@ -946,28 +883,21 @@ async def begin_renew_certificate( raw_result = await self._renew_certificate_initial( fabric_name=fabric_name, renew_certificate=renew_certificate, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Fabric', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -979,4 +909,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_renew_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_jobs_operations.py index 7911ede448ea..a0119261a8ff 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_jobs_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_jobs_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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._replication_jobs_operations import build_cancel_request_initial, build_export_request_initial, build_get_request, build_list_request, build_restart_request_initial, build_resume_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, filter: Optional[str] = None, @@ -56,7 +62,8 @@ def list( :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.JobCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.JobCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobCollection"] @@ -64,38 +71,35 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('JobCollection', pipeline_response) + deserialized = self._deserialize("JobCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,11 +117,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs'} # type: ignore + @distributed_trace_async async def get( self, job_name: str, @@ -139,28 +145,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + job_name=job_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -174,8 +170,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}'} # type: ignore + async def _cancel_initial( self, job_name: str, @@ -186,28 +184,18 @@ async def _cancel_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._cancel_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_cancel_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + job_name=job_name, + template_url=self._cancel_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -223,8 +211,11 @@ async def _cancel_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/cancel'} # type: ignore + + @distributed_trace_async async def begin_cancel( self, job_name: str, @@ -238,15 +229,17 @@ async def begin_cancel( :type job_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. + :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. + :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 Job or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Job] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] lro_delay = kwargs.pop( 'polling_interval', @@ -259,25 +252,17 @@ async def begin_cancel( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Job', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -289,6 +274,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/cancel'} # type: ignore async def _restart_initial( @@ -301,28 +287,18 @@ async def _restart_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._restart_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_restart_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + job_name=job_name, + template_url=self._restart_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -338,8 +314,11 @@ async def _restart_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/restart'} # type: ignore + + @distributed_trace_async async def begin_restart( self, job_name: str, @@ -353,15 +332,17 @@ async def begin_restart( :type job_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. + :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. + :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 Job or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Job] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] lro_delay = kwargs.pop( 'polling_interval', @@ -374,25 +355,17 @@ async def begin_restart( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Job', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -404,6 +377,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/restart'} # type: ignore async def _resume_initial( @@ -417,33 +391,23 @@ async def _resume_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._resume_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(resume_job_params, 'ResumeJobParams') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_resume_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._resume_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(resume_job_params, 'ResumeJobParams') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -459,8 +423,11 @@ async def _resume_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _resume_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/resume'} # type: ignore + + @distributed_trace_async async def begin_resume( self, job_name: str, @@ -477,15 +444,18 @@ async def begin_resume( :type resume_job_params: ~azure.mgmt.recoveryservicessiterecovery.models.ResumeJobParams :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. + :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. + :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 Job or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Job] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] lro_delay = kwargs.pop( 'polling_interval', @@ -496,28 +466,21 @@ async def begin_resume( raw_result = await self._resume_initial( job_name=job_name, resume_job_params=resume_job_params, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Job', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -529,6 +492,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/resume'} # type: ignore async def _export_initial( @@ -541,32 +505,22 @@ async def _export_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._export_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(job_query_parameter, 'JobQueryParameter') + + request = build_export_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._export_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_query_parameter, 'JobQueryParameter') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -582,8 +536,11 @@ async def _export_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _export_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/export'} # type: ignore + + @distributed_trace_async async def begin_export( self, job_query_parameter: "_models.JobQueryParameter", @@ -597,15 +554,18 @@ async def begin_export( :type job_query_parameter: ~azure.mgmt.recoveryservicessiterecovery.models.JobQueryParameter :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. + :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. + :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 Job or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Job] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] lro_delay = kwargs.pop( 'polling_interval', @@ -615,27 +575,21 @@ async def begin_export( if cont_token is None: raw_result = await self._export_initial( job_query_parameter=job_query_parameter, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Job', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -647,4 +601,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_export.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/export'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_logical_networks_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_logical_networks_operations.py index 4457d21fc2b2..53e620316c7e 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_logical_networks_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_logical_networks_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._replication_logical_networks_operations import build_get_request, build_list_by_replication_fabrics_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_fabrics( self, fabric_name: str, @@ -53,8 +59,10 @@ def list_by_replication_fabrics( :param fabric_name: Server Id. :type fabric_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LogicalNetworkCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.LogicalNetworkCollection] + :return: An iterator like instance of either LogicalNetworkCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.LogicalNetworkCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.LogicalNetworkCollection"] @@ -62,37 +70,35 @@ def list_by_replication_fabrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_fabrics.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self.list_by_replication_fabrics.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('LogicalNetworkCollection', pipeline_response) + deserialized = self._deserialize("LogicalNetworkCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,11 +116,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_replication_fabrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -139,29 +147,19 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'logicalNetworkName': self._serialize.url("logical_network_name", logical_network_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + logical_network_name=logical_network_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -175,4 +173,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks/{logicalNetworkName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_migration_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_migration_items_operations.py index 7f27db60edd5..5f4d719390c7 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_migration_items_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_migration_items_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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._replication_migration_items_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_by_replication_protection_containers_request, build_list_request, build_migrate_request_initial, build_resync_request_initial, build_test_migrate_cleanup_request_initial, build_test_migrate_request_initial, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_protection_containers( self, fabric_name: str, @@ -67,8 +73,10 @@ def list_by_replication_protection_containers( :param filter: OData filter options. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MigrationItemCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItemCollection] + :return: An iterator like instance of either MigrationItemCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItemCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItemCollection"] @@ -76,44 +84,43 @@ def list_by_replication_protection_containers( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_protection_containers.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - if take_token is not None: - query_parameters['takeToken'] = self._serialize.query("take_token", take_token, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + skip_token=skip_token, + take_token=take_token, + filter=filter, + template_url=self.list_by_replication_protection_containers.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + skip_token=skip_token, + take_token=take_token, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('MigrationItemCollection', pipeline_response) + deserialized = self._deserialize("MigrationItemCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -131,11 +138,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_replication_protection_containers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -163,30 +172,20 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -200,8 +199,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'} # type: ignore + async def _create_initial( self, fabric_name: str, @@ -215,35 +216,25 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'EnableMigrationInput') + + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'EnableMigrationInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,8 +250,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, fabric_name: str, @@ -283,15 +277,20 @@ async def begin_create( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.EnableMigrationInput :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. + :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 MigrationItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 MigrationItem or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -304,30 +303,21 @@ async def begin_create( protection_container_name=protection_container_name, migration_item_name=migration_item_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('MigrationItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -339,6 +329,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'} # type: ignore async def _delete_initial( @@ -354,30 +345,21 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if delete_option is not None: - query_parameters['deleteOption'] = self._serialize.query("delete_option", delete_option, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + delete_option=delete_option, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -390,6 +372,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, fabric_name: str, @@ -412,15 +396,17 @@ async def begin_delete( :type delete_option: 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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -436,24 +422,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -465,6 +441,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'} # type: ignore async def _update_initial( @@ -480,35 +457,25 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'UpdateMigrationItemInput') + + request = build_update_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'UpdateMigrationItemInput') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -524,8 +491,11 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, fabric_name: str, @@ -548,15 +518,20 @@ async def begin_update( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMigrationItemInput :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. + :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 MigrationItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 MigrationItem or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -569,30 +544,21 @@ async def begin_update( protection_container_name=protection_container_name, migration_item_name=migration_item_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('MigrationItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -604,6 +570,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'} # type: ignore async def _migrate_initial( @@ -619,35 +586,25 @@ async def _migrate_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._migrate_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(migrate_input, 'MigrateInput') + + request = build_migrate_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + content_type=content_type, + json=_json, + template_url=self._migrate_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(migrate_input, 'MigrateInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -663,8 +620,11 @@ async def _migrate_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _migrate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate'} # type: ignore + + @distributed_trace_async async def begin_migrate( self, fabric_name: str, @@ -687,15 +647,20 @@ async def begin_migrate( :type migrate_input: ~azure.mgmt.recoveryservicessiterecovery.models.MigrateInput :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. + :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 MigrationItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 MigrationItem or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -708,30 +673,21 @@ async def begin_migrate( protection_container_name=protection_container_name, migration_item_name=migration_item_name, migrate_input=migrate_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('MigrationItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -743,6 +699,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate'} # type: ignore async def _resync_initial( @@ -758,35 +715,25 @@ async def _resync_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._resync_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'ResyncInput') + + request = build_resync_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + content_type=content_type, + json=_json, + template_url=self._resync_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'ResyncInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -802,8 +749,11 @@ async def _resync_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _resync_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync'} # type: ignore + + @distributed_trace_async async def begin_resync( self, fabric_name: str, @@ -826,15 +776,20 @@ async def begin_resync( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.ResyncInput :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. + :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 MigrationItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 MigrationItem or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -847,30 +802,21 @@ async def begin_resync( protection_container_name=protection_container_name, migration_item_name=migration_item_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('MigrationItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -882,6 +828,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_resync.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync'} # type: ignore async def _test_migrate_initial( @@ -897,35 +844,25 @@ async def _test_migrate_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._test_migrate_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(test_migrate_input, 'TestMigrateInput') + + request = build_test_migrate_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + content_type=content_type, + json=_json, + template_url=self._test_migrate_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(test_migrate_input, 'TestMigrateInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -941,8 +878,11 @@ async def _test_migrate_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _test_migrate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate'} # type: ignore + + @distributed_trace_async async def begin_test_migrate( self, fabric_name: str, @@ -965,15 +905,20 @@ async def begin_test_migrate( :type test_migrate_input: ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateInput :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. + :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 MigrationItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 MigrationItem or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -986,30 +931,21 @@ async def begin_test_migrate( protection_container_name=protection_container_name, migration_item_name=migration_item_name, test_migrate_input=test_migrate_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('MigrationItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1021,6 +957,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_test_migrate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate'} # type: ignore async def _test_migrate_cleanup_initial( @@ -1036,35 +973,25 @@ async def _test_migrate_cleanup_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._test_migrate_cleanup_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(test_migrate_cleanup_input, 'TestMigrateCleanupInput') + + request = build_test_migrate_cleanup_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + content_type=content_type, + json=_json, + template_url=self._test_migrate_cleanup_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(test_migrate_cleanup_input, 'TestMigrateCleanupInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1080,8 +1007,11 @@ async def _test_migrate_cleanup_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _test_migrate_cleanup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup'} # type: ignore + + @distributed_trace_async async def begin_test_migrate_cleanup( self, fabric_name: str, @@ -1101,18 +1031,24 @@ async def begin_test_migrate_cleanup( :param migration_item_name: Migration item name. :type migration_item_name: str :param test_migrate_cleanup_input: Test migrate cleanup input. - :type test_migrate_cleanup_input: ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateCleanupInput + :type test_migrate_cleanup_input: + ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateCleanupInput :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. + :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 MigrationItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 MigrationItem or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1125,30 +1061,21 @@ async def begin_test_migrate_cleanup( protection_container_name=protection_container_name, migration_item_name=migration_item_name, test_migrate_cleanup_input=test_migrate_cleanup_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('MigrationItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1160,8 +1087,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_test_migrate_cleanup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup'} # type: ignore + @distributed_trace def list( self, skip_token: Optional[str] = None, @@ -1180,8 +1109,10 @@ def list( :param filter: OData filter options. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MigrationItemCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItemCollection] + :return: An iterator like instance of either MigrationItemCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItemCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItemCollection"] @@ -1189,42 +1120,39 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - if take_token is not None: - query_parameters['takeToken'] = self._serialize.query("take_token", take_token, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + take_token=take_token, + filter=filter, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + take_token=take_token, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('MigrationItemCollection', pipeline_response) + deserialized = self._deserialize("MigrationItemCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1242,6 +1170,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_network_mappings_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_network_mappings_operations.py index 3bbaa3a25171..42647a85b25a 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_network_mappings_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_network_mappings_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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._replication_network_mappings_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_by_replication_networks_request, build_list_request, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_networks( self, fabric_name: str, @@ -58,8 +64,10 @@ def list_by_replication_networks( :param network_name: Primary network name. :type network_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkMappingCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingCollection] + :return: An iterator like instance of either NetworkMappingCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkMappingCollection"] @@ -67,38 +75,37 @@ def list_by_replication_networks( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_networks.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_networks_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + network_name=network_name, + template_url=self.list_by_replication_networks.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_networks_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + network_name=network_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkMappingCollection', pipeline_response) + deserialized = self._deserialize("NetworkMappingCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -116,11 +123,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_replication_networks.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -148,30 +157,20 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - 'networkMappingName': self._serialize.url("network_mapping_name", network_mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + network_name=network_name, + network_mapping_name=network_mapping_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -185,8 +184,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}'} # type: ignore + async def _create_initial( self, fabric_name: str, @@ -200,35 +201,25 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - 'networkMappingName': self._serialize.url("network_mapping_name", network_mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'CreateNetworkMappingInput') + + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + network_name=network_name, + network_mapping_name=network_mapping_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'CreateNetworkMappingInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,8 +235,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, fabric_name: str, @@ -268,15 +262,20 @@ async def begin_create( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.CreateNetworkMappingInput :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. + :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 NetworkMapping or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMapping] - :raises ~azure.core.exceptions.HttpResponseError: + :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 NetworkMapping or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMapping] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkMapping"] lro_delay = kwargs.pop( 'polling_interval', @@ -289,30 +288,21 @@ async def begin_create( network_name=network_name, network_mapping_name=network_mapping_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('NetworkMapping', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - 'networkMappingName': self._serialize.url("network_mapping_name", network_mapping_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -324,6 +314,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}'} # type: ignore async def _delete_initial( @@ -338,28 +329,20 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - 'networkMappingName': self._serialize.url("network_mapping_name", network_mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + network_name=network_name, + network_mapping_name=network_mapping_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -372,6 +355,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, fabric_name: str, @@ -391,15 +376,17 @@ async def begin_delete( :type network_mapping_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -414,24 +401,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - 'networkMappingName': self._serialize.url("network_mapping_name", network_mapping_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -443,6 +420,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}'} # type: ignore async def _update_initial( @@ -458,35 +436,25 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - 'networkMappingName': self._serialize.url("network_mapping_name", network_mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'UpdateNetworkMappingInput') + + request = build_update_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + network_name=network_name, + network_mapping_name=network_mapping_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'UpdateNetworkMappingInput') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -502,8 +470,11 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, fabric_name: str, @@ -526,15 +497,20 @@ async def begin_update( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateNetworkMappingInput :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. + :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 NetworkMapping or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMapping] - :raises ~azure.core.exceptions.HttpResponseError: + :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 NetworkMapping or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMapping] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkMapping"] lro_delay = kwargs.pop( 'polling_interval', @@ -547,30 +523,21 @@ async def begin_update( network_name=network_name, network_mapping_name=network_mapping_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('NetworkMapping', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - 'networkMappingName': self._serialize.url("network_mapping_name", network_mapping_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -582,8 +549,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}'} # type: ignore + @distributed_trace def list( self, **kwargs: Any @@ -593,8 +562,10 @@ def list( Lists all ASR network mappings in the vault. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkMappingCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingCollection] + :return: An iterator like instance of either NetworkMappingCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkMappingCollection"] @@ -602,36 +573,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkMappingCollection', pipeline_response) + deserialized = self._deserialize("NetworkMappingCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -649,6 +617,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_networks_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_networks_operations.py index 6d52180d1ad0..bedba851c5e8 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_networks_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_networks_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._replication_networks_operations import build_get_request, build_list_by_replication_fabrics_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_fabrics( self, fabric_name: str, @@ -54,7 +60,8 @@ def list_by_replication_fabrics( :type fabric_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either NetworkCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkCollection"] @@ -62,37 +69,35 @@ def list_by_replication_fabrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_fabrics.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self.list_by_replication_fabrics.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkCollection', pipeline_response) + deserialized = self._deserialize("NetworkCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,11 +115,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_replication_fabrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -139,29 +146,19 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + network_name=network_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -175,8 +172,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}'} # type: ignore + + @distributed_trace def list( self, **kwargs: Any @@ -187,7 +187,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either NetworkCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkCollection"] @@ -195,36 +196,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkCollection', pipeline_response) + deserialized = self._deserialize("NetworkCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -242,6 +240,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_policies_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_policies_operations.py index 0dad4bd2b5f0..661012448ddd 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_policies_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_policies_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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._replication_policies_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -53,7 +59,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PolicyCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.PolicyCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.PolicyCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyCollection"] @@ -61,36 +68,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('PolicyCollection', pipeline_response) + deserialized = self._deserialize("PolicyCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -108,11 +112,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies'} # type: ignore + @distributed_trace_async async def get( self, policy_name: str, @@ -134,28 +140,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'policyName': self._serialize.url("policy_name", policy_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + policy_name=policy_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -169,8 +165,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}'} # type: ignore + async def _create_initial( self, policy_name: str, @@ -182,33 +180,23 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'policyName': self._serialize.url("policy_name", policy_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(input, 'CreatePolicyInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + policy_name=policy_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'CreatePolicyInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -224,8 +212,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, policy_name: str, @@ -242,15 +233,20 @@ async def begin_create( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.CreatePolicyInput :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. + :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 Policy or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Policy] - :raises ~azure.core.exceptions.HttpResponseError: + :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 Policy or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Policy] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Policy"] lro_delay = kwargs.pop( 'polling_interval', @@ -261,28 +257,21 @@ async def begin_create( raw_result = await self._create_initial( policy_name=policy_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Policy', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'policyName': self._serialize.url("policy_name", policy_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -294,6 +283,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}'} # type: ignore async def _delete_initial( @@ -306,26 +296,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'policyName': self._serialize.url("policy_name", policy_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + policy_name=policy_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -338,6 +320,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, policy_name: str, @@ -351,15 +335,17 @@ async def begin_delete( :type policy_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -372,22 +358,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'policyName': self._serialize.url("policy_name", policy_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -399,6 +377,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}'} # type: ignore async def _update_initial( @@ -412,33 +391,23 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'policyName': self._serialize.url("policy_name", policy_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'UpdatePolicyInput') + + request = build_update_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + policy_name=policy_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'UpdatePolicyInput') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -454,8 +423,11 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, policy_name: str, @@ -472,15 +444,20 @@ async def begin_update( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.UpdatePolicyInput :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. + :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 Policy or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Policy] - :raises ~azure.core.exceptions.HttpResponseError: + :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 Policy or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Policy] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Policy"] lro_delay = kwargs.pop( 'polling_interval', @@ -491,28 +468,21 @@ async def begin_update( raw_result = await self._update_initial( policy_name=policy_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Policy', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'policyName': self._serialize.url("policy_name", policy_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -524,4 +494,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protectable_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protectable_items_operations.py index 0c9e0c2dccf5..48e8bd684156 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protectable_items_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protectable_items_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._replication_protectable_items_operations import build_get_request, build_list_by_replication_protection_containers_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_protection_containers( self, fabric_name: str, @@ -65,8 +71,10 @@ def list_by_replication_protection_containers( :param skip_token: skipToken OData query parameter. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProtectableItemCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectableItemCollection] + :return: An iterator like instance of either ProtectableItemCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectableItemCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectableItemCollection"] @@ -74,44 +82,43 @@ def list_by_replication_protection_containers( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_protection_containers.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if take is not None: - query_parameters['$take'] = self._serialize.query("take", take, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + filter=filter, + take=take, + skip_token=skip_token, + template_url=self.list_by_replication_protection_containers.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + filter=filter, + take=take, + skip_token=skip_token, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ProtectableItemCollection', pipeline_response) + deserialized = self._deserialize("ProtectableItemCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -129,11 +136,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_replication_protection_containers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -161,30 +170,20 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'protectableItemName': self._serialize.url("protectable_item_name", protectable_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + protectable_item_name=protectable_item_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -198,4 +197,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems/{protectableItemName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protected_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protected_items_operations.py index b0284f52c115..127ad15094b1 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protected_items_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protected_items_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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._replication_protected_items_operations import build_add_disks_request_initial, build_apply_recovery_point_request_initial, build_create_request_initial, build_delete_request_initial, build_failover_cancel_request_initial, build_failover_commit_request_initial, build_get_request, build_list_by_replication_protection_containers_request, build_list_request, build_planned_failover_request_initial, build_purge_request_initial, build_remove_disks_request_initial, build_repair_replication_request_initial, build_reprotect_request_initial, build_resolve_health_errors_request_initial, build_switch_provider_request_initial, build_test_failover_cleanup_request_initial, build_test_failover_request_initial, build_unplanned_failover_request_initial, build_update_appliance_request_initial, build_update_mobility_service_request_initial, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_protection_containers( self, fabric_name: str, @@ -58,8 +64,10 @@ def list_by_replication_protection_containers( :param protection_container_name: Protection container name. :type protection_container_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ReplicationProtectedItemCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItemCollection] + :return: An iterator like instance of either ReplicationProtectedItemCollection or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItemCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItemCollection"] @@ -67,38 +75,37 @@ def list_by_replication_protection_containers( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_protection_containers.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + template_url=self.list_by_replication_protection_containers.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ReplicationProtectedItemCollection', pipeline_response) + deserialized = self._deserialize("ReplicationProtectedItemCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -116,11 +123,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_replication_protection_containers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -148,30 +157,20 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -185,8 +184,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'} # type: ignore + async def _create_initial( self, fabric_name: str, @@ -200,35 +201,25 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(input, 'EnableProtectionInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'EnableProtectionInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,8 +235,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, fabric_name: str, @@ -268,15 +262,20 @@ async def begin_create( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.EnableProtectionInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -289,30 +288,21 @@ async def begin_create( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -324,6 +314,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'} # type: ignore async def _purge_initial( @@ -338,28 +329,20 @@ async def _purge_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._purge_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_purge_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=self._purge_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -372,6 +355,8 @@ async def _purge_initial( _purge_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'} # type: ignore + + @distributed_trace_async async def begin_purge( self, fabric_name: str, @@ -393,15 +378,17 @@ async def begin_purge( :type replicated_protected_item_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -416,24 +403,14 @@ async def begin_purge( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -445,6 +422,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'} # type: ignore async def _update_initial( @@ -460,35 +438,25 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(update_protection_input, 'UpdateReplicationProtectedItemInput') + + request = build_update_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(update_protection_input, 'UpdateReplicationProtectedItemInput') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -504,8 +472,11 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, fabric_name: str, @@ -525,18 +496,24 @@ async def begin_update( :param replicated_protected_item_name: Replication protected item name. :type replicated_protected_item_name: str :param update_protection_input: Update protection input. - :type update_protection_input: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInput + :type update_protection_input: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -549,30 +526,21 @@ async def begin_update( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, update_protection_input=update_protection_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -584,6 +552,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'} # type: ignore async def _add_disks_initial( @@ -599,35 +568,25 @@ async def _add_disks_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._add_disks_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(add_disks_input, 'AddDisksInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_add_disks_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._add_disks_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(add_disks_input, 'AddDisksInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -643,8 +602,11 @@ async def _add_disks_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _add_disks_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks'} # type: ignore + + @distributed_trace_async async def begin_add_disks( self, fabric_name: str, @@ -667,15 +629,20 @@ async def begin_add_disks( :type add_disks_input: ~azure.mgmt.recoveryservicessiterecovery.models.AddDisksInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -688,30 +655,21 @@ async def begin_add_disks( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, add_disks_input=add_disks_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -723,6 +681,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_add_disks.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks'} # type: ignore async def _apply_recovery_point_initial( @@ -738,35 +697,25 @@ async def _apply_recovery_point_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._apply_recovery_point_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(apply_recovery_point_input, 'ApplyRecoveryPointInput') + + request = build_apply_recovery_point_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._apply_recovery_point_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(apply_recovery_point_input, 'ApplyRecoveryPointInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -782,8 +731,11 @@ async def _apply_recovery_point_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _apply_recovery_point_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint'} # type: ignore + + @distributed_trace_async async def begin_apply_recovery_point( self, fabric_name: str, @@ -803,18 +755,24 @@ async def begin_apply_recovery_point( :param replicated_protected_item_name: The replicated protected item name. :type replicated_protected_item_name: str :param apply_recovery_point_input: The ApplyRecoveryPointInput. - :type apply_recovery_point_input: ~azure.mgmt.recoveryservicessiterecovery.models.ApplyRecoveryPointInput + :type apply_recovery_point_input: + ~azure.mgmt.recoveryservicessiterecovery.models.ApplyRecoveryPointInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -827,30 +785,21 @@ async def begin_apply_recovery_point( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, apply_recovery_point_input=apply_recovery_point_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -862,6 +811,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_apply_recovery_point.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint'} # type: ignore async def _failover_cancel_initial( @@ -876,30 +826,20 @@ async def _failover_cancel_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._failover_cancel_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_failover_cancel_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=self._failover_cancel_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -915,8 +855,11 @@ async def _failover_cancel_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _failover_cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel'} # type: ignore + + @distributed_trace_async async def begin_failover_cancel( self, fabric_name: str, @@ -936,15 +879,19 @@ async def begin_failover_cancel( :type replicated_protected_item_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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -959,27 +906,17 @@ async def begin_failover_cancel( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -991,6 +928,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_failover_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel'} # type: ignore async def _failover_commit_initial( @@ -1005,30 +943,20 @@ async def _failover_commit_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._failover_commit_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_failover_commit_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=self._failover_commit_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1044,8 +972,11 @@ async def _failover_commit_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _failover_commit_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit'} # type: ignore + + @distributed_trace_async async def begin_failover_commit( self, fabric_name: str, @@ -1065,15 +996,19 @@ async def begin_failover_commit( :type replicated_protected_item_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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1088,27 +1023,17 @@ async def begin_failover_commit( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1120,6 +1045,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_failover_commit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit'} # type: ignore async def _planned_failover_initial( @@ -1135,35 +1061,25 @@ async def _planned_failover_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._planned_failover_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(failover_input, 'PlannedFailoverInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_planned_failover_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._planned_failover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(failover_input, 'PlannedFailoverInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1179,8 +1095,11 @@ async def _planned_failover_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _planned_failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover'} # type: ignore + + @distributed_trace_async async def begin_planned_failover( self, fabric_name: str, @@ -1203,15 +1122,20 @@ async def begin_planned_failover( :type failover_input: ~azure.mgmt.recoveryservicessiterecovery.models.PlannedFailoverInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1224,30 +1148,21 @@ async def begin_planned_failover( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, failover_input=failover_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1259,6 +1174,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_planned_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover'} # type: ignore async def _delete_initial( @@ -1274,33 +1190,25 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + _json = self._serialize.body(disable_protection_input, 'DisableProtectionInput') + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(disable_protection_input, 'DisableProtectionInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1313,6 +1221,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove'} # type: ignore + + @distributed_trace_async async def begin_delete( self, fabric_name: str, @@ -1333,18 +1243,22 @@ async def begin_delete( :param replicated_protected_item_name: Replication protected item name. :type replicated_protected_item_name: str :param disable_protection_input: Disable protection input. - :type disable_protection_input: ~azure.mgmt.recoveryservicessiterecovery.models.DisableProtectionInput + :type disable_protection_input: + ~azure.mgmt.recoveryservicessiterecovery.models.DisableProtectionInput :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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1357,27 +1271,18 @@ async def begin_delete( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, disable_protection_input=disable_protection_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1389,6 +1294,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove'} # type: ignore async def _remove_disks_initial( @@ -1404,35 +1310,25 @@ async def _remove_disks_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._remove_disks_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(remove_disks_input, 'RemoveDisksInput') + + request = build_remove_disks_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._remove_disks_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(remove_disks_input, 'RemoveDisksInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1448,8 +1344,11 @@ async def _remove_disks_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _remove_disks_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks'} # type: ignore + + @distributed_trace_async async def begin_remove_disks( self, fabric_name: str, @@ -1472,15 +1371,20 @@ async def begin_remove_disks( :type remove_disks_input: ~azure.mgmt.recoveryservicessiterecovery.models.RemoveDisksInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1493,30 +1397,21 @@ async def begin_remove_disks( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, remove_disks_input=remove_disks_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1528,6 +1423,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_remove_disks.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks'} # type: ignore async def _repair_replication_initial( @@ -1542,30 +1438,20 @@ async def _repair_replication_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._repair_replication_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_repair_replication_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=self._repair_replication_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1581,8 +1467,11 @@ async def _repair_replication_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _repair_replication_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication'} # type: ignore + + @distributed_trace_async async def begin_repair_replication( self, fabric_name: str, @@ -1603,15 +1492,19 @@ async def begin_repair_replication( :type replicated_protected_item_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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1626,27 +1519,17 @@ async def begin_repair_replication( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1658,6 +1541,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_repair_replication.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication'} # type: ignore async def _reprotect_initial( @@ -1673,35 +1557,25 @@ async def _reprotect_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reprotect_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(reprotect_input, 'ReverseReplicationInput') + + request = build_reprotect_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._reprotect_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(reprotect_input, 'ReverseReplicationInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1717,8 +1591,11 @@ async def _reprotect_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _reprotect_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect'} # type: ignore + + @distributed_trace_async async def begin_reprotect( self, fabric_name: str, @@ -1741,15 +1618,20 @@ async def begin_reprotect( :type reprotect_input: ~azure.mgmt.recoveryservicessiterecovery.models.ReverseReplicationInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1762,30 +1644,21 @@ async def begin_reprotect( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, reprotect_input=reprotect_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1797,6 +1670,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reprotect.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect'} # type: ignore async def _resolve_health_errors_initial( @@ -1812,35 +1686,25 @@ async def _resolve_health_errors_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._resolve_health_errors_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(resolve_health_input, 'ResolveHealthInput') + + request = build_resolve_health_errors_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._resolve_health_errors_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(resolve_health_input, 'ResolveHealthInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1856,8 +1720,11 @@ async def _resolve_health_errors_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _resolve_health_errors_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/resolveHealthErrors'} # type: ignore + + @distributed_trace_async async def begin_resolve_health_errors( self, fabric_name: str, @@ -1880,15 +1747,20 @@ async def begin_resolve_health_errors( :type resolve_health_input: ~azure.mgmt.recoveryservicessiterecovery.models.ResolveHealthInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1901,30 +1773,21 @@ async def begin_resolve_health_errors( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, resolve_health_input=resolve_health_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1936,8 +1799,139 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_resolve_health_errors.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/resolveHealthErrors'} # type: ignore + async def _switch_provider_initial( + self, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + switch_provider_input: "_models.SwitchProviderInput", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(switch_provider_input, 'SwitchProviderInput') + + request = build_switch_provider_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._switch_provider_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _switch_provider_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/switchProvider'} # type: ignore + + + @distributed_trace_async + async def begin_switch_provider( + self, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + switch_provider_input: "_models.SwitchProviderInput", + **kwargs: Any + ) -> AsyncLROPoller["_models.ReplicationProtectedItem"]: + """Execute switch provider. + + Operation to initiate a switch provider of the replication protected item. + + :param fabric_name: Unique fabric name. + :type fabric_name: str + :param protection_container_name: Protection container name. + :type protection_container_name: str + :param replicated_protected_item_name: Replication protected item name. + :type replicated_protected_item_name: str + :param switch_provider_input: Switch provider input. + :type switch_provider_input: + ~azure.mgmt.recoveryservicessiterecovery.models.SwitchProviderInput + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._switch_provider_initial( + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + switch_provider_input=switch_provider_input, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_switch_provider.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/switchProvider'} # type: ignore + async def _test_failover_initial( self, fabric_name: str, @@ -1951,35 +1945,25 @@ async def _test_failover_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._test_failover_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(testfailover_input, 'TestFailoverInput') + + request = build_test_failover_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._test_failover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(testfailover_input, 'TestFailoverInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1995,8 +1979,11 @@ async def _test_failover_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _test_failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover'} # type: ignore + + @distributed_trace_async async def begin_test_failover( self, fabric_name: str, @@ -2019,15 +2006,20 @@ async def begin_test_failover( :type testfailover_input: ~azure.mgmt.recoveryservicessiterecovery.models.TestFailoverInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -2040,30 +2032,21 @@ async def begin_test_failover( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, testfailover_input=testfailover_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2075,6 +2058,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_test_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover'} # type: ignore async def _test_failover_cleanup_initial( @@ -2090,35 +2074,25 @@ async def _test_failover_cleanup_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._test_failover_cleanup_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(cleanup_input, 'TestFailoverCleanupInput') + + request = build_test_failover_cleanup_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._test_failover_cleanup_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cleanup_input, 'TestFailoverCleanupInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2134,8 +2108,11 @@ async def _test_failover_cleanup_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _test_failover_cleanup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup'} # type: ignore + + @distributed_trace_async async def begin_test_failover_cleanup( self, fabric_name: str, @@ -2158,15 +2135,20 @@ async def begin_test_failover_cleanup( :type cleanup_input: ~azure.mgmt.recoveryservicessiterecovery.models.TestFailoverCleanupInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -2179,30 +2161,21 @@ async def begin_test_failover_cleanup( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, cleanup_input=cleanup_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2214,6 +2187,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_test_failover_cleanup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup'} # type: ignore async def _unplanned_failover_initial( @@ -2229,35 +2203,25 @@ async def _unplanned_failover_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._unplanned_failover_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(failover_input, 'UnplannedFailoverInput') + + request = build_unplanned_failover_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._unplanned_failover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(failover_input, 'UnplannedFailoverInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2273,8 +2237,11 @@ async def _unplanned_failover_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _unplanned_failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover'} # type: ignore + + @distributed_trace_async async def begin_unplanned_failover( self, fabric_name: str, @@ -2297,15 +2264,20 @@ async def begin_unplanned_failover( :type failover_input: ~azure.mgmt.recoveryservicessiterecovery.models.UnplannedFailoverInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -2318,30 +2290,21 @@ async def begin_unplanned_failover( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, failover_input=failover_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2353,6 +2316,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_unplanned_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover'} # type: ignore async def _update_appliance_initial( @@ -2368,35 +2332,25 @@ async def _update_appliance_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_appliance_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(appliance_update_input, 'UpdateApplianceForReplicationProtectedItemInput') + + request = build_update_appliance_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._update_appliance_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(appliance_update_input, 'UpdateApplianceForReplicationProtectedItemInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2412,8 +2366,11 @@ async def _update_appliance_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_appliance_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateAppliance'} # type: ignore + + @distributed_trace_async async def begin_update_appliance( self, fabric_name: str, @@ -2433,18 +2390,24 @@ async def begin_update_appliance( :param replicated_protected_item_name: Replication protected item name. :type replicated_protected_item_name: str :param appliance_update_input: Appliance update protection input. - :type appliance_update_input: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput + :type appliance_update_input: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -2457,30 +2420,21 @@ async def begin_update_appliance( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, appliance_update_input=appliance_update_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2492,6 +2446,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_appliance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateAppliance'} # type: ignore async def _update_mobility_service_initial( @@ -2507,35 +2462,25 @@ async def _update_mobility_service_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_mobility_service_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicationProtectedItemName': self._serialize.url("replication_protected_item_name", replication_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(update_mobility_service_request, 'UpdateMobilityServiceRequest') + + request = build_update_mobility_service_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replication_protected_item_name=replication_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._update_mobility_service_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(update_mobility_service_request, 'UpdateMobilityServiceRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2551,8 +2496,11 @@ async def _update_mobility_service_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_mobility_service_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService'} # type: ignore + + @distributed_trace_async async def begin_update_mobility_service( self, fabric_name: str, @@ -2575,18 +2523,24 @@ async def begin_update_mobility_service( :type replication_protected_item_name: str :param update_mobility_service_request: Request to update the mobility service on the protected item. - :type update_mobility_service_request: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest + :type update_mobility_service_request: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -2599,30 +2553,21 @@ async def begin_update_mobility_service( protection_container_name=protection_container_name, replication_protected_item_name=replication_protected_item_name, update_mobility_service_request=update_mobility_service_request, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicationProtectedItemName': self._serialize.url("replication_protected_item_name", replication_protected_item_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -2634,8 +2579,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_mobility_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService'} # type: ignore + @distributed_trace def list( self, skip_token: Optional[str] = None, @@ -2652,8 +2599,10 @@ def list( :param filter: OData filter options. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ReplicationProtectedItemCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItemCollection] + :return: An iterator like instance of either ReplicationProtectedItemCollection or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItemCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItemCollection"] @@ -2661,40 +2610,37 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + filter=filter, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ReplicationProtectedItemCollection', pipeline_response) + deserialized = self._deserialize("ReplicationProtectedItemCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -2712,6 +2658,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protection_container_mappings_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protection_container_mappings_operations.py index e15f3a0ee80f..e183ca4f0af8 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protection_container_mappings_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protection_container_mappings_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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._replication_protection_container_mappings_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_by_replication_protection_containers_request, build_list_request, build_purge_request_initial, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_protection_containers( self, fabric_name: str, @@ -58,8 +64,10 @@ def list_by_replication_protection_containers( :param protection_container_name: Protection container name. :type protection_container_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProtectionContainerMappingCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMappingCollection] + :return: An iterator like instance of either ProtectionContainerMappingCollection or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMappingCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerMappingCollection"] @@ -67,38 +75,37 @@ def list_by_replication_protection_containers( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_protection_containers.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + template_url=self.list_by_replication_protection_containers.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ProtectionContainerMappingCollection', pipeline_response) + deserialized = self._deserialize("ProtectionContainerMappingCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -116,11 +123,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_replication_protection_containers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -148,30 +157,20 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + mapping_name=mapping_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -185,8 +184,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}'} # type: ignore + async def _create_initial( self, fabric_name: str, @@ -200,35 +201,25 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(creation_input, 'CreateProtectionContainerMappingInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + mapping_name=mapping_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(creation_input, 'CreateProtectionContainerMappingInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,8 +235,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, fabric_name: str, @@ -265,18 +259,24 @@ async def begin_create( :param mapping_name: Protection container mapping name. :type mapping_name: str :param creation_input: Mapping creation input. - :type creation_input: ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInput + :type creation_input: + ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInput :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. + :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 ProtectionContainerMapping or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMapping] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ProtectionContainerMapping or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMapping] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerMapping"] lro_delay = kwargs.pop( 'polling_interval', @@ -289,30 +289,21 @@ async def begin_create( protection_container_name=protection_container_name, mapping_name=mapping_name, creation_input=creation_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ProtectionContainerMapping', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -324,6 +315,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}'} # type: ignore async def _purge_initial( @@ -338,28 +330,20 @@ async def _purge_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._purge_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_purge_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + mapping_name=mapping_name, + template_url=self._purge_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -372,6 +356,8 @@ async def _purge_initial( _purge_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}'} # type: ignore + + @distributed_trace_async async def begin_purge( self, fabric_name: str, @@ -391,15 +377,17 @@ async def begin_purge( :type mapping_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -414,24 +402,14 @@ async def begin_purge( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -443,6 +421,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}'} # type: ignore async def _update_initial( @@ -458,35 +437,25 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(update_input, 'UpdateProtectionContainerMappingInput') + + request = build_update_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + mapping_name=mapping_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(update_input, 'UpdateProtectionContainerMappingInput') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -502,8 +471,11 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, fabric_name: str, @@ -523,18 +495,24 @@ async def begin_update( :param mapping_name: Protection container mapping name. :type mapping_name: str :param update_input: Mapping update input. - :type update_input: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInput + :type update_input: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInput :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. + :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 ProtectionContainerMapping or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMapping] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ProtectionContainerMapping or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMapping] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerMapping"] lro_delay = kwargs.pop( 'polling_interval', @@ -547,30 +525,21 @@ async def begin_update( protection_container_name=protection_container_name, mapping_name=mapping_name, update_input=update_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ProtectionContainerMapping', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -582,6 +551,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}'} # type: ignore async def _delete_initial( @@ -597,33 +567,25 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + _json = self._serialize.body(removal_input, 'RemoveProtectionContainerMappingInput') + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + mapping_name=mapping_name, + content_type=content_type, + json=_json, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(removal_input, 'RemoveProtectionContainerMappingInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -636,6 +598,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove'} # type: ignore + + @distributed_trace_async async def begin_delete( self, fabric_name: str, @@ -655,18 +619,22 @@ async def begin_delete( :param mapping_name: Protection container mapping name. :type mapping_name: str :param removal_input: Removal input. - :type removal_input: ~azure.mgmt.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput + :type removal_input: + ~azure.mgmt.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput :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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -679,27 +647,18 @@ async def begin_delete( protection_container_name=protection_container_name, mapping_name=mapping_name, removal_input=removal_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -711,8 +670,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove'} # type: ignore + @distributed_trace def list( self, **kwargs: Any @@ -722,8 +683,10 @@ def list( Lists the protection container mappings in the vault. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProtectionContainerMappingCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMappingCollection] + :return: An iterator like instance of either ProtectionContainerMappingCollection or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMappingCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerMappingCollection"] @@ -731,36 +694,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ProtectionContainerMappingCollection', pipeline_response) + deserialized = self._deserialize("ProtectionContainerMappingCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -778,6 +738,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protection_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protection_containers_operations.py index 84a5ae45062f..bacc5e96649e 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protection_containers_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protection_containers_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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._replication_protection_containers_operations import build_create_request_initial, build_delete_request_initial, build_discover_protectable_item_request_initial, build_get_request, build_list_by_replication_fabrics_request, build_list_request, build_switch_protection_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_fabrics( self, fabric_name: str, @@ -55,8 +61,10 @@ def list_by_replication_fabrics( :param fabric_name: Fabric name. :type fabric_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProtectionContainerCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerCollection] + :return: An iterator like instance of either ProtectionContainerCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerCollection"] @@ -64,37 +72,35 @@ def list_by_replication_fabrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_fabrics.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self.list_by_replication_fabrics.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ProtectionContainerCollection', pipeline_response) + deserialized = self._deserialize("ProtectionContainerCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,11 +118,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_replication_fabrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -141,29 +149,19 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -177,8 +175,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}'} # type: ignore + async def _create_initial( self, fabric_name: str, @@ -191,34 +191,24 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(creation_input, 'CreateProtectionContainerInput') + + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(creation_input, 'CreateProtectionContainerInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -234,8 +224,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, fabric_name: str, @@ -252,18 +245,24 @@ async def begin_create( :param protection_container_name: Unique protection container ARM name. :type protection_container_name: str :param creation_input: Creation input. - :type creation_input: ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionContainerInput + :type creation_input: + ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionContainerInput :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. + :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 ProtectionContainer or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ProtectionContainer or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -275,29 +274,21 @@ async def begin_create( fabric_name=fabric_name, protection_container_name=protection_container_name, creation_input=creation_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ProtectionContainer', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -309,6 +300,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}'} # type: ignore async def _discover_protectable_item_initial( @@ -323,34 +315,24 @@ async def _discover_protectable_item_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._discover_protectable_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(discover_protectable_item_request, 'DiscoverProtectableItemRequest') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_discover_protectable_item_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + content_type=content_type, + json=_json, + template_url=self._discover_protectable_item_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(discover_protectable_item_request, 'DiscoverProtectableItemRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -366,8 +348,11 @@ async def _discover_protectable_item_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _discover_protectable_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/discoverProtectableItem'} # type: ignore + + @distributed_trace_async async def begin_discover_protectable_item( self, fabric_name: str, @@ -384,18 +369,24 @@ async def begin_discover_protectable_item( :param protection_container_name: The name of the protection container. :type protection_container_name: str :param discover_protectable_item_request: The request object to add a protectable item. - :type discover_protectable_item_request: ~azure.mgmt.recoveryservicessiterecovery.models.DiscoverProtectableItemRequest + :type discover_protectable_item_request: + ~azure.mgmt.recoveryservicessiterecovery.models.DiscoverProtectableItemRequest :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. + :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 ProtectionContainer or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ProtectionContainer or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -407,29 +398,21 @@ async def begin_discover_protectable_item( fabric_name=fabric_name, protection_container_name=protection_container_name, discover_protectable_item_request=discover_protectable_item_request, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ProtectionContainer', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -441,6 +424,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_discover_protectable_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/discoverProtectableItem'} # type: ignore async def _delete_initial( @@ -454,27 +438,19 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -487,6 +463,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/remove'} # type: ignore + + @distributed_trace_async async def begin_delete( self, fabric_name: str, @@ -503,15 +481,17 @@ async def begin_delete( :type protection_container_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -525,23 +505,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -553,6 +524,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/remove'} # type: ignore async def _switch_protection_initial( @@ -567,34 +539,24 @@ async def _switch_protection_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._switch_protection_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(switch_input, 'SwitchProtectionInput') + + request = build_switch_protection_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + content_type=content_type, + json=_json, + template_url=self._switch_protection_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(switch_input, 'SwitchProtectionInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -610,8 +572,11 @@ async def _switch_protection_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _switch_protection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchprotection'} # type: ignore + + @distributed_trace_async async def begin_switch_protection( self, fabric_name: str, @@ -632,15 +597,20 @@ async def begin_switch_protection( :type switch_input: ~azure.mgmt.recoveryservicessiterecovery.models.SwitchProtectionInput :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. + :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 ProtectionContainer or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ProtectionContainer or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -652,29 +622,21 @@ async def begin_switch_protection( fabric_name=fabric_name, protection_container_name=protection_container_name, switch_input=switch_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ProtectionContainer', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -686,8 +648,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_switch_protection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchprotection'} # type: ignore + @distributed_trace def list( self, **kwargs: Any @@ -697,8 +661,10 @@ def list( Lists the protection containers in a vault. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProtectionContainerCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerCollection] + :return: An iterator like instance of either ProtectionContainerCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerCollection"] @@ -706,36 +672,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ProtectionContainerCollection', pipeline_response) + deserialized = self._deserialize("ProtectionContainerCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -753,6 +716,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protection_intents_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protection_intents_operations.py index c52d56cdbd00..334b4e7f0477 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protection_intents_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_protection_intents_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._replication_protection_intents_operations import build_create_request, build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, skip_token: Optional[str] = None, @@ -56,8 +62,10 @@ def list( :param take_token: The page size. :type take_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ReplicationProtectionIntentCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectionIntentCollection] + :return: An iterator like instance of either ReplicationProtectionIntentCollection or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectionIntentCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectionIntentCollection"] @@ -65,40 +73,37 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - if take_token is not None: - query_parameters['takeToken'] = self._serialize.query("take_token", take_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + take_token=take_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + take_token=take_token, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ReplicationProtectionIntentCollection', pipeline_response) + deserialized = self._deserialize("ReplicationProtectionIntentCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -116,11 +121,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents'} # type: ignore + @distributed_trace_async async def get( self, intent_object_name: str, @@ -142,28 +149,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'intentObjectName': self._serialize.url("intent_object_name", intent_object_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + intent_object_name=intent_object_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -177,8 +174,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}'} # type: ignore + + @distributed_trace_async async def create( self, intent_object_name: str, @@ -203,33 +203,23 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'intentObjectName': self._serialize.url("intent_object_name", intent_object_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'CreateProtectionIntentInput') + + request = build_create_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + intent_object_name=intent_object_name, + content_type=content_type, + json=_json, + template_url=self.create.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'CreateProtectionIntentInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -243,4 +233,6 @@ async def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_recovery_plans_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_recovery_plans_operations.py index 5c56917dca7a..2aa70378397e 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_recovery_plans_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_recovery_plans_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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._replication_recovery_plans_operations import build_create_request_initial, build_delete_request_initial, build_failover_cancel_request_initial, build_failover_commit_request_initial, build_get_request, build_list_request, build_planned_failover_request_initial, build_reprotect_request_initial, build_test_failover_cleanup_request_initial, build_test_failover_request_initial, build_unplanned_failover_request_initial, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -52,8 +58,10 @@ def list( Lists the recovery plans in the vault. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RecoveryPlanCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanCollection] + :return: An iterator like instance of either RecoveryPlanCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlanCollection"] @@ -61,36 +69,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('RecoveryPlanCollection', pipeline_response) + deserialized = self._deserialize("RecoveryPlanCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -108,11 +113,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans'} # type: ignore + @distributed_trace_async async def get( self, recovery_plan_name: str, @@ -134,28 +141,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -169,8 +166,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}'} # type: ignore + async def _create_initial( self, recovery_plan_name: str, @@ -182,33 +181,23 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'CreateRecoveryPlanInput') + + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'CreateRecoveryPlanInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -224,8 +213,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, recovery_plan_name: str, @@ -242,15 +234,20 @@ async def begin_create( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.CreateRecoveryPlanInput :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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -261,28 +258,21 @@ async def begin_create( raw_result = await self._create_initial( recovery_plan_name=recovery_plan_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -294,6 +284,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}'} # type: ignore async def _delete_initial( @@ -306,26 +297,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -338,6 +321,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, recovery_plan_name: str, @@ -351,15 +336,17 @@ async def begin_delete( :type recovery_plan_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -372,22 +359,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -399,6 +378,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}'} # type: ignore async def _update_initial( @@ -412,33 +392,23 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'UpdateRecoveryPlanInput') + + request = build_update_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'UpdateRecoveryPlanInput') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -454,8 +424,11 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, recovery_plan_name: str, @@ -472,15 +445,20 @@ async def begin_update( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateRecoveryPlanInput :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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -491,28 +469,21 @@ async def begin_update( raw_result = await self._update_initial( recovery_plan_name=recovery_plan_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -524,6 +495,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}'} # type: ignore async def _failover_cancel_initial( @@ -536,28 +508,18 @@ async def _failover_cancel_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._failover_cancel_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_failover_cancel_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + template_url=self._failover_cancel_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -573,8 +535,11 @@ async def _failover_cancel_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _failover_cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel'} # type: ignore + + @distributed_trace_async async def begin_failover_cancel( self, recovery_plan_name: str, @@ -588,15 +553,19 @@ async def begin_failover_cancel( :type recovery_plan_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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -609,25 +578,17 @@ async def begin_failover_cancel( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -639,6 +600,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_failover_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel'} # type: ignore async def _failover_commit_initial( @@ -651,28 +613,18 @@ async def _failover_commit_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._failover_commit_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_failover_commit_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + template_url=self._failover_commit_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -688,8 +640,11 @@ async def _failover_commit_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _failover_commit_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit'} # type: ignore + + @distributed_trace_async async def begin_failover_commit( self, recovery_plan_name: str, @@ -703,15 +658,19 @@ async def begin_failover_commit( :type recovery_plan_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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -724,25 +683,17 @@ async def begin_failover_commit( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -754,6 +705,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_failover_commit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit'} # type: ignore async def _planned_failover_initial( @@ -767,33 +719,23 @@ async def _planned_failover_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._planned_failover_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'RecoveryPlanPlannedFailoverInput') + + request = build_planned_failover_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + content_type=content_type, + json=_json, + template_url=self._planned_failover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'RecoveryPlanPlannedFailoverInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -809,8 +751,11 @@ async def _planned_failover_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _planned_failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover'} # type: ignore + + @distributed_trace_async async def begin_planned_failover( self, recovery_plan_name: str, @@ -827,15 +772,20 @@ async def begin_planned_failover( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInput :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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -846,28 +796,21 @@ async def begin_planned_failover( raw_result = await self._planned_failover_initial( recovery_plan_name=recovery_plan_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -879,6 +822,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_planned_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover'} # type: ignore async def _reprotect_initial( @@ -891,28 +835,18 @@ async def _reprotect_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._reprotect_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_reprotect_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + template_url=self._reprotect_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -928,8 +862,11 @@ async def _reprotect_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _reprotect_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect'} # type: ignore + + @distributed_trace_async async def begin_reprotect( self, recovery_plan_name: str, @@ -943,15 +880,19 @@ async def begin_reprotect( :type recovery_plan_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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -964,25 +905,17 @@ async def begin_reprotect( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -994,6 +927,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reprotect.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect'} # type: ignore async def _test_failover_initial( @@ -1007,33 +941,23 @@ async def _test_failover_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._test_failover_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'RecoveryPlanTestFailoverInput') + + request = build_test_failover_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + content_type=content_type, + json=_json, + template_url=self._test_failover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'RecoveryPlanTestFailoverInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1049,8 +973,11 @@ async def _test_failover_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _test_failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover'} # type: ignore + + @distributed_trace_async async def begin_test_failover( self, recovery_plan_name: str, @@ -1067,15 +994,20 @@ async def begin_test_failover( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInput :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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -1086,28 +1018,21 @@ async def begin_test_failover( raw_result = await self._test_failover_initial( recovery_plan_name=recovery_plan_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1119,6 +1044,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_test_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover'} # type: ignore async def _test_failover_cleanup_initial( @@ -1132,33 +1058,23 @@ async def _test_failover_cleanup_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._test_failover_cleanup_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'RecoveryPlanTestFailoverCleanupInput') + + request = build_test_failover_cleanup_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + content_type=content_type, + json=_json, + template_url=self._test_failover_cleanup_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'RecoveryPlanTestFailoverCleanupInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1174,8 +1090,11 @@ async def _test_failover_cleanup_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _test_failover_cleanup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup'} # type: ignore + + @distributed_trace_async async def begin_test_failover_cleanup( self, recovery_plan_name: str, @@ -1189,18 +1108,24 @@ async def begin_test_failover_cleanup( :param recovery_plan_name: Recovery plan name. :type recovery_plan_name: str :param input: Recovery plan test failover cleanup input. - :type input: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput + :type input: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput :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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -1211,28 +1136,21 @@ async def begin_test_failover_cleanup( raw_result = await self._test_failover_cleanup_initial( recovery_plan_name=recovery_plan_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1244,6 +1162,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_test_failover_cleanup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup'} # type: ignore async def _unplanned_failover_initial( @@ -1257,33 +1176,23 @@ async def _unplanned_failover_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._unplanned_failover_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'RecoveryPlanUnplannedFailoverInput') + + request = build_unplanned_failover_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + content_type=content_type, + json=_json, + template_url=self._unplanned_failover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'RecoveryPlanUnplannedFailoverInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1299,8 +1208,11 @@ async def _unplanned_failover_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _unplanned_failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover'} # type: ignore + + @distributed_trace_async async def begin_unplanned_failover( self, recovery_plan_name: str, @@ -1317,15 +1229,20 @@ async def begin_unplanned_failover( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInput :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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -1336,28 +1253,21 @@ async def begin_unplanned_failover( raw_result = await self._unplanned_failover_initial( recovery_plan_name=recovery_plan_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -1369,4 +1279,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_unplanned_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_recovery_services_providers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_recovery_services_providers_operations.py index 80f47eae7691..24065678e1c8 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_recovery_services_providers_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_recovery_services_providers_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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._replication_recovery_services_providers_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_by_replication_fabrics_request, build_list_request, build_purge_request_initial, build_refresh_provider_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_fabrics( self, fabric_name: str, @@ -55,8 +61,10 @@ def list_by_replication_fabrics( :param fabric_name: Fabric name. :type fabric_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RecoveryServicesProviderCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProviderCollection] + :return: An iterator like instance of either RecoveryServicesProviderCollection or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProviderCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryServicesProviderCollection"] @@ -64,37 +72,35 @@ def list_by_replication_fabrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_fabrics.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self.list_by_replication_fabrics.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('RecoveryServicesProviderCollection', pipeline_response) + deserialized = self._deserialize("RecoveryServicesProviderCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,11 +118,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_replication_fabrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -141,29 +149,19 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + provider_name=provider_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -177,8 +175,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}'} # type: ignore + async def _create_initial( self, fabric_name: str, @@ -191,34 +191,24 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(add_provider_input, 'AddRecoveryServicesProviderInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + provider_name=provider_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(add_provider_input, 'AddRecoveryServicesProviderInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -234,8 +224,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, fabric_name: str, @@ -252,18 +245,24 @@ async def begin_create( :param provider_name: Recovery services provider name. :type provider_name: str :param add_provider_input: Add provider input. - :type add_provider_input: ~azure.mgmt.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInput + :type add_provider_input: + ~azure.mgmt.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInput :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. + :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 RecoveryServicesProvider or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProvider] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryServicesProvider or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProvider] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryServicesProvider"] lro_delay = kwargs.pop( 'polling_interval', @@ -275,29 +274,21 @@ async def begin_create( fabric_name=fabric_name, provider_name=provider_name, add_provider_input=add_provider_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryServicesProvider', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -309,6 +300,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}'} # type: ignore async def _purge_initial( @@ -322,27 +314,19 @@ async def _purge_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._purge_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_purge_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + provider_name=provider_name, + template_url=self._purge_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,6 +339,8 @@ async def _purge_initial( _purge_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}'} # type: ignore + + @distributed_trace_async async def begin_purge( self, fabric_name: str, @@ -371,15 +357,17 @@ async def begin_purge( :type provider_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -393,23 +381,14 @@ async def begin_purge( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -421,6 +400,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}'} # type: ignore async def _refresh_provider_initial( @@ -434,29 +414,19 @@ async def _refresh_provider_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._refresh_provider_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_refresh_provider_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + provider_name=provider_name, + template_url=self._refresh_provider_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -472,8 +442,11 @@ async def _refresh_provider_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _refresh_provider_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider'} # type: ignore + + @distributed_trace_async async def begin_refresh_provider( self, fabric_name: str, @@ -490,15 +463,19 @@ async def begin_refresh_provider( :type provider_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. + :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 RecoveryServicesProvider or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProvider] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryServicesProvider or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProvider] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryServicesProvider"] lro_delay = kwargs.pop( 'polling_interval', @@ -512,26 +489,17 @@ async def begin_refresh_provider( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryServicesProvider', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -543,6 +511,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_refresh_provider.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider'} # type: ignore async def _delete_initial( @@ -556,27 +525,19 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + provider_name=provider_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -589,13 +550,18 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove'} # type: ignore + + @distributed_trace_async async def begin_delete( self, fabric_name: str, provider_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty we assume that it is old client and continue the old behavior). + """Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is + unsupported. To maintain backward compatibility for released clients the object + "deleteRspInput" is used (if the object is empty we assume that it is old client and continue + the old behavior). The operation to removes/delete(unregister) a recovery services provider from the vault. @@ -605,15 +571,17 @@ async def begin_delete( :type provider_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -627,23 +595,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -655,8 +614,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove'} # type: ignore + @distributed_trace def list( self, **kwargs: Any @@ -666,8 +627,10 @@ def list( Lists the registered recovery services providers in the vault. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RecoveryServicesProviderCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProviderCollection] + :return: An iterator like instance of either RecoveryServicesProviderCollection or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProviderCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryServicesProviderCollection"] @@ -675,36 +638,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('RecoveryServicesProviderCollection', pipeline_response) + deserialized = self._deserialize("RecoveryServicesProviderCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -722,6 +682,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_storage_classification_mappings_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_storage_classification_mappings_operations.py index f03d4631b17f..29d2ca9b0f23 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_storage_classification_mappings_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_storage_classification_mappings_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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._replication_storage_classification_mappings_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_by_replication_storage_classifications_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_storage_classifications( self, fabric_name: str, @@ -58,8 +64,10 @@ def list_by_replication_storage_classifications( :param storage_classification_name: Storage classification name. :type storage_classification_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either StorageClassificationMappingCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingCollection] + :return: An iterator like instance of either StorageClassificationMappingCollection or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageClassificationMappingCollection"] @@ -67,38 +75,37 @@ def list_by_replication_storage_classifications( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_storage_classifications.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'storageClassificationName': self._serialize.url("storage_classification_name", storage_classification_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_storage_classifications_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + storage_classification_name=storage_classification_name, + template_url=self.list_by_replication_storage_classifications.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_storage_classifications_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + storage_classification_name=storage_classification_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('StorageClassificationMappingCollection', pipeline_response) + deserialized = self._deserialize("StorageClassificationMappingCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -116,11 +123,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_replication_storage_classifications.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -148,30 +157,20 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'storageClassificationName': self._serialize.url("storage_classification_name", storage_classification_name, 'str'), - 'storageClassificationMappingName': self._serialize.url("storage_classification_mapping_name", storage_classification_mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + storage_classification_name=storage_classification_name, + storage_classification_mapping_name=storage_classification_mapping_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -185,8 +184,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}'} # type: ignore + async def _create_initial( self, fabric_name: str, @@ -200,35 +201,25 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'storageClassificationName': self._serialize.url("storage_classification_name", storage_classification_name, 'str'), - 'storageClassificationMappingName': self._serialize.url("storage_classification_mapping_name", storage_classification_mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(pairing_input, 'StorageClassificationMappingInput') + + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + storage_classification_name=storage_classification_name, + storage_classification_mapping_name=storage_classification_mapping_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(pairing_input, 'StorageClassificationMappingInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,8 +235,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, fabric_name: str, @@ -265,18 +259,24 @@ async def begin_create( :param storage_classification_mapping_name: Storage classification mapping name. :type storage_classification_mapping_name: str :param pairing_input: Pairing input. - :type pairing_input: ~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingInput + :type pairing_input: + ~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingInput :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. + :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 StorageClassificationMapping or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMapping] - :raises ~azure.core.exceptions.HttpResponseError: + :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 StorageClassificationMapping or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMapping] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageClassificationMapping"] lro_delay = kwargs.pop( 'polling_interval', @@ -289,30 +289,21 @@ async def begin_create( storage_classification_name=storage_classification_name, storage_classification_mapping_name=storage_classification_mapping_name, pairing_input=pairing_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('StorageClassificationMapping', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'storageClassificationName': self._serialize.url("storage_classification_name", storage_classification_name, 'str'), - 'storageClassificationMappingName': self._serialize.url("storage_classification_mapping_name", storage_classification_mapping_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -324,6 +315,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}'} # type: ignore async def _delete_initial( @@ -338,28 +330,20 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'storageClassificationName': self._serialize.url("storage_classification_name", storage_classification_name, 'str'), - 'storageClassificationMappingName': self._serialize.url("storage_classification_mapping_name", storage_classification_mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + storage_classification_name=storage_classification_name, + storage_classification_mapping_name=storage_classification_mapping_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -372,6 +356,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, fabric_name: str, @@ -391,15 +377,17 @@ async def begin_delete( :type storage_classification_mapping_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -414,24 +402,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'storageClassificationName': self._serialize.url("storage_classification_name", storage_classification_name, 'str'), - 'storageClassificationMappingName': self._serialize.url("storage_classification_mapping_name", storage_classification_mapping_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -443,8 +421,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}'} # type: ignore + @distributed_trace def list( self, **kwargs: Any @@ -454,8 +434,10 @@ def list( Lists the storage classification mappings in the vault. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either StorageClassificationMappingCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingCollection] + :return: An iterator like instance of either StorageClassificationMappingCollection or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageClassificationMappingCollection"] @@ -463,36 +445,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('StorageClassificationMappingCollection', pipeline_response) + deserialized = self._deserialize("StorageClassificationMappingCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -510,6 +489,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_storage_classifications_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_storage_classifications_operations.py index 268cea4ddaa0..a0e6eb3aaa7c 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_storage_classifications_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_storage_classifications_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._replication_storage_classifications_operations import build_get_request, build_list_by_replication_fabrics_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_fabrics( self, fabric_name: str, @@ -53,8 +59,10 @@ def list_by_replication_fabrics( :param fabric_name: Site name of interest. :type fabric_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either StorageClassificationCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationCollection] + :return: An iterator like instance of either StorageClassificationCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageClassificationCollection"] @@ -62,37 +70,35 @@ def list_by_replication_fabrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_fabrics.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self.list_by_replication_fabrics.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('StorageClassificationCollection', pipeline_response) + deserialized = self._deserialize("StorageClassificationCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,11 +116,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_replication_fabrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -139,29 +147,19 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'storageClassificationName': self._serialize.url("storage_classification_name", storage_classification_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + storage_classification_name=storage_classification_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -175,8 +173,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}'} # type: ignore + + @distributed_trace def list( self, **kwargs: Any @@ -186,8 +187,10 @@ def list( Lists the storage classifications in the vault. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either StorageClassificationCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationCollection] + :return: An iterator like instance of either StorageClassificationCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageClassificationCollection"] @@ -195,36 +198,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('StorageClassificationCollection', pipeline_response) + deserialized = self._deserialize("StorageClassificationCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -242,6 +242,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_vault_health_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_vault_health_operations.py index 6a7bd7685f28..d3cb06814577 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_vault_health_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_vault_health_operations.py @@ -5,18 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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_async import distributed_trace_async 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._replication_vault_health_operations import build_get_request, build_refresh_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -42,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def get( self, **kwargs: Any @@ -60,27 +65,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -94,8 +89,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth'} # type: ignore + async def _refresh_initial( self, **kwargs: Any @@ -105,27 +102,17 @@ async def _refresh_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._refresh_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_refresh_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self._refresh_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -141,8 +128,11 @@ async def _refresh_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _refresh_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh'} # type: ignore + + @distributed_trace_async async def begin_refresh( self, **kwargs: Any @@ -153,15 +143,19 @@ async def begin_refresh( :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. + :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 VaultHealthDetails or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.VaultHealthDetails] - :raises ~azure.core.exceptions.HttpResponseError: + :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 VaultHealthDetails or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.VaultHealthDetails] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.VaultHealthDetails"] lro_delay = kwargs.pop( 'polling_interval', @@ -173,24 +167,17 @@ async def begin_refresh( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('VaultHealthDetails', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -202,4 +189,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_refresh.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_vault_setting_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_vault_setting_operations.py index 749dbb361a90..e7a29686e267 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_vault_setting_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replication_vault_setting_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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._replication_vault_setting_operations import build_create_request_initial, build_get_request, build_list_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list( self, **kwargs: Any @@ -52,8 +58,10 @@ def list( Gets the list of vault setting. This includes the Migration Hub connection settings. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VaultSettingCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.VaultSettingCollection] + :return: An iterator like instance of either VaultSettingCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.VaultSettingCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.VaultSettingCollection"] @@ -61,36 +69,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('VaultSettingCollection', pipeline_response) + deserialized = self._deserialize("VaultSettingCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -108,11 +113,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings'} # type: ignore + @distributed_trace_async async def get( self, vault_setting_name: str, @@ -134,28 +141,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'vaultSettingName': self._serialize.url("vault_setting_name", vault_setting_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + vault_setting_name=vault_setting_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -169,8 +166,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}'} # type: ignore + async def _create_initial( self, vault_setting_name: str, @@ -182,33 +181,23 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'vaultSettingName': self._serialize.url("vault_setting_name", vault_setting_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'VaultSettingCreationInput') + + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + vault_setting_name=vault_setting_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'VaultSettingCreationInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -222,15 +211,19 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, vault_setting_name: str, input: "_models.VaultSettingCreationInput", **kwargs: Any ) -> AsyncLROPoller["_models.VaultSetting"]: - """Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + """Updates vault setting. A vault setting object is a singleton per vault and it is always present + by default. The operation to configure vault setting. @@ -240,15 +233,20 @@ async def begin_create( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.VaultSettingCreationInput :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. + :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 VaultSetting or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.VaultSetting] - :raises ~azure.core.exceptions.HttpResponseError: + :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 VaultSetting or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.VaultSetting] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.VaultSetting"] lro_delay = kwargs.pop( 'polling_interval', @@ -259,28 +257,21 @@ async def begin_create( raw_result = await self._create_initial( vault_setting_name=vault_setting_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('VaultSetting', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'vaultSettingName': self._serialize.url("vault_setting_name", vault_setting_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -292,4 +283,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replicationv_centers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replicationv_centers_operations.py index 8f79f5778ca6..56a4a60a2811 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replicationv_centers_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_replicationv_centers_operations.py @@ -5,19 +5,24 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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.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._replicationv_centers_operations import build_create_request_initial, build_delete_request_initial, build_get_request, build_list_by_replication_fabrics_request, build_list_request, build_update_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -43,6 +48,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_fabrics( self, fabric_name: str, @@ -56,7 +62,8 @@ def list_by_replication_fabrics( :type fabric_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VCenterCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.VCenterCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.VCenterCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenterCollection"] @@ -64,37 +71,35 @@ def list_by_replication_fabrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_fabrics.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self.list_by_replication_fabrics.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('VCenterCollection', pipeline_response) + deserialized = self._deserialize("VCenterCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,11 +117,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) list_by_replication_fabrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters'} # type: ignore + @distributed_trace_async async def get( self, fabric_name: str, @@ -141,29 +148,19 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + vcenter_name=vcenter_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -177,8 +174,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}'} # type: ignore + async def _create_initial( self, fabric_name: str, @@ -191,34 +190,24 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(add_v_center_request, 'AddVCenterRequest') + + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + vcenter_name=vcenter_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(add_v_center_request, 'AddVCenterRequest') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -234,8 +223,11 @@ async def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}'} # type: ignore + + @distributed_trace_async async def begin_create( self, fabric_name: str, @@ -255,15 +247,20 @@ async def begin_create( :type add_v_center_request: ~azure.mgmt.recoveryservicessiterecovery.models.AddVCenterRequest :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. + :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 VCenter or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.VCenter] - :raises ~azure.core.exceptions.HttpResponseError: + :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 VCenter or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.VCenter] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenter"] lro_delay = kwargs.pop( 'polling_interval', @@ -275,29 +272,21 @@ async def begin_create( fabric_name=fabric_name, vcenter_name=vcenter_name, add_v_center_request=add_v_center_request, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('VCenter', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -309,6 +298,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}'} # type: ignore async def _delete_initial( @@ -322,27 +312,19 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + vcenter_name=vcenter_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -355,6 +337,8 @@ async def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, fabric_name: str, @@ -371,15 +355,17 @@ async def begin_delete( :type vcenter_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -393,23 +379,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -421,6 +398,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}'} # type: ignore async def _update_initial( @@ -435,34 +413,24 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(update_v_center_request, 'UpdateVCenterRequest') + + request = build_update_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + vcenter_name=vcenter_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(update_v_center_request, 'UpdateVCenterRequest') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -478,8 +446,11 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, fabric_name: str, @@ -496,18 +467,24 @@ async def begin_update( :param vcenter_name: vcenter name. :type vcenter_name: str :param update_v_center_request: The input to the update vCenter operation. - :type update_v_center_request: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateVCenterRequest + :type update_v_center_request: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateVCenterRequest :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. + :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 VCenter or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.VCenter] - :raises ~azure.core.exceptions.HttpResponseError: + :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 VCenter or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicessiterecovery.models.VCenter] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenter"] lro_delay = kwargs.pop( 'polling_interval', @@ -519,29 +496,21 @@ async def begin_update( fabric_name=fabric_name, vcenter_name=vcenter_name, update_v_center_request=update_v_center_request, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('VCenter', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), - } - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -553,8 +522,10 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}'} # type: ignore + @distributed_trace def list( self, **kwargs: Any @@ -565,7 +536,8 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VCenterCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.VCenterCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.VCenterCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenterCollection"] @@ -573,36 +545,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('VCenterCollection', pipeline_response) + deserialized = self._deserialize("VCenterCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -620,6 +589,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_supported_operating_systems_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_supported_operating_systems_operations.py index f0297f15e1a0..8a9e24c13e1f 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_supported_operating_systems_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_supported_operating_systems_operations.py @@ -5,16 +5,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._supported_operating_systems_operations import build_get_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -40,6 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace_async async def get( self, instance_type: Optional[str] = None, @@ -61,29 +66,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if instance_type is not None: - query_parameters['instanceType'] = self._serialize.query("instance_type", instance_type, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + instance_type=instance_type, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -97,4 +91,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationSupportedOperatingSystems'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_target_compute_sizes_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_target_compute_sizes_operations.py index 19c76da87e88..1b76cc14833f 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_target_compute_sizes_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/aio/operations/_target_compute_sizes_operations.py @@ -5,17 +5,22 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import functools from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.pipeline.transport import AsyncHttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models - +from ..._vendor import _convert_request +from ...operations._target_compute_sizes_operations import build_list_by_replication_protected_items_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -41,6 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_protected_items( self, fabric_name: str, @@ -59,8 +65,10 @@ def list_by_replication_protected_items( :param replicated_protected_item_name: Replication protected item name. :type replicated_protected_item_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either TargetComputeSizeCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.TargetComputeSizeCollection] + :return: An iterator like instance of either TargetComputeSizeCollection or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.TargetComputeSizeCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TargetComputeSizeCollection"] @@ -68,39 +76,39 @@ def list_by_replication_protected_items( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_protected_items.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protected_items_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=self.list_by_replication_protected_items.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protected_items_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request async def extract_data(pipeline_response): - deserialized = self._deserialize('TargetComputeSizeCollection', pipeline_response) + deserialized = self._deserialize("TargetComputeSizeCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,6 +126,7 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/__init__.py index 239805a44784..ed86dfae3d3b 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/__init__.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/__init__.py @@ -6,988 +6,513 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import A2AAddDisksInput - from ._models_py3 import A2AApplyRecoveryPointInput - from ._models_py3 import A2AContainerCreationInput - from ._models_py3 import A2AContainerMappingInput - from ._models_py3 import A2ACreateProtectionIntentInput - from ._models_py3 import A2ACrossClusterMigrationApplyRecoveryPointInput - from ._models_py3 import A2ACrossClusterMigrationContainerCreationInput - from ._models_py3 import A2ACrossClusterMigrationEnableProtectionInput - from ._models_py3 import A2ACrossClusterMigrationPolicyCreationInput - from ._models_py3 import A2ACrossClusterMigrationReplicationDetails - from ._models_py3 import A2AEnableProtectionInput - from ._models_py3 import A2AEventDetails - from ._models_py3 import A2APolicyCreationInput - from ._models_py3 import A2APolicyDetails - from ._models_py3 import A2AProtectedDiskDetails - from ._models_py3 import A2AProtectedManagedDiskDetails - from ._models_py3 import A2AProtectionContainerMappingDetails - from ._models_py3 import A2AProtectionIntentDiskInputDetails - from ._models_py3 import A2AProtectionIntentManagedDiskInputDetails - from ._models_py3 import A2ARecoveryPointDetails - from ._models_py3 import A2ARemoveDisksInput - from ._models_py3 import A2AReplicationDetails - from ._models_py3 import A2AReplicationIntentDetails - from ._models_py3 import A2AReprotectInput - from ._models_py3 import A2ASwitchProtectionInput - from ._models_py3 import A2ATestFailoverInput - from ._models_py3 import A2AUnplannedFailoverInput - from ._models_py3 import A2AUnprotectedDiskDetails - from ._models_py3 import A2AUpdateContainerMappingInput - from ._models_py3 import A2AUpdateReplicationProtectedItemInput - from ._models_py3 import A2AVmDiskInputDetails - from ._models_py3 import A2AVmManagedDiskInputDetails - from ._models_py3 import A2AVmManagedDiskUpdateDetails - from ._models_py3 import A2AZoneDetails - from ._models_py3 import ASRTask - from ._models_py3 import AddDisksInput - from ._models_py3 import AddDisksInputProperties - from ._models_py3 import AddDisksProviderSpecificInput - from ._models_py3 import AddRecoveryServicesProviderInput - from ._models_py3 import AddRecoveryServicesProviderInputProperties - from ._models_py3 import AddVCenterRequest - from ._models_py3 import AddVCenterRequestProperties - from ._models_py3 import AgentDetails - from ._models_py3 import AgentDiskDetails - from ._models_py3 import Alert - from ._models_py3 import AlertCollection - from ._models_py3 import AlertProperties - from ._models_py3 import ApplyRecoveryPointInput - from ._models_py3 import ApplyRecoveryPointInputProperties - from ._models_py3 import ApplyRecoveryPointProviderSpecificInput - from ._models_py3 import AsrJobDetails - from ._models_py3 import AutomationRunbookTaskDetails - from ._models_py3 import AzureFabricCreationInput - from ._models_py3 import AzureFabricSpecificDetails - from ._models_py3 import AzureToAzureCreateNetworkMappingInput - from ._models_py3 import AzureToAzureNetworkMappingSettings - from ._models_py3 import AzureToAzureUpdateNetworkMappingInput - from ._models_py3 import AzureToAzureVmSyncedConfigDetails - from ._models_py3 import AzureVmDiskDetails - from ._models_py3 import ComputeSizeErrorDetails - from ._models_py3 import ConfigurationSettings - from ._models_py3 import ConfigureAlertRequest - from ._models_py3 import ConfigureAlertRequestProperties - from ._models_py3 import ConsistencyCheckTaskDetails - from ._models_py3 import CreateNetworkMappingInput - from ._models_py3 import CreateNetworkMappingInputProperties - from ._models_py3 import CreatePolicyInput - from ._models_py3 import CreatePolicyInputProperties - from ._models_py3 import CreateProtectionContainerInput - from ._models_py3 import CreateProtectionContainerInputProperties - from ._models_py3 import CreateProtectionContainerMappingInput - from ._models_py3 import CreateProtectionContainerMappingInputProperties - from ._models_py3 import CreateProtectionIntentInput - from ._models_py3 import CreateProtectionIntentProperties - from ._models_py3 import CreateProtectionIntentProviderSpecificDetails - from ._models_py3 import CreateRecoveryPlanInput - from ._models_py3 import CreateRecoveryPlanInputProperties - from ._models_py3 import CurrentJobDetails - from ._models_py3 import CurrentScenarioDetails - from ._models_py3 import DataStore - from ._models_py3 import DisableProtectionInput - from ._models_py3 import DisableProtectionInputProperties - from ._models_py3 import DisableProtectionProviderSpecificInput - from ._models_py3 import DiscoverProtectableItemRequest - from ._models_py3 import DiscoverProtectableItemRequestProperties - from ._models_py3 import DiskDetails - from ._models_py3 import DiskEncryptionInfo - from ._models_py3 import DiskEncryptionKeyInfo - from ._models_py3 import DiskVolumeDetails - from ._models_py3 import Display - from ._models_py3 import DraDetails - from ._models_py3 import EnableMigrationInput - from ._models_py3 import EnableMigrationInputProperties - from ._models_py3 import EnableMigrationProviderSpecificInput - from ._models_py3 import EnableProtectionInput - from ._models_py3 import EnableProtectionInputProperties - from ._models_py3 import EnableProtectionProviderSpecificInput - from ._models_py3 import EncryptionDetails - from ._models_py3 import Event - from ._models_py3 import EventCollection - from ._models_py3 import EventProperties - from ._models_py3 import EventProviderSpecificDetails - from ._models_py3 import EventQueryParameter - from ._models_py3 import EventSpecificDetails - from ._models_py3 import ExistingProtectionProfile - from ._models_py3 import ExistingRecoveryAvailabilitySet - from ._models_py3 import ExistingRecoveryProximityPlacementGroup - from ._models_py3 import ExistingRecoveryResourceGroup - from ._models_py3 import ExistingRecoveryVirtualNetwork - from ._models_py3 import ExistingStorageAccount - from ._models_py3 import ExportJobDetails - from ._models_py3 import Fabric - from ._models_py3 import FabricCollection - from ._models_py3 import FabricCreationInput - from ._models_py3 import FabricCreationInputProperties - from ._models_py3 import FabricProperties - from ._models_py3 import FabricQueryParameter - from ._models_py3 import FabricReplicationGroupTaskDetails - from ._models_py3 import FabricSpecificCreateNetworkMappingInput - from ._models_py3 import FabricSpecificCreationInput - from ._models_py3 import FabricSpecificDetails - from ._models_py3 import FabricSpecificUpdateNetworkMappingInput - from ._models_py3 import FailoverJobDetails - from ._models_py3 import FailoverProcessServerRequest - from ._models_py3 import FailoverProcessServerRequestProperties - from ._models_py3 import FailoverReplicationProtectedItemDetails - from ._models_py3 import GroupTaskDetails - from ._models_py3 import HealthError - from ._models_py3 import HealthErrorSummary - from ._models_py3 import HyperVHostDetails - from ._models_py3 import HyperVReplica2012EventDetails - from ._models_py3 import HyperVReplica2012R2EventDetails - from ._models_py3 import HyperVReplicaAzureApplyRecoveryPointInput - from ._models_py3 import HyperVReplicaAzureDiskInputDetails - from ._models_py3 import HyperVReplicaAzureEnableProtectionInput - from ._models_py3 import HyperVReplicaAzureEventDetails - from ._models_py3 import HyperVReplicaAzureFailbackProviderInput - from ._models_py3 import HyperVReplicaAzureManagedDiskDetails - from ._models_py3 import HyperVReplicaAzurePlannedFailoverProviderInput - from ._models_py3 import HyperVReplicaAzurePolicyDetails - from ._models_py3 import HyperVReplicaAzurePolicyInput - from ._models_py3 import HyperVReplicaAzureReplicationDetails - from ._models_py3 import HyperVReplicaAzureReprotectInput - from ._models_py3 import HyperVReplicaAzureTestFailoverInput - from ._models_py3 import HyperVReplicaAzureUnplannedFailoverInput - from ._models_py3 import HyperVReplicaAzureUpdateReplicationProtectedItemInput - from ._models_py3 import HyperVReplicaBaseEventDetails - from ._models_py3 import HyperVReplicaBasePolicyDetails - from ._models_py3 import HyperVReplicaBaseReplicationDetails - from ._models_py3 import HyperVReplicaBluePolicyDetails - from ._models_py3 import HyperVReplicaBluePolicyInput - from ._models_py3 import HyperVReplicaBlueReplicationDetails - from ._models_py3 import HyperVReplicaPolicyDetails - from ._models_py3 import HyperVReplicaPolicyInput - from ._models_py3 import HyperVReplicaReplicationDetails - from ._models_py3 import HyperVSiteDetails - from ._models_py3 import HyperVVirtualMachineDetails - from ._models_py3 import IPConfigDetails - from ._models_py3 import IPConfigInputDetails - from ._models_py3 import IdentityProviderDetails - from ._models_py3 import IdentityProviderInput - from ._models_py3 import InMageAgentDetails - from ._models_py3 import InMageAzureV2ApplyRecoveryPointInput - from ._models_py3 import InMageAzureV2DiskInputDetails - from ._models_py3 import InMageAzureV2EnableProtectionInput - from ._models_py3 import InMageAzureV2EventDetails - from ._models_py3 import InMageAzureV2ManagedDiskDetails - from ._models_py3 import InMageAzureV2PolicyDetails - from ._models_py3 import InMageAzureV2PolicyInput - from ._models_py3 import InMageAzureV2ProtectedDiskDetails - from ._models_py3 import InMageAzureV2RecoveryPointDetails - from ._models_py3 import InMageAzureV2ReplicationDetails - from ._models_py3 import InMageAzureV2ReprotectInput - from ._models_py3 import InMageAzureV2TestFailoverInput - from ._models_py3 import InMageAzureV2UnplannedFailoverInput - from ._models_py3 import InMageAzureV2UpdateReplicationProtectedItemInput - from ._models_py3 import InMageBasePolicyDetails - from ._models_py3 import InMageDisableProtectionProviderSpecificInput - from ._models_py3 import InMageDiskDetails - from ._models_py3 import InMageDiskExclusionInput - from ._models_py3 import InMageDiskSignatureExclusionOptions - from ._models_py3 import InMageEnableProtectionInput - from ._models_py3 import InMagePolicyDetails - from ._models_py3 import InMagePolicyInput - from ._models_py3 import InMageProtectedDiskDetails - from ._models_py3 import InMageRcmAgentUpgradeBlockingErrorDetails - from ._models_py3 import InMageRcmApplyRecoveryPointInput - from ._models_py3 import InMageRcmDiscoveredProtectedVmDetails - from ._models_py3 import InMageRcmDiskInput - from ._models_py3 import InMageRcmDisksDefaultInput - from ._models_py3 import InMageRcmEnableProtectionInput - from ._models_py3 import InMageRcmEventDetails - from ._models_py3 import InMageRcmFabricCreationInput - from ._models_py3 import InMageRcmFabricSpecificDetails - from ._models_py3 import InMageRcmFailbackDiscoveredProtectedVmDetails - from ._models_py3 import InMageRcmFailbackEventDetails - from ._models_py3 import InMageRcmFailbackMobilityAgentDetails - from ._models_py3 import InMageRcmFailbackNicDetails - from ._models_py3 import InMageRcmFailbackPlannedFailoverProviderInput - from ._models_py3 import InMageRcmFailbackPolicyCreationInput - from ._models_py3 import InMageRcmFailbackPolicyDetails - from ._models_py3 import InMageRcmFailbackProtectedDiskDetails - from ._models_py3 import InMageRcmFailbackReplicationDetails - from ._models_py3 import InMageRcmFailbackReprotectInput - from ._models_py3 import InMageRcmFailbackSyncDetails - from ._models_py3 import InMageRcmLastAgentUpgradeErrorDetails - from ._models_py3 import InMageRcmMobilityAgentDetails - from ._models_py3 import InMageRcmNicDetails - from ._models_py3 import InMageRcmNicInput - from ._models_py3 import InMageRcmPolicyCreationInput - from ._models_py3 import InMageRcmPolicyDetails - from ._models_py3 import InMageRcmProtectedDiskDetails - from ._models_py3 import InMageRcmProtectionContainerMappingDetails - from ._models_py3 import InMageRcmRecoveryPointDetails - from ._models_py3 import InMageRcmReplicationDetails - from ._models_py3 import InMageRcmReprotectInput - from ._models_py3 import InMageRcmSyncDetails - from ._models_py3 import InMageRcmTestFailoverInput - from ._models_py3 import InMageRcmUnplannedFailoverInput - from ._models_py3 import InMageRcmUpdateApplianceForReplicationProtectedItemInput - from ._models_py3 import InMageRcmUpdateContainerMappingInput - from ._models_py3 import InMageRcmUpdateReplicationProtectedItemInput - from ._models_py3 import InMageReplicationDetails - from ._models_py3 import InMageReprotectInput - from ._models_py3 import InMageTestFailoverInput - from ._models_py3 import InMageUnplannedFailoverInput - from ._models_py3 import InMageVolumeExclusionOptions - from ._models_py3 import InconsistentVmDetails - from ._models_py3 import InitialReplicationDetails - from ._models_py3 import InlineWorkflowTaskDetails - from ._models_py3 import InnerHealthError - from ._models_py3 import InputEndpoint - from ._models_py3 import Job - from ._models_py3 import JobCollection - from ._models_py3 import JobDetails - from ._models_py3 import JobEntity - from ._models_py3 import JobErrorDetails - from ._models_py3 import JobProperties - from ._models_py3 import JobQueryParameter - from ._models_py3 import JobStatusEventDetails - from ._models_py3 import JobTaskDetails - from ._models_py3 import KeyEncryptionKeyInfo - from ._models_py3 import LogicalNetwork - from ._models_py3 import LogicalNetworkCollection - from ._models_py3 import LogicalNetworkProperties - from ._models_py3 import ManualActionTaskDetails - from ._models_py3 import MarsAgentDetails - from ._models_py3 import MasterTargetServer - from ._models_py3 import MigrateInput - from ._models_py3 import MigrateInputProperties - from ._models_py3 import MigrateProviderSpecificInput - from ._models_py3 import MigrationItem - from ._models_py3 import MigrationItemCollection - from ._models_py3 import MigrationItemProperties - from ._models_py3 import MigrationItemsQueryParameter - from ._models_py3 import MigrationProviderSpecificSettings - from ._models_py3 import MigrationRecoveryPoint - from ._models_py3 import MigrationRecoveryPointCollection - from ._models_py3 import MigrationRecoveryPointProperties - from ._models_py3 import MobilityServiceUpdate - from ._models_py3 import Network - from ._models_py3 import NetworkCollection - from ._models_py3 import NetworkMapping - from ._models_py3 import NetworkMappingCollection - from ._models_py3 import NetworkMappingFabricSpecificSettings - from ._models_py3 import NetworkMappingProperties - from ._models_py3 import NetworkProperties - from ._models_py3 import NewProtectionProfile - from ._models_py3 import NewRecoveryVirtualNetwork - from ._models_py3 import OSDetails - from ._models_py3 import OSDiskDetails - from ._models_py3 import OSVersionWrapper - from ._models_py3 import OperationsDiscovery - from ._models_py3 import OperationsDiscoveryCollection - from ._models_py3 import PlannedFailoverInput - from ._models_py3 import PlannedFailoverInputProperties - from ._models_py3 import PlannedFailoverProviderSpecificFailoverInput - from ._models_py3 import Policy - from ._models_py3 import PolicyCollection - from ._models_py3 import PolicyProperties - from ._models_py3 import PolicyProviderSpecificDetails - from ._models_py3 import PolicyProviderSpecificInput - from ._models_py3 import ProcessServer - from ._models_py3 import ProcessServerDetails - from ._models_py3 import ProtectableItem - from ._models_py3 import ProtectableItemCollection - from ._models_py3 import ProtectableItemProperties - from ._models_py3 import ProtectableItemQueryParameter - from ._models_py3 import ProtectedItemsQueryParameter - from ._models_py3 import ProtectionContainer - from ._models_py3 import ProtectionContainerCollection - from ._models_py3 import ProtectionContainerFabricSpecificDetails - from ._models_py3 import ProtectionContainerMapping - from ._models_py3 import ProtectionContainerMappingCollection - from ._models_py3 import ProtectionContainerMappingProperties - from ._models_py3 import ProtectionContainerMappingProviderSpecificDetails - from ._models_py3 import ProtectionContainerProperties - from ._models_py3 import ProtectionProfileCustomDetails - from ._models_py3 import ProviderError - from ._models_py3 import ProviderSpecificRecoveryPointDetails - from ._models_py3 import PushInstallerDetails - from ._models_py3 import RcmProxyDetails - from ._models_py3 import RecoveryAvailabilitySetCustomDetails - from ._models_py3 import RecoveryPlan - from ._models_py3 import RecoveryPlanA2ADetails - from ._models_py3 import RecoveryPlanA2AFailoverInput - from ._models_py3 import RecoveryPlanA2AInput - from ._models_py3 import RecoveryPlanAction - from ._models_py3 import RecoveryPlanActionDetails - from ._models_py3 import RecoveryPlanAutomationRunbookActionDetails - from ._models_py3 import RecoveryPlanCollection - from ._models_py3 import RecoveryPlanGroup - from ._models_py3 import RecoveryPlanGroupTaskDetails - from ._models_py3 import RecoveryPlanHyperVReplicaAzureFailbackInput - from ._models_py3 import RecoveryPlanHyperVReplicaAzureFailoverInput - from ._models_py3 import RecoveryPlanInMageAzureV2FailoverInput - from ._models_py3 import RecoveryPlanInMageFailoverInput - from ._models_py3 import RecoveryPlanInMageRcmFailbackFailoverInput - from ._models_py3 import RecoveryPlanInMageRcmFailoverInput - from ._models_py3 import RecoveryPlanManualActionDetails - from ._models_py3 import RecoveryPlanPlannedFailoverInput - from ._models_py3 import RecoveryPlanPlannedFailoverInputProperties - from ._models_py3 import RecoveryPlanProperties - from ._models_py3 import RecoveryPlanProtectedItem - from ._models_py3 import RecoveryPlanProviderSpecificDetails - from ._models_py3 import RecoveryPlanProviderSpecificFailoverInput - from ._models_py3 import RecoveryPlanProviderSpecificInput - from ._models_py3 import RecoveryPlanScriptActionDetails - from ._models_py3 import RecoveryPlanShutdownGroupTaskDetails - from ._models_py3 import RecoveryPlanTestFailoverCleanupInput - from ._models_py3 import RecoveryPlanTestFailoverCleanupInputProperties - from ._models_py3 import RecoveryPlanTestFailoverInput - from ._models_py3 import RecoveryPlanTestFailoverInputProperties - from ._models_py3 import RecoveryPlanUnplannedFailoverInput - from ._models_py3 import RecoveryPlanUnplannedFailoverInputProperties - from ._models_py3 import RecoveryPoint - from ._models_py3 import RecoveryPointCollection - from ._models_py3 import RecoveryPointProperties - from ._models_py3 import RecoveryProximityPlacementGroupCustomDetails - from ._models_py3 import RecoveryResourceGroupCustomDetails - from ._models_py3 import RecoveryServicesProvider - from ._models_py3 import RecoveryServicesProviderCollection - from ._models_py3 import RecoveryServicesProviderProperties - from ._models_py3 import RecoveryVirtualNetworkCustomDetails - from ._models_py3 import RemoveDisksInput - from ._models_py3 import RemoveDisksInputProperties - from ._models_py3 import RemoveDisksProviderSpecificInput - from ._models_py3 import RemoveProtectionContainerMappingInput - from ._models_py3 import RemoveProtectionContainerMappingInputProperties - from ._models_py3 import RenewCertificateInput - from ._models_py3 import RenewCertificateInputProperties - from ._models_py3 import ReplicationAgentDetails - from ._models_py3 import ReplicationEligibilityResults - from ._models_py3 import ReplicationEligibilityResultsCollection - from ._models_py3 import ReplicationEligibilityResultsErrorInfo - from ._models_py3 import ReplicationEligibilityResultsProperties - from ._models_py3 import ReplicationGroupDetails - from ._models_py3 import ReplicationProtectedItem - from ._models_py3 import ReplicationProtectedItemCollection - from ._models_py3 import ReplicationProtectedItemProperties - from ._models_py3 import ReplicationProtectionIntent - from ._models_py3 import ReplicationProtectionIntentCollection - from ._models_py3 import ReplicationProtectionIntentProperties - from ._models_py3 import ReplicationProtectionIntentProviderSpecificSettings - from ._models_py3 import ReplicationProviderContainerUnmappingInput - from ._models_py3 import ReplicationProviderSpecificContainerCreationInput - from ._models_py3 import ReplicationProviderSpecificContainerMappingInput - from ._models_py3 import ReplicationProviderSpecificSettings - from ._models_py3 import ReplicationProviderSpecificUpdateContainerMappingInput - from ._models_py3 import ReprotectAgentDetails - from ._models_py3 import ResolveHealthError - from ._models_py3 import ResolveHealthInput - from ._models_py3 import ResolveHealthInputProperties - from ._models_py3 import Resource - from ._models_py3 import ResourceHealthSummary - from ._models_py3 import ResumeJobParams - from ._models_py3 import ResumeJobParamsProperties - from ._models_py3 import ResyncInput - from ._models_py3 import ResyncInputProperties - from ._models_py3 import ResyncProviderSpecificInput - from ._models_py3 import RetentionVolume - from ._models_py3 import ReverseReplicationInput - from ._models_py3 import ReverseReplicationInputProperties - from ._models_py3 import ReverseReplicationProviderSpecificInput - from ._models_py3 import RoleAssignment - from ._models_py3 import RunAsAccount - from ._models_py3 import ScriptActionTaskDetails - from ._models_py3 import ServiceError - from ._models_py3 import StorageAccountCustomDetails - from ._models_py3 import StorageClassification - from ._models_py3 import StorageClassificationCollection - from ._models_py3 import StorageClassificationMapping - from ._models_py3 import StorageClassificationMappingCollection - from ._models_py3 import StorageClassificationMappingInput - from ._models_py3 import StorageClassificationMappingProperties - from ._models_py3 import StorageClassificationProperties - from ._models_py3 import StorageMappingInputProperties - from ._models_py3 import Subnet - from ._models_py3 import SupportedOSDetails - from ._models_py3 import SupportedOSProperties - from ._models_py3 import SupportedOSProperty - from ._models_py3 import SupportedOperatingSystems - from ._models_py3 import SwitchProtectionInput - from ._models_py3 import SwitchProtectionInputProperties - from ._models_py3 import SwitchProtectionJobDetails - from ._models_py3 import SwitchProtectionProviderSpecificInput - from ._models_py3 import TargetComputeSize - from ._models_py3 import TargetComputeSizeCollection - from ._models_py3 import TargetComputeSizeProperties - from ._models_py3 import TaskTypeDetails - from ._models_py3 import TestFailoverCleanupInput - from ._models_py3 import TestFailoverCleanupInputProperties - from ._models_py3 import TestFailoverInput - from ._models_py3 import TestFailoverInputProperties - from ._models_py3 import TestFailoverJobDetails - from ._models_py3 import TestFailoverProviderSpecificInput - from ._models_py3 import TestMigrateCleanupInput - from ._models_py3 import TestMigrateCleanupInputProperties - from ._models_py3 import TestMigrateInput - from ._models_py3 import TestMigrateInputProperties - from ._models_py3 import TestMigrateProviderSpecificInput - from ._models_py3 import UnplannedFailoverInput - from ._models_py3 import UnplannedFailoverInputProperties - from ._models_py3 import UnplannedFailoverProviderSpecificInput - from ._models_py3 import UpdateApplianceForReplicationProtectedItemInput - from ._models_py3 import UpdateApplianceForReplicationProtectedItemInputProperties - from ._models_py3 import UpdateApplianceForReplicationProtectedItemProviderSpecificInput - from ._models_py3 import UpdateDiskInput - from ._models_py3 import UpdateMigrationItemInput - from ._models_py3 import UpdateMigrationItemInputProperties - from ._models_py3 import UpdateMigrationItemProviderSpecificInput - from ._models_py3 import UpdateMobilityServiceRequest - from ._models_py3 import UpdateMobilityServiceRequestProperties - from ._models_py3 import UpdateNetworkMappingInput - from ._models_py3 import UpdateNetworkMappingInputProperties - from ._models_py3 import UpdatePolicyInput - from ._models_py3 import UpdatePolicyInputProperties - from ._models_py3 import UpdateProtectionContainerMappingInput - from ._models_py3 import UpdateProtectionContainerMappingInputProperties - from ._models_py3 import UpdateRecoveryPlanInput - from ._models_py3 import UpdateRecoveryPlanInputProperties - from ._models_py3 import UpdateReplicationProtectedItemInput - from ._models_py3 import UpdateReplicationProtectedItemInputProperties - from ._models_py3 import UpdateReplicationProtectedItemProviderInput - from ._models_py3 import UpdateVCenterRequest - from ._models_py3 import UpdateVCenterRequestProperties - from ._models_py3 import VCenter - from ._models_py3 import VCenterCollection - from ._models_py3 import VCenterProperties - from ._models_py3 import VMNicDetails - from ._models_py3 import VMNicInputDetails - from ._models_py3 import VMwareCbtContainerCreationInput - from ._models_py3 import VMwareCbtContainerMappingInput - from ._models_py3 import VMwareCbtDiskInput - from ._models_py3 import VMwareCbtEnableMigrationInput - from ._models_py3 import VMwareCbtEventDetails - from ._models_py3 import VMwareCbtMigrateInput - from ._models_py3 import VMwareCbtMigrationDetails - from ._models_py3 import VMwareCbtNicDetails - from ._models_py3 import VMwareCbtNicInput - from ._models_py3 import VMwareCbtPolicyCreationInput - from ._models_py3 import VMwareCbtProtectedDiskDetails - from ._models_py3 import VMwareCbtProtectionContainerMappingDetails - from ._models_py3 import VMwareCbtResyncInput - from ._models_py3 import VMwareCbtTestMigrateInput - from ._models_py3 import VMwareCbtUpdateDiskInput - from ._models_py3 import VMwareCbtUpdateMigrationItemInput - from ._models_py3 import VMwareDetails - from ._models_py3 import VMwareV2FabricCreationInput - from ._models_py3 import VMwareV2FabricSpecificDetails - from ._models_py3 import VMwareVirtualMachineDetails - from ._models_py3 import VaultHealthDetails - from ._models_py3 import VaultHealthProperties - from ._models_py3 import VaultSetting - from ._models_py3 import VaultSettingCollection - from ._models_py3 import VaultSettingCreationInput - from ._models_py3 import VaultSettingCreationInputProperties - from ._models_py3 import VaultSettingProperties - from ._models_py3 import VersionDetails - from ._models_py3 import VirtualMachineTaskDetails - from ._models_py3 import VmNicUpdatesTaskDetails - from ._models_py3 import VmmDetails - from ._models_py3 import VmmToAzureCreateNetworkMappingInput - from ._models_py3 import VmmToAzureNetworkMappingSettings - from ._models_py3 import VmmToAzureUpdateNetworkMappingInput - from ._models_py3 import VmmToVmmCreateNetworkMappingInput - from ._models_py3 import VmmToVmmNetworkMappingSettings - from ._models_py3 import VmmToVmmUpdateNetworkMappingInput - from ._models_py3 import VmmVirtualMachineDetails - from ._models_py3 import VmwareCbtPolicyDetails -except (SyntaxError, ImportError): - from ._models import A2AAddDisksInput # type: ignore - from ._models import A2AApplyRecoveryPointInput # type: ignore - from ._models import A2AContainerCreationInput # type: ignore - from ._models import A2AContainerMappingInput # type: ignore - from ._models import A2ACreateProtectionIntentInput # type: ignore - from ._models import A2ACrossClusterMigrationApplyRecoveryPointInput # type: ignore - from ._models import A2ACrossClusterMigrationContainerCreationInput # type: ignore - from ._models import A2ACrossClusterMigrationEnableProtectionInput # type: ignore - from ._models import A2ACrossClusterMigrationPolicyCreationInput # type: ignore - from ._models import A2ACrossClusterMigrationReplicationDetails # type: ignore - from ._models import A2AEnableProtectionInput # type: ignore - from ._models import A2AEventDetails # type: ignore - from ._models import A2APolicyCreationInput # type: ignore - from ._models import A2APolicyDetails # type: ignore - from ._models import A2AProtectedDiskDetails # type: ignore - from ._models import A2AProtectedManagedDiskDetails # type: ignore - from ._models import A2AProtectionContainerMappingDetails # type: ignore - from ._models import A2AProtectionIntentDiskInputDetails # type: ignore - from ._models import A2AProtectionIntentManagedDiskInputDetails # type: ignore - from ._models import A2ARecoveryPointDetails # type: ignore - from ._models import A2ARemoveDisksInput # type: ignore - from ._models import A2AReplicationDetails # type: ignore - from ._models import A2AReplicationIntentDetails # type: ignore - from ._models import A2AReprotectInput # type: ignore - from ._models import A2ASwitchProtectionInput # type: ignore - from ._models import A2ATestFailoverInput # type: ignore - from ._models import A2AUnplannedFailoverInput # type: ignore - from ._models import A2AUnprotectedDiskDetails # type: ignore - from ._models import A2AUpdateContainerMappingInput # type: ignore - from ._models import A2AUpdateReplicationProtectedItemInput # type: ignore - from ._models import A2AVmDiskInputDetails # type: ignore - from ._models import A2AVmManagedDiskInputDetails # type: ignore - from ._models import A2AVmManagedDiskUpdateDetails # type: ignore - from ._models import A2AZoneDetails # type: ignore - from ._models import ASRTask # type: ignore - from ._models import AddDisksInput # type: ignore - from ._models import AddDisksInputProperties # type: ignore - from ._models import AddDisksProviderSpecificInput # type: ignore - from ._models import AddRecoveryServicesProviderInput # type: ignore - from ._models import AddRecoveryServicesProviderInputProperties # type: ignore - from ._models import AddVCenterRequest # type: ignore - from ._models import AddVCenterRequestProperties # type: ignore - from ._models import AgentDetails # type: ignore - from ._models import AgentDiskDetails # type: ignore - from ._models import Alert # type: ignore - from ._models import AlertCollection # type: ignore - from ._models import AlertProperties # type: ignore - from ._models import ApplyRecoveryPointInput # type: ignore - from ._models import ApplyRecoveryPointInputProperties # type: ignore - from ._models import ApplyRecoveryPointProviderSpecificInput # type: ignore - from ._models import AsrJobDetails # type: ignore - from ._models import AutomationRunbookTaskDetails # type: ignore - from ._models import AzureFabricCreationInput # type: ignore - from ._models import AzureFabricSpecificDetails # type: ignore - from ._models import AzureToAzureCreateNetworkMappingInput # type: ignore - from ._models import AzureToAzureNetworkMappingSettings # type: ignore - from ._models import AzureToAzureUpdateNetworkMappingInput # type: ignore - from ._models import AzureToAzureVmSyncedConfigDetails # type: ignore - from ._models import AzureVmDiskDetails # type: ignore - from ._models import ComputeSizeErrorDetails # type: ignore - from ._models import ConfigurationSettings # type: ignore - from ._models import ConfigureAlertRequest # type: ignore - from ._models import ConfigureAlertRequestProperties # type: ignore - from ._models import ConsistencyCheckTaskDetails # type: ignore - from ._models import CreateNetworkMappingInput # type: ignore - from ._models import CreateNetworkMappingInputProperties # type: ignore - from ._models import CreatePolicyInput # type: ignore - from ._models import CreatePolicyInputProperties # type: ignore - from ._models import CreateProtectionContainerInput # type: ignore - from ._models import CreateProtectionContainerInputProperties # type: ignore - from ._models import CreateProtectionContainerMappingInput # type: ignore - from ._models import CreateProtectionContainerMappingInputProperties # type: ignore - from ._models import CreateProtectionIntentInput # type: ignore - from ._models import CreateProtectionIntentProperties # type: ignore - from ._models import CreateProtectionIntentProviderSpecificDetails # type: ignore - from ._models import CreateRecoveryPlanInput # type: ignore - from ._models import CreateRecoveryPlanInputProperties # type: ignore - from ._models import CurrentJobDetails # type: ignore - from ._models import CurrentScenarioDetails # type: ignore - from ._models import DataStore # type: ignore - from ._models import DisableProtectionInput # type: ignore - from ._models import DisableProtectionInputProperties # type: ignore - from ._models import DisableProtectionProviderSpecificInput # type: ignore - from ._models import DiscoverProtectableItemRequest # type: ignore - from ._models import DiscoverProtectableItemRequestProperties # type: ignore - from ._models import DiskDetails # type: ignore - from ._models import DiskEncryptionInfo # type: ignore - from ._models import DiskEncryptionKeyInfo # type: ignore - from ._models import DiskVolumeDetails # type: ignore - from ._models import Display # type: ignore - from ._models import DraDetails # type: ignore - from ._models import EnableMigrationInput # type: ignore - from ._models import EnableMigrationInputProperties # type: ignore - from ._models import EnableMigrationProviderSpecificInput # type: ignore - from ._models import EnableProtectionInput # type: ignore - from ._models import EnableProtectionInputProperties # type: ignore - from ._models import EnableProtectionProviderSpecificInput # type: ignore - from ._models import EncryptionDetails # type: ignore - from ._models import Event # type: ignore - from ._models import EventCollection # type: ignore - from ._models import EventProperties # type: ignore - from ._models import EventProviderSpecificDetails # type: ignore - from ._models import EventQueryParameter # type: ignore - from ._models import EventSpecificDetails # type: ignore - from ._models import ExistingProtectionProfile # type: ignore - from ._models import ExistingRecoveryAvailabilitySet # type: ignore - from ._models import ExistingRecoveryProximityPlacementGroup # type: ignore - from ._models import ExistingRecoveryResourceGroup # type: ignore - from ._models import ExistingRecoveryVirtualNetwork # type: ignore - from ._models import ExistingStorageAccount # type: ignore - from ._models import ExportJobDetails # type: ignore - from ._models import Fabric # type: ignore - from ._models import FabricCollection # type: ignore - from ._models import FabricCreationInput # type: ignore - from ._models import FabricCreationInputProperties # type: ignore - from ._models import FabricProperties # type: ignore - from ._models import FabricQueryParameter # type: ignore - from ._models import FabricReplicationGroupTaskDetails # type: ignore - from ._models import FabricSpecificCreateNetworkMappingInput # type: ignore - from ._models import FabricSpecificCreationInput # type: ignore - from ._models import FabricSpecificDetails # type: ignore - from ._models import FabricSpecificUpdateNetworkMappingInput # type: ignore - from ._models import FailoverJobDetails # type: ignore - from ._models import FailoverProcessServerRequest # type: ignore - from ._models import FailoverProcessServerRequestProperties # type: ignore - from ._models import FailoverReplicationProtectedItemDetails # type: ignore - from ._models import GroupTaskDetails # type: ignore - from ._models import HealthError # type: ignore - from ._models import HealthErrorSummary # type: ignore - from ._models import HyperVHostDetails # type: ignore - from ._models import HyperVReplica2012EventDetails # type: ignore - from ._models import HyperVReplica2012R2EventDetails # type: ignore - from ._models import HyperVReplicaAzureApplyRecoveryPointInput # type: ignore - from ._models import HyperVReplicaAzureDiskInputDetails # type: ignore - from ._models import HyperVReplicaAzureEnableProtectionInput # type: ignore - from ._models import HyperVReplicaAzureEventDetails # type: ignore - from ._models import HyperVReplicaAzureFailbackProviderInput # type: ignore - from ._models import HyperVReplicaAzureManagedDiskDetails # type: ignore - from ._models import HyperVReplicaAzurePlannedFailoverProviderInput # type: ignore - from ._models import HyperVReplicaAzurePolicyDetails # type: ignore - from ._models import HyperVReplicaAzurePolicyInput # type: ignore - from ._models import HyperVReplicaAzureReplicationDetails # type: ignore - from ._models import HyperVReplicaAzureReprotectInput # type: ignore - from ._models import HyperVReplicaAzureTestFailoverInput # type: ignore - from ._models import HyperVReplicaAzureUnplannedFailoverInput # type: ignore - from ._models import HyperVReplicaAzureUpdateReplicationProtectedItemInput # type: ignore - from ._models import HyperVReplicaBaseEventDetails # type: ignore - from ._models import HyperVReplicaBasePolicyDetails # type: ignore - from ._models import HyperVReplicaBaseReplicationDetails # type: ignore - from ._models import HyperVReplicaBluePolicyDetails # type: ignore - from ._models import HyperVReplicaBluePolicyInput # type: ignore - from ._models import HyperVReplicaBlueReplicationDetails # type: ignore - from ._models import HyperVReplicaPolicyDetails # type: ignore - from ._models import HyperVReplicaPolicyInput # type: ignore - from ._models import HyperVReplicaReplicationDetails # type: ignore - from ._models import HyperVSiteDetails # type: ignore - from ._models import HyperVVirtualMachineDetails # type: ignore - from ._models import IPConfigDetails # type: ignore - from ._models import IPConfigInputDetails # type: ignore - from ._models import IdentityProviderDetails # type: ignore - from ._models import IdentityProviderInput # type: ignore - from ._models import InMageAgentDetails # type: ignore - from ._models import InMageAzureV2ApplyRecoveryPointInput # type: ignore - from ._models import InMageAzureV2DiskInputDetails # type: ignore - from ._models import InMageAzureV2EnableProtectionInput # type: ignore - from ._models import InMageAzureV2EventDetails # type: ignore - from ._models import InMageAzureV2ManagedDiskDetails # type: ignore - from ._models import InMageAzureV2PolicyDetails # type: ignore - from ._models import InMageAzureV2PolicyInput # type: ignore - from ._models import InMageAzureV2ProtectedDiskDetails # type: ignore - from ._models import InMageAzureV2RecoveryPointDetails # type: ignore - from ._models import InMageAzureV2ReplicationDetails # type: ignore - from ._models import InMageAzureV2ReprotectInput # type: ignore - from ._models import InMageAzureV2TestFailoverInput # type: ignore - from ._models import InMageAzureV2UnplannedFailoverInput # type: ignore - from ._models import InMageAzureV2UpdateReplicationProtectedItemInput # type: ignore - from ._models import InMageBasePolicyDetails # type: ignore - from ._models import InMageDisableProtectionProviderSpecificInput # type: ignore - from ._models import InMageDiskDetails # type: ignore - from ._models import InMageDiskExclusionInput # type: ignore - from ._models import InMageDiskSignatureExclusionOptions # type: ignore - from ._models import InMageEnableProtectionInput # type: ignore - from ._models import InMagePolicyDetails # type: ignore - from ._models import InMagePolicyInput # type: ignore - from ._models import InMageProtectedDiskDetails # type: ignore - from ._models import InMageRcmAgentUpgradeBlockingErrorDetails # type: ignore - from ._models import InMageRcmApplyRecoveryPointInput # type: ignore - from ._models import InMageRcmDiscoveredProtectedVmDetails # type: ignore - from ._models import InMageRcmDiskInput # type: ignore - from ._models import InMageRcmDisksDefaultInput # type: ignore - from ._models import InMageRcmEnableProtectionInput # type: ignore - from ._models import InMageRcmEventDetails # type: ignore - from ._models import InMageRcmFabricCreationInput # type: ignore - from ._models import InMageRcmFabricSpecificDetails # type: ignore - from ._models import InMageRcmFailbackDiscoveredProtectedVmDetails # type: ignore - from ._models import InMageRcmFailbackEventDetails # type: ignore - from ._models import InMageRcmFailbackMobilityAgentDetails # type: ignore - from ._models import InMageRcmFailbackNicDetails # type: ignore - from ._models import InMageRcmFailbackPlannedFailoverProviderInput # type: ignore - from ._models import InMageRcmFailbackPolicyCreationInput # type: ignore - from ._models import InMageRcmFailbackPolicyDetails # type: ignore - from ._models import InMageRcmFailbackProtectedDiskDetails # type: ignore - from ._models import InMageRcmFailbackReplicationDetails # type: ignore - from ._models import InMageRcmFailbackReprotectInput # type: ignore - from ._models import InMageRcmFailbackSyncDetails # type: ignore - from ._models import InMageRcmLastAgentUpgradeErrorDetails # type: ignore - from ._models import InMageRcmMobilityAgentDetails # type: ignore - from ._models import InMageRcmNicDetails # type: ignore - from ._models import InMageRcmNicInput # type: ignore - from ._models import InMageRcmPolicyCreationInput # type: ignore - from ._models import InMageRcmPolicyDetails # type: ignore - from ._models import InMageRcmProtectedDiskDetails # type: ignore - from ._models import InMageRcmProtectionContainerMappingDetails # type: ignore - from ._models import InMageRcmRecoveryPointDetails # type: ignore - from ._models import InMageRcmReplicationDetails # type: ignore - from ._models import InMageRcmReprotectInput # type: ignore - from ._models import InMageRcmSyncDetails # type: ignore - from ._models import InMageRcmTestFailoverInput # type: ignore - from ._models import InMageRcmUnplannedFailoverInput # type: ignore - from ._models import InMageRcmUpdateApplianceForReplicationProtectedItemInput # type: ignore - from ._models import InMageRcmUpdateContainerMappingInput # type: ignore - from ._models import InMageRcmUpdateReplicationProtectedItemInput # type: ignore - from ._models import InMageReplicationDetails # type: ignore - from ._models import InMageReprotectInput # type: ignore - from ._models import InMageTestFailoverInput # type: ignore - from ._models import InMageUnplannedFailoverInput # type: ignore - from ._models import InMageVolumeExclusionOptions # type: ignore - from ._models import InconsistentVmDetails # type: ignore - from ._models import InitialReplicationDetails # type: ignore - from ._models import InlineWorkflowTaskDetails # type: ignore - from ._models import InnerHealthError # type: ignore - from ._models import InputEndpoint # type: ignore - from ._models import Job # type: ignore - from ._models import JobCollection # type: ignore - from ._models import JobDetails # type: ignore - from ._models import JobEntity # type: ignore - from ._models import JobErrorDetails # type: ignore - from ._models import JobProperties # type: ignore - from ._models import JobQueryParameter # type: ignore - from ._models import JobStatusEventDetails # type: ignore - from ._models import JobTaskDetails # type: ignore - from ._models import KeyEncryptionKeyInfo # type: ignore - from ._models import LogicalNetwork # type: ignore - from ._models import LogicalNetworkCollection # type: ignore - from ._models import LogicalNetworkProperties # type: ignore - from ._models import ManualActionTaskDetails # type: ignore - from ._models import MarsAgentDetails # type: ignore - from ._models import MasterTargetServer # type: ignore - from ._models import MigrateInput # type: ignore - from ._models import MigrateInputProperties # type: ignore - from ._models import MigrateProviderSpecificInput # type: ignore - from ._models import MigrationItem # type: ignore - from ._models import MigrationItemCollection # type: ignore - from ._models import MigrationItemProperties # type: ignore - from ._models import MigrationItemsQueryParameter # type: ignore - from ._models import MigrationProviderSpecificSettings # type: ignore - from ._models import MigrationRecoveryPoint # type: ignore - from ._models import MigrationRecoveryPointCollection # type: ignore - from ._models import MigrationRecoveryPointProperties # type: ignore - from ._models import MobilityServiceUpdate # type: ignore - from ._models import Network # type: ignore - from ._models import NetworkCollection # type: ignore - from ._models import NetworkMapping # type: ignore - from ._models import NetworkMappingCollection # type: ignore - from ._models import NetworkMappingFabricSpecificSettings # type: ignore - from ._models import NetworkMappingProperties # type: ignore - from ._models import NetworkProperties # type: ignore - from ._models import NewProtectionProfile # type: ignore - from ._models import NewRecoveryVirtualNetwork # type: ignore - from ._models import OSDetails # type: ignore - from ._models import OSDiskDetails # type: ignore - from ._models import OSVersionWrapper # type: ignore - from ._models import OperationsDiscovery # type: ignore - from ._models import OperationsDiscoveryCollection # type: ignore - from ._models import PlannedFailoverInput # type: ignore - from ._models import PlannedFailoverInputProperties # type: ignore - from ._models import PlannedFailoverProviderSpecificFailoverInput # type: ignore - from ._models import Policy # type: ignore - from ._models import PolicyCollection # type: ignore - from ._models import PolicyProperties # type: ignore - from ._models import PolicyProviderSpecificDetails # type: ignore - from ._models import PolicyProviderSpecificInput # type: ignore - from ._models import ProcessServer # type: ignore - from ._models import ProcessServerDetails # type: ignore - from ._models import ProtectableItem # type: ignore - from ._models import ProtectableItemCollection # type: ignore - from ._models import ProtectableItemProperties # type: ignore - from ._models import ProtectableItemQueryParameter # type: ignore - from ._models import ProtectedItemsQueryParameter # type: ignore - from ._models import ProtectionContainer # type: ignore - from ._models import ProtectionContainerCollection # type: ignore - from ._models import ProtectionContainerFabricSpecificDetails # type: ignore - from ._models import ProtectionContainerMapping # type: ignore - from ._models import ProtectionContainerMappingCollection # type: ignore - from ._models import ProtectionContainerMappingProperties # type: ignore - from ._models import ProtectionContainerMappingProviderSpecificDetails # type: ignore - from ._models import ProtectionContainerProperties # type: ignore - from ._models import ProtectionProfileCustomDetails # type: ignore - from ._models import ProviderError # type: ignore - from ._models import ProviderSpecificRecoveryPointDetails # type: ignore - from ._models import PushInstallerDetails # type: ignore - from ._models import RcmProxyDetails # type: ignore - from ._models import RecoveryAvailabilitySetCustomDetails # type: ignore - from ._models import RecoveryPlan # type: ignore - from ._models import RecoveryPlanA2ADetails # type: ignore - from ._models import RecoveryPlanA2AFailoverInput # type: ignore - from ._models import RecoveryPlanA2AInput # type: ignore - from ._models import RecoveryPlanAction # type: ignore - from ._models import RecoveryPlanActionDetails # type: ignore - from ._models import RecoveryPlanAutomationRunbookActionDetails # type: ignore - from ._models import RecoveryPlanCollection # type: ignore - from ._models import RecoveryPlanGroup # type: ignore - from ._models import RecoveryPlanGroupTaskDetails # type: ignore - from ._models import RecoveryPlanHyperVReplicaAzureFailbackInput # type: ignore - from ._models import RecoveryPlanHyperVReplicaAzureFailoverInput # type: ignore - from ._models import RecoveryPlanInMageAzureV2FailoverInput # type: ignore - from ._models import RecoveryPlanInMageFailoverInput # type: ignore - from ._models import RecoveryPlanInMageRcmFailbackFailoverInput # type: ignore - from ._models import RecoveryPlanInMageRcmFailoverInput # type: ignore - from ._models import RecoveryPlanManualActionDetails # type: ignore - from ._models import RecoveryPlanPlannedFailoverInput # type: ignore - from ._models import RecoveryPlanPlannedFailoverInputProperties # type: ignore - from ._models import RecoveryPlanProperties # type: ignore - from ._models import RecoveryPlanProtectedItem # type: ignore - from ._models import RecoveryPlanProviderSpecificDetails # type: ignore - from ._models import RecoveryPlanProviderSpecificFailoverInput # type: ignore - from ._models import RecoveryPlanProviderSpecificInput # type: ignore - from ._models import RecoveryPlanScriptActionDetails # type: ignore - from ._models import RecoveryPlanShutdownGroupTaskDetails # type: ignore - from ._models import RecoveryPlanTestFailoverCleanupInput # type: ignore - from ._models import RecoveryPlanTestFailoverCleanupInputProperties # type: ignore - from ._models import RecoveryPlanTestFailoverInput # type: ignore - from ._models import RecoveryPlanTestFailoverInputProperties # type: ignore - from ._models import RecoveryPlanUnplannedFailoverInput # type: ignore - from ._models import RecoveryPlanUnplannedFailoverInputProperties # type: ignore - from ._models import RecoveryPoint # type: ignore - from ._models import RecoveryPointCollection # type: ignore - from ._models import RecoveryPointProperties # type: ignore - from ._models import RecoveryProximityPlacementGroupCustomDetails # type: ignore - from ._models import RecoveryResourceGroupCustomDetails # type: ignore - from ._models import RecoveryServicesProvider # type: ignore - from ._models import RecoveryServicesProviderCollection # type: ignore - from ._models import RecoveryServicesProviderProperties # type: ignore - from ._models import RecoveryVirtualNetworkCustomDetails # type: ignore - from ._models import RemoveDisksInput # type: ignore - from ._models import RemoveDisksInputProperties # type: ignore - from ._models import RemoveDisksProviderSpecificInput # type: ignore - from ._models import RemoveProtectionContainerMappingInput # type: ignore - from ._models import RemoveProtectionContainerMappingInputProperties # type: ignore - from ._models import RenewCertificateInput # type: ignore - from ._models import RenewCertificateInputProperties # type: ignore - from ._models import ReplicationAgentDetails # type: ignore - from ._models import ReplicationEligibilityResults # type: ignore - from ._models import ReplicationEligibilityResultsCollection # type: ignore - from ._models import ReplicationEligibilityResultsErrorInfo # type: ignore - from ._models import ReplicationEligibilityResultsProperties # type: ignore - from ._models import ReplicationGroupDetails # type: ignore - from ._models import ReplicationProtectedItem # type: ignore - from ._models import ReplicationProtectedItemCollection # type: ignore - from ._models import ReplicationProtectedItemProperties # type: ignore - from ._models import ReplicationProtectionIntent # type: ignore - from ._models import ReplicationProtectionIntentCollection # type: ignore - from ._models import ReplicationProtectionIntentProperties # type: ignore - from ._models import ReplicationProtectionIntentProviderSpecificSettings # type: ignore - from ._models import ReplicationProviderContainerUnmappingInput # type: ignore - from ._models import ReplicationProviderSpecificContainerCreationInput # type: ignore - from ._models import ReplicationProviderSpecificContainerMappingInput # type: ignore - from ._models import ReplicationProviderSpecificSettings # type: ignore - from ._models import ReplicationProviderSpecificUpdateContainerMappingInput # type: ignore - from ._models import ReprotectAgentDetails # type: ignore - from ._models import ResolveHealthError # type: ignore - from ._models import ResolveHealthInput # type: ignore - from ._models import ResolveHealthInputProperties # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceHealthSummary # type: ignore - from ._models import ResumeJobParams # type: ignore - from ._models import ResumeJobParamsProperties # type: ignore - from ._models import ResyncInput # type: ignore - from ._models import ResyncInputProperties # type: ignore - from ._models import ResyncProviderSpecificInput # type: ignore - from ._models import RetentionVolume # type: ignore - from ._models import ReverseReplicationInput # type: ignore - from ._models import ReverseReplicationInputProperties # type: ignore - from ._models import ReverseReplicationProviderSpecificInput # type: ignore - from ._models import RoleAssignment # type: ignore - from ._models import RunAsAccount # type: ignore - from ._models import ScriptActionTaskDetails # type: ignore - from ._models import ServiceError # type: ignore - from ._models import StorageAccountCustomDetails # type: ignore - from ._models import StorageClassification # type: ignore - from ._models import StorageClassificationCollection # type: ignore - from ._models import StorageClassificationMapping # type: ignore - from ._models import StorageClassificationMappingCollection # type: ignore - from ._models import StorageClassificationMappingInput # type: ignore - from ._models import StorageClassificationMappingProperties # type: ignore - from ._models import StorageClassificationProperties # type: ignore - from ._models import StorageMappingInputProperties # type: ignore - from ._models import Subnet # type: ignore - from ._models import SupportedOSDetails # type: ignore - from ._models import SupportedOSProperties # type: ignore - from ._models import SupportedOSProperty # type: ignore - from ._models import SupportedOperatingSystems # type: ignore - from ._models import SwitchProtectionInput # type: ignore - from ._models import SwitchProtectionInputProperties # type: ignore - from ._models import SwitchProtectionJobDetails # type: ignore - from ._models import SwitchProtectionProviderSpecificInput # type: ignore - from ._models import TargetComputeSize # type: ignore - from ._models import TargetComputeSizeCollection # type: ignore - from ._models import TargetComputeSizeProperties # type: ignore - from ._models import TaskTypeDetails # type: ignore - from ._models import TestFailoverCleanupInput # type: ignore - from ._models import TestFailoverCleanupInputProperties # type: ignore - from ._models import TestFailoverInput # type: ignore - from ._models import TestFailoverInputProperties # type: ignore - from ._models import TestFailoverJobDetails # type: ignore - from ._models import TestFailoverProviderSpecificInput # type: ignore - from ._models import TestMigrateCleanupInput # type: ignore - from ._models import TestMigrateCleanupInputProperties # type: ignore - from ._models import TestMigrateInput # type: ignore - from ._models import TestMigrateInputProperties # type: ignore - from ._models import TestMigrateProviderSpecificInput # type: ignore - from ._models import UnplannedFailoverInput # type: ignore - from ._models import UnplannedFailoverInputProperties # type: ignore - from ._models import UnplannedFailoverProviderSpecificInput # type: ignore - from ._models import UpdateApplianceForReplicationProtectedItemInput # type: ignore - from ._models import UpdateApplianceForReplicationProtectedItemInputProperties # type: ignore - from ._models import UpdateApplianceForReplicationProtectedItemProviderSpecificInput # type: ignore - from ._models import UpdateDiskInput # type: ignore - from ._models import UpdateMigrationItemInput # type: ignore - from ._models import UpdateMigrationItemInputProperties # type: ignore - from ._models import UpdateMigrationItemProviderSpecificInput # type: ignore - from ._models import UpdateMobilityServiceRequest # type: ignore - from ._models import UpdateMobilityServiceRequestProperties # type: ignore - from ._models import UpdateNetworkMappingInput # type: ignore - from ._models import UpdateNetworkMappingInputProperties # type: ignore - from ._models import UpdatePolicyInput # type: ignore - from ._models import UpdatePolicyInputProperties # type: ignore - from ._models import UpdateProtectionContainerMappingInput # type: ignore - from ._models import UpdateProtectionContainerMappingInputProperties # type: ignore - from ._models import UpdateRecoveryPlanInput # type: ignore - from ._models import UpdateRecoveryPlanInputProperties # type: ignore - from ._models import UpdateReplicationProtectedItemInput # type: ignore - from ._models import UpdateReplicationProtectedItemInputProperties # type: ignore - from ._models import UpdateReplicationProtectedItemProviderInput # type: ignore - from ._models import UpdateVCenterRequest # type: ignore - from ._models import UpdateVCenterRequestProperties # type: ignore - from ._models import VCenter # type: ignore - from ._models import VCenterCollection # type: ignore - from ._models import VCenterProperties # type: ignore - from ._models import VMNicDetails # type: ignore - from ._models import VMNicInputDetails # type: ignore - from ._models import VMwareCbtContainerCreationInput # type: ignore - from ._models import VMwareCbtContainerMappingInput # type: ignore - from ._models import VMwareCbtDiskInput # type: ignore - from ._models import VMwareCbtEnableMigrationInput # type: ignore - from ._models import VMwareCbtEventDetails # type: ignore - from ._models import VMwareCbtMigrateInput # type: ignore - from ._models import VMwareCbtMigrationDetails # type: ignore - from ._models import VMwareCbtNicDetails # type: ignore - from ._models import VMwareCbtNicInput # type: ignore - from ._models import VMwareCbtPolicyCreationInput # type: ignore - from ._models import VMwareCbtProtectedDiskDetails # type: ignore - from ._models import VMwareCbtProtectionContainerMappingDetails # type: ignore - from ._models import VMwareCbtResyncInput # type: ignore - from ._models import VMwareCbtTestMigrateInput # type: ignore - from ._models import VMwareCbtUpdateDiskInput # type: ignore - from ._models import VMwareCbtUpdateMigrationItemInput # type: ignore - from ._models import VMwareDetails # type: ignore - from ._models import VMwareV2FabricCreationInput # type: ignore - from ._models import VMwareV2FabricSpecificDetails # type: ignore - from ._models import VMwareVirtualMachineDetails # type: ignore - from ._models import VaultHealthDetails # type: ignore - from ._models import VaultHealthProperties # type: ignore - from ._models import VaultSetting # type: ignore - from ._models import VaultSettingCollection # type: ignore - from ._models import VaultSettingCreationInput # type: ignore - from ._models import VaultSettingCreationInputProperties # type: ignore - from ._models import VaultSettingProperties # type: ignore - from ._models import VersionDetails # type: ignore - from ._models import VirtualMachineTaskDetails # type: ignore - from ._models import VmNicUpdatesTaskDetails # type: ignore - from ._models import VmmDetails # type: ignore - from ._models import VmmToAzureCreateNetworkMappingInput # type: ignore - from ._models import VmmToAzureNetworkMappingSettings # type: ignore - from ._models import VmmToAzureUpdateNetworkMappingInput # type: ignore - from ._models import VmmToVmmCreateNetworkMappingInput # type: ignore - from ._models import VmmToVmmNetworkMappingSettings # type: ignore - from ._models import VmmToVmmUpdateNetworkMappingInput # type: ignore - from ._models import VmmVirtualMachineDetails # type: ignore - from ._models import VmwareCbtPolicyDetails # type: ignore +from ._models_py3 import A2AAddDisksInput +from ._models_py3 import A2AApplyRecoveryPointInput +from ._models_py3 import A2AContainerCreationInput +from ._models_py3 import A2AContainerMappingInput +from ._models_py3 import A2ACreateProtectionIntentInput +from ._models_py3 import A2ACrossClusterMigrationApplyRecoveryPointInput +from ._models_py3 import A2ACrossClusterMigrationContainerCreationInput +from ._models_py3 import A2ACrossClusterMigrationEnableProtectionInput +from ._models_py3 import A2ACrossClusterMigrationPolicyCreationInput +from ._models_py3 import A2ACrossClusterMigrationReplicationDetails +from ._models_py3 import A2AEnableProtectionInput +from ._models_py3 import A2AEventDetails +from ._models_py3 import A2APolicyCreationInput +from ._models_py3 import A2APolicyDetails +from ._models_py3 import A2AProtectedDiskDetails +from ._models_py3 import A2AProtectedManagedDiskDetails +from ._models_py3 import A2AProtectionContainerMappingDetails +from ._models_py3 import A2AProtectionIntentDiskInputDetails +from ._models_py3 import A2AProtectionIntentManagedDiskInputDetails +from ._models_py3 import A2ARecoveryPointDetails +from ._models_py3 import A2ARemoveDisksInput +from ._models_py3 import A2AReplicationDetails +from ._models_py3 import A2AReplicationIntentDetails +from ._models_py3 import A2AReprotectInput +from ._models_py3 import A2ASwitchProtectionInput +from ._models_py3 import A2ATestFailoverInput +from ._models_py3 import A2AUnplannedFailoverInput +from ._models_py3 import A2AUnprotectedDiskDetails +from ._models_py3 import A2AUpdateContainerMappingInput +from ._models_py3 import A2AUpdateReplicationProtectedItemInput +from ._models_py3 import A2AVmDiskInputDetails +from ._models_py3 import A2AVmManagedDiskInputDetails +from ._models_py3 import A2AVmManagedDiskUpdateDetails +from ._models_py3 import A2AZoneDetails +from ._models_py3 import ASRTask +from ._models_py3 import AddDisksInput +from ._models_py3 import AddDisksInputProperties +from ._models_py3 import AddDisksProviderSpecificInput +from ._models_py3 import AddRecoveryServicesProviderInput +from ._models_py3 import AddRecoveryServicesProviderInputProperties +from ._models_py3 import AddVCenterRequest +from ._models_py3 import AddVCenterRequestProperties +from ._models_py3 import AgentDetails +from ._models_py3 import AgentDiskDetails +from ._models_py3 import Alert +from ._models_py3 import AlertCollection +from ._models_py3 import AlertProperties +from ._models_py3 import ApplianceCollection +from ._models_py3 import ApplianceQueryParameter +from ._models_py3 import ApplianceSpecificDetails +from ._models_py3 import ApplyRecoveryPointInput +from ._models_py3 import ApplyRecoveryPointInputProperties +from ._models_py3 import ApplyRecoveryPointProviderSpecificInput +from ._models_py3 import AsrJobDetails +from ._models_py3 import AutomationRunbookTaskDetails +from ._models_py3 import AzureFabricCreationInput +from ._models_py3 import AzureFabricSpecificDetails +from ._models_py3 import AzureToAzureCreateNetworkMappingInput +from ._models_py3 import AzureToAzureNetworkMappingSettings +from ._models_py3 import AzureToAzureUpdateNetworkMappingInput +from ._models_py3 import AzureToAzureVmSyncedConfigDetails +from ._models_py3 import AzureVmDiskDetails +from ._models_py3 import ComputeSizeErrorDetails +from ._models_py3 import ConfigurationSettings +from ._models_py3 import ConfigureAlertRequest +from ._models_py3 import ConfigureAlertRequestProperties +from ._models_py3 import ConsistencyCheckTaskDetails +from ._models_py3 import CreateNetworkMappingInput +from ._models_py3 import CreateNetworkMappingInputProperties +from ._models_py3 import CreatePolicyInput +from ._models_py3 import CreatePolicyInputProperties +from ._models_py3 import CreateProtectionContainerInput +from ._models_py3 import CreateProtectionContainerInputProperties +from ._models_py3 import CreateProtectionContainerMappingInput +from ._models_py3 import CreateProtectionContainerMappingInputProperties +from ._models_py3 import CreateProtectionIntentInput +from ._models_py3 import CreateProtectionIntentProperties +from ._models_py3 import CreateProtectionIntentProviderSpecificDetails +from ._models_py3 import CreateRecoveryPlanInput +from ._models_py3 import CreateRecoveryPlanInputProperties +from ._models_py3 import CurrentJobDetails +from ._models_py3 import CurrentScenarioDetails +from ._models_py3 import DataStore +from ._models_py3 import DisableProtectionInput +from ._models_py3 import DisableProtectionInputProperties +from ._models_py3 import DisableProtectionProviderSpecificInput +from ._models_py3 import DiscoverProtectableItemRequest +from ._models_py3 import DiscoverProtectableItemRequestProperties +from ._models_py3 import DiskDetails +from ._models_py3 import DiskEncryptionInfo +from ._models_py3 import DiskEncryptionKeyInfo +from ._models_py3 import DiskVolumeDetails +from ._models_py3 import Display +from ._models_py3 import DraDetails +from ._models_py3 import EnableMigrationInput +from ._models_py3 import EnableMigrationInputProperties +from ._models_py3 import EnableMigrationProviderSpecificInput +from ._models_py3 import EnableProtectionInput +from ._models_py3 import EnableProtectionInputProperties +from ._models_py3 import EnableProtectionProviderSpecificInput +from ._models_py3 import EncryptionDetails +from ._models_py3 import Event +from ._models_py3 import EventCollection +from ._models_py3 import EventProperties +from ._models_py3 import EventProviderSpecificDetails +from ._models_py3 import EventQueryParameter +from ._models_py3 import EventSpecificDetails +from ._models_py3 import ExistingProtectionProfile +from ._models_py3 import ExistingRecoveryAvailabilitySet +from ._models_py3 import ExistingRecoveryProximityPlacementGroup +from ._models_py3 import ExistingRecoveryResourceGroup +from ._models_py3 import ExistingRecoveryVirtualNetwork +from ._models_py3 import ExistingStorageAccount +from ._models_py3 import ExportJobDetails +from ._models_py3 import ExtendedLocation +from ._models_py3 import Fabric +from ._models_py3 import FabricCollection +from ._models_py3 import FabricCreationInput +from ._models_py3 import FabricCreationInputProperties +from ._models_py3 import FabricProperties +from ._models_py3 import FabricQueryParameter +from ._models_py3 import FabricReplicationGroupTaskDetails +from ._models_py3 import FabricSpecificCreateNetworkMappingInput +from ._models_py3 import FabricSpecificCreationInput +from ._models_py3 import FabricSpecificDetails +from ._models_py3 import FabricSpecificUpdateNetworkMappingInput +from ._models_py3 import FailoverJobDetails +from ._models_py3 import FailoverProcessServerRequest +from ._models_py3 import FailoverProcessServerRequestProperties +from ._models_py3 import FailoverReplicationProtectedItemDetails +from ._models_py3 import GroupTaskDetails +from ._models_py3 import HealthError +from ._models_py3 import HealthErrorSummary +from ._models_py3 import HyperVHostDetails +from ._models_py3 import HyperVReplica2012EventDetails +from ._models_py3 import HyperVReplica2012R2EventDetails +from ._models_py3 import HyperVReplicaAzureApplyRecoveryPointInput +from ._models_py3 import HyperVReplicaAzureDiskInputDetails +from ._models_py3 import HyperVReplicaAzureEnableProtectionInput +from ._models_py3 import HyperVReplicaAzureEventDetails +from ._models_py3 import HyperVReplicaAzureFailbackProviderInput +from ._models_py3 import HyperVReplicaAzureManagedDiskDetails +from ._models_py3 import HyperVReplicaAzurePlannedFailoverProviderInput +from ._models_py3 import HyperVReplicaAzurePolicyDetails +from ._models_py3 import HyperVReplicaAzurePolicyInput +from ._models_py3 import HyperVReplicaAzureReplicationDetails +from ._models_py3 import HyperVReplicaAzureReprotectInput +from ._models_py3 import HyperVReplicaAzureTestFailoverInput +from ._models_py3 import HyperVReplicaAzureUnplannedFailoverInput +from ._models_py3 import HyperVReplicaAzureUpdateReplicationProtectedItemInput +from ._models_py3 import HyperVReplicaBaseEventDetails +from ._models_py3 import HyperVReplicaBasePolicyDetails +from ._models_py3 import HyperVReplicaBaseReplicationDetails +from ._models_py3 import HyperVReplicaBluePolicyDetails +from ._models_py3 import HyperVReplicaBluePolicyInput +from ._models_py3 import HyperVReplicaBlueReplicationDetails +from ._models_py3 import HyperVReplicaPolicyDetails +from ._models_py3 import HyperVReplicaPolicyInput +from ._models_py3 import HyperVReplicaReplicationDetails +from ._models_py3 import HyperVSiteDetails +from ._models_py3 import HyperVVirtualMachineDetails +from ._models_py3 import IPConfigDetails +from ._models_py3 import IPConfigInputDetails +from ._models_py3 import IdentityProviderDetails +from ._models_py3 import IdentityProviderInput +from ._models_py3 import InMageAgentDetails +from ._models_py3 import InMageAzureV2ApplyRecoveryPointInput +from ._models_py3 import InMageAzureV2DiskInputDetails +from ._models_py3 import InMageAzureV2EnableProtectionInput +from ._models_py3 import InMageAzureV2EventDetails +from ._models_py3 import InMageAzureV2ManagedDiskDetails +from ._models_py3 import InMageAzureV2PolicyDetails +from ._models_py3 import InMageAzureV2PolicyInput +from ._models_py3 import InMageAzureV2ProtectedDiskDetails +from ._models_py3 import InMageAzureV2RecoveryPointDetails +from ._models_py3 import InMageAzureV2ReplicationDetails +from ._models_py3 import InMageAzureV2ReprotectInput +from ._models_py3 import InMageAzureV2SwitchProviderBlockingErrorDetails +from ._models_py3 import InMageAzureV2SwitchProviderDetails +from ._models_py3 import InMageAzureV2SwitchProviderInput +from ._models_py3 import InMageAzureV2TestFailoverInput +from ._models_py3 import InMageAzureV2UnplannedFailoverInput +from ._models_py3 import InMageAzureV2UpdateReplicationProtectedItemInput +from ._models_py3 import InMageBasePolicyDetails +from ._models_py3 import InMageDisableProtectionProviderSpecificInput +from ._models_py3 import InMageDiskDetails +from ._models_py3 import InMageDiskExclusionInput +from ._models_py3 import InMageDiskSignatureExclusionOptions +from ._models_py3 import InMageEnableProtectionInput +from ._models_py3 import InMageFabricSwitchProviderBlockingErrorDetails +from ._models_py3 import InMagePolicyDetails +from ._models_py3 import InMagePolicyInput +from ._models_py3 import InMageProtectedDiskDetails +from ._models_py3 import InMageRcmAgentUpgradeBlockingErrorDetails +from ._models_py3 import InMageRcmApplianceDetails +from ._models_py3 import InMageRcmApplianceSpecificDetails +from ._models_py3 import InMageRcmApplyRecoveryPointInput +from ._models_py3 import InMageRcmDiscoveredProtectedVmDetails +from ._models_py3 import InMageRcmDiskInput +from ._models_py3 import InMageRcmDisksDefaultInput +from ._models_py3 import InMageRcmEnableProtectionInput +from ._models_py3 import InMageRcmEventDetails +from ._models_py3 import InMageRcmFabricCreationInput +from ._models_py3 import InMageRcmFabricSpecificDetails +from ._models_py3 import InMageRcmFabricSwitchProviderBlockingErrorDetails +from ._models_py3 import InMageRcmFailbackDiscoveredProtectedVmDetails +from ._models_py3 import InMageRcmFailbackEventDetails +from ._models_py3 import InMageRcmFailbackMobilityAgentDetails +from ._models_py3 import InMageRcmFailbackNicDetails +from ._models_py3 import InMageRcmFailbackPlannedFailoverProviderInput +from ._models_py3 import InMageRcmFailbackPolicyCreationInput +from ._models_py3 import InMageRcmFailbackPolicyDetails +from ._models_py3 import InMageRcmFailbackProtectedDiskDetails +from ._models_py3 import InMageRcmFailbackReplicationDetails +from ._models_py3 import InMageRcmFailbackReprotectInput +from ._models_py3 import InMageRcmFailbackSyncDetails +from ._models_py3 import InMageRcmLastAgentUpgradeErrorDetails +from ._models_py3 import InMageRcmMobilityAgentDetails +from ._models_py3 import InMageRcmNicDetails +from ._models_py3 import InMageRcmNicInput +from ._models_py3 import InMageRcmPolicyCreationInput +from ._models_py3 import InMageRcmPolicyDetails +from ._models_py3 import InMageRcmProtectedDiskDetails +from ._models_py3 import InMageRcmProtectionContainerMappingDetails +from ._models_py3 import InMageRcmRecoveryPointDetails +from ._models_py3 import InMageRcmReplicationDetails +from ._models_py3 import InMageRcmReprotectInput +from ._models_py3 import InMageRcmSyncDetails +from ._models_py3 import InMageRcmTestFailoverInput +from ._models_py3 import InMageRcmUnplannedFailoverInput +from ._models_py3 import InMageRcmUpdateApplianceForReplicationProtectedItemInput +from ._models_py3 import InMageRcmUpdateContainerMappingInput +from ._models_py3 import InMageRcmUpdateReplicationProtectedItemInput +from ._models_py3 import InMageReplicationDetails +from ._models_py3 import InMageReprotectInput +from ._models_py3 import InMageTestFailoverInput +from ._models_py3 import InMageUnplannedFailoverInput +from ._models_py3 import InMageVolumeExclusionOptions +from ._models_py3 import InconsistentVmDetails +from ._models_py3 import InitialReplicationDetails +from ._models_py3 import InlineWorkflowTaskDetails +from ._models_py3 import InnerHealthError +from ._models_py3 import InputEndpoint +from ._models_py3 import Job +from ._models_py3 import JobCollection +from ._models_py3 import JobDetails +from ._models_py3 import JobEntity +from ._models_py3 import JobErrorDetails +from ._models_py3 import JobProperties +from ._models_py3 import JobQueryParameter +from ._models_py3 import JobStatusEventDetails +from ._models_py3 import JobTaskDetails +from ._models_py3 import KeyEncryptionKeyInfo +from ._models_py3 import LogicalNetwork +from ._models_py3 import LogicalNetworkCollection +from ._models_py3 import LogicalNetworkProperties +from ._models_py3 import ManualActionTaskDetails +from ._models_py3 import MarsAgentDetails +from ._models_py3 import MasterTargetServer +from ._models_py3 import MigrateInput +from ._models_py3 import MigrateInputProperties +from ._models_py3 import MigrateProviderSpecificInput +from ._models_py3 import MigrationItem +from ._models_py3 import MigrationItemCollection +from ._models_py3 import MigrationItemProperties +from ._models_py3 import MigrationItemsQueryParameter +from ._models_py3 import MigrationProviderSpecificSettings +from ._models_py3 import MigrationRecoveryPoint +from ._models_py3 import MigrationRecoveryPointCollection +from ._models_py3 import MigrationRecoveryPointProperties +from ._models_py3 import MobilityServiceUpdate +from ._models_py3 import Network +from ._models_py3 import NetworkCollection +from ._models_py3 import NetworkMapping +from ._models_py3 import NetworkMappingCollection +from ._models_py3 import NetworkMappingFabricSpecificSettings +from ._models_py3 import NetworkMappingProperties +from ._models_py3 import NetworkProperties +from ._models_py3 import NewProtectionProfile +from ._models_py3 import NewRecoveryVirtualNetwork +from ._models_py3 import OSDetails +from ._models_py3 import OSDiskDetails +from ._models_py3 import OSVersionWrapper +from ._models_py3 import OperationsDiscovery +from ._models_py3 import OperationsDiscoveryCollection +from ._models_py3 import PlannedFailoverInput +from ._models_py3 import PlannedFailoverInputProperties +from ._models_py3 import PlannedFailoverProviderSpecificFailoverInput +from ._models_py3 import Policy +from ._models_py3 import PolicyCollection +from ._models_py3 import PolicyProperties +from ._models_py3 import PolicyProviderSpecificDetails +from ._models_py3 import PolicyProviderSpecificInput +from ._models_py3 import ProcessServer +from ._models_py3 import ProcessServerDetails +from ._models_py3 import ProtectableItem +from ._models_py3 import ProtectableItemCollection +from ._models_py3 import ProtectableItemProperties +from ._models_py3 import ProtectableItemQueryParameter +from ._models_py3 import ProtectedItemsQueryParameter +from ._models_py3 import ProtectionContainer +from ._models_py3 import ProtectionContainerCollection +from ._models_py3 import ProtectionContainerFabricSpecificDetails +from ._models_py3 import ProtectionContainerMapping +from ._models_py3 import ProtectionContainerMappingCollection +from ._models_py3 import ProtectionContainerMappingProperties +from ._models_py3 import ProtectionContainerMappingProviderSpecificDetails +from ._models_py3 import ProtectionContainerProperties +from ._models_py3 import ProtectionProfileCustomDetails +from ._models_py3 import ProviderError +from ._models_py3 import ProviderSpecificRecoveryPointDetails +from ._models_py3 import PushInstallerDetails +from ._models_py3 import RcmProxyDetails +from ._models_py3 import RecoveryAvailabilitySetCustomDetails +from ._models_py3 import RecoveryPlan +from ._models_py3 import RecoveryPlanA2ADetails +from ._models_py3 import RecoveryPlanA2AFailoverInput +from ._models_py3 import RecoveryPlanA2AInput +from ._models_py3 import RecoveryPlanAction +from ._models_py3 import RecoveryPlanActionDetails +from ._models_py3 import RecoveryPlanAutomationRunbookActionDetails +from ._models_py3 import RecoveryPlanCollection +from ._models_py3 import RecoveryPlanGroup +from ._models_py3 import RecoveryPlanGroupTaskDetails +from ._models_py3 import RecoveryPlanHyperVReplicaAzureFailbackInput +from ._models_py3 import RecoveryPlanHyperVReplicaAzureFailoverInput +from ._models_py3 import RecoveryPlanInMageAzureV2FailoverInput +from ._models_py3 import RecoveryPlanInMageFailoverInput +from ._models_py3 import RecoveryPlanInMageRcmFailbackFailoverInput +from ._models_py3 import RecoveryPlanInMageRcmFailoverInput +from ._models_py3 import RecoveryPlanManualActionDetails +from ._models_py3 import RecoveryPlanPlannedFailoverInput +from ._models_py3 import RecoveryPlanPlannedFailoverInputProperties +from ._models_py3 import RecoveryPlanProperties +from ._models_py3 import RecoveryPlanProtectedItem +from ._models_py3 import RecoveryPlanProviderSpecificDetails +from ._models_py3 import RecoveryPlanProviderSpecificFailoverInput +from ._models_py3 import RecoveryPlanProviderSpecificInput +from ._models_py3 import RecoveryPlanScriptActionDetails +from ._models_py3 import RecoveryPlanShutdownGroupTaskDetails +from ._models_py3 import RecoveryPlanTestFailoverCleanupInput +from ._models_py3 import RecoveryPlanTestFailoverCleanupInputProperties +from ._models_py3 import RecoveryPlanTestFailoverInput +from ._models_py3 import RecoveryPlanTestFailoverInputProperties +from ._models_py3 import RecoveryPlanUnplannedFailoverInput +from ._models_py3 import RecoveryPlanUnplannedFailoverInputProperties +from ._models_py3 import RecoveryPoint +from ._models_py3 import RecoveryPointCollection +from ._models_py3 import RecoveryPointProperties +from ._models_py3 import RecoveryProximityPlacementGroupCustomDetails +from ._models_py3 import RecoveryResourceGroupCustomDetails +from ._models_py3 import RecoveryServicesProvider +from ._models_py3 import RecoveryServicesProviderCollection +from ._models_py3 import RecoveryServicesProviderProperties +from ._models_py3 import RecoveryVirtualNetworkCustomDetails +from ._models_py3 import RemoveDisksInput +from ._models_py3 import RemoveDisksInputProperties +from ._models_py3 import RemoveDisksProviderSpecificInput +from ._models_py3 import RemoveProtectionContainerMappingInput +from ._models_py3 import RemoveProtectionContainerMappingInputProperties +from ._models_py3 import RenewCertificateInput +from ._models_py3 import RenewCertificateInputProperties +from ._models_py3 import ReplicationAgentDetails +from ._models_py3 import ReplicationAppliance +from ._models_py3 import ReplicationApplianceProperties +from ._models_py3 import ReplicationEligibilityResults +from ._models_py3 import ReplicationEligibilityResultsCollection +from ._models_py3 import ReplicationEligibilityResultsErrorInfo +from ._models_py3 import ReplicationEligibilityResultsProperties +from ._models_py3 import ReplicationGroupDetails +from ._models_py3 import ReplicationProtectedItem +from ._models_py3 import ReplicationProtectedItemCollection +from ._models_py3 import ReplicationProtectedItemProperties +from ._models_py3 import ReplicationProtectionIntent +from ._models_py3 import ReplicationProtectionIntentCollection +from ._models_py3 import ReplicationProtectionIntentProperties +from ._models_py3 import ReplicationProtectionIntentProviderSpecificSettings +from ._models_py3 import ReplicationProviderContainerUnmappingInput +from ._models_py3 import ReplicationProviderSpecificContainerCreationInput +from ._models_py3 import ReplicationProviderSpecificContainerMappingInput +from ._models_py3 import ReplicationProviderSpecificSettings +from ._models_py3 import ReplicationProviderSpecificUpdateContainerMappingInput +from ._models_py3 import ReprotectAgentDetails +from ._models_py3 import ResolveHealthError +from ._models_py3 import ResolveHealthInput +from ._models_py3 import ResolveHealthInputProperties +from ._models_py3 import Resource +from ._models_py3 import ResourceHealthSummary +from ._models_py3 import ResumeJobParams +from ._models_py3 import ResumeJobParamsProperties +from ._models_py3 import ResyncInput +from ._models_py3 import ResyncInputProperties +from ._models_py3 import ResyncProviderSpecificInput +from ._models_py3 import RetentionVolume +from ._models_py3 import ReverseReplicationInput +from ._models_py3 import ReverseReplicationInputProperties +from ._models_py3 import ReverseReplicationProviderSpecificInput +from ._models_py3 import RoleAssignment +from ._models_py3 import RunAsAccount +from ._models_py3 import ScriptActionTaskDetails +from ._models_py3 import ServiceError +from ._models_py3 import StorageAccountCustomDetails +from ._models_py3 import StorageClassification +from ._models_py3 import StorageClassificationCollection +from ._models_py3 import StorageClassificationMapping +from ._models_py3 import StorageClassificationMappingCollection +from ._models_py3 import StorageClassificationMappingInput +from ._models_py3 import StorageClassificationMappingProperties +from ._models_py3 import StorageClassificationProperties +from ._models_py3 import StorageMappingInputProperties +from ._models_py3 import Subnet +from ._models_py3 import SupportedOSDetails +from ._models_py3 import SupportedOSProperties +from ._models_py3 import SupportedOSProperty +from ._models_py3 import SupportedOperatingSystems +from ._models_py3 import SwitchProtectionInput +from ._models_py3 import SwitchProtectionInputProperties +from ._models_py3 import SwitchProtectionJobDetails +from ._models_py3 import SwitchProtectionProviderSpecificInput +from ._models_py3 import SwitchProviderInput +from ._models_py3 import SwitchProviderInputProperties +from ._models_py3 import SwitchProviderSpecificInput +from ._models_py3 import TargetComputeSize +from ._models_py3 import TargetComputeSizeCollection +from ._models_py3 import TargetComputeSizeProperties +from ._models_py3 import TaskTypeDetails +from ._models_py3 import TestFailoverCleanupInput +from ._models_py3 import TestFailoverCleanupInputProperties +from ._models_py3 import TestFailoverInput +from ._models_py3 import TestFailoverInputProperties +from ._models_py3 import TestFailoverJobDetails +from ._models_py3 import TestFailoverProviderSpecificInput +from ._models_py3 import TestMigrateCleanupInput +from ._models_py3 import TestMigrateCleanupInputProperties +from ._models_py3 import TestMigrateInput +from ._models_py3 import TestMigrateInputProperties +from ._models_py3 import TestMigrateProviderSpecificInput +from ._models_py3 import UnplannedFailoverInput +from ._models_py3 import UnplannedFailoverInputProperties +from ._models_py3 import UnplannedFailoverProviderSpecificInput +from ._models_py3 import UpdateApplianceForReplicationProtectedItemInput +from ._models_py3 import UpdateApplianceForReplicationProtectedItemInputProperties +from ._models_py3 import UpdateApplianceForReplicationProtectedItemProviderSpecificInput +from ._models_py3 import UpdateDiskInput +from ._models_py3 import UpdateMigrationItemInput +from ._models_py3 import UpdateMigrationItemInputProperties +from ._models_py3 import UpdateMigrationItemProviderSpecificInput +from ._models_py3 import UpdateMobilityServiceRequest +from ._models_py3 import UpdateMobilityServiceRequestProperties +from ._models_py3 import UpdateNetworkMappingInput +from ._models_py3 import UpdateNetworkMappingInputProperties +from ._models_py3 import UpdatePolicyInput +from ._models_py3 import UpdatePolicyInputProperties +from ._models_py3 import UpdateProtectionContainerMappingInput +from ._models_py3 import UpdateProtectionContainerMappingInputProperties +from ._models_py3 import UpdateRecoveryPlanInput +from ._models_py3 import UpdateRecoveryPlanInputProperties +from ._models_py3 import UpdateReplicationProtectedItemInput +from ._models_py3 import UpdateReplicationProtectedItemInputProperties +from ._models_py3 import UpdateReplicationProtectedItemProviderInput +from ._models_py3 import UpdateVCenterRequest +from ._models_py3 import UpdateVCenterRequestProperties +from ._models_py3 import VCenter +from ._models_py3 import VCenterCollection +from ._models_py3 import VCenterProperties +from ._models_py3 import VMNicDetails +from ._models_py3 import VMNicInputDetails +from ._models_py3 import VMwareCbtContainerCreationInput +from ._models_py3 import VMwareCbtContainerMappingInput +from ._models_py3 import VMwareCbtDiskInput +from ._models_py3 import VMwareCbtEnableMigrationInput +from ._models_py3 import VMwareCbtEventDetails +from ._models_py3 import VMwareCbtMigrateInput +from ._models_py3 import VMwareCbtMigrationDetails +from ._models_py3 import VMwareCbtNicDetails +from ._models_py3 import VMwareCbtNicInput +from ._models_py3 import VMwareCbtPolicyCreationInput +from ._models_py3 import VMwareCbtProtectedDiskDetails +from ._models_py3 import VMwareCbtProtectionContainerMappingDetails +from ._models_py3 import VMwareCbtResyncInput +from ._models_py3 import VMwareCbtTestMigrateInput +from ._models_py3 import VMwareCbtUpdateDiskInput +from ._models_py3 import VMwareCbtUpdateMigrationItemInput +from ._models_py3 import VMwareDetails +from ._models_py3 import VMwareV2FabricCreationInput +from ._models_py3 import VMwareV2FabricSpecificDetails +from ._models_py3 import VMwareVirtualMachineDetails +from ._models_py3 import VaultHealthDetails +from ._models_py3 import VaultHealthProperties +from ._models_py3 import VaultSetting +from ._models_py3 import VaultSettingCollection +from ._models_py3 import VaultSettingCreationInput +from ._models_py3 import VaultSettingCreationInputProperties +from ._models_py3 import VaultSettingProperties +from ._models_py3 import VersionDetails +from ._models_py3 import VirtualMachineTaskDetails +from ._models_py3 import VmNicUpdatesTaskDetails +from ._models_py3 import VmmDetails +from ._models_py3 import VmmToAzureCreateNetworkMappingInput +from ._models_py3 import VmmToAzureNetworkMappingSettings +from ._models_py3 import VmmToAzureUpdateNetworkMappingInput +from ._models_py3 import VmmToVmmCreateNetworkMappingInput +from ._models_py3 import VmmToVmmNetworkMappingSettings +from ._models_py3 import VmmToVmmUpdateNetworkMappingInput +from ._models_py3 import VmmVirtualMachineDetails +from ._models_py3 import VmwareCbtPolicyDetails + from ._site_recovery_management_client_enums import ( A2ARecoveryAvailabilityType, @@ -997,12 +522,14 @@ AgentVersionStatus, AlternateLocationRecoveryOption, AutoProtectionOfDataDisk, + AutomationAccountAuthenticationType, DataSyncStatus, DisableProtectionReason, DiskAccountType, DiskReplicationProgressHealth, EthernetAddressType, ExportJobOutputSerializationType, + ExtendedLocationType, FailoverDeploymentModel, HealthErrorCategory, HealthErrorCustomerResolvability, @@ -1086,6 +613,9 @@ 'Alert', 'AlertCollection', 'AlertProperties', + 'ApplianceCollection', + 'ApplianceQueryParameter', + 'ApplianceSpecificDetails', 'ApplyRecoveryPointInput', 'ApplyRecoveryPointInputProperties', 'ApplyRecoveryPointProviderSpecificInput', @@ -1150,6 +680,7 @@ 'ExistingRecoveryVirtualNetwork', 'ExistingStorageAccount', 'ExportJobDetails', + 'ExtendedLocation', 'Fabric', 'FabricCollection', 'FabricCreationInput', @@ -1212,6 +743,9 @@ 'InMageAzureV2RecoveryPointDetails', 'InMageAzureV2ReplicationDetails', 'InMageAzureV2ReprotectInput', + 'InMageAzureV2SwitchProviderBlockingErrorDetails', + 'InMageAzureV2SwitchProviderDetails', + 'InMageAzureV2SwitchProviderInput', 'InMageAzureV2TestFailoverInput', 'InMageAzureV2UnplannedFailoverInput', 'InMageAzureV2UpdateReplicationProtectedItemInput', @@ -1221,10 +755,13 @@ 'InMageDiskExclusionInput', 'InMageDiskSignatureExclusionOptions', 'InMageEnableProtectionInput', + 'InMageFabricSwitchProviderBlockingErrorDetails', 'InMagePolicyDetails', 'InMagePolicyInput', 'InMageProtectedDiskDetails', 'InMageRcmAgentUpgradeBlockingErrorDetails', + 'InMageRcmApplianceDetails', + 'InMageRcmApplianceSpecificDetails', 'InMageRcmApplyRecoveryPointInput', 'InMageRcmDiscoveredProtectedVmDetails', 'InMageRcmDiskInput', @@ -1233,6 +770,7 @@ 'InMageRcmEventDetails', 'InMageRcmFabricCreationInput', 'InMageRcmFabricSpecificDetails', + 'InMageRcmFabricSwitchProviderBlockingErrorDetails', 'InMageRcmFailbackDiscoveredProtectedVmDetails', 'InMageRcmFailbackEventDetails', 'InMageRcmFailbackMobilityAgentDetails', @@ -1391,6 +929,8 @@ 'RenewCertificateInput', 'RenewCertificateInputProperties', 'ReplicationAgentDetails', + 'ReplicationAppliance', + 'ReplicationApplianceProperties', 'ReplicationEligibilityResults', 'ReplicationEligibilityResultsCollection', 'ReplicationEligibilityResultsErrorInfo', @@ -1445,6 +985,9 @@ 'SwitchProtectionInputProperties', 'SwitchProtectionJobDetails', 'SwitchProtectionProviderSpecificInput', + 'SwitchProviderInput', + 'SwitchProviderInputProperties', + 'SwitchProviderSpecificInput', 'TargetComputeSize', 'TargetComputeSizeCollection', 'TargetComputeSizeProperties', @@ -1536,12 +1079,14 @@ 'AgentVersionStatus', 'AlternateLocationRecoveryOption', 'AutoProtectionOfDataDisk', + 'AutomationAccountAuthenticationType', 'DataSyncStatus', 'DisableProtectionReason', 'DiskAccountType', 'DiskReplicationProgressHealth', 'EthernetAddressType', 'ExportJobOutputSerializationType', + 'ExtendedLocationType', 'FailoverDeploymentModel', 'HealthErrorCategory', 'HealthErrorCustomerResolvability', diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/_models.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/_models.py deleted file mode 100644 index a67702ce31bd..000000000000 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/_models.py +++ /dev/null @@ -1,20801 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class AddDisksProviderSpecificInput(msrest.serialization.Model): - """Add Disks provider specific input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2AAddDisksInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2AAddDisksInput'} - } - - def __init__( - self, - **kwargs - ): - super(AddDisksProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2AAddDisksInput(AddDisksProviderSpecificInput): - """A2A add disk(s) input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param vm_disks: The list of vm disk details. - :type vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] - :param vm_managed_disks: The list of vm managed disk details. - :type vm_managed_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmManagedDiskInputDetails] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'vm_disks': {'key': 'vmDisks', 'type': '[A2AVmDiskInputDetails]'}, - 'vm_managed_disks': {'key': 'vmManagedDisks', 'type': '[A2AVmManagedDiskInputDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AAddDisksInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.vm_disks = kwargs.get('vm_disks', None) - self.vm_managed_disks = kwargs.get('vm_managed_disks', None) - - -class ApplyRecoveryPointProviderSpecificInput(msrest.serialization.Model): - """Provider specific input for apply recovery point. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2AApplyRecoveryPointInput, A2ACrossClusterMigrationApplyRecoveryPointInput, HyperVReplicaAzureApplyRecoveryPointInput, InMageAzureV2ApplyRecoveryPointInput, InMageRcmApplyRecoveryPointInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2AApplyRecoveryPointInput', 'A2ACrossClusterMigration': 'A2ACrossClusterMigrationApplyRecoveryPointInput', 'HyperVReplicaAzure': 'HyperVReplicaAzureApplyRecoveryPointInput', 'InMageAzureV2': 'InMageAzureV2ApplyRecoveryPointInput', 'InMageRcm': 'InMageRcmApplyRecoveryPointInput'} - } - - def __init__( - self, - **kwargs - ): - super(ApplyRecoveryPointProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2AApplyRecoveryPointInput(ApplyRecoveryPointProviderSpecificInput): - """ApplyRecoveryPoint input specific to A2A provider. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AApplyRecoveryPointInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - - -class ReplicationProviderSpecificContainerCreationInput(msrest.serialization.Model): - """Provider specific input for container creation operation. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2AContainerCreationInput, A2ACrossClusterMigrationContainerCreationInput, VMwareCbtContainerCreationInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2AContainerCreationInput', 'A2ACrossClusterMigration': 'A2ACrossClusterMigrationContainerCreationInput', 'VMwareCbt': 'VMwareCbtContainerCreationInput'} - } - - def __init__( - self, - **kwargs - ): - super(ReplicationProviderSpecificContainerCreationInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2AContainerCreationInput(ReplicationProviderSpecificContainerCreationInput): - """A2A cloud creation input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AContainerCreationInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - - -class ReplicationProviderSpecificContainerMappingInput(msrest.serialization.Model): - """Provider specific input for pairing operations. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2AContainerMappingInput, VMwareCbtContainerMappingInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2AContainerMappingInput', 'VMwareCbt': 'VMwareCbtContainerMappingInput'} - } - - def __init__( - self, - **kwargs - ): - super(ReplicationProviderSpecificContainerMappingInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2AContainerMappingInput(ReplicationProviderSpecificContainerMappingInput): - """A2A container mapping input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param agent_auto_update_status: A value indicating whether the auto update is enabled. - Possible values include: "Disabled", "Enabled". - :type agent_auto_update_status: str or - ~azure.mgmt.recoveryservicessiterecovery.models.AgentAutoUpdateStatus - :param automation_account_arm_id: The automation account arm id. - :type automation_account_arm_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'agent_auto_update_status': {'key': 'agentAutoUpdateStatus', 'type': 'str'}, - 'automation_account_arm_id': {'key': 'automationAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AContainerMappingInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.agent_auto_update_status = kwargs.get('agent_auto_update_status', None) - self.automation_account_arm_id = kwargs.get('automation_account_arm_id', None) - - -class CreateProtectionIntentProviderSpecificDetails(msrest.serialization.Model): - """Create protection intent provider specific input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2ACreateProtectionIntentInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2ACreateProtectionIntentInput'} - } - - def __init__( - self, - **kwargs - ): - super(CreateProtectionIntentProviderSpecificDetails, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2ACreateProtectionIntentInput(CreateProtectionIntentProviderSpecificDetails): - """A2A create protection intent input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param fabric_object_id: Required. The fabric specific object Id of the virtual machine. - :type fabric_object_id: str - :param primary_location: Required. The primary location for the virtual machine. - :type primary_location: str - :param recovery_location: Required. The recovery location for the virtual machine. - :type recovery_location: str - :param recovery_subscription_id: Required. The recovery subscription Id of the virtual machine. - :type recovery_subscription_id: str - :param recovery_availability_type: Required. The recovery availability type of the virtual - machine. Possible values include: "Single", "AvailabilitySet", "AvailabilityZone". - :type recovery_availability_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.A2ARecoveryAvailabilityType - :param protection_profile_custom_input: The protection profile custom inputs. - :type protection_profile_custom_input: - ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionProfileCustomDetails - :param recovery_resource_group_id: Required. The recovery resource group Id. Valid for V2 - scenarios. - :type recovery_resource_group_id: str - :param primary_staging_storage_account_custom_input: The primary staging storage account input. - :type primary_staging_storage_account_custom_input: - ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails - :param recovery_availability_set_custom_input: The recovery availability set input. - :type recovery_availability_set_custom_input: - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryAvailabilitySetCustomDetails - :param recovery_virtual_network_custom_input: The recovery virtual network input. - :type recovery_virtual_network_custom_input: - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryVirtualNetworkCustomDetails - :param recovery_proximity_placement_group_custom_input: The recovery proximity placement group - custom input. - :type recovery_proximity_placement_group_custom_input: - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryProximityPlacementGroupCustomDetails - :param auto_protection_of_data_disk: A value indicating whether the auto protection is enabled. - Possible values include: "Disabled", "Enabled". - :type auto_protection_of_data_disk: str or - ~azure.mgmt.recoveryservicessiterecovery.models.AutoProtectionOfDataDisk - :param vm_disks: The list of vm disk inputs. - :type vm_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectionIntentDiskInputDetails] - :param vm_managed_disks: The list of vm managed disk inputs. - :type vm_managed_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectionIntentManagedDiskInputDetails] - :param multi_vm_group_name: The multi vm group name. - :type multi_vm_group_name: str - :param multi_vm_group_id: The multi vm group id. - :type multi_vm_group_id: str - :param recovery_boot_diag_storage_account: The boot diagnostic storage account. - :type recovery_boot_diag_storage_account: - ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails - :param disk_encryption_info: The recovery disk encryption information (for two pass flows). - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo - :param recovery_availability_zone: The recovery availability zone. - :type recovery_availability_zone: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'fabric_object_id': {'required': True}, - 'primary_location': {'required': True}, - 'recovery_location': {'required': True}, - 'recovery_subscription_id': {'required': True}, - 'recovery_availability_type': {'required': True}, - 'recovery_resource_group_id': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'fabric_object_id': {'key': 'fabricObjectId', 'type': 'str'}, - 'primary_location': {'key': 'primaryLocation', 'type': 'str'}, - 'recovery_location': {'key': 'recoveryLocation', 'type': 'str'}, - 'recovery_subscription_id': {'key': 'recoverySubscriptionId', 'type': 'str'}, - 'recovery_availability_type': {'key': 'recoveryAvailabilityType', 'type': 'str'}, - 'protection_profile_custom_input': {'key': 'protectionProfileCustomInput', 'type': 'ProtectionProfileCustomDetails'}, - 'recovery_resource_group_id': {'key': 'recoveryResourceGroupId', 'type': 'str'}, - 'primary_staging_storage_account_custom_input': {'key': 'primaryStagingStorageAccountCustomInput', 'type': 'StorageAccountCustomDetails'}, - 'recovery_availability_set_custom_input': {'key': 'recoveryAvailabilitySetCustomInput', 'type': 'RecoveryAvailabilitySetCustomDetails'}, - 'recovery_virtual_network_custom_input': {'key': 'recoveryVirtualNetworkCustomInput', 'type': 'RecoveryVirtualNetworkCustomDetails'}, - 'recovery_proximity_placement_group_custom_input': {'key': 'recoveryProximityPlacementGroupCustomInput', 'type': 'RecoveryProximityPlacementGroupCustomDetails'}, - 'auto_protection_of_data_disk': {'key': 'autoProtectionOfDataDisk', 'type': 'str'}, - 'vm_disks': {'key': 'vmDisks', 'type': '[A2AProtectionIntentDiskInputDetails]'}, - 'vm_managed_disks': {'key': 'vmManagedDisks', 'type': '[A2AProtectionIntentManagedDiskInputDetails]'}, - 'multi_vm_group_name': {'key': 'multiVmGroupName', 'type': 'str'}, - 'multi_vm_group_id': {'key': 'multiVmGroupId', 'type': 'str'}, - 'recovery_boot_diag_storage_account': {'key': 'recoveryBootDiagStorageAccount', 'type': 'StorageAccountCustomDetails'}, - 'disk_encryption_info': {'key': 'diskEncryptionInfo', 'type': 'DiskEncryptionInfo'}, - 'recovery_availability_zone': {'key': 'recoveryAvailabilityZone', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2ACreateProtectionIntentInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.fabric_object_id = kwargs['fabric_object_id'] - self.primary_location = kwargs['primary_location'] - self.recovery_location = kwargs['recovery_location'] - self.recovery_subscription_id = kwargs['recovery_subscription_id'] - self.recovery_availability_type = kwargs['recovery_availability_type'] - self.protection_profile_custom_input = kwargs.get('protection_profile_custom_input', None) - self.recovery_resource_group_id = kwargs['recovery_resource_group_id'] - self.primary_staging_storage_account_custom_input = kwargs.get('primary_staging_storage_account_custom_input', None) - self.recovery_availability_set_custom_input = kwargs.get('recovery_availability_set_custom_input', None) - self.recovery_virtual_network_custom_input = kwargs.get('recovery_virtual_network_custom_input', None) - self.recovery_proximity_placement_group_custom_input = kwargs.get('recovery_proximity_placement_group_custom_input', None) - self.auto_protection_of_data_disk = kwargs.get('auto_protection_of_data_disk', None) - self.vm_disks = kwargs.get('vm_disks', None) - self.vm_managed_disks = kwargs.get('vm_managed_disks', None) - self.multi_vm_group_name = kwargs.get('multi_vm_group_name', None) - self.multi_vm_group_id = kwargs.get('multi_vm_group_id', None) - self.recovery_boot_diag_storage_account = kwargs.get('recovery_boot_diag_storage_account', None) - self.disk_encryption_info = kwargs.get('disk_encryption_info', None) - self.recovery_availability_zone = kwargs.get('recovery_availability_zone', None) - - -class A2ACrossClusterMigrationApplyRecoveryPointInput(ApplyRecoveryPointProviderSpecificInput): - """ApplyRecoveryPoint input specific to A2ACrossClusterMigration provider. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2ACrossClusterMigrationApplyRecoveryPointInput, self).__init__(**kwargs) - self.instance_type = 'A2ACrossClusterMigration' # type: str - - -class A2ACrossClusterMigrationContainerCreationInput(ReplicationProviderSpecificContainerCreationInput): - """A2ACrossClusterMigration cloud creation input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2ACrossClusterMigrationContainerCreationInput, self).__init__(**kwargs) - self.instance_type = 'A2ACrossClusterMigration' # type: str - - -class EnableProtectionProviderSpecificInput(msrest.serialization.Model): - """Enable protection provider specific input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2AEnableProtectionInput, A2ACrossClusterMigrationEnableProtectionInput, HyperVReplicaAzureEnableProtectionInput, InMageEnableProtectionInput, InMageAzureV2EnableProtectionInput, InMageRcmEnableProtectionInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2AEnableProtectionInput', 'A2ACrossClusterMigration': 'A2ACrossClusterMigrationEnableProtectionInput', 'HyperVReplicaAzure': 'HyperVReplicaAzureEnableProtectionInput', 'InMage': 'InMageEnableProtectionInput', 'InMageAzureV2': 'InMageAzureV2EnableProtectionInput', 'InMageRcm': 'InMageRcmEnableProtectionInput'} - } - - def __init__( - self, - **kwargs - ): - super(EnableProtectionProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2ACrossClusterMigrationEnableProtectionInput(EnableProtectionProviderSpecificInput): - """A2A Cross-Cluster Migration enable protection input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param fabric_object_id: The fabric specific object Id of the virtual machine. - :type fabric_object_id: str - :param recovery_container_id: The recovery container Id. - :type recovery_container_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'fabric_object_id': {'key': 'fabricObjectId', 'type': 'str'}, - 'recovery_container_id': {'key': 'recoveryContainerId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2ACrossClusterMigrationEnableProtectionInput, self).__init__(**kwargs) - self.instance_type = 'A2ACrossClusterMigration' # type: str - self.fabric_object_id = kwargs.get('fabric_object_id', None) - self.recovery_container_id = kwargs.get('recovery_container_id', None) - - -class PolicyProviderSpecificInput(msrest.serialization.Model): - """Base class for provider specific input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2APolicyCreationInput, A2ACrossClusterMigrationPolicyCreationInput, HyperVReplicaPolicyInput, HyperVReplicaAzurePolicyInput, InMagePolicyInput, InMageAzureV2PolicyInput, InMageRcmPolicyCreationInput, InMageRcmFailbackPolicyCreationInput, VMwareCbtPolicyCreationInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2APolicyCreationInput', 'A2ACrossClusterMigration': 'A2ACrossClusterMigrationPolicyCreationInput', 'HyperVReplica2012': 'HyperVReplicaPolicyInput', 'HyperVReplicaAzure': 'HyperVReplicaAzurePolicyInput', 'InMage': 'InMagePolicyInput', 'InMageAzureV2': 'InMageAzureV2PolicyInput', 'InMageRcm': 'InMageRcmPolicyCreationInput', 'InMageRcmFailback': 'InMageRcmFailbackPolicyCreationInput', 'VMwareCbt': 'VMwareCbtPolicyCreationInput'} - } - - def __init__( - self, - **kwargs - ): - super(PolicyProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2ACrossClusterMigrationPolicyCreationInput(PolicyProviderSpecificInput): - """A2A Cross-Cluster Migration Policy creation input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2ACrossClusterMigrationPolicyCreationInput, self).__init__(**kwargs) - self.instance_type = 'A2ACrossClusterMigration' # type: str - - -class ReplicationProviderSpecificSettings(msrest.serialization.Model): - """Replication provider specific settings. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2AReplicationDetails, A2ACrossClusterMigrationReplicationDetails, HyperVReplicaReplicationDetails, HyperVReplicaBlueReplicationDetails, HyperVReplicaAzureReplicationDetails, HyperVReplicaBaseReplicationDetails, InMageReplicationDetails, InMageAzureV2ReplicationDetails, InMageRcmReplicationDetails, InMageRcmFailbackReplicationDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2AReplicationDetails', 'A2ACrossClusterMigration': 'A2ACrossClusterMigrationReplicationDetails', 'HyperVReplica2012': 'HyperVReplicaReplicationDetails', 'HyperVReplica2012R2': 'HyperVReplicaBlueReplicationDetails', 'HyperVReplicaAzure': 'HyperVReplicaAzureReplicationDetails', 'HyperVReplicaBaseReplicationDetails': 'HyperVReplicaBaseReplicationDetails', 'InMage': 'InMageReplicationDetails', 'InMageAzureV2': 'InMageAzureV2ReplicationDetails', 'InMageRcm': 'InMageRcmReplicationDetails', 'InMageRcmFailback': 'InMageRcmFailbackReplicationDetails'} - } - - def __init__( - self, - **kwargs - ): - super(ReplicationProviderSpecificSettings, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2ACrossClusterMigrationReplicationDetails(ReplicationProviderSpecificSettings): - """A2A provider specific settings. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param fabric_object_id: The fabric specific object Id of the virtual machine. - :type fabric_object_id: str - :param primary_fabric_location: Primary fabric location. - :type primary_fabric_location: str - :param os_type: The type of operating system. - :type os_type: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param lifecycle_id: An id associated with the PE that survives actions like switch protection - which change the backing PE/CPE objects internally.The lifecycle id gets carried forward to - have a link/continuity in being able to have an Id that denotes the "same" protected item even - though other internal Ids/ARM Id might be changing. - :type lifecycle_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'fabric_object_id': {'key': 'fabricObjectId', 'type': 'str'}, - 'primary_fabric_location': {'key': 'primaryFabricLocation', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vm_protection_state': {'key': 'vmProtectionState', 'type': 'str'}, - 'vm_protection_state_description': {'key': 'vmProtectionStateDescription', 'type': 'str'}, - 'lifecycle_id': {'key': 'lifecycleId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2ACrossClusterMigrationReplicationDetails, self).__init__(**kwargs) - self.instance_type = 'A2ACrossClusterMigration' # type: str - self.fabric_object_id = kwargs.get('fabric_object_id', None) - self.primary_fabric_location = kwargs.get('primary_fabric_location', None) - self.os_type = kwargs.get('os_type', None) - self.vm_protection_state = kwargs.get('vm_protection_state', None) - self.vm_protection_state_description = kwargs.get('vm_protection_state_description', None) - self.lifecycle_id = kwargs.get('lifecycle_id', None) - - -class A2AEnableProtectionInput(EnableProtectionProviderSpecificInput): - """A2A enable protection input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param fabric_object_id: Required. The fabric specific object Id of the virtual machine. - :type fabric_object_id: str - :param recovery_container_id: The recovery container Id. - :type recovery_container_id: str - :param recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. - :type recovery_resource_group_id: str - :param recovery_cloud_service_id: The recovery cloud service Id. Valid for V1 scenarios. - :type recovery_cloud_service_id: str - :param recovery_availability_set_id: The recovery availability set Id. - :type recovery_availability_set_id: str - :param recovery_proximity_placement_group_id: The recovery proximity placement group Id. - :type recovery_proximity_placement_group_id: str - :param vm_disks: The list of vm disk details. - :type vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] - :param vm_managed_disks: The list of vm managed disk details. - :type vm_managed_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmManagedDiskInputDetails] - :param multi_vm_group_name: The multi vm group name. - :type multi_vm_group_name: str - :param multi_vm_group_id: The multi vm group id. - :type multi_vm_group_id: str - :param recovery_boot_diag_storage_account_id: The boot diagnostic storage account. - :type recovery_boot_diag_storage_account_id: str - :param disk_encryption_info: The recovery disk encryption information (for two pass flows). - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo - :param recovery_availability_zone: The recovery availability zone. - :type recovery_availability_zone: str - :param recovery_azure_network_id: The recovery Azure virtual network ARM id. - :type recovery_azure_network_id: str - :param recovery_subnet_name: The recovery subnet name. - :type recovery_subnet_name: str - :param recovery_virtual_machine_scale_set_id: The virtual machine scale set Id. - :type recovery_virtual_machine_scale_set_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'fabric_object_id': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'fabric_object_id': {'key': 'fabricObjectId', 'type': 'str'}, - 'recovery_container_id': {'key': 'recoveryContainerId', 'type': 'str'}, - 'recovery_resource_group_id': {'key': 'recoveryResourceGroupId', 'type': 'str'}, - 'recovery_cloud_service_id': {'key': 'recoveryCloudServiceId', 'type': 'str'}, - 'recovery_availability_set_id': {'key': 'recoveryAvailabilitySetId', 'type': 'str'}, - 'recovery_proximity_placement_group_id': {'key': 'recoveryProximityPlacementGroupId', 'type': 'str'}, - 'vm_disks': {'key': 'vmDisks', 'type': '[A2AVmDiskInputDetails]'}, - 'vm_managed_disks': {'key': 'vmManagedDisks', 'type': '[A2AVmManagedDiskInputDetails]'}, - 'multi_vm_group_name': {'key': 'multiVmGroupName', 'type': 'str'}, - 'multi_vm_group_id': {'key': 'multiVmGroupId', 'type': 'str'}, - 'recovery_boot_diag_storage_account_id': {'key': 'recoveryBootDiagStorageAccountId', 'type': 'str'}, - 'disk_encryption_info': {'key': 'diskEncryptionInfo', 'type': 'DiskEncryptionInfo'}, - 'recovery_availability_zone': {'key': 'recoveryAvailabilityZone', 'type': 'str'}, - 'recovery_azure_network_id': {'key': 'recoveryAzureNetworkId', 'type': 'str'}, - 'recovery_subnet_name': {'key': 'recoverySubnetName', 'type': 'str'}, - 'recovery_virtual_machine_scale_set_id': {'key': 'recoveryVirtualMachineScaleSetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AEnableProtectionInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.fabric_object_id = kwargs['fabric_object_id'] - self.recovery_container_id = kwargs.get('recovery_container_id', None) - self.recovery_resource_group_id = kwargs.get('recovery_resource_group_id', None) - self.recovery_cloud_service_id = kwargs.get('recovery_cloud_service_id', None) - self.recovery_availability_set_id = kwargs.get('recovery_availability_set_id', None) - self.recovery_proximity_placement_group_id = kwargs.get('recovery_proximity_placement_group_id', None) - self.vm_disks = kwargs.get('vm_disks', None) - self.vm_managed_disks = kwargs.get('vm_managed_disks', None) - self.multi_vm_group_name = kwargs.get('multi_vm_group_name', None) - self.multi_vm_group_id = kwargs.get('multi_vm_group_id', None) - self.recovery_boot_diag_storage_account_id = kwargs.get('recovery_boot_diag_storage_account_id', None) - self.disk_encryption_info = kwargs.get('disk_encryption_info', None) - self.recovery_availability_zone = kwargs.get('recovery_availability_zone', None) - self.recovery_azure_network_id = kwargs.get('recovery_azure_network_id', None) - self.recovery_subnet_name = kwargs.get('recovery_subnet_name', None) - self.recovery_virtual_machine_scale_set_id = kwargs.get('recovery_virtual_machine_scale_set_id', None) - - -class EventProviderSpecificDetails(msrest.serialization.Model): - """Model class for provider specific details for an event. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2AEventDetails, HyperVReplica2012EventDetails, HyperVReplica2012R2EventDetails, HyperVReplicaAzureEventDetails, HyperVReplicaBaseEventDetails, InMageAzureV2EventDetails, InMageRcmEventDetails, InMageRcmFailbackEventDetails, VMwareCbtEventDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2AEventDetails', 'HyperVReplica2012': 'HyperVReplica2012EventDetails', 'HyperVReplica2012R2': 'HyperVReplica2012R2EventDetails', 'HyperVReplicaAzure': 'HyperVReplicaAzureEventDetails', 'HyperVReplicaBaseEventDetails': 'HyperVReplicaBaseEventDetails', 'InMageAzureV2': 'InMageAzureV2EventDetails', 'InMageRcm': 'InMageRcmEventDetails', 'InMageRcmFailback': 'InMageRcmFailbackEventDetails', 'VMwareCbt': 'VMwareCbtEventDetails'} - } - - def __init__( - self, - **kwargs - ): - super(EventProviderSpecificDetails, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2AEventDetails(EventProviderSpecificDetails): - """Model class for event details of a A2A event. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param protected_item_name: The protected item arm name. - :type protected_item_name: str - :param fabric_object_id: The azure vm arm id. - :type fabric_object_id: str - :param fabric_name: Fabric arm name. - :type fabric_name: str - :param fabric_location: The fabric location. - :type fabric_location: str - :param remote_fabric_name: Remote fabric arm name. - :type remote_fabric_name: str - :param remote_fabric_location: Remote fabric location. - :type remote_fabric_location: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'protected_item_name': {'key': 'protectedItemName', 'type': 'str'}, - 'fabric_object_id': {'key': 'fabricObjectId', 'type': 'str'}, - 'fabric_name': {'key': 'fabricName', 'type': 'str'}, - 'fabric_location': {'key': 'fabricLocation', 'type': 'str'}, - 'remote_fabric_name': {'key': 'remoteFabricName', 'type': 'str'}, - 'remote_fabric_location': {'key': 'remoteFabricLocation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AEventDetails, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.protected_item_name = kwargs.get('protected_item_name', None) - self.fabric_object_id = kwargs.get('fabric_object_id', None) - self.fabric_name = kwargs.get('fabric_name', None) - self.fabric_location = kwargs.get('fabric_location', None) - self.remote_fabric_name = kwargs.get('remote_fabric_name', None) - self.remote_fabric_location = kwargs.get('remote_fabric_location', None) - - -class A2APolicyCreationInput(PolicyProviderSpecificInput): - """A2A Policy creation input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_history: The duration in minutes until which the recovery points need to - be stored. - :type recovery_point_history: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in - minutes). - :type crash_consistent_frequency_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be - enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: "Enable", "Disable". - :type multi_vm_sync_status: str or - ~azure.mgmt.recoveryservicessiterecovery.models.SetMultiVmSyncStatus - """ - - _validation = { - 'instance_type': {'required': True}, - 'multi_vm_sync_status': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_history': {'key': 'recoveryPointHistory', 'type': 'int'}, - 'crash_consistent_frequency_in_minutes': {'key': 'crashConsistentFrequencyInMinutes', 'type': 'int'}, - 'app_consistent_frequency_in_minutes': {'key': 'appConsistentFrequencyInMinutes', 'type': 'int'}, - 'multi_vm_sync_status': {'key': 'multiVmSyncStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2APolicyCreationInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.recovery_point_history = kwargs.get('recovery_point_history', None) - self.crash_consistent_frequency_in_minutes = kwargs.get('crash_consistent_frequency_in_minutes', None) - self.app_consistent_frequency_in_minutes = kwargs.get('app_consistent_frequency_in_minutes', None) - self.multi_vm_sync_status = kwargs['multi_vm_sync_status'] - - -class PolicyProviderSpecificDetails(msrest.serialization.Model): - """Base class for Provider specific details for policies. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2APolicyDetails, HyperVReplicaPolicyDetails, HyperVReplicaBluePolicyDetails, HyperVReplicaAzurePolicyDetails, HyperVReplicaBasePolicyDetails, InMagePolicyDetails, InMageAzureV2PolicyDetails, InMageBasePolicyDetails, InMageRcmPolicyDetails, InMageRcmFailbackPolicyDetails, VmwareCbtPolicyDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2APolicyDetails', 'HyperVReplica2012': 'HyperVReplicaPolicyDetails', 'HyperVReplica2012R2': 'HyperVReplicaBluePolicyDetails', 'HyperVReplicaAzure': 'HyperVReplicaAzurePolicyDetails', 'HyperVReplicaBasePolicyDetails': 'HyperVReplicaBasePolicyDetails', 'InMage': 'InMagePolicyDetails', 'InMageAzureV2': 'InMageAzureV2PolicyDetails', 'InMageBasePolicyDetails': 'InMageBasePolicyDetails', 'InMageRcm': 'InMageRcmPolicyDetails', 'InMageRcmFailback': 'InMageRcmFailbackPolicyDetails', 'VMwareCbt': 'VmwareCbtPolicyDetails'} - } - - def __init__( - self, - **kwargs - ): - super(PolicyProviderSpecificDetails, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2APolicyDetails(PolicyProviderSpecificDetails): - """A2A specific policy details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param recovery_point_threshold_in_minutes: The recovery point threshold in minutes. - :type recovery_point_threshold_in_minutes: int - :param recovery_point_history: The duration in minutes until which the recovery points need to - be stored. - :type recovery_point_history: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. - :type multi_vm_sync_status: str - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in - minutes. - :type crash_consistent_frequency_in_minutes: int - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_threshold_in_minutes': {'key': 'recoveryPointThresholdInMinutes', 'type': 'int'}, - 'recovery_point_history': {'key': 'recoveryPointHistory', 'type': 'int'}, - 'app_consistent_frequency_in_minutes': {'key': 'appConsistentFrequencyInMinutes', 'type': 'int'}, - 'multi_vm_sync_status': {'key': 'multiVmSyncStatus', 'type': 'str'}, - 'crash_consistent_frequency_in_minutes': {'key': 'crashConsistentFrequencyInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(A2APolicyDetails, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.recovery_point_threshold_in_minutes = kwargs.get('recovery_point_threshold_in_minutes', None) - self.recovery_point_history = kwargs.get('recovery_point_history', None) - self.app_consistent_frequency_in_minutes = kwargs.get('app_consistent_frequency_in_minutes', None) - self.multi_vm_sync_status = kwargs.get('multi_vm_sync_status', None) - self.crash_consistent_frequency_in_minutes = kwargs.get('crash_consistent_frequency_in_minutes', None) - - -class A2AProtectedDiskDetails(msrest.serialization.Model): - """A2A protected disk details. - - :param disk_uri: The disk uri. - :type disk_uri: str - :param recovery_azure_storage_account_id: The recovery disk storage account. - :type recovery_azure_storage_account_id: str - :param primary_disk_azure_storage_account_id: The primary disk storage account. - :type primary_disk_azure_storage_account_id: str - :param recovery_disk_uri: Recovery disk uri. - :type recovery_disk_uri: str - :param disk_name: The disk name. - :type disk_name: str - :param disk_capacity_in_bytes: The disk capacity in bytes. - :type disk_capacity_in_bytes: long - :param primary_staging_azure_storage_account_id: The primary staging storage account. - :type primary_staging_azure_storage_account_id: str - :param disk_type: The type of disk. - :type disk_type: str - :param resync_required: A value indicating whether resync is required for this disk. - :type resync_required: bool - :param monitoring_percentage_completion: The percentage of the monitoring job. The type of the - monitoring job is defined by MonitoringJobType property. - :type monitoring_percentage_completion: int - :param monitoring_job_type: The type of the monitoring job. The progress is contained in - MonitoringPercentageCompletion property. - :type monitoring_job_type: str - :param data_pending_in_staging_storage_account_in_mb: The data pending for replication in MB at - staging account. - :type data_pending_in_staging_storage_account_in_mb: float - :param data_pending_at_source_agent_in_mb: The data pending at source virtual machine in MB. - :type data_pending_at_source_agent_in_mb: float - :param disk_state: The disk state. - :type disk_state: str - :param allowed_disk_level_operation: The disk level operations list. - :type allowed_disk_level_operation: list[str] - :param is_disk_encrypted: A value indicating whether vm has encrypted os disk or not. - :type is_disk_encrypted: bool - :param secret_identifier: The secret URL / identifier (BEK). - :type secret_identifier: str - :param dek_key_vault_arm_id: The KeyVault resource id for secret (BEK). - :type dek_key_vault_arm_id: str - :param is_disk_key_encrypted: A value indicating whether disk key got encrypted or not. - :type is_disk_key_encrypted: bool - :param key_identifier: The key URL / identifier (KEK). - :type key_identifier: str - :param kek_key_vault_arm_id: The KeyVault resource id for key (KEK). - :type kek_key_vault_arm_id: str - :param failover_disk_name: The failover name for the managed disk. - :type failover_disk_name: str - :param tfo_disk_name: The test failover name for the managed disk. - :type tfo_disk_name: str - """ - - _attribute_map = { - 'disk_uri': {'key': 'diskUri', 'type': 'str'}, - 'recovery_azure_storage_account_id': {'key': 'recoveryAzureStorageAccountId', 'type': 'str'}, - 'primary_disk_azure_storage_account_id': {'key': 'primaryDiskAzureStorageAccountId', 'type': 'str'}, - 'recovery_disk_uri': {'key': 'recoveryDiskUri', 'type': 'str'}, - 'disk_name': {'key': 'diskName', 'type': 'str'}, - 'disk_capacity_in_bytes': {'key': 'diskCapacityInBytes', 'type': 'long'}, - 'primary_staging_azure_storage_account_id': {'key': 'primaryStagingAzureStorageAccountId', 'type': 'str'}, - 'disk_type': {'key': 'diskType', 'type': 'str'}, - 'resync_required': {'key': 'resyncRequired', 'type': 'bool'}, - 'monitoring_percentage_completion': {'key': 'monitoringPercentageCompletion', 'type': 'int'}, - 'monitoring_job_type': {'key': 'monitoringJobType', 'type': 'str'}, - 'data_pending_in_staging_storage_account_in_mb': {'key': 'dataPendingInStagingStorageAccountInMB', 'type': 'float'}, - 'data_pending_at_source_agent_in_mb': {'key': 'dataPendingAtSourceAgentInMB', 'type': 'float'}, - 'disk_state': {'key': 'diskState', 'type': 'str'}, - 'allowed_disk_level_operation': {'key': 'allowedDiskLevelOperation', 'type': '[str]'}, - 'is_disk_encrypted': {'key': 'isDiskEncrypted', 'type': 'bool'}, - 'secret_identifier': {'key': 'secretIdentifier', 'type': 'str'}, - 'dek_key_vault_arm_id': {'key': 'dekKeyVaultArmId', 'type': 'str'}, - 'is_disk_key_encrypted': {'key': 'isDiskKeyEncrypted', 'type': 'bool'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'kek_key_vault_arm_id': {'key': 'kekKeyVaultArmId', 'type': 'str'}, - 'failover_disk_name': {'key': 'failoverDiskName', 'type': 'str'}, - 'tfo_disk_name': {'key': 'tfoDiskName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AProtectedDiskDetails, self).__init__(**kwargs) - self.disk_uri = kwargs.get('disk_uri', None) - self.recovery_azure_storage_account_id = kwargs.get('recovery_azure_storage_account_id', None) - self.primary_disk_azure_storage_account_id = kwargs.get('primary_disk_azure_storage_account_id', None) - self.recovery_disk_uri = kwargs.get('recovery_disk_uri', None) - self.disk_name = kwargs.get('disk_name', None) - self.disk_capacity_in_bytes = kwargs.get('disk_capacity_in_bytes', None) - self.primary_staging_azure_storage_account_id = kwargs.get('primary_staging_azure_storage_account_id', None) - self.disk_type = kwargs.get('disk_type', None) - self.resync_required = kwargs.get('resync_required', None) - self.monitoring_percentage_completion = kwargs.get('monitoring_percentage_completion', None) - self.monitoring_job_type = kwargs.get('monitoring_job_type', None) - self.data_pending_in_staging_storage_account_in_mb = kwargs.get('data_pending_in_staging_storage_account_in_mb', None) - self.data_pending_at_source_agent_in_mb = kwargs.get('data_pending_at_source_agent_in_mb', None) - self.disk_state = kwargs.get('disk_state', None) - self.allowed_disk_level_operation = kwargs.get('allowed_disk_level_operation', None) - self.is_disk_encrypted = kwargs.get('is_disk_encrypted', None) - self.secret_identifier = kwargs.get('secret_identifier', None) - self.dek_key_vault_arm_id = kwargs.get('dek_key_vault_arm_id', None) - self.is_disk_key_encrypted = kwargs.get('is_disk_key_encrypted', None) - self.key_identifier = kwargs.get('key_identifier', None) - self.kek_key_vault_arm_id = kwargs.get('kek_key_vault_arm_id', None) - self.failover_disk_name = kwargs.get('failover_disk_name', None) - self.tfo_disk_name = kwargs.get('tfo_disk_name', None) - - -class A2AProtectedManagedDiskDetails(msrest.serialization.Model): - """A2A protected managed disk details. - - :param disk_id: The managed disk Arm id. - :type disk_id: str - :param recovery_resource_group_id: The recovery disk resource group Arm Id. - :type recovery_resource_group_id: str - :param recovery_target_disk_id: Recovery target disk Arm Id. - :type recovery_target_disk_id: str - :param recovery_replica_disk_id: Recovery replica disk Arm Id. - :type recovery_replica_disk_id: str - :param recovery_orignal_target_disk_id: Recovery original target disk Arm Id. - :type recovery_orignal_target_disk_id: str - :param recovery_replica_disk_account_type: The replica disk type. Its an optional value and - will be same as source disk type if not user provided. - :type recovery_replica_disk_account_type: str - :param recovery_target_disk_account_type: The target disk type after failover. Its an optional - value and will be same as source disk type if not user provided. - :type recovery_target_disk_account_type: str - :param recovery_disk_encryption_set_id: The recovery disk encryption set Id. - :type recovery_disk_encryption_set_id: str - :param primary_disk_encryption_set_id: The primary disk encryption set Id. - :type primary_disk_encryption_set_id: str - :param disk_name: The disk name. - :type disk_name: str - :param disk_capacity_in_bytes: The disk capacity in bytes. - :type disk_capacity_in_bytes: long - :param primary_staging_azure_storage_account_id: The primary staging storage account. - :type primary_staging_azure_storage_account_id: str - :param disk_type: The type of disk. - :type disk_type: str - :param resync_required: A value indicating whether resync is required for this disk. - :type resync_required: bool - :param monitoring_percentage_completion: The percentage of the monitoring job. The type of the - monitoring job is defined by MonitoringJobType property. - :type monitoring_percentage_completion: int - :param monitoring_job_type: The type of the monitoring job. The progress is contained in - MonitoringPercentageCompletion property. - :type monitoring_job_type: str - :param data_pending_in_staging_storage_account_in_mb: The data pending for replication in MB at - staging account. - :type data_pending_in_staging_storage_account_in_mb: float - :param data_pending_at_source_agent_in_mb: The data pending at source virtual machine in MB. - :type data_pending_at_source_agent_in_mb: float - :param disk_state: The disk state. - :type disk_state: str - :param allowed_disk_level_operation: The disk level operations list. - :type allowed_disk_level_operation: list[str] - :param is_disk_encrypted: A value indicating whether vm has encrypted os disk or not. - :type is_disk_encrypted: bool - :param secret_identifier: The secret URL / identifier (BEK). - :type secret_identifier: str - :param dek_key_vault_arm_id: The KeyVault resource id for secret (BEK). - :type dek_key_vault_arm_id: str - :param is_disk_key_encrypted: A value indicating whether disk key got encrypted or not. - :type is_disk_key_encrypted: bool - :param key_identifier: The key URL / identifier (KEK). - :type key_identifier: str - :param kek_key_vault_arm_id: The KeyVault resource id for key (KEK). - :type kek_key_vault_arm_id: str - :param failover_disk_name: The failover name for the managed disk. - :type failover_disk_name: str - :param tfo_disk_name: The test failover name for the managed disk. - :type tfo_disk_name: str - """ - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'recovery_resource_group_id': {'key': 'recoveryResourceGroupId', 'type': 'str'}, - 'recovery_target_disk_id': {'key': 'recoveryTargetDiskId', 'type': 'str'}, - 'recovery_replica_disk_id': {'key': 'recoveryReplicaDiskId', 'type': 'str'}, - 'recovery_orignal_target_disk_id': {'key': 'recoveryOrignalTargetDiskId', 'type': 'str'}, - 'recovery_replica_disk_account_type': {'key': 'recoveryReplicaDiskAccountType', 'type': 'str'}, - 'recovery_target_disk_account_type': {'key': 'recoveryTargetDiskAccountType', 'type': 'str'}, - 'recovery_disk_encryption_set_id': {'key': 'recoveryDiskEncryptionSetId', 'type': 'str'}, - 'primary_disk_encryption_set_id': {'key': 'primaryDiskEncryptionSetId', 'type': 'str'}, - 'disk_name': {'key': 'diskName', 'type': 'str'}, - 'disk_capacity_in_bytes': {'key': 'diskCapacityInBytes', 'type': 'long'}, - 'primary_staging_azure_storage_account_id': {'key': 'primaryStagingAzureStorageAccountId', 'type': 'str'}, - 'disk_type': {'key': 'diskType', 'type': 'str'}, - 'resync_required': {'key': 'resyncRequired', 'type': 'bool'}, - 'monitoring_percentage_completion': {'key': 'monitoringPercentageCompletion', 'type': 'int'}, - 'monitoring_job_type': {'key': 'monitoringJobType', 'type': 'str'}, - 'data_pending_in_staging_storage_account_in_mb': {'key': 'dataPendingInStagingStorageAccountInMB', 'type': 'float'}, - 'data_pending_at_source_agent_in_mb': {'key': 'dataPendingAtSourceAgentInMB', 'type': 'float'}, - 'disk_state': {'key': 'diskState', 'type': 'str'}, - 'allowed_disk_level_operation': {'key': 'allowedDiskLevelOperation', 'type': '[str]'}, - 'is_disk_encrypted': {'key': 'isDiskEncrypted', 'type': 'bool'}, - 'secret_identifier': {'key': 'secretIdentifier', 'type': 'str'}, - 'dek_key_vault_arm_id': {'key': 'dekKeyVaultArmId', 'type': 'str'}, - 'is_disk_key_encrypted': {'key': 'isDiskKeyEncrypted', 'type': 'bool'}, - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'kek_key_vault_arm_id': {'key': 'kekKeyVaultArmId', 'type': 'str'}, - 'failover_disk_name': {'key': 'failoverDiskName', 'type': 'str'}, - 'tfo_disk_name': {'key': 'tfoDiskName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AProtectedManagedDiskDetails, self).__init__(**kwargs) - self.disk_id = kwargs.get('disk_id', None) - self.recovery_resource_group_id = kwargs.get('recovery_resource_group_id', None) - self.recovery_target_disk_id = kwargs.get('recovery_target_disk_id', None) - self.recovery_replica_disk_id = kwargs.get('recovery_replica_disk_id', None) - self.recovery_orignal_target_disk_id = kwargs.get('recovery_orignal_target_disk_id', None) - self.recovery_replica_disk_account_type = kwargs.get('recovery_replica_disk_account_type', None) - self.recovery_target_disk_account_type = kwargs.get('recovery_target_disk_account_type', None) - self.recovery_disk_encryption_set_id = kwargs.get('recovery_disk_encryption_set_id', None) - self.primary_disk_encryption_set_id = kwargs.get('primary_disk_encryption_set_id', None) - self.disk_name = kwargs.get('disk_name', None) - self.disk_capacity_in_bytes = kwargs.get('disk_capacity_in_bytes', None) - self.primary_staging_azure_storage_account_id = kwargs.get('primary_staging_azure_storage_account_id', None) - self.disk_type = kwargs.get('disk_type', None) - self.resync_required = kwargs.get('resync_required', None) - self.monitoring_percentage_completion = kwargs.get('monitoring_percentage_completion', None) - self.monitoring_job_type = kwargs.get('monitoring_job_type', None) - self.data_pending_in_staging_storage_account_in_mb = kwargs.get('data_pending_in_staging_storage_account_in_mb', None) - self.data_pending_at_source_agent_in_mb = kwargs.get('data_pending_at_source_agent_in_mb', None) - self.disk_state = kwargs.get('disk_state', None) - self.allowed_disk_level_operation = kwargs.get('allowed_disk_level_operation', None) - self.is_disk_encrypted = kwargs.get('is_disk_encrypted', None) - self.secret_identifier = kwargs.get('secret_identifier', None) - self.dek_key_vault_arm_id = kwargs.get('dek_key_vault_arm_id', None) - self.is_disk_key_encrypted = kwargs.get('is_disk_key_encrypted', None) - self.key_identifier = kwargs.get('key_identifier', None) - self.kek_key_vault_arm_id = kwargs.get('kek_key_vault_arm_id', None) - self.failover_disk_name = kwargs.get('failover_disk_name', None) - self.tfo_disk_name = kwargs.get('tfo_disk_name', None) - - -class ProtectionContainerMappingProviderSpecificDetails(msrest.serialization.Model): - """Container mapping provider specific details. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2AProtectionContainerMappingDetails, InMageRcmProtectionContainerMappingDetails, VMwareCbtProtectionContainerMappingDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2AProtectionContainerMappingDetails', 'InMageRcm': 'InMageRcmProtectionContainerMappingDetails', 'VMwareCbt': 'VMwareCbtProtectionContainerMappingDetails'} - } - - def __init__( - self, - **kwargs - ): - super(ProtectionContainerMappingProviderSpecificDetails, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2AProtectionContainerMappingDetails(ProtectionContainerMappingProviderSpecificDetails): - """A2A provider specific settings. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param agent_auto_update_status: A value indicating whether the auto update is enabled. - Possible values include: "Disabled", "Enabled". - :type agent_auto_update_status: str or - ~azure.mgmt.recoveryservicessiterecovery.models.AgentAutoUpdateStatus - :param automation_account_arm_id: The automation account arm id. - :type automation_account_arm_id: str - :param schedule_name: The schedule arm name. - :type schedule_name: str - :param job_schedule_name: The job schedule arm name. - :type job_schedule_name: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'agent_auto_update_status': {'key': 'agentAutoUpdateStatus', 'type': 'str'}, - 'automation_account_arm_id': {'key': 'automationAccountArmId', 'type': 'str'}, - 'schedule_name': {'key': 'scheduleName', 'type': 'str'}, - 'job_schedule_name': {'key': 'jobScheduleName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AProtectionContainerMappingDetails, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.agent_auto_update_status = kwargs.get('agent_auto_update_status', None) - self.automation_account_arm_id = kwargs.get('automation_account_arm_id', None) - self.schedule_name = kwargs.get('schedule_name', None) - self.job_schedule_name = kwargs.get('job_schedule_name', None) - - -class A2AProtectionIntentDiskInputDetails(msrest.serialization.Model): - """Azure VM unmanaged disk input details. - - All required parameters must be populated in order to send to Azure. - - :param disk_uri: Required. The disk Uri. - :type disk_uri: str - :param recovery_azure_storage_account_custom_input: The recovery VHD storage account input. - :type recovery_azure_storage_account_custom_input: - ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails - :param primary_staging_storage_account_custom_input: The primary staging storage account input. - :type primary_staging_storage_account_custom_input: - ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails - """ - - _validation = { - 'disk_uri': {'required': True}, - } - - _attribute_map = { - 'disk_uri': {'key': 'diskUri', 'type': 'str'}, - 'recovery_azure_storage_account_custom_input': {'key': 'recoveryAzureStorageAccountCustomInput', 'type': 'StorageAccountCustomDetails'}, - 'primary_staging_storage_account_custom_input': {'key': 'primaryStagingStorageAccountCustomInput', 'type': 'StorageAccountCustomDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AProtectionIntentDiskInputDetails, self).__init__(**kwargs) - self.disk_uri = kwargs['disk_uri'] - self.recovery_azure_storage_account_custom_input = kwargs.get('recovery_azure_storage_account_custom_input', None) - self.primary_staging_storage_account_custom_input = kwargs.get('primary_staging_storage_account_custom_input', None) - - -class A2AProtectionIntentManagedDiskInputDetails(msrest.serialization.Model): - """Azure VM managed disk input details. - - All required parameters must be populated in order to send to Azure. - - :param disk_id: Required. The disk Id. - :type disk_id: str - :param primary_staging_storage_account_custom_input: The primary staging storage account input. - :type primary_staging_storage_account_custom_input: - ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails - :param recovery_resource_group_custom_input: The recovery resource group input. - :type recovery_resource_group_custom_input: - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryResourceGroupCustomDetails - :param recovery_replica_disk_account_type: The replica disk type. Its an optional value and - will be same as source disk type if not user provided. - :type recovery_replica_disk_account_type: str - :param recovery_target_disk_account_type: The target disk type after failover. Its an optional - value and will be same as source disk type if not user provided. - :type recovery_target_disk_account_type: str - :param recovery_disk_encryption_set_id: The recovery disk encryption set Id. - :type recovery_disk_encryption_set_id: str - :param disk_encryption_info: The recovery disk encryption information (for one / single pass - flows). - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo - """ - - _validation = { - 'disk_id': {'required': True}, - } - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'primary_staging_storage_account_custom_input': {'key': 'primaryStagingStorageAccountCustomInput', 'type': 'StorageAccountCustomDetails'}, - 'recovery_resource_group_custom_input': {'key': 'recoveryResourceGroupCustomInput', 'type': 'RecoveryResourceGroupCustomDetails'}, - 'recovery_replica_disk_account_type': {'key': 'recoveryReplicaDiskAccountType', 'type': 'str'}, - 'recovery_target_disk_account_type': {'key': 'recoveryTargetDiskAccountType', 'type': 'str'}, - 'recovery_disk_encryption_set_id': {'key': 'recoveryDiskEncryptionSetId', 'type': 'str'}, - 'disk_encryption_info': {'key': 'diskEncryptionInfo', 'type': 'DiskEncryptionInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AProtectionIntentManagedDiskInputDetails, self).__init__(**kwargs) - self.disk_id = kwargs['disk_id'] - self.primary_staging_storage_account_custom_input = kwargs.get('primary_staging_storage_account_custom_input', None) - self.recovery_resource_group_custom_input = kwargs.get('recovery_resource_group_custom_input', None) - self.recovery_replica_disk_account_type = kwargs.get('recovery_replica_disk_account_type', None) - self.recovery_target_disk_account_type = kwargs.get('recovery_target_disk_account_type', None) - self.recovery_disk_encryption_set_id = kwargs.get('recovery_disk_encryption_set_id', None) - self.disk_encryption_info = kwargs.get('disk_encryption_info', None) - - -class ProviderSpecificRecoveryPointDetails(msrest.serialization.Model): - """Replication provider specific recovery point details. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2ARecoveryPointDetails, InMageAzureV2RecoveryPointDetails, InMageRcmRecoveryPointDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the provider type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2ARecoveryPointDetails', 'InMageAzureV2': 'InMageAzureV2RecoveryPointDetails', 'InMageRcm': 'InMageRcmRecoveryPointDetails'} - } - - def __init__( - self, - **kwargs - ): - super(ProviderSpecificRecoveryPointDetails, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2ARecoveryPointDetails(ProviderSpecificRecoveryPointDetails): - """A2A provider specific recovery point details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the provider type.Constant filled by server. - :type instance_type: str - :param recovery_point_sync_type: A value indicating whether the recovery point is multi VM - consistent. Possible values include: "MultiVmSyncRecoveryPoint", "PerVmRecoveryPoint". - :type recovery_point_sync_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointSyncType - :param disks: List of disk ids representing a recovery point. - :type disks: list[str] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_sync_type': {'key': 'recoveryPointSyncType', 'type': 'str'}, - 'disks': {'key': 'disks', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(A2ARecoveryPointDetails, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.recovery_point_sync_type = kwargs.get('recovery_point_sync_type', None) - self.disks = kwargs.get('disks', None) - - -class RemoveDisksProviderSpecificInput(msrest.serialization.Model): - """Remove Disk provider specific input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2ARemoveDisksInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2ARemoveDisksInput'} - } - - def __init__( - self, - **kwargs - ): - super(RemoveDisksProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2ARemoveDisksInput(RemoveDisksProviderSpecificInput): - """A2A remove disk(s) input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param vm_disks_uris: The list of vm disk vhd URIs. - :type vm_disks_uris: list[str] - :param vm_managed_disks_ids: The list of vm managed disk Ids. - :type vm_managed_disks_ids: list[str] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'vm_disks_uris': {'key': 'vmDisksUris', 'type': '[str]'}, - 'vm_managed_disks_ids': {'key': 'vmManagedDisksIds', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(A2ARemoveDisksInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.vm_disks_uris = kwargs.get('vm_disks_uris', None) - self.vm_managed_disks_ids = kwargs.get('vm_managed_disks_ids', None) - - -class A2AReplicationDetails(ReplicationProviderSpecificSettings): - """A2A provider specific settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param fabric_object_id: The fabric specific object Id of the virtual machine. - :type fabric_object_id: str - :ivar initial_primary_zone: The initial primary availability zone. - :vartype initial_primary_zone: str - :ivar initial_primary_fabric_location: The initial primary fabric location. - :vartype initial_primary_fabric_location: str - :ivar initial_recovery_zone: The initial recovery availability zone. - :vartype initial_recovery_zone: str - :ivar initial_recovery_fabric_location: The initial recovery fabric location. - :vartype initial_recovery_fabric_location: str - :param multi_vm_group_id: The multi vm group Id. - :type multi_vm_group_id: str - :param multi_vm_group_name: The multi vm group name. - :type multi_vm_group_name: str - :param multi_vm_group_create_option: Whether Multi VM group is auto created or specified by - user. Possible values include: "AutoCreated", "UserSpecified". - :type multi_vm_group_create_option: str or - ~azure.mgmt.recoveryservicessiterecovery.models.MultiVmGroupCreateOption - :param management_id: The management Id. - :type management_id: str - :param protected_disks: The list of protected disks. - :type protected_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectedDiskDetails] - :param unprotected_disks: The list of unprotected disks. - :type unprotected_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.A2AUnprotectedDiskDetails] - :param protected_managed_disks: The list of protected managed disks. - :type protected_managed_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectedManagedDiskDetails] - :param recovery_boot_diag_storage_account_id: The recovery boot diagnostic storage account Arm - Id. - :type recovery_boot_diag_storage_account_id: str - :param primary_fabric_location: Primary fabric location. - :type primary_fabric_location: str - :param recovery_fabric_location: The recovery fabric location. - :type recovery_fabric_location: str - :param os_type: The type of operating system. - :type os_type: str - :param recovery_azure_vm_size: The size of recovery virtual machine. - :type recovery_azure_vm_size: str - :param recovery_azure_vm_name: The name of recovery virtual machine. - :type recovery_azure_vm_name: str - :param recovery_azure_resource_group_id: The recovery resource group. - :type recovery_azure_resource_group_id: str - :param recovery_cloud_service: The recovery cloud service. - :type recovery_cloud_service: str - :param recovery_availability_set: The recovery availability set. - :type recovery_availability_set: str - :param selected_recovery_azure_network_id: The recovery virtual network. - :type selected_recovery_azure_network_id: str - :param selected_tfo_azure_network_id: The test failover virtual network. - :type selected_tfo_azure_network_id: str - :param vm_nics: The virtual machine nic details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] - :param vm_synced_config_details: The synced configuration details. - :type vm_synced_config_details: - ~azure.mgmt.recoveryservicessiterecovery.models.AzureToAzureVmSyncedConfigDetails - :param monitoring_percentage_completion: The percentage of the monitoring job. The type of the - monitoring job is defined by MonitoringJobType property. - :type monitoring_percentage_completion: int - :param monitoring_job_type: The type of the monitoring job. The progress is contained in - MonitoringPercentageCompletion property. - :type monitoring_job_type: str - :param last_heartbeat: The last heartbeat received from the source server. - :type last_heartbeat: ~datetime.datetime - :param agent_version: The agent version. - :type agent_version: str - :param agent_expiry_date: Agent expiry date. - :type agent_expiry_date: ~datetime.datetime - :param is_replication_agent_update_required: A value indicating whether replication agent - update is required. - :type is_replication_agent_update_required: bool - :ivar agent_certificate_expiry_date: Agent certificate expiry date. - :vartype agent_certificate_expiry_date: ~datetime.datetime - :param is_replication_agent_certificate_update_required: A value indicating whether agent - certificate update is required. - :type is_replication_agent_certificate_update_required: bool - :param recovery_fabric_object_id: The recovery fabric object Id. - :type recovery_fabric_object_id: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param lifecycle_id: An id associated with the PE that survives actions like switch protection - which change the backing PE/CPE objects internally.The lifecycle id gets carried forward to - have a link/continuity in being able to have an Id that denotes the "same" protected item even - though other internal Ids/ARM Id might be changing. - :type lifecycle_id: str - :param test_failover_recovery_fabric_object_id: The test failover fabric object Id. - :type test_failover_recovery_fabric_object_id: str - :param rpo_in_seconds: The last RPO value in seconds. - :type rpo_in_seconds: long - :param last_rpo_calculated_time: The time (in UTC) when the last RPO value was calculated by - Protection Service. - :type last_rpo_calculated_time: ~datetime.datetime - :param primary_availability_zone: The primary availability zone. - :type primary_availability_zone: str - :param recovery_availability_zone: The recovery availability zone. - :type recovery_availability_zone: str - :ivar vm_encryption_type: The encryption type of the VM. Possible values include: - "NotEncrypted", "OnePassEncrypted", "TwoPassEncrypted". - :vartype vm_encryption_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.VmEncryptionType - :param tfo_azure_vm_name: The test failover vm name. - :type tfo_azure_vm_name: str - :ivar recovery_azure_generation: The recovery azure generation. - :vartype recovery_azure_generation: str - :param recovery_proximity_placement_group_id: The recovery proximity placement group Id. - :type recovery_proximity_placement_group_id: str - :param auto_protection_of_data_disk: A value indicating whether the auto protection is enabled. - Possible values include: "Disabled", "Enabled". - :type auto_protection_of_data_disk: str or - ~azure.mgmt.recoveryservicessiterecovery.models.AutoProtectionOfDataDisk - :param recovery_virtual_machine_scale_set_id: The recovery virtual machine scale set id. - :type recovery_virtual_machine_scale_set_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'initial_primary_zone': {'readonly': True}, - 'initial_primary_fabric_location': {'readonly': True}, - 'initial_recovery_zone': {'readonly': True}, - 'initial_recovery_fabric_location': {'readonly': True}, - 'agent_certificate_expiry_date': {'readonly': True}, - 'vm_encryption_type': {'readonly': True}, - 'recovery_azure_generation': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'fabric_object_id': {'key': 'fabricObjectId', 'type': 'str'}, - 'initial_primary_zone': {'key': 'initialPrimaryZone', 'type': 'str'}, - 'initial_primary_fabric_location': {'key': 'initialPrimaryFabricLocation', 'type': 'str'}, - 'initial_recovery_zone': {'key': 'initialRecoveryZone', 'type': 'str'}, - 'initial_recovery_fabric_location': {'key': 'initialRecoveryFabricLocation', 'type': 'str'}, - 'multi_vm_group_id': {'key': 'multiVmGroupId', 'type': 'str'}, - 'multi_vm_group_name': {'key': 'multiVmGroupName', 'type': 'str'}, - 'multi_vm_group_create_option': {'key': 'multiVmGroupCreateOption', 'type': 'str'}, - 'management_id': {'key': 'managementId', 'type': 'str'}, - 'protected_disks': {'key': 'protectedDisks', 'type': '[A2AProtectedDiskDetails]'}, - 'unprotected_disks': {'key': 'unprotectedDisks', 'type': '[A2AUnprotectedDiskDetails]'}, - 'protected_managed_disks': {'key': 'protectedManagedDisks', 'type': '[A2AProtectedManagedDiskDetails]'}, - 'recovery_boot_diag_storage_account_id': {'key': 'recoveryBootDiagStorageAccountId', 'type': 'str'}, - 'primary_fabric_location': {'key': 'primaryFabricLocation', 'type': 'str'}, - 'recovery_fabric_location': {'key': 'recoveryFabricLocation', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'recovery_azure_vm_size': {'key': 'recoveryAzureVMSize', 'type': 'str'}, - 'recovery_azure_vm_name': {'key': 'recoveryAzureVMName', 'type': 'str'}, - 'recovery_azure_resource_group_id': {'key': 'recoveryAzureResourceGroupId', 'type': 'str'}, - 'recovery_cloud_service': {'key': 'recoveryCloudService', 'type': 'str'}, - 'recovery_availability_set': {'key': 'recoveryAvailabilitySet', 'type': 'str'}, - 'selected_recovery_azure_network_id': {'key': 'selectedRecoveryAzureNetworkId', 'type': 'str'}, - 'selected_tfo_azure_network_id': {'key': 'selectedTfoAzureNetworkId', 'type': 'str'}, - 'vm_nics': {'key': 'vmNics', 'type': '[VMNicDetails]'}, - 'vm_synced_config_details': {'key': 'vmSyncedConfigDetails', 'type': 'AzureToAzureVmSyncedConfigDetails'}, - 'monitoring_percentage_completion': {'key': 'monitoringPercentageCompletion', 'type': 'int'}, - 'monitoring_job_type': {'key': 'monitoringJobType', 'type': 'str'}, - 'last_heartbeat': {'key': 'lastHeartbeat', 'type': 'iso-8601'}, - 'agent_version': {'key': 'agentVersion', 'type': 'str'}, - 'agent_expiry_date': {'key': 'agentExpiryDate', 'type': 'iso-8601'}, - 'is_replication_agent_update_required': {'key': 'isReplicationAgentUpdateRequired', 'type': 'bool'}, - 'agent_certificate_expiry_date': {'key': 'agentCertificateExpiryDate', 'type': 'iso-8601'}, - 'is_replication_agent_certificate_update_required': {'key': 'isReplicationAgentCertificateUpdateRequired', 'type': 'bool'}, - 'recovery_fabric_object_id': {'key': 'recoveryFabricObjectId', 'type': 'str'}, - 'vm_protection_state': {'key': 'vmProtectionState', 'type': 'str'}, - 'vm_protection_state_description': {'key': 'vmProtectionStateDescription', 'type': 'str'}, - 'lifecycle_id': {'key': 'lifecycleId', 'type': 'str'}, - 'test_failover_recovery_fabric_object_id': {'key': 'testFailoverRecoveryFabricObjectId', 'type': 'str'}, - 'rpo_in_seconds': {'key': 'rpoInSeconds', 'type': 'long'}, - 'last_rpo_calculated_time': {'key': 'lastRpoCalculatedTime', 'type': 'iso-8601'}, - 'primary_availability_zone': {'key': 'primaryAvailabilityZone', 'type': 'str'}, - 'recovery_availability_zone': {'key': 'recoveryAvailabilityZone', 'type': 'str'}, - 'vm_encryption_type': {'key': 'vmEncryptionType', 'type': 'str'}, - 'tfo_azure_vm_name': {'key': 'tfoAzureVMName', 'type': 'str'}, - 'recovery_azure_generation': {'key': 'recoveryAzureGeneration', 'type': 'str'}, - 'recovery_proximity_placement_group_id': {'key': 'recoveryProximityPlacementGroupId', 'type': 'str'}, - 'auto_protection_of_data_disk': {'key': 'autoProtectionOfDataDisk', 'type': 'str'}, - 'recovery_virtual_machine_scale_set_id': {'key': 'recoveryVirtualMachineScaleSetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AReplicationDetails, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.fabric_object_id = kwargs.get('fabric_object_id', None) - self.initial_primary_zone = None - self.initial_primary_fabric_location = None - self.initial_recovery_zone = None - self.initial_recovery_fabric_location = None - self.multi_vm_group_id = kwargs.get('multi_vm_group_id', None) - self.multi_vm_group_name = kwargs.get('multi_vm_group_name', None) - self.multi_vm_group_create_option = kwargs.get('multi_vm_group_create_option', None) - self.management_id = kwargs.get('management_id', None) - self.protected_disks = kwargs.get('protected_disks', None) - self.unprotected_disks = kwargs.get('unprotected_disks', None) - self.protected_managed_disks = kwargs.get('protected_managed_disks', None) - self.recovery_boot_diag_storage_account_id = kwargs.get('recovery_boot_diag_storage_account_id', None) - self.primary_fabric_location = kwargs.get('primary_fabric_location', None) - self.recovery_fabric_location = kwargs.get('recovery_fabric_location', None) - self.os_type = kwargs.get('os_type', None) - self.recovery_azure_vm_size = kwargs.get('recovery_azure_vm_size', None) - self.recovery_azure_vm_name = kwargs.get('recovery_azure_vm_name', None) - self.recovery_azure_resource_group_id = kwargs.get('recovery_azure_resource_group_id', None) - self.recovery_cloud_service = kwargs.get('recovery_cloud_service', None) - self.recovery_availability_set = kwargs.get('recovery_availability_set', None) - self.selected_recovery_azure_network_id = kwargs.get('selected_recovery_azure_network_id', None) - self.selected_tfo_azure_network_id = kwargs.get('selected_tfo_azure_network_id', None) - self.vm_nics = kwargs.get('vm_nics', None) - self.vm_synced_config_details = kwargs.get('vm_synced_config_details', None) - self.monitoring_percentage_completion = kwargs.get('monitoring_percentage_completion', None) - self.monitoring_job_type = kwargs.get('monitoring_job_type', None) - self.last_heartbeat = kwargs.get('last_heartbeat', None) - self.agent_version = kwargs.get('agent_version', None) - self.agent_expiry_date = kwargs.get('agent_expiry_date', None) - self.is_replication_agent_update_required = kwargs.get('is_replication_agent_update_required', None) - self.agent_certificate_expiry_date = None - self.is_replication_agent_certificate_update_required = kwargs.get('is_replication_agent_certificate_update_required', None) - self.recovery_fabric_object_id = kwargs.get('recovery_fabric_object_id', None) - self.vm_protection_state = kwargs.get('vm_protection_state', None) - self.vm_protection_state_description = kwargs.get('vm_protection_state_description', None) - self.lifecycle_id = kwargs.get('lifecycle_id', None) - self.test_failover_recovery_fabric_object_id = kwargs.get('test_failover_recovery_fabric_object_id', None) - self.rpo_in_seconds = kwargs.get('rpo_in_seconds', None) - self.last_rpo_calculated_time = kwargs.get('last_rpo_calculated_time', None) - self.primary_availability_zone = kwargs.get('primary_availability_zone', None) - self.recovery_availability_zone = kwargs.get('recovery_availability_zone', None) - self.vm_encryption_type = None - self.tfo_azure_vm_name = kwargs.get('tfo_azure_vm_name', None) - self.recovery_azure_generation = None - self.recovery_proximity_placement_group_id = kwargs.get('recovery_proximity_placement_group_id', None) - self.auto_protection_of_data_disk = kwargs.get('auto_protection_of_data_disk', None) - self.recovery_virtual_machine_scale_set_id = kwargs.get('recovery_virtual_machine_scale_set_id', None) - - -class ReplicationProtectionIntentProviderSpecificSettings(msrest.serialization.Model): - """Replication provider specific settings. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2AReplicationIntentDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2AReplicationIntentDetails'} - } - - def __init__( - self, - **kwargs - ): - super(ReplicationProtectionIntentProviderSpecificSettings, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2AReplicationIntentDetails(ReplicationProtectionIntentProviderSpecificSettings): - """A2A provider specific settings. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param fabric_object_id: The fabric specific object Id of the virtual machine. - :type fabric_object_id: str - :param primary_location: The primary location for the virtual machine. - :type primary_location: str - :param recovery_location: The recovery location for the virtual machine. - :type recovery_location: str - :param recovery_subscription_id: The recovery subscription Id of the virtual machine. - :type recovery_subscription_id: str - :param vm_disks: The list of vm disk details. - :type vm_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectionIntentDiskInputDetails] - :param vm_managed_disks: The list of vm managed disk details. - :type vm_managed_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectionIntentManagedDiskInputDetails] - :param recovery_resource_group_id: The recovery resource group id. - :type recovery_resource_group_id: str - :param protection_profile: The protection profile custom details. - :type protection_profile: - ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionProfileCustomDetails - :param primary_staging_storage_account: The primary staging storage account details. - :type primary_staging_storage_account: - ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails - :param recovery_availability_set: The recovery availability set details. - :type recovery_availability_set: - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryAvailabilitySetCustomDetails - :param recovery_virtual_network: The recovery virtual network details. - :type recovery_virtual_network: - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryVirtualNetworkCustomDetails - :param recovery_proximity_placement_group: The recovery proximity placement group custom - details. - :type recovery_proximity_placement_group: - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryProximityPlacementGroupCustomDetails - :param auto_protection_of_data_disk: A value indicating whether the auto protection is enabled. - Possible values include: "Disabled", "Enabled". - :type auto_protection_of_data_disk: str or - ~azure.mgmt.recoveryservicessiterecovery.models.AutoProtectionOfDataDisk - :param multi_vm_group_name: The multi vm group name. - :type multi_vm_group_name: str - :param multi_vm_group_id: The multi vm group id. - :type multi_vm_group_id: str - :param recovery_boot_diag_storage_account: The boot diagnostic storage account. - :type recovery_boot_diag_storage_account: - ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails - :param disk_encryption_info: The recovery disk encryption information (for two pass flows). - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo - :param recovery_availability_zone: The recovery availability zone. - :type recovery_availability_zone: str - :param recovery_availability_type: Required. The recovery availability type of the virtual - machine. - :type recovery_availability_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'recovery_availability_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'fabric_object_id': {'key': 'fabricObjectId', 'type': 'str'}, - 'primary_location': {'key': 'primaryLocation', 'type': 'str'}, - 'recovery_location': {'key': 'recoveryLocation', 'type': 'str'}, - 'recovery_subscription_id': {'key': 'recoverySubscriptionId', 'type': 'str'}, - 'vm_disks': {'key': 'vmDisks', 'type': '[A2AProtectionIntentDiskInputDetails]'}, - 'vm_managed_disks': {'key': 'vmManagedDisks', 'type': '[A2AProtectionIntentManagedDiskInputDetails]'}, - 'recovery_resource_group_id': {'key': 'recoveryResourceGroupId', 'type': 'str'}, - 'protection_profile': {'key': 'protectionProfile', 'type': 'ProtectionProfileCustomDetails'}, - 'primary_staging_storage_account': {'key': 'primaryStagingStorageAccount', 'type': 'StorageAccountCustomDetails'}, - 'recovery_availability_set': {'key': 'recoveryAvailabilitySet', 'type': 'RecoveryAvailabilitySetCustomDetails'}, - 'recovery_virtual_network': {'key': 'recoveryVirtualNetwork', 'type': 'RecoveryVirtualNetworkCustomDetails'}, - 'recovery_proximity_placement_group': {'key': 'recoveryProximityPlacementGroup', 'type': 'RecoveryProximityPlacementGroupCustomDetails'}, - 'auto_protection_of_data_disk': {'key': 'autoProtectionOfDataDisk', 'type': 'str'}, - 'multi_vm_group_name': {'key': 'multiVmGroupName', 'type': 'str'}, - 'multi_vm_group_id': {'key': 'multiVmGroupId', 'type': 'str'}, - 'recovery_boot_diag_storage_account': {'key': 'recoveryBootDiagStorageAccount', 'type': 'StorageAccountCustomDetails'}, - 'disk_encryption_info': {'key': 'diskEncryptionInfo', 'type': 'DiskEncryptionInfo'}, - 'recovery_availability_zone': {'key': 'recoveryAvailabilityZone', 'type': 'str'}, - 'recovery_availability_type': {'key': 'recoveryAvailabilityType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AReplicationIntentDetails, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.fabric_object_id = kwargs.get('fabric_object_id', None) - self.primary_location = kwargs.get('primary_location', None) - self.recovery_location = kwargs.get('recovery_location', None) - self.recovery_subscription_id = kwargs.get('recovery_subscription_id', None) - self.vm_disks = kwargs.get('vm_disks', None) - self.vm_managed_disks = kwargs.get('vm_managed_disks', None) - self.recovery_resource_group_id = kwargs.get('recovery_resource_group_id', None) - self.protection_profile = kwargs.get('protection_profile', None) - self.primary_staging_storage_account = kwargs.get('primary_staging_storage_account', None) - self.recovery_availability_set = kwargs.get('recovery_availability_set', None) - self.recovery_virtual_network = kwargs.get('recovery_virtual_network', None) - self.recovery_proximity_placement_group = kwargs.get('recovery_proximity_placement_group', None) - self.auto_protection_of_data_disk = kwargs.get('auto_protection_of_data_disk', None) - self.multi_vm_group_name = kwargs.get('multi_vm_group_name', None) - self.multi_vm_group_id = kwargs.get('multi_vm_group_id', None) - self.recovery_boot_diag_storage_account = kwargs.get('recovery_boot_diag_storage_account', None) - self.disk_encryption_info = kwargs.get('disk_encryption_info', None) - self.recovery_availability_zone = kwargs.get('recovery_availability_zone', None) - self.recovery_availability_type = kwargs['recovery_availability_type'] - - -class ReverseReplicationProviderSpecificInput(msrest.serialization.Model): - """Provider specific reverse replication input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2AReprotectInput, HyperVReplicaAzureReprotectInput, InMageReprotectInput, InMageAzureV2ReprotectInput, InMageRcmReprotectInput, InMageRcmFailbackReprotectInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2AReprotectInput', 'HyperVReplicaAzure': 'HyperVReplicaAzureReprotectInput', 'InMage': 'InMageReprotectInput', 'InMageAzureV2': 'InMageAzureV2ReprotectInput', 'InMageRcm': 'InMageRcmReprotectInput', 'InMageRcmFailback': 'InMageRcmFailbackReprotectInput'} - } - - def __init__( - self, - **kwargs - ): - super(ReverseReplicationProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2AReprotectInput(ReverseReplicationProviderSpecificInput): - """Azure specific reprotect input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_container_id: The recovery container Id. - :type recovery_container_id: str - :param vm_disks: The list of vm disk details. - :type vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] - :param recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. - :type recovery_resource_group_id: str - :param recovery_cloud_service_id: The recovery cloud service Id. Valid for V1 scenarios. - :type recovery_cloud_service_id: str - :param recovery_availability_set_id: The recovery availability set. - :type recovery_availability_set_id: str - :param policy_id: The Policy Id. - :type policy_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_container_id': {'key': 'recoveryContainerId', 'type': 'str'}, - 'vm_disks': {'key': 'vmDisks', 'type': '[A2AVmDiskInputDetails]'}, - 'recovery_resource_group_id': {'key': 'recoveryResourceGroupId', 'type': 'str'}, - 'recovery_cloud_service_id': {'key': 'recoveryCloudServiceId', 'type': 'str'}, - 'recovery_availability_set_id': {'key': 'recoveryAvailabilitySetId', 'type': 'str'}, - 'policy_id': {'key': 'policyId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AReprotectInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.recovery_container_id = kwargs.get('recovery_container_id', None) - self.vm_disks = kwargs.get('vm_disks', None) - self.recovery_resource_group_id = kwargs.get('recovery_resource_group_id', None) - self.recovery_cloud_service_id = kwargs.get('recovery_cloud_service_id', None) - self.recovery_availability_set_id = kwargs.get('recovery_availability_set_id', None) - self.policy_id = kwargs.get('policy_id', None) - - -class SwitchProtectionProviderSpecificInput(msrest.serialization.Model): - """Provider specific switch protection input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2ASwitchProtectionInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2ASwitchProtectionInput'} - } - - def __init__( - self, - **kwargs - ): - super(SwitchProtectionProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2ASwitchProtectionInput(SwitchProtectionProviderSpecificInput): - """A2A specific switch protection input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param recovery_container_id: The recovery container Id. - :type recovery_container_id: str - :param vm_disks: The list of vm disk details. - :type vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] - :param vm_managed_disks: The list of vm managed disk details. - :type vm_managed_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmManagedDiskInputDetails] - :param recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. - :type recovery_resource_group_id: str - :param recovery_cloud_service_id: The recovery cloud service Id. Valid for V1 scenarios. - :type recovery_cloud_service_id: str - :param recovery_availability_set_id: The recovery availability set. - :type recovery_availability_set_id: str - :param policy_id: The Policy Id. - :type policy_id: str - :param recovery_boot_diag_storage_account_id: The boot diagnostic storage account. - :type recovery_boot_diag_storage_account_id: str - :param recovery_availability_zone: The recovery availability zone. - :type recovery_availability_zone: str - :param recovery_proximity_placement_group_id: The recovery proximity placement group Id. - :type recovery_proximity_placement_group_id: str - :param recovery_virtual_machine_scale_set_id: The virtual machine scale set id. - :type recovery_virtual_machine_scale_set_id: str - :param disk_encryption_info: The recovery disk encryption information. - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_container_id': {'key': 'recoveryContainerId', 'type': 'str'}, - 'vm_disks': {'key': 'vmDisks', 'type': '[A2AVmDiskInputDetails]'}, - 'vm_managed_disks': {'key': 'vmManagedDisks', 'type': '[A2AVmManagedDiskInputDetails]'}, - 'recovery_resource_group_id': {'key': 'recoveryResourceGroupId', 'type': 'str'}, - 'recovery_cloud_service_id': {'key': 'recoveryCloudServiceId', 'type': 'str'}, - 'recovery_availability_set_id': {'key': 'recoveryAvailabilitySetId', 'type': 'str'}, - 'policy_id': {'key': 'policyId', 'type': 'str'}, - 'recovery_boot_diag_storage_account_id': {'key': 'recoveryBootDiagStorageAccountId', 'type': 'str'}, - 'recovery_availability_zone': {'key': 'recoveryAvailabilityZone', 'type': 'str'}, - 'recovery_proximity_placement_group_id': {'key': 'recoveryProximityPlacementGroupId', 'type': 'str'}, - 'recovery_virtual_machine_scale_set_id': {'key': 'recoveryVirtualMachineScaleSetId', 'type': 'str'}, - 'disk_encryption_info': {'key': 'diskEncryptionInfo', 'type': 'DiskEncryptionInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(A2ASwitchProtectionInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.recovery_container_id = kwargs.get('recovery_container_id', None) - self.vm_disks = kwargs.get('vm_disks', None) - self.vm_managed_disks = kwargs.get('vm_managed_disks', None) - self.recovery_resource_group_id = kwargs.get('recovery_resource_group_id', None) - self.recovery_cloud_service_id = kwargs.get('recovery_cloud_service_id', None) - self.recovery_availability_set_id = kwargs.get('recovery_availability_set_id', None) - self.policy_id = kwargs.get('policy_id', None) - self.recovery_boot_diag_storage_account_id = kwargs.get('recovery_boot_diag_storage_account_id', None) - self.recovery_availability_zone = kwargs.get('recovery_availability_zone', None) - self.recovery_proximity_placement_group_id = kwargs.get('recovery_proximity_placement_group_id', None) - self.recovery_virtual_machine_scale_set_id = kwargs.get('recovery_virtual_machine_scale_set_id', None) - self.disk_encryption_info = kwargs.get('disk_encryption_info', None) - - -class TestFailoverProviderSpecificInput(msrest.serialization.Model): - """Provider specific test failover input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2ATestFailoverInput, HyperVReplicaAzureTestFailoverInput, InMageTestFailoverInput, InMageAzureV2TestFailoverInput, InMageRcmTestFailoverInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2ATestFailoverInput', 'HyperVReplicaAzure': 'HyperVReplicaAzureTestFailoverInput', 'InMage': 'InMageTestFailoverInput', 'InMageAzureV2': 'InMageAzureV2TestFailoverInput', 'InMageRcm': 'InMageRcmTestFailoverInput'} - } - - def __init__( - self, - **kwargs - ): - super(TestFailoverProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2ATestFailoverInput(TestFailoverProviderSpecificInput): - """A2A provider specific input for test failover. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_id: The recovery point id to be passed to test failover to a particular - recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str - :param cloud_service_creation_option: A value indicating whether to use recovery cloud service - for TFO or not. - :type cloud_service_creation_option: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - 'cloud_service_creation_option': {'key': 'cloudServiceCreationOption', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2ATestFailoverInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.recovery_point_id = kwargs.get('recovery_point_id', None) - self.cloud_service_creation_option = kwargs.get('cloud_service_creation_option', None) - - -class UnplannedFailoverProviderSpecificInput(msrest.serialization.Model): - """Provider specific unplanned failover input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2AUnplannedFailoverInput, HyperVReplicaAzureUnplannedFailoverInput, InMageUnplannedFailoverInput, InMageAzureV2UnplannedFailoverInput, InMageRcmUnplannedFailoverInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2AUnplannedFailoverInput', 'HyperVReplicaAzure': 'HyperVReplicaAzureUnplannedFailoverInput', 'InMage': 'InMageUnplannedFailoverInput', 'InMageAzureV2': 'InMageAzureV2UnplannedFailoverInput', 'InMageRcm': 'InMageRcmUnplannedFailoverInput'} - } - - def __init__( - self, - **kwargs - ): - super(UnplannedFailoverProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2AUnplannedFailoverInput(UnplannedFailoverProviderSpecificInput): - """A2A provider specific input for unplanned failover. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_id: The recovery point id to be passed to failover to a particular - recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str - :param cloud_service_creation_option: A value indicating whether to use recovery cloud service - for failover or not. - :type cloud_service_creation_option: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - 'cloud_service_creation_option': {'key': 'cloudServiceCreationOption', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AUnplannedFailoverInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.recovery_point_id = kwargs.get('recovery_point_id', None) - self.cloud_service_creation_option = kwargs.get('cloud_service_creation_option', None) - - -class A2AUnprotectedDiskDetails(msrest.serialization.Model): - """A2A unprotected disk details. - - :param disk_lun_id: The source lun Id for the data disk. - :type disk_lun_id: int - :param disk_auto_protection_status: A value indicating whether the disk auto protection is - enabled. Possible values include: "Disabled", "Enabled". - :type disk_auto_protection_status: str or - ~azure.mgmt.recoveryservicessiterecovery.models.AutoProtectionOfDataDisk - """ - - _attribute_map = { - 'disk_lun_id': {'key': 'diskLunId', 'type': 'int'}, - 'disk_auto_protection_status': {'key': 'diskAutoProtectionStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AUnprotectedDiskDetails, self).__init__(**kwargs) - self.disk_lun_id = kwargs.get('disk_lun_id', None) - self.disk_auto_protection_status = kwargs.get('disk_auto_protection_status', None) - - -class ReplicationProviderSpecificUpdateContainerMappingInput(msrest.serialization.Model): - """Provider specific input for update pairing operations. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2AUpdateContainerMappingInput, InMageRcmUpdateContainerMappingInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2AUpdateContainerMappingInput', 'InMageRcm': 'InMageRcmUpdateContainerMappingInput'} - } - - def __init__( - self, - **kwargs - ): - super(ReplicationProviderSpecificUpdateContainerMappingInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2AUpdateContainerMappingInput(ReplicationProviderSpecificUpdateContainerMappingInput): - """A2A update protection container mapping. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param agent_auto_update_status: A value indicating whether the auto update is enabled. - Possible values include: "Disabled", "Enabled". - :type agent_auto_update_status: str or - ~azure.mgmt.recoveryservicessiterecovery.models.AgentAutoUpdateStatus - :param automation_account_arm_id: The automation account arm id. - :type automation_account_arm_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'agent_auto_update_status': {'key': 'agentAutoUpdateStatus', 'type': 'str'}, - 'automation_account_arm_id': {'key': 'automationAccountArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AUpdateContainerMappingInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.agent_auto_update_status = kwargs.get('agent_auto_update_status', None) - self.automation_account_arm_id = kwargs.get('automation_account_arm_id', None) - - -class UpdateReplicationProtectedItemProviderInput(msrest.serialization.Model): - """Update replication protected item provider specific input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: A2AUpdateReplicationProtectedItemInput, HyperVReplicaAzureUpdateReplicationProtectedItemInput, InMageAzureV2UpdateReplicationProtectedItemInput, InMageRcmUpdateReplicationProtectedItemInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'A2AUpdateReplicationProtectedItemInput', 'HyperVReplicaAzure': 'HyperVReplicaAzureUpdateReplicationProtectedItemInput', 'InMageAzureV2': 'InMageAzureV2UpdateReplicationProtectedItemInput', 'InMageRcm': 'InMageRcmUpdateReplicationProtectedItemInput'} - } - - def __init__( - self, - **kwargs - ): - super(UpdateReplicationProtectedItemProviderInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class A2AUpdateReplicationProtectedItemInput(UpdateReplicationProtectedItemProviderInput): - """InMage Azure V2 input to update replication protected item. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_cloud_service_id: The target cloud service ARM Id (for V1). - :type recovery_cloud_service_id: str - :param recovery_resource_group_id: The target resource group ARM Id (for V2). - :type recovery_resource_group_id: str - :param managed_disk_update_details: Managed disk update details. - :type managed_disk_update_details: - list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmManagedDiskUpdateDetails] - :param recovery_boot_diag_storage_account_id: The boot diagnostic storage account. - :type recovery_boot_diag_storage_account_id: str - :param disk_encryption_info: The recovery os disk encryption information. - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo - :param tfo_azure_vm_name: The user given name for Test Failover VM. - :type tfo_azure_vm_name: str - :param recovery_proximity_placement_group_id: The recovery proximity placement group Id. - :type recovery_proximity_placement_group_id: str - :param recovery_virtual_machine_scale_set_id: The recovery virtual machine scale set Id. - :type recovery_virtual_machine_scale_set_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_cloud_service_id': {'key': 'recoveryCloudServiceId', 'type': 'str'}, - 'recovery_resource_group_id': {'key': 'recoveryResourceGroupId', 'type': 'str'}, - 'managed_disk_update_details': {'key': 'managedDiskUpdateDetails', 'type': '[A2AVmManagedDiskUpdateDetails]'}, - 'recovery_boot_diag_storage_account_id': {'key': 'recoveryBootDiagStorageAccountId', 'type': 'str'}, - 'disk_encryption_info': {'key': 'diskEncryptionInfo', 'type': 'DiskEncryptionInfo'}, - 'tfo_azure_vm_name': {'key': 'tfoAzureVMName', 'type': 'str'}, - 'recovery_proximity_placement_group_id': {'key': 'recoveryProximityPlacementGroupId', 'type': 'str'}, - 'recovery_virtual_machine_scale_set_id': {'key': 'recoveryVirtualMachineScaleSetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AUpdateReplicationProtectedItemInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.recovery_cloud_service_id = kwargs.get('recovery_cloud_service_id', None) - self.recovery_resource_group_id = kwargs.get('recovery_resource_group_id', None) - self.managed_disk_update_details = kwargs.get('managed_disk_update_details', None) - self.recovery_boot_diag_storage_account_id = kwargs.get('recovery_boot_diag_storage_account_id', None) - self.disk_encryption_info = kwargs.get('disk_encryption_info', None) - self.tfo_azure_vm_name = kwargs.get('tfo_azure_vm_name', None) - self.recovery_proximity_placement_group_id = kwargs.get('recovery_proximity_placement_group_id', None) - self.recovery_virtual_machine_scale_set_id = kwargs.get('recovery_virtual_machine_scale_set_id', None) - - -class A2AVmDiskInputDetails(msrest.serialization.Model): - """A2A disk input details. - - All required parameters must be populated in order to send to Azure. - - :param disk_uri: Required. The disk Uri. - :type disk_uri: str - :param recovery_azure_storage_account_id: Required. The recovery VHD storage account Id. - :type recovery_azure_storage_account_id: str - :param primary_staging_azure_storage_account_id: Required. The primary staging storage account - Id. - :type primary_staging_azure_storage_account_id: str - """ - - _validation = { - 'disk_uri': {'required': True}, - 'recovery_azure_storage_account_id': {'required': True}, - 'primary_staging_azure_storage_account_id': {'required': True}, - } - - _attribute_map = { - 'disk_uri': {'key': 'diskUri', 'type': 'str'}, - 'recovery_azure_storage_account_id': {'key': 'recoveryAzureStorageAccountId', 'type': 'str'}, - 'primary_staging_azure_storage_account_id': {'key': 'primaryStagingAzureStorageAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AVmDiskInputDetails, self).__init__(**kwargs) - self.disk_uri = kwargs['disk_uri'] - self.recovery_azure_storage_account_id = kwargs['recovery_azure_storage_account_id'] - self.primary_staging_azure_storage_account_id = kwargs['primary_staging_azure_storage_account_id'] - - -class A2AVmManagedDiskInputDetails(msrest.serialization.Model): - """A2A managed disk input details. - - All required parameters must be populated in order to send to Azure. - - :param disk_id: Required. The disk Id. - :type disk_id: str - :param primary_staging_azure_storage_account_id: Required. The primary staging storage account - Arm Id. - :type primary_staging_azure_storage_account_id: str - :param recovery_resource_group_id: Required. The target resource group Arm Id. - :type recovery_resource_group_id: str - :param recovery_replica_disk_account_type: The replica disk type. Its an optional value and - will be same as source disk type if not user provided. - :type recovery_replica_disk_account_type: str - :param recovery_target_disk_account_type: The target disk type after failover. Its an optional - value and will be same as source disk type if not user provided. - :type recovery_target_disk_account_type: str - :param recovery_disk_encryption_set_id: The recovery disk encryption set Id. - :type recovery_disk_encryption_set_id: str - :param disk_encryption_info: The recovery disk encryption information (for one / single pass - flows). - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo - """ - - _validation = { - 'disk_id': {'required': True}, - 'primary_staging_azure_storage_account_id': {'required': True}, - 'recovery_resource_group_id': {'required': True}, - } - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'primary_staging_azure_storage_account_id': {'key': 'primaryStagingAzureStorageAccountId', 'type': 'str'}, - 'recovery_resource_group_id': {'key': 'recoveryResourceGroupId', 'type': 'str'}, - 'recovery_replica_disk_account_type': {'key': 'recoveryReplicaDiskAccountType', 'type': 'str'}, - 'recovery_target_disk_account_type': {'key': 'recoveryTargetDiskAccountType', 'type': 'str'}, - 'recovery_disk_encryption_set_id': {'key': 'recoveryDiskEncryptionSetId', 'type': 'str'}, - 'disk_encryption_info': {'key': 'diskEncryptionInfo', 'type': 'DiskEncryptionInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AVmManagedDiskInputDetails, self).__init__(**kwargs) - self.disk_id = kwargs['disk_id'] - self.primary_staging_azure_storage_account_id = kwargs['primary_staging_azure_storage_account_id'] - self.recovery_resource_group_id = kwargs['recovery_resource_group_id'] - self.recovery_replica_disk_account_type = kwargs.get('recovery_replica_disk_account_type', None) - self.recovery_target_disk_account_type = kwargs.get('recovery_target_disk_account_type', None) - self.recovery_disk_encryption_set_id = kwargs.get('recovery_disk_encryption_set_id', None) - self.disk_encryption_info = kwargs.get('disk_encryption_info', None) - - -class A2AVmManagedDiskUpdateDetails(msrest.serialization.Model): - """A2A Vm managed disk update details. - - :param disk_id: The disk Id. - :type disk_id: str - :param recovery_target_disk_account_type: The target disk type before failover. - :type recovery_target_disk_account_type: str - :param recovery_replica_disk_account_type: The replica disk type before failover. - :type recovery_replica_disk_account_type: str - :param disk_encryption_info: The recovery os disk encryption information. - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo - :param failover_disk_name: The target disk name for unplanned failover operation. - :type failover_disk_name: str - :param tfo_disk_name: The target disk name for test failover operation. - :type tfo_disk_name: str - """ - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'recovery_target_disk_account_type': {'key': 'recoveryTargetDiskAccountType', 'type': 'str'}, - 'recovery_replica_disk_account_type': {'key': 'recoveryReplicaDiskAccountType', 'type': 'str'}, - 'disk_encryption_info': {'key': 'diskEncryptionInfo', 'type': 'DiskEncryptionInfo'}, - 'failover_disk_name': {'key': 'failoverDiskName', 'type': 'str'}, - 'tfo_disk_name': {'key': 'tfoDiskName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AVmManagedDiskUpdateDetails, self).__init__(**kwargs) - self.disk_id = kwargs.get('disk_id', None) - self.recovery_target_disk_account_type = kwargs.get('recovery_target_disk_account_type', None) - self.recovery_replica_disk_account_type = kwargs.get('recovery_replica_disk_account_type', None) - self.disk_encryption_info = kwargs.get('disk_encryption_info', None) - self.failover_disk_name = kwargs.get('failover_disk_name', None) - self.tfo_disk_name = kwargs.get('tfo_disk_name', None) - - -class A2AZoneDetails(msrest.serialization.Model): - """Zone details data. - - :param source: Source zone info. - :type source: str - :param target: The target zone info. - :type target: str - """ - - _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(A2AZoneDetails, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.target = kwargs.get('target', None) - - -class AddDisksInput(msrest.serialization.Model): - """Input for add disk(s) operation. - - :param properties: Add disks input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.AddDisksInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AddDisksInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(AddDisksInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class AddDisksInputProperties(msrest.serialization.Model): - """Add Disks input properties. - - All required parameters must be populated in order to send to Azure. - - :param provider_specific_details: Required. The ReplicationProviderInput. For - HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it - will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.AddDisksProviderSpecificInput - """ - - _validation = { - 'provider_specific_details': {'required': True}, - } - - _attribute_map = { - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'AddDisksProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(AddDisksInputProperties, self).__init__(**kwargs) - self.provider_specific_details = kwargs['provider_specific_details'] - - -class AddRecoveryServicesProviderInput(msrest.serialization.Model): - """Input required to add a provider. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. The properties of an add provider request. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AddRecoveryServicesProviderInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(AddRecoveryServicesProviderInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class AddRecoveryServicesProviderInputProperties(msrest.serialization.Model): - """The properties of an add provider request. - - All required parameters must be populated in order to send to Azure. - - :param machine_name: Required. The name of the machine where the provider is getting added. - :type machine_name: str - :param machine_id: The Id of the machine where the provider is getting added. - :type machine_id: str - :param bios_id: The Bios Id of the machine. - :type bios_id: str - :param authentication_identity_input: Required. The identity provider input for DRA - authentication. - :type authentication_identity_input: - ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderInput - :param resource_access_identity_input: Required. The identity provider input for resource - access. - :type resource_access_identity_input: - ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderInput - :param data_plane_authentication_identity_input: The identity provider input for data plane - authentication. - :type data_plane_authentication_identity_input: - ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderInput - """ - - _validation = { - 'machine_name': {'required': True}, - 'authentication_identity_input': {'required': True}, - 'resource_access_identity_input': {'required': True}, - } - - _attribute_map = { - 'machine_name': {'key': 'machineName', 'type': 'str'}, - 'machine_id': {'key': 'machineId', 'type': 'str'}, - 'bios_id': {'key': 'biosId', 'type': 'str'}, - 'authentication_identity_input': {'key': 'authenticationIdentityInput', 'type': 'IdentityProviderInput'}, - 'resource_access_identity_input': {'key': 'resourceAccessIdentityInput', 'type': 'IdentityProviderInput'}, - 'data_plane_authentication_identity_input': {'key': 'dataPlaneAuthenticationIdentityInput', 'type': 'IdentityProviderInput'}, - } - - def __init__( - self, - **kwargs - ): - super(AddRecoveryServicesProviderInputProperties, self).__init__(**kwargs) - self.machine_name = kwargs['machine_name'] - self.machine_id = kwargs.get('machine_id', None) - self.bios_id = kwargs.get('bios_id', None) - self.authentication_identity_input = kwargs['authentication_identity_input'] - self.resource_access_identity_input = kwargs['resource_access_identity_input'] - self.data_plane_authentication_identity_input = kwargs.get('data_plane_authentication_identity_input', None) - - -class AddVCenterRequest(msrest.serialization.Model): - """Input required to add vCenter. - - :param properties: The properties of an add vCenter request. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.AddVCenterRequestProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'AddVCenterRequestProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(AddVCenterRequest, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class AddVCenterRequestProperties(msrest.serialization.Model): - """The properties of an add vCenter request. - - :param friendly_name: The friendly name of the vCenter. - :type friendly_name: str - :param ip_address: The IP address of the vCenter to be discovered. - :type ip_address: str - :param process_server_id: The process server Id from where the discovery is orchestrated. - :type process_server_id: str - :param port: The port number for discovery. - :type port: str - :param run_as_account_id: The account Id which has privileges to discover the vCenter. - :type run_as_account_id: str - """ - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'process_server_id': {'key': 'processServerId', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'str'}, - 'run_as_account_id': {'key': 'runAsAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AddVCenterRequestProperties, self).__init__(**kwargs) - self.friendly_name = kwargs.get('friendly_name', None) - self.ip_address = kwargs.get('ip_address', None) - self.process_server_id = kwargs.get('process_server_id', None) - self.port = kwargs.get('port', None) - self.run_as_account_id = kwargs.get('run_as_account_id', None) - - -class AgentDetails(msrest.serialization.Model): - """Agent details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar agent_id: The Id of the agent running on the server. - :vartype agent_id: str - :ivar machine_id: The Id of the machine to which the agent is registered. - :vartype machine_id: str - :ivar bios_id: The machine BIOS Id. - :vartype bios_id: str - :ivar fqdn: The machine FQDN. - :vartype fqdn: str - :ivar disks: The disks. - :vartype disks: list[~azure.mgmt.recoveryservicessiterecovery.models.AgentDiskDetails] - """ - - _validation = { - 'agent_id': {'readonly': True}, - 'machine_id': {'readonly': True}, - 'bios_id': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'disks': {'readonly': True}, - } - - _attribute_map = { - 'agent_id': {'key': 'agentId', 'type': 'str'}, - 'machine_id': {'key': 'machineId', 'type': 'str'}, - 'bios_id': {'key': 'biosId', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'disks': {'key': 'disks', 'type': '[AgentDiskDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentDetails, self).__init__(**kwargs) - self.agent_id = None - self.machine_id = None - self.bios_id = None - self.fqdn = None - self.disks = None - - -class AgentDiskDetails(msrest.serialization.Model): - """Agent disk details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar disk_id: The disk Id. - :vartype disk_id: str - :ivar disk_name: The disk name. - :vartype disk_name: str - :ivar is_os_disk: A value indicating whether the disk is the OS disk. - :vartype is_os_disk: str - :ivar capacity_in_bytes: The disk capacity in bytes. - :vartype capacity_in_bytes: long - :ivar lun_id: The lun of disk. - :vartype lun_id: int - """ - - _validation = { - 'disk_id': {'readonly': True}, - 'disk_name': {'readonly': True}, - 'is_os_disk': {'readonly': True}, - 'capacity_in_bytes': {'readonly': True}, - 'lun_id': {'readonly': True}, - } - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'disk_name': {'key': 'diskName', 'type': 'str'}, - 'is_os_disk': {'key': 'isOSDisk', 'type': 'str'}, - 'capacity_in_bytes': {'key': 'capacityInBytes', 'type': 'long'}, - 'lun_id': {'key': 'lunId', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(AgentDiskDetails, self).__init__(**kwargs) - self.disk_id = None - self.disk_name = None - self.is_os_disk = None - self.capacity_in_bytes = None - self.lun_id = None - - -class Resource(msrest.serialization.Model): - """Azure resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - - -class Alert(Resource): - """Implements the Alert class. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: Alert related data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.AlertProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'AlertProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(Alert, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class AlertCollection(msrest.serialization.Model): - """Collection of alerts. - - :param value: The list of alerts. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.Alert] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Alert]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AlertCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class AlertProperties(msrest.serialization.Model): - """The properties of an alert. - - :param send_to_owners: A value indicating whether to send email to subscription administrator. - :type send_to_owners: str - :param custom_email_addresses: The custom email address for sending emails. - :type custom_email_addresses: list[str] - :param locale: The locale for the email notification. - :type locale: str - """ - - _attribute_map = { - 'send_to_owners': {'key': 'sendToOwners', 'type': 'str'}, - 'custom_email_addresses': {'key': 'customEmailAddresses', 'type': '[str]'}, - 'locale': {'key': 'locale', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AlertProperties, self).__init__(**kwargs) - self.send_to_owners = kwargs.get('send_to_owners', None) - self.custom_email_addresses = kwargs.get('custom_email_addresses', None) - self.locale = kwargs.get('locale', None) - - -class ApplyRecoveryPointInput(msrest.serialization.Model): - """Input to apply recovery point. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. The input properties to apply recovery point. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.ApplyRecoveryPointInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ApplyRecoveryPointInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplyRecoveryPointInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ApplyRecoveryPointInputProperties(msrest.serialization.Model): - """Input properties to apply recovery point. - - All required parameters must be populated in order to send to Azure. - - :param recovery_point_id: The recovery point Id. - :type recovery_point_id: str - :param provider_specific_details: Required. Provider specific input for applying recovery - point. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.ApplyRecoveryPointProviderSpecificInput - """ - - _validation = { - 'provider_specific_details': {'required': True}, - } - - _attribute_map = { - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'ApplyRecoveryPointProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplyRecoveryPointInputProperties, self).__init__(**kwargs) - self.recovery_point_id = kwargs.get('recovery_point_id', None) - self.provider_specific_details = kwargs['provider_specific_details'] - - -class JobDetails(msrest.serialization.Model): - """Job details based on specific job type. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AsrJobDetails, ExportJobDetails, FailoverJobDetails, SwitchProtectionJobDetails, TestFailoverJobDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for - possible values).Constant filled by server. - :type instance_type: str - :param affected_object_details: The affected object properties like source server, source - cloud, target server, target cloud etc. based on the workflow object details. - :type affected_object_details: dict[str, str] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'affected_object_details': {'key': 'affectedObjectDetails', 'type': '{str}'}, - } - - _subtype_map = { - 'instance_type': {'AsrJobDetails': 'AsrJobDetails', 'ExportJobDetails': 'ExportJobDetails', 'FailoverJobDetails': 'FailoverJobDetails', 'SwitchProtectionJobDetails': 'SwitchProtectionJobDetails', 'TestFailoverJobDetails': 'TestFailoverJobDetails'} - } - - def __init__( - self, - **kwargs - ): - super(JobDetails, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - self.affected_object_details = kwargs.get('affected_object_details', None) - - -class AsrJobDetails(JobDetails): - """This class represents job details based on specific job type. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for - possible values).Constant filled by server. - :type instance_type: str - :param affected_object_details: The affected object properties like source server, source - cloud, target server, target cloud etc. based on the workflow object details. - :type affected_object_details: dict[str, str] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'affected_object_details': {'key': 'affectedObjectDetails', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(AsrJobDetails, self).__init__(**kwargs) - self.instance_type = 'AsrJobDetails' # type: str - - -class ASRTask(msrest.serialization.Model): - """Task of the Job. - - :param task_id: The Id. - :type task_id: str - :param name: The unique Task name. - :type name: str - :param start_time: The start time. - :type start_time: ~datetime.datetime - :param end_time: The end time. - :type end_time: ~datetime.datetime - :param allowed_actions: The state/actions applicable on this task. - :type allowed_actions: list[str] - :param friendly_name: The name. - :type friendly_name: str - :param state: The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, - Cancelled, Suspended or Other. - :type state: str - :param state_description: The description of the task state. For example - For Succeeded state, - description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. - :type state_description: str - :param task_type: The type of task. Details in CustomDetails property depend on this type. - :type task_type: str - :param custom_details: The custom task details based on the task type. - :type custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.TaskTypeDetails - :param group_task_custom_details: The custom task details based on the task type, if the task - type is GroupTaskDetails or one of the types derived from it. - :type group_task_custom_details: - ~azure.mgmt.recoveryservicessiterecovery.models.GroupTaskDetails - :param errors: The task error details. - :type errors: list[~azure.mgmt.recoveryservicessiterecovery.models.JobErrorDetails] - """ - - _attribute_map = { - 'task_id': {'key': 'taskId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'allowed_actions': {'key': 'allowedActions', 'type': '[str]'}, - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'state_description': {'key': 'stateDescription', 'type': 'str'}, - 'task_type': {'key': 'taskType', 'type': 'str'}, - 'custom_details': {'key': 'customDetails', 'type': 'TaskTypeDetails'}, - 'group_task_custom_details': {'key': 'groupTaskCustomDetails', 'type': 'GroupTaskDetails'}, - 'errors': {'key': 'errors', 'type': '[JobErrorDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(ASRTask, self).__init__(**kwargs) - self.task_id = kwargs.get('task_id', None) - self.name = kwargs.get('name', None) - self.start_time = kwargs.get('start_time', None) - self.end_time = kwargs.get('end_time', None) - self.allowed_actions = kwargs.get('allowed_actions', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.state = kwargs.get('state', None) - self.state_description = kwargs.get('state_description', None) - self.task_type = kwargs.get('task_type', None) - self.custom_details = kwargs.get('custom_details', None) - self.group_task_custom_details = kwargs.get('group_task_custom_details', None) - self.errors = kwargs.get('errors', None) - - -class TaskTypeDetails(msrest.serialization.Model): - """Task details based on specific task type. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AutomationRunbookTaskDetails, ConsistencyCheckTaskDetails, JobTaskDetails, ManualActionTaskDetails, ScriptActionTaskDetails, VmNicUpdatesTaskDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'AutomationRunbookTaskDetails': 'AutomationRunbookTaskDetails', 'ConsistencyCheckTaskDetails': 'ConsistencyCheckTaskDetails', 'JobTaskDetails': 'JobTaskDetails', 'ManualActionTaskDetails': 'ManualActionTaskDetails', 'ScriptActionTaskDetails': 'ScriptActionTaskDetails', 'VmNicUpdatesTaskDetails': 'VmNicUpdatesTaskDetails'} - } - - def __init__( - self, - **kwargs - ): - super(TaskTypeDetails, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class AutomationRunbookTaskDetails(TaskTypeDetails): - """This class represents the task details for an automation runbook. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param name: The recovery plan task name. - :type name: str - :param cloud_service_name: The cloud service of the automation runbook account. - :type cloud_service_name: str - :param subscription_id: The subscription Id of the automation runbook account. - :type subscription_id: str - :param account_name: The automation account name of the runbook. - :type account_name: str - :param runbook_id: The runbook Id. - :type runbook_id: str - :param runbook_name: The runbook name. - :type runbook_name: str - :param job_id: The job Id of the runbook execution. - :type job_id: str - :param job_output: The execution output of the runbook. - :type job_output: str - :param is_primary_side_script: A value indicating whether it is a primary side script or not. - :type is_primary_side_script: bool - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'cloud_service_name': {'key': 'cloudServiceName', 'type': 'str'}, - 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - 'runbook_id': {'key': 'runbookId', 'type': 'str'}, - 'runbook_name': {'key': 'runbookName', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'job_output': {'key': 'jobOutput', 'type': 'str'}, - 'is_primary_side_script': {'key': 'isPrimarySideScript', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(AutomationRunbookTaskDetails, self).__init__(**kwargs) - self.instance_type = 'AutomationRunbookTaskDetails' # type: str - self.name = kwargs.get('name', None) - self.cloud_service_name = kwargs.get('cloud_service_name', None) - self.subscription_id = kwargs.get('subscription_id', None) - self.account_name = kwargs.get('account_name', None) - self.runbook_id = kwargs.get('runbook_id', None) - self.runbook_name = kwargs.get('runbook_name', None) - self.job_id = kwargs.get('job_id', None) - self.job_output = kwargs.get('job_output', None) - self.is_primary_side_script = kwargs.get('is_primary_side_script', None) - - -class FabricSpecificCreationInput(msrest.serialization.Model): - """Fabric provider specific settings. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureFabricCreationInput, InMageRcmFabricCreationInput, VMwareV2FabricCreationInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'Azure': 'AzureFabricCreationInput', 'InMageRcm': 'InMageRcmFabricCreationInput', 'VMwareV2': 'VMwareV2FabricCreationInput'} - } - - def __init__( - self, - **kwargs - ): - super(FabricSpecificCreationInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class AzureFabricCreationInput(FabricSpecificCreationInput): - """Fabric provider specific settings. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type.Constant filled by server. - :type instance_type: str - :param location: The Location. - :type location: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureFabricCreationInput, self).__init__(**kwargs) - self.instance_type = 'Azure' # type: str - self.location = kwargs.get('location', None) - - -class FabricSpecificDetails(msrest.serialization.Model): - """Fabric specific details. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureFabricSpecificDetails, HyperVSiteDetails, InMageRcmFabricSpecificDetails, VmmDetails, VMwareDetails, VMwareV2FabricSpecificDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'Azure': 'AzureFabricSpecificDetails', 'HyperVSite': 'HyperVSiteDetails', 'InMageRcm': 'InMageRcmFabricSpecificDetails', 'VMM': 'VmmDetails', 'VMware': 'VMwareDetails', 'VMwareV2': 'VMwareV2FabricSpecificDetails'} - } - - def __init__( - self, - **kwargs - ): - super(FabricSpecificDetails, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class AzureFabricSpecificDetails(FabricSpecificDetails): - """Azure Fabric Specific Details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param location: The Location for the Azure fabric. - :type location: str - :param container_ids: The container Ids for the Azure fabric. - :type container_ids: list[str] - :param zones: The zones. - :type zones: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AZoneDetails] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'container_ids': {'key': 'containerIds', 'type': '[str]'}, - 'zones': {'key': 'zones', 'type': '[A2AZoneDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureFabricSpecificDetails, self).__init__(**kwargs) - self.instance_type = 'Azure' # type: str - self.location = kwargs.get('location', None) - self.container_ids = kwargs.get('container_ids', None) - self.zones = kwargs.get('zones', None) - - -class FabricSpecificCreateNetworkMappingInput(msrest.serialization.Model): - """Input details specific to fabrics during Network Mapping. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureToAzureCreateNetworkMappingInput, VmmToAzureCreateNetworkMappingInput, VmmToVmmCreateNetworkMappingInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'AzureToAzure': 'AzureToAzureCreateNetworkMappingInput', 'VmmToAzure': 'VmmToAzureCreateNetworkMappingInput', 'VmmToVmm': 'VmmToVmmCreateNetworkMappingInput'} - } - - def __init__( - self, - **kwargs - ): - super(FabricSpecificCreateNetworkMappingInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class AzureToAzureCreateNetworkMappingInput(FabricSpecificCreateNetworkMappingInput): - """Create network mappings input properties/behavior specific to Azure to Azure Network mapping. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str - :param primary_network_id: Required. The primary azure vnet Id. - :type primary_network_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'primary_network_id': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'primary_network_id': {'key': 'primaryNetworkId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureToAzureCreateNetworkMappingInput, self).__init__(**kwargs) - self.instance_type = 'AzureToAzure' # type: str - self.primary_network_id = kwargs['primary_network_id'] - - -class NetworkMappingFabricSpecificSettings(msrest.serialization.Model): - """Network Mapping fabric specific settings. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureToAzureNetworkMappingSettings, VmmToAzureNetworkMappingSettings, VmmToVmmNetworkMappingSettings. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'AzureToAzure': 'AzureToAzureNetworkMappingSettings', 'VmmToAzure': 'VmmToAzureNetworkMappingSettings', 'VmmToVmm': 'VmmToVmmNetworkMappingSettings'} - } - - def __init__( - self, - **kwargs - ): - super(NetworkMappingFabricSpecificSettings, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class AzureToAzureNetworkMappingSettings(NetworkMappingFabricSpecificSettings): - """A2A Network Mapping fabric specific settings. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param primary_fabric_location: The primary fabric location. - :type primary_fabric_location: str - :param recovery_fabric_location: The recovery fabric location. - :type recovery_fabric_location: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'primary_fabric_location': {'key': 'primaryFabricLocation', 'type': 'str'}, - 'recovery_fabric_location': {'key': 'recoveryFabricLocation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureToAzureNetworkMappingSettings, self).__init__(**kwargs) - self.instance_type = 'AzureToAzure' # type: str - self.primary_fabric_location = kwargs.get('primary_fabric_location', None) - self.recovery_fabric_location = kwargs.get('recovery_fabric_location', None) - - -class FabricSpecificUpdateNetworkMappingInput(msrest.serialization.Model): - """Input details specific to fabrics during Network Mapping. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureToAzureUpdateNetworkMappingInput, VmmToAzureUpdateNetworkMappingInput, VmmToVmmUpdateNetworkMappingInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'AzureToAzure': 'AzureToAzureUpdateNetworkMappingInput', 'VmmToAzure': 'VmmToAzureUpdateNetworkMappingInput', 'VmmToVmm': 'VmmToVmmUpdateNetworkMappingInput'} - } - - def __init__( - self, - **kwargs - ): - super(FabricSpecificUpdateNetworkMappingInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class AzureToAzureUpdateNetworkMappingInput(FabricSpecificUpdateNetworkMappingInput): - """Updates network mappings input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str - :param primary_network_id: The primary azure vnet Id. - :type primary_network_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'primary_network_id': {'key': 'primaryNetworkId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureToAzureUpdateNetworkMappingInput, self).__init__(**kwargs) - self.instance_type = 'AzureToAzure' # type: str - self.primary_network_id = kwargs.get('primary_network_id', None) - - -class AzureToAzureVmSyncedConfigDetails(msrest.serialization.Model): - """Azure to Azure VM synced configuration details. - - :param tags: A set of tags. The Azure VM tags. - :type tags: dict[str, str] - :param input_endpoints: The Azure VM input endpoints. - :type input_endpoints: list[~azure.mgmt.recoveryservicessiterecovery.models.InputEndpoint] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'input_endpoints': {'key': 'inputEndpoints', 'type': '[InputEndpoint]'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureToAzureVmSyncedConfigDetails, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.input_endpoints = kwargs.get('input_endpoints', None) - - -class AzureVmDiskDetails(msrest.serialization.Model): - """Disk details for E2A provider. - - :param vhd_type: VHD type. - :type vhd_type: str - :param vhd_id: The VHD id. - :type vhd_id: str - :param disk_id: The disk resource id. - :type disk_id: str - :param vhd_name: VHD name. - :type vhd_name: str - :param max_size_mb: Max side in MB. - :type max_size_mb: str - :param target_disk_location: Blob uri of the Azure disk. - :type target_disk_location: str - :param target_disk_name: The target Azure disk name. - :type target_disk_name: str - :param lun_id: Ordinal\LunId of the disk for the Azure VM. - :type lun_id: str - :param disk_encryption_set_id: The DiskEncryptionSet ARM ID. - :type disk_encryption_set_id: str - :param custom_target_disk_name: The custom target Azure disk name. - :type custom_target_disk_name: str - """ - - _attribute_map = { - 'vhd_type': {'key': 'vhdType', 'type': 'str'}, - 'vhd_id': {'key': 'vhdId', 'type': 'str'}, - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'vhd_name': {'key': 'vhdName', 'type': 'str'}, - 'max_size_mb': {'key': 'maxSizeMB', 'type': 'str'}, - 'target_disk_location': {'key': 'targetDiskLocation', 'type': 'str'}, - 'target_disk_name': {'key': 'targetDiskName', 'type': 'str'}, - 'lun_id': {'key': 'lunId', 'type': 'str'}, - 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, - 'custom_target_disk_name': {'key': 'customTargetDiskName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureVmDiskDetails, self).__init__(**kwargs) - self.vhd_type = kwargs.get('vhd_type', None) - self.vhd_id = kwargs.get('vhd_id', None) - self.disk_id = kwargs.get('disk_id', None) - self.vhd_name = kwargs.get('vhd_name', None) - self.max_size_mb = kwargs.get('max_size_mb', None) - self.target_disk_location = kwargs.get('target_disk_location', None) - self.target_disk_name = kwargs.get('target_disk_name', None) - self.lun_id = kwargs.get('lun_id', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.custom_target_disk_name = kwargs.get('custom_target_disk_name', None) - - -class ComputeSizeErrorDetails(msrest.serialization.Model): - """Represents the error used to indicate why the target compute size is not applicable. - - :param message: The error message. - :type message: str - :param severity: The severity of the error. - :type severity: str - """ - - _attribute_map = { - 'message': {'key': 'message', 'type': 'str'}, - 'severity': {'key': 'severity', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComputeSizeErrorDetails, self).__init__(**kwargs) - self.message = kwargs.get('message', None) - self.severity = kwargs.get('severity', None) - - -class ConfigurationSettings(msrest.serialization.Model): - """Replication provider specific settings. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: HyperVVirtualMachineDetails, ReplicationGroupDetails, VMwareVirtualMachineDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'HyperVVirtualMachine': 'HyperVVirtualMachineDetails', 'ReplicationGroupDetails': 'ReplicationGroupDetails', 'VMwareVirtualMachine': 'VMwareVirtualMachineDetails'} - } - - def __init__( - self, - **kwargs - ): - super(ConfigurationSettings, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class ConfigureAlertRequest(msrest.serialization.Model): - """Request to configure alerts for the system. - - :param properties: The properties of a configure alert request. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.ConfigureAlertRequestProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ConfigureAlertRequestProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ConfigureAlertRequest, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ConfigureAlertRequestProperties(msrest.serialization.Model): - """Properties of a configure alert request. - - :param send_to_owners: A value indicating whether to send email to subscription administrator. - :type send_to_owners: str - :param custom_email_addresses: The custom email address for sending emails. - :type custom_email_addresses: list[str] - :param locale: The locale for the email notification. - :type locale: str - """ - - _attribute_map = { - 'send_to_owners': {'key': 'sendToOwners', 'type': 'str'}, - 'custom_email_addresses': {'key': 'customEmailAddresses', 'type': '[str]'}, - 'locale': {'key': 'locale', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ConfigureAlertRequestProperties, self).__init__(**kwargs) - self.send_to_owners = kwargs.get('send_to_owners', None) - self.custom_email_addresses = kwargs.get('custom_email_addresses', None) - self.locale = kwargs.get('locale', None) - - -class ConsistencyCheckTaskDetails(TaskTypeDetails): - """This class contains monitoring details of all the inconsistent Protected Entities in Vmm. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param vm_details: The list of inconsistent Vm details. - :type vm_details: list[~azure.mgmt.recoveryservicessiterecovery.models.InconsistentVmDetails] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'vm_details': {'key': 'vmDetails', 'type': '[InconsistentVmDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConsistencyCheckTaskDetails, self).__init__(**kwargs) - self.instance_type = 'ConsistencyCheckTaskDetails' # type: str - self.vm_details = kwargs.get('vm_details', None) - - -class CreateNetworkMappingInput(msrest.serialization.Model): - """Create network mappings input. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. Input properties for creating network mapping. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.CreateNetworkMappingInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'CreateNetworkMappingInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateNetworkMappingInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CreateNetworkMappingInputProperties(msrest.serialization.Model): - """Common input details for network mapping operation. - - All required parameters must be populated in order to send to Azure. - - :param recovery_fabric_name: Recovery fabric Name. - :type recovery_fabric_name: str - :param recovery_network_id: Required. Recovery network Id. - :type recovery_network_id: str - :param fabric_specific_details: Fabric specific input properties. - :type fabric_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.FabricSpecificCreateNetworkMappingInput - """ - - _validation = { - 'recovery_network_id': {'required': True}, - } - - _attribute_map = { - 'recovery_fabric_name': {'key': 'recoveryFabricName', 'type': 'str'}, - 'recovery_network_id': {'key': 'recoveryNetworkId', 'type': 'str'}, - 'fabric_specific_details': {'key': 'fabricSpecificDetails', 'type': 'FabricSpecificCreateNetworkMappingInput'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateNetworkMappingInputProperties, self).__init__(**kwargs) - self.recovery_fabric_name = kwargs.get('recovery_fabric_name', None) - self.recovery_network_id = kwargs['recovery_network_id'] - self.fabric_specific_details = kwargs.get('fabric_specific_details', None) - - -class CreatePolicyInput(msrest.serialization.Model): - """Protection Policy input. - - :param properties: Policy creation properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.CreatePolicyInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'CreatePolicyInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(CreatePolicyInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class CreatePolicyInputProperties(msrest.serialization.Model): - """Policy creation properties. - - :param provider_specific_input: The ReplicationProviderSettings. - :type provider_specific_input: - ~azure.mgmt.recoveryservicessiterecovery.models.PolicyProviderSpecificInput - """ - - _attribute_map = { - 'provider_specific_input': {'key': 'providerSpecificInput', 'type': 'PolicyProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(CreatePolicyInputProperties, self).__init__(**kwargs) - self.provider_specific_input = kwargs.get('provider_specific_input', None) - - -class CreateProtectionContainerInput(msrest.serialization.Model): - """Create protection container input. - - :param properties: Create protection container input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionContainerInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'CreateProtectionContainerInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateProtectionContainerInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class CreateProtectionContainerInputProperties(msrest.serialization.Model): - """Create protection container input properties. - - :param provider_specific_input: Provider specific inputs for container creation. - :type provider_specific_input: - list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerCreationInput] - """ - - _attribute_map = { - 'provider_specific_input': {'key': 'providerSpecificInput', 'type': '[ReplicationProviderSpecificContainerCreationInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateProtectionContainerInputProperties, self).__init__(**kwargs) - self.provider_specific_input = kwargs.get('provider_specific_input', None) - - -class CreateProtectionContainerMappingInput(msrest.serialization.Model): - """Configure pairing input. - - :param properties: Configure protection input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'CreateProtectionContainerMappingInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateProtectionContainerMappingInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class CreateProtectionContainerMappingInputProperties(msrest.serialization.Model): - """Configure pairing input properties. - - :param target_protection_container_id: The target unique protection container name. - :type target_protection_container_id: str - :param policy_id: Applicable policy. - :type policy_id: str - :param provider_specific_input: Provider specific input for pairing. - :type provider_specific_input: - ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerMappingInput - """ - - _attribute_map = { - 'target_protection_container_id': {'key': 'targetProtectionContainerId', 'type': 'str'}, - 'policy_id': {'key': 'policyId', 'type': 'str'}, - 'provider_specific_input': {'key': 'providerSpecificInput', 'type': 'ReplicationProviderSpecificContainerMappingInput'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateProtectionContainerMappingInputProperties, self).__init__(**kwargs) - self.target_protection_container_id = kwargs.get('target_protection_container_id', None) - self.policy_id = kwargs.get('policy_id', None) - self.provider_specific_input = kwargs.get('provider_specific_input', None) - - -class CreateProtectionIntentInput(msrest.serialization.Model): - """Create protection intent input. - - :param properties: Create protection intent input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionIntentProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'CreateProtectionIntentProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateProtectionIntentInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class CreateProtectionIntentProperties(msrest.serialization.Model): - """Create protection intent input properties. - - :param provider_specific_details: The ReplicationProviderInput. For A2A provider, it will be - A2ACreateProtectionIntentInput object. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionIntentProviderSpecificDetails - """ - - _attribute_map = { - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'CreateProtectionIntentProviderSpecificDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateProtectionIntentProperties, self).__init__(**kwargs) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class CreateRecoveryPlanInput(msrest.serialization.Model): - """Create recovery plan input class. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. Recovery plan creation properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.CreateRecoveryPlanInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'CreateRecoveryPlanInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateRecoveryPlanInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class CreateRecoveryPlanInputProperties(msrest.serialization.Model): - """Recovery plan creation properties. - - All required parameters must be populated in order to send to Azure. - - :param primary_fabric_id: Required. The primary fabric Id. - :type primary_fabric_id: str - :param recovery_fabric_id: Required. The recovery fabric Id. - :type recovery_fabric_id: str - :param failover_deployment_model: The failover deployment model. Possible values include: - "NotApplicable", "Classic", "ResourceManager". - :type failover_deployment_model: str or - ~azure.mgmt.recoveryservicessiterecovery.models.FailoverDeploymentModel - :param groups: Required. The recovery plan groups. - :type groups: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroup] - :param provider_specific_input: The provider specific input. - :type provider_specific_input: - list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificInput] - """ - - _validation = { - 'primary_fabric_id': {'required': True}, - 'recovery_fabric_id': {'required': True}, - 'groups': {'required': True}, - } - - _attribute_map = { - 'primary_fabric_id': {'key': 'primaryFabricId', 'type': 'str'}, - 'recovery_fabric_id': {'key': 'recoveryFabricId', 'type': 'str'}, - 'failover_deployment_model': {'key': 'failoverDeploymentModel', 'type': 'str'}, - 'groups': {'key': 'groups', 'type': '[RecoveryPlanGroup]'}, - 'provider_specific_input': {'key': 'providerSpecificInput', 'type': '[RecoveryPlanProviderSpecificInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateRecoveryPlanInputProperties, self).__init__(**kwargs) - self.primary_fabric_id = kwargs['primary_fabric_id'] - self.recovery_fabric_id = kwargs['recovery_fabric_id'] - self.failover_deployment_model = kwargs.get('failover_deployment_model', None) - self.groups = kwargs['groups'] - self.provider_specific_input = kwargs.get('provider_specific_input', None) - - -class CurrentJobDetails(msrest.serialization.Model): - """Current job details of the migration item. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar job_name: The job name. - :vartype job_name: str - :ivar job_id: The ARM Id of the job being executed. - :vartype job_id: str - :ivar start_time: The start time of the job. - :vartype start_time: ~datetime.datetime - """ - - _validation = { - 'job_name': {'readonly': True}, - 'job_id': {'readonly': True}, - 'start_time': {'readonly': True}, - } - - _attribute_map = { - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(CurrentJobDetails, self).__init__(**kwargs) - self.job_name = None - self.job_id = None - self.start_time = None - - -class CurrentScenarioDetails(msrest.serialization.Model): - """Current scenario details of the protected entity. - - :param scenario_name: Scenario name. - :type scenario_name: str - :param job_id: ARM Id of the job being executed. - :type job_id: str - :param start_time: Start time of the workflow. - :type start_time: ~datetime.datetime - """ - - _attribute_map = { - 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(CurrentScenarioDetails, self).__init__(**kwargs) - self.scenario_name = kwargs.get('scenario_name', None) - self.job_id = kwargs.get('job_id', None) - self.start_time = kwargs.get('start_time', None) - - -class DataStore(msrest.serialization.Model): - """The datastore details of the MT. - - :param symbolic_name: The symbolic name of data store. - :type symbolic_name: str - :param uuid: The uuid of data store. - :type uuid: str - :param capacity: The capacity of data store in GBs. - :type capacity: str - :param free_space: The free space of data store in GBs. - :type free_space: str - :param type: The type of data store. - :type type: str - """ - - _attribute_map = { - 'symbolic_name': {'key': 'symbolicName', 'type': 'str'}, - 'uuid': {'key': 'uuid', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'str'}, - 'free_space': {'key': 'freeSpace', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DataStore, self).__init__(**kwargs) - self.symbolic_name = kwargs.get('symbolic_name', None) - self.uuid = kwargs.get('uuid', None) - self.capacity = kwargs.get('capacity', None) - self.free_space = kwargs.get('free_space', None) - self.type = kwargs.get('type', None) - - -class DisableProtectionInput(msrest.serialization.Model): - """Disable protection input. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. Disable protection input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.DisableProtectionInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DisableProtectionInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(DisableProtectionInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class DisableProtectionInputProperties(msrest.serialization.Model): - """Disable protection input properties. - - :param disable_protection_reason: Disable protection reason. It can have values - NotSpecified/MigrationComplete. Possible values include: "NotSpecified", "MigrationComplete". - :type disable_protection_reason: str or - ~azure.mgmt.recoveryservicessiterecovery.models.DisableProtectionReason - :param replication_provider_input: Replication provider specific input. - :type replication_provider_input: - ~azure.mgmt.recoveryservicessiterecovery.models.DisableProtectionProviderSpecificInput - """ - - _attribute_map = { - 'disable_protection_reason': {'key': 'disableProtectionReason', 'type': 'str'}, - 'replication_provider_input': {'key': 'replicationProviderInput', 'type': 'DisableProtectionProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(DisableProtectionInputProperties, self).__init__(**kwargs) - self.disable_protection_reason = kwargs.get('disable_protection_reason', None) - self.replication_provider_input = kwargs.get('replication_provider_input', None) - - -class DisableProtectionProviderSpecificInput(msrest.serialization.Model): - """Disable protection provider specific input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: InMageDisableProtectionProviderSpecificInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'InMage': 'InMageDisableProtectionProviderSpecificInput'} - } - - def __init__( - self, - **kwargs - ): - super(DisableProtectionProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class DiscoverProtectableItemRequest(msrest.serialization.Model): - """Request to add a physical machine as a protectable item in a container. - - :param properties: The properties of a discover protectable item request. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.DiscoverProtectableItemRequestProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'DiscoverProtectableItemRequestProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(DiscoverProtectableItemRequest, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class DiscoverProtectableItemRequestProperties(msrest.serialization.Model): - """Discover protectable item properties. - - :param friendly_name: The friendly name of the physical machine. - :type friendly_name: str - :param ip_address: The IP address of the physical machine to be discovered. - :type ip_address: str - :param os_type: The OS type on the physical machine. - :type os_type: str - """ - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DiscoverProtectableItemRequestProperties, self).__init__(**kwargs) - self.friendly_name = kwargs.get('friendly_name', None) - self.ip_address = kwargs.get('ip_address', None) - self.os_type = kwargs.get('os_type', None) - - -class DiskDetails(msrest.serialization.Model): - """Onprem disk details data. - - :param max_size_mb: The hard disk max size in MB. - :type max_size_mb: long - :param vhd_type: The type of the volume. - :type vhd_type: str - :param vhd_id: The VHD Id. - :type vhd_id: str - :param vhd_name: The VHD name. - :type vhd_name: str - """ - - _attribute_map = { - 'max_size_mb': {'key': 'maxSizeMB', 'type': 'long'}, - 'vhd_type': {'key': 'vhdType', 'type': 'str'}, - 'vhd_id': {'key': 'vhdId', 'type': 'str'}, - 'vhd_name': {'key': 'vhdName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DiskDetails, self).__init__(**kwargs) - self.max_size_mb = kwargs.get('max_size_mb', None) - self.vhd_type = kwargs.get('vhd_type', None) - self.vhd_id = kwargs.get('vhd_id', None) - self.vhd_name = kwargs.get('vhd_name', None) - - -class DiskEncryptionInfo(msrest.serialization.Model): - """Recovery disk encryption info (BEK and KEK). - - :param disk_encryption_key_info: The recovery KeyVault reference for secret. - :type disk_encryption_key_info: - ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionKeyInfo - :param key_encryption_key_info: The recovery KeyVault reference for key. - :type key_encryption_key_info: - ~azure.mgmt.recoveryservicessiterecovery.models.KeyEncryptionKeyInfo - """ - - _attribute_map = { - 'disk_encryption_key_info': {'key': 'diskEncryptionKeyInfo', 'type': 'DiskEncryptionKeyInfo'}, - 'key_encryption_key_info': {'key': 'keyEncryptionKeyInfo', 'type': 'KeyEncryptionKeyInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(DiskEncryptionInfo, self).__init__(**kwargs) - self.disk_encryption_key_info = kwargs.get('disk_encryption_key_info', None) - self.key_encryption_key_info = kwargs.get('key_encryption_key_info', None) - - -class DiskEncryptionKeyInfo(msrest.serialization.Model): - """Disk Encryption Key Information (BitLocker Encryption Key (BEK) on Windows). - - :param secret_identifier: The secret url / identifier. - :type secret_identifier: str - :param key_vault_resource_arm_id: The KeyVault resource ARM id for secret. - :type key_vault_resource_arm_id: str - """ - - _attribute_map = { - 'secret_identifier': {'key': 'secretIdentifier', 'type': 'str'}, - 'key_vault_resource_arm_id': {'key': 'keyVaultResourceArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DiskEncryptionKeyInfo, self).__init__(**kwargs) - self.secret_identifier = kwargs.get('secret_identifier', None) - self.key_vault_resource_arm_id = kwargs.get('key_vault_resource_arm_id', None) - - -class DiskVolumeDetails(msrest.serialization.Model): - """Volume details. - - :param label: The volume label. - :type label: str - :param name: The volume name. - :type name: str - """ - - _attribute_map = { - 'label': {'key': 'label', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(DiskVolumeDetails, self).__init__(**kwargs) - self.label = kwargs.get('label', None) - self.name = kwargs.get('name', None) - - -class Display(msrest.serialization.Model): - """Contains the localized display information for this particular operation / action. These value will be used by several clients for (1) custom role definitions for RBAC; (2) complex query filters for the event service; and (3) audit history / records for management operations. - - :param provider: The provider. The localized friendly form of the resource provider name - it - is expected to also include the publisher/company responsible. It should use Title Casing and - begin with "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or - "Microsoft Compute.". - :type provider: str - :param resource: The resource. The localized friendly form of the resource related to this - action/operation - it should match the public documentation for the resource provider. It - should use Title Casing. This value should be unique for a particular URL type (e.g. nested - types should *not* reuse their parent's display.resource field). e.g. "Virtual Machines" or - "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler Jobs". - :type resource: str - :param operation: The operation. The localized friendly name for the operation, as it should be - shown to the user. It should be concise (to fit in drop downs) but clear (i.e. - self-documenting). It should use Title Casing. Prescriptive guidance: Read Create or Update - Delete 'ActionName'. - :type operation: str - :param description: The description. The localized friendly description for the operation, as - it should be shown to the user. It should be thorough, yet concise - it will be used in tool - tips and detailed views. Prescriptive guidance for namespaces: Read any 'display.provider' - resource Create or Update any 'display.provider' resource Delete any 'display.provider' - resource Perform any other action on any 'display.provider' resource Prescriptive guidance for - namespaces: Read any 'display.resource' Create or Update any 'display.resource' Delete any - 'display.resource' 'ActionName' any 'display.resources'. - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Display, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class DraDetails(msrest.serialization.Model): - """DRA details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The DRA Id. - :vartype id: str - :ivar name: The DRA name. - :vartype name: str - :ivar bios_id: The DRA Bios Id. - :vartype bios_id: str - :ivar version: The version. - :vartype version: str - :ivar last_heartbeat_utc: The last heartbeat received from the DRA. - :vartype last_heartbeat_utc: ~datetime.datetime - :ivar health: The health. Possible values include: "None", "Normal", "Warning", "Critical". - :vartype health: str or ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionHealth - :ivar health_errors: The health errors. - :vartype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :ivar forward_protected_item_count: The count of protected items which are protected in forward - direction. - :vartype forward_protected_item_count: int - :ivar reverse_protected_item_count: The count of protected items which are protected in reverse - direction. - :vartype reverse_protected_item_count: int - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'bios_id': {'readonly': True}, - 'version': {'readonly': True}, - 'last_heartbeat_utc': {'readonly': True}, - 'health': {'readonly': True}, - 'health_errors': {'readonly': True}, - 'forward_protected_item_count': {'readonly': True}, - 'reverse_protected_item_count': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'bios_id': {'key': 'biosId', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'last_heartbeat_utc': {'key': 'lastHeartbeatUtc', 'type': 'iso-8601'}, - 'health': {'key': 'health', 'type': 'str'}, - 'health_errors': {'key': 'healthErrors', 'type': '[HealthError]'}, - 'forward_protected_item_count': {'key': 'forwardProtectedItemCount', 'type': 'int'}, - 'reverse_protected_item_count': {'key': 'reverseProtectedItemCount', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(DraDetails, self).__init__(**kwargs) - self.id = None - self.name = None - self.bios_id = None - self.version = None - self.last_heartbeat_utc = None - self.health = None - self.health_errors = None - self.forward_protected_item_count = None - self.reverse_protected_item_count = None - - -class EnableMigrationInput(msrest.serialization.Model): - """Enable migration input. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. Enable migration input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.EnableMigrationInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'EnableMigrationInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(EnableMigrationInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class EnableMigrationInputProperties(msrest.serialization.Model): - """Enable migration input properties. - - All required parameters must be populated in order to send to Azure. - - :param policy_id: Required. The policy Id. - :type policy_id: str - :param provider_specific_details: Required. The provider specific details. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.EnableMigrationProviderSpecificInput - """ - - _validation = { - 'policy_id': {'required': True}, - 'provider_specific_details': {'required': True}, - } - - _attribute_map = { - 'policy_id': {'key': 'policyId', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'EnableMigrationProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(EnableMigrationInputProperties, self).__init__(**kwargs) - self.policy_id = kwargs['policy_id'] - self.provider_specific_details = kwargs['provider_specific_details'] - - -class EnableMigrationProviderSpecificInput(msrest.serialization.Model): - """Enable migration provider specific input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: VMwareCbtEnableMigrationInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'VMwareCbt': 'VMwareCbtEnableMigrationInput'} - } - - def __init__( - self, - **kwargs - ): - super(EnableMigrationProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class EnableProtectionInput(msrest.serialization.Model): - """Enable protection input. - - :param properties: Enable protection input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.EnableProtectionInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'EnableProtectionInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(EnableProtectionInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class EnableProtectionInputProperties(msrest.serialization.Model): - """Enable protection input properties. - - :param policy_id: The Policy Id. - :type policy_id: str - :param protectable_item_id: The protectable item Id. - :type protectable_item_id: str - :param provider_specific_details: The ReplicationProviderInput. For HyperVReplicaAzure - provider, it will be AzureEnableProtectionInput object. For San provider, it will be - SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.EnableProtectionProviderSpecificInput - """ - - _attribute_map = { - 'policy_id': {'key': 'policyId', 'type': 'str'}, - 'protectable_item_id': {'key': 'protectableItemId', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'EnableProtectionProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(EnableProtectionInputProperties, self).__init__(**kwargs) - self.policy_id = kwargs.get('policy_id', None) - self.protectable_item_id = kwargs.get('protectable_item_id', None) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class EncryptionDetails(msrest.serialization.Model): - """Encryption details for the fabric. - - :param kek_state: The key encryption key state for the Vmm. - :type kek_state: str - :param kek_cert_thumbprint: The key encryption key certificate thumbprint. - :type kek_cert_thumbprint: str - :param kek_cert_expiry_date: The key encryption key certificate expiry date. - :type kek_cert_expiry_date: ~datetime.datetime - """ - - _attribute_map = { - 'kek_state': {'key': 'kekState', 'type': 'str'}, - 'kek_cert_thumbprint': {'key': 'kekCertThumbprint', 'type': 'str'}, - 'kek_cert_expiry_date': {'key': 'kekCertExpiryDate', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(EncryptionDetails, self).__init__(**kwargs) - self.kek_state = kwargs.get('kek_state', None) - self.kek_cert_thumbprint = kwargs.get('kek_cert_thumbprint', None) - self.kek_cert_expiry_date = kwargs.get('kek_cert_expiry_date', None) - - -class Event(Resource): - """Implements the Event class. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: Event related data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.EventProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'EventProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(Event, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class EventCollection(msrest.serialization.Model): - """Collection of fabric details. - - :param value: The list of events. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.Event] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Event]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EventCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class EventProperties(msrest.serialization.Model): - """The properties of a monitoring event. - - :param event_code: The Id of the monitoring event. - :type event_code: str - :param description: The event name. - :type description: str - :param event_type: The type of the event. for example: VM Health, Server Health, Job Failure - etc. - :type event_type: str - :param affected_object_friendly_name: The friendly name of the source of the event on which it - is raised (for example, VM, VMM etc). - :type affected_object_friendly_name: str - :param affected_object_correlation_id: The affected object correlationId for the event. - :type affected_object_correlation_id: str - :param severity: The severity of the event. - :type severity: str - :param time_of_occurrence: The time of occurrence of the event. - :type time_of_occurrence: ~datetime.datetime - :param fabric_id: The ARM ID of the fabric. - :type fabric_id: str - :param provider_specific_details: The provider specific settings. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.EventProviderSpecificDetails - :param event_specific_details: The event specific settings. - :type event_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.EventSpecificDetails - :param health_errors: The list of errors / warnings capturing details associated with the - issue(s). - :type health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - """ - - _attribute_map = { - 'event_code': {'key': 'eventCode', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'affected_object_friendly_name': {'key': 'affectedObjectFriendlyName', 'type': 'str'}, - 'affected_object_correlation_id': {'key': 'affectedObjectCorrelationId', 'type': 'str'}, - 'severity': {'key': 'severity', 'type': 'str'}, - 'time_of_occurrence': {'key': 'timeOfOccurrence', 'type': 'iso-8601'}, - 'fabric_id': {'key': 'fabricId', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'EventProviderSpecificDetails'}, - 'event_specific_details': {'key': 'eventSpecificDetails', 'type': 'EventSpecificDetails'}, - 'health_errors': {'key': 'healthErrors', 'type': '[HealthError]'}, - } - - def __init__( - self, - **kwargs - ): - super(EventProperties, self).__init__(**kwargs) - self.event_code = kwargs.get('event_code', None) - self.description = kwargs.get('description', None) - self.event_type = kwargs.get('event_type', None) - self.affected_object_friendly_name = kwargs.get('affected_object_friendly_name', None) - self.affected_object_correlation_id = kwargs.get('affected_object_correlation_id', None) - self.severity = kwargs.get('severity', None) - self.time_of_occurrence = kwargs.get('time_of_occurrence', None) - self.fabric_id = kwargs.get('fabric_id', None) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - self.event_specific_details = kwargs.get('event_specific_details', None) - self.health_errors = kwargs.get('health_errors', None) - - -class EventQueryParameter(msrest.serialization.Model): - """Implements the event query parameter. - - :param event_code: The source id of the events to be queried. - :type event_code: str - :param severity: The severity of the events to be queried. - :type severity: str - :param event_type: The type of the events to be queried. - :type event_type: str - :param fabric_name: The affected object server id of the events to be queried. - :type fabric_name: str - :param affected_object_friendly_name: The affected object name of the events to be queried. - :type affected_object_friendly_name: str - :param affected_object_correlation_id: The affected object correlationId for the events to be - queried. - :type affected_object_correlation_id: str - :param start_time: The start time of the time range within which the events are to be queried. - :type start_time: ~datetime.datetime - :param end_time: The end time of the time range within which the events are to be queried. - :type end_time: ~datetime.datetime - """ - - _attribute_map = { - 'event_code': {'key': 'eventCode', 'type': 'str'}, - 'severity': {'key': 'severity', 'type': 'str'}, - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'fabric_name': {'key': 'fabricName', 'type': 'str'}, - 'affected_object_friendly_name': {'key': 'affectedObjectFriendlyName', 'type': 'str'}, - 'affected_object_correlation_id': {'key': 'affectedObjectCorrelationId', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(EventQueryParameter, self).__init__(**kwargs) - self.event_code = kwargs.get('event_code', None) - self.severity = kwargs.get('severity', None) - self.event_type = kwargs.get('event_type', None) - self.fabric_name = kwargs.get('fabric_name', None) - self.affected_object_friendly_name = kwargs.get('affected_object_friendly_name', None) - self.affected_object_correlation_id = kwargs.get('affected_object_correlation_id', None) - self.start_time = kwargs.get('start_time', None) - self.end_time = kwargs.get('end_time', None) - - -class EventSpecificDetails(msrest.serialization.Model): - """Model class for event specific details for an event. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobStatusEventDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'JobStatus': 'JobStatusEventDetails'} - } - - def __init__( - self, - **kwargs - ): - super(EventSpecificDetails, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class ProtectionProfileCustomDetails(msrest.serialization.Model): - """Protection Profile custom input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ExistingProtectionProfile, NewProtectionProfile. - - All required parameters must be populated in order to send to Azure. - - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - """ - - _validation = { - 'resource_type': {'required': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - } - - _subtype_map = { - 'resource_type': {'Existing': 'ExistingProtectionProfile', 'New': 'NewProtectionProfile'} - } - - def __init__( - self, - **kwargs - ): - super(ProtectionProfileCustomDetails, self).__init__(**kwargs) - self.resource_type = None # type: Optional[str] - - -class ExistingProtectionProfile(ProtectionProfileCustomDetails): - """Existing storage account input. - - All required parameters must be populated in order to send to Azure. - - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param protection_profile_id: Required. The protection profile Arm Id. Throw error, if resource - does not exists. - :type protection_profile_id: str - """ - - _validation = { - 'resource_type': {'required': True}, - 'protection_profile_id': {'required': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'protection_profile_id': {'key': 'protectionProfileId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExistingProtectionProfile, self).__init__(**kwargs) - self.resource_type = 'Existing' # type: str - self.protection_profile_id = kwargs['protection_profile_id'] - - -class RecoveryAvailabilitySetCustomDetails(msrest.serialization.Model): - """Recovery Availability Set custom input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ExistingRecoveryAvailabilitySet. - - All required parameters must be populated in order to send to Azure. - - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - """ - - _validation = { - 'resource_type': {'required': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - } - - _subtype_map = { - 'resource_type': {'Existing': 'ExistingRecoveryAvailabilitySet'} - } - - def __init__( - self, - **kwargs - ): - super(RecoveryAvailabilitySetCustomDetails, self).__init__(**kwargs) - self.resource_type = None # type: Optional[str] - - -class ExistingRecoveryAvailabilitySet(RecoveryAvailabilitySetCustomDetails): - """Existing recovery availability set input. - - All required parameters must be populated in order to send to Azure. - - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param recovery_availability_set_id: The recovery availability set Id. Will throw error, if - resource does not exist. - :type recovery_availability_set_id: str - """ - - _validation = { - 'resource_type': {'required': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'recovery_availability_set_id': {'key': 'recoveryAvailabilitySetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExistingRecoveryAvailabilitySet, self).__init__(**kwargs) - self.resource_type = 'Existing' # type: str - self.recovery_availability_set_id = kwargs.get('recovery_availability_set_id', None) - - -class RecoveryProximityPlacementGroupCustomDetails(msrest.serialization.Model): - """Recovery Proximity placement group custom input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ExistingRecoveryProximityPlacementGroup. - - All required parameters must be populated in order to send to Azure. - - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - """ - - _validation = { - 'resource_type': {'required': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - } - - _subtype_map = { - 'resource_type': {'Existing': 'ExistingRecoveryProximityPlacementGroup'} - } - - def __init__( - self, - **kwargs - ): - super(RecoveryProximityPlacementGroupCustomDetails, self).__init__(**kwargs) - self.resource_type = None # type: Optional[str] - - -class ExistingRecoveryProximityPlacementGroup(RecoveryProximityPlacementGroupCustomDetails): - """Existing recovery proximity placement group input. - - All required parameters must be populated in order to send to Azure. - - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param recovery_proximity_placement_group_id: The recovery proximity placement group Id. Will - throw error, if resource does not exist. - :type recovery_proximity_placement_group_id: str - """ - - _validation = { - 'resource_type': {'required': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'recovery_proximity_placement_group_id': {'key': 'recoveryProximityPlacementGroupId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExistingRecoveryProximityPlacementGroup, self).__init__(**kwargs) - self.resource_type = 'Existing' # type: str - self.recovery_proximity_placement_group_id = kwargs.get('recovery_proximity_placement_group_id', None) - - -class RecoveryResourceGroupCustomDetails(msrest.serialization.Model): - """Recovery Resource Group custom input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ExistingRecoveryResourceGroup. - - All required parameters must be populated in order to send to Azure. - - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - """ - - _validation = { - 'resource_type': {'required': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - } - - _subtype_map = { - 'resource_type': {'Existing': 'ExistingRecoveryResourceGroup'} - } - - def __init__( - self, - **kwargs - ): - super(RecoveryResourceGroupCustomDetails, self).__init__(**kwargs) - self.resource_type = None # type: Optional[str] - - -class ExistingRecoveryResourceGroup(RecoveryResourceGroupCustomDetails): - """Existing recovery resource group input. - - All required parameters must be populated in order to send to Azure. - - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. - :type recovery_resource_group_id: str - """ - - _validation = { - 'resource_type': {'required': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'recovery_resource_group_id': {'key': 'recoveryResourceGroupId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExistingRecoveryResourceGroup, self).__init__(**kwargs) - self.resource_type = 'Existing' # type: str - self.recovery_resource_group_id = kwargs.get('recovery_resource_group_id', None) - - -class RecoveryVirtualNetworkCustomDetails(msrest.serialization.Model): - """Recovery Virtual network custom input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ExistingRecoveryVirtualNetwork, NewRecoveryVirtualNetwork. - - All required parameters must be populated in order to send to Azure. - - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - """ - - _validation = { - 'resource_type': {'required': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - } - - _subtype_map = { - 'resource_type': {'Existing': 'ExistingRecoveryVirtualNetwork', 'New': 'NewRecoveryVirtualNetwork'} - } - - def __init__( - self, - **kwargs - ): - super(RecoveryVirtualNetworkCustomDetails, self).__init__(**kwargs) - self.resource_type = None # type: Optional[str] - - -class ExistingRecoveryVirtualNetwork(RecoveryVirtualNetworkCustomDetails): - """Existing recovery virtual network input. - - All required parameters must be populated in order to send to Azure. - - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param recovery_virtual_network_id: Required. The recovery virtual network Id. Will throw - error, if resource does not exist. - :type recovery_virtual_network_id: str - :param recovery_subnet_name: The recovery subnet name. - :type recovery_subnet_name: str - """ - - _validation = { - 'resource_type': {'required': True}, - 'recovery_virtual_network_id': {'required': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'recovery_virtual_network_id': {'key': 'recoveryVirtualNetworkId', 'type': 'str'}, - 'recovery_subnet_name': {'key': 'recoverySubnetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExistingRecoveryVirtualNetwork, self).__init__(**kwargs) - self.resource_type = 'Existing' # type: str - self.recovery_virtual_network_id = kwargs['recovery_virtual_network_id'] - self.recovery_subnet_name = kwargs.get('recovery_subnet_name', None) - - -class StorageAccountCustomDetails(msrest.serialization.Model): - """Storage account custom input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ExistingStorageAccount. - - All required parameters must be populated in order to send to Azure. - - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - """ - - _validation = { - 'resource_type': {'required': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - } - - _subtype_map = { - 'resource_type': {'Existing': 'ExistingStorageAccount'} - } - - def __init__( - self, - **kwargs - ): - super(StorageAccountCustomDetails, self).__init__(**kwargs) - self.resource_type = None # type: Optional[str] - - -class ExistingStorageAccount(StorageAccountCustomDetails): - """Existing storage account input. - - All required parameters must be populated in order to send to Azure. - - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param azure_storage_account_id: Required. The storage account Arm Id. Throw error, if resource - does not exists. - :type azure_storage_account_id: str - """ - - _validation = { - 'resource_type': {'required': True}, - 'azure_storage_account_id': {'required': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'azure_storage_account_id': {'key': 'azureStorageAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExistingStorageAccount, self).__init__(**kwargs) - self.resource_type = 'Existing' # type: str - self.azure_storage_account_id = kwargs['azure_storage_account_id'] - - -class ExportJobDetails(JobDetails): - """This class represents details for export jobs workflow. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for - possible values).Constant filled by server. - :type instance_type: str - :param affected_object_details: The affected object properties like source server, source - cloud, target server, target cloud etc. based on the workflow object details. - :type affected_object_details: dict[str, str] - :param blob_uri: BlobUri of the exported jobs. - :type blob_uri: str - :param sas_token: The sas token to access blob. - :type sas_token: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'affected_object_details': {'key': 'affectedObjectDetails', 'type': '{str}'}, - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'sas_token': {'key': 'sasToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExportJobDetails, self).__init__(**kwargs) - self.instance_type = 'ExportJobDetails' # type: str - self.blob_uri = kwargs.get('blob_uri', None) - self.sas_token = kwargs.get('sas_token', None) - - -class Fabric(Resource): - """Fabric definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: Fabric related data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.FabricProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'FabricProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(Fabric, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class FabricCollection(msrest.serialization.Model): - """Collection of fabric details. - - :param value: The fabric details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Fabric]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FabricCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class FabricCreationInput(msrest.serialization.Model): - """Site details provided during the time of site creation. - - :param properties: Fabric creation input. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.FabricCreationInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FabricCreationInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(FabricCreationInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class FabricCreationInputProperties(msrest.serialization.Model): - """Properties of site details provided during the time of site creation. - - :param custom_details: Fabric provider specific creation input. - :type custom_details: - ~azure.mgmt.recoveryservicessiterecovery.models.FabricSpecificCreationInput - """ - - _attribute_map = { - 'custom_details': {'key': 'customDetails', 'type': 'FabricSpecificCreationInput'}, - } - - def __init__( - self, - **kwargs - ): - super(FabricCreationInputProperties, self).__init__(**kwargs) - self.custom_details = kwargs.get('custom_details', None) - - -class FabricProperties(msrest.serialization.Model): - """Fabric properties. - - :param friendly_name: Friendly name of the fabric. - :type friendly_name: str - :param encryption_details: Encryption details for the fabric. - :type encryption_details: ~azure.mgmt.recoveryservicessiterecovery.models.EncryptionDetails - :param rollover_encryption_details: Rollover encryption details for the fabric. - :type rollover_encryption_details: - ~azure.mgmt.recoveryservicessiterecovery.models.EncryptionDetails - :param internal_identifier: Dra Registration Id. - :type internal_identifier: str - :param bcdr_state: BCDR state of the fabric. - :type bcdr_state: str - :param custom_details: Fabric specific settings. - :type custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.FabricSpecificDetails - :param health_error_details: Fabric health error details. - :type health_error_details: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param health: Health of fabric. - :type health: str - """ - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'encryption_details': {'key': 'encryptionDetails', 'type': 'EncryptionDetails'}, - 'rollover_encryption_details': {'key': 'rolloverEncryptionDetails', 'type': 'EncryptionDetails'}, - 'internal_identifier': {'key': 'internalIdentifier', 'type': 'str'}, - 'bcdr_state': {'key': 'bcdrState', 'type': 'str'}, - 'custom_details': {'key': 'customDetails', 'type': 'FabricSpecificDetails'}, - 'health_error_details': {'key': 'healthErrorDetails', 'type': '[HealthError]'}, - 'health': {'key': 'health', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FabricProperties, self).__init__(**kwargs) - self.friendly_name = kwargs.get('friendly_name', None) - self.encryption_details = kwargs.get('encryption_details', None) - self.rollover_encryption_details = kwargs.get('rollover_encryption_details', None) - self.internal_identifier = kwargs.get('internal_identifier', None) - self.bcdr_state = kwargs.get('bcdr_state', None) - self.custom_details = kwargs.get('custom_details', None) - self.health_error_details = kwargs.get('health_error_details', None) - self.health = kwargs.get('health', None) - - -class FabricQueryParameter(msrest.serialization.Model): - """Query parameter to get fabric. - - :param zone_to_zone_mappings: A value indicating whether the zone to zone mappings are to be - returned. - :type zone_to_zone_mappings: str - :param fetch_agent_details: A value indicating whether the agent details are to be fetched. - :type fetch_agent_details: str - :param bios_id: The BIOS Id to be used for fetching agent details. - :type bios_id: str - :param fqdn: The FQDN to be used for fetching agent details. - :type fqdn: str - :param discovery_type: The type of the discovered machine to be used for fetching agent - details. - :type discovery_type: str - :param os_type: The OS type to be used for fetching agent details. - :type os_type: str - """ - - _attribute_map = { - 'zone_to_zone_mappings': {'key': 'zoneToZoneMappings', 'type': 'str'}, - 'fetch_agent_details': {'key': 'fetchAgentDetails', 'type': 'str'}, - 'bios_id': {'key': 'biosId', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'discovery_type': {'key': 'discoveryType', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FabricQueryParameter, self).__init__(**kwargs) - self.zone_to_zone_mappings = kwargs.get('zone_to_zone_mappings', None) - self.fetch_agent_details = kwargs.get('fetch_agent_details', None) - self.bios_id = kwargs.get('bios_id', None) - self.fqdn = kwargs.get('fqdn', None) - self.discovery_type = kwargs.get('discovery_type', None) - self.os_type = kwargs.get('os_type', None) - - -class JobTaskDetails(TaskTypeDetails): - """This class represents a task which is actually a workflow so that one can navigate to its individual drill down. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FabricReplicationGroupTaskDetails, VirtualMachineTaskDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param job_task: The job entity. - :type job_task: ~azure.mgmt.recoveryservicessiterecovery.models.JobEntity - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'job_task': {'key': 'jobTask', 'type': 'JobEntity'}, - } - - _subtype_map = { - 'instance_type': {'FabricReplicationGroupTaskDetails': 'FabricReplicationGroupTaskDetails', 'VirtualMachineTaskDetails': 'VirtualMachineTaskDetails'} - } - - def __init__( - self, - **kwargs - ): - super(JobTaskDetails, self).__init__(**kwargs) - self.instance_type = 'JobTaskDetails' # type: str - self.job_task = kwargs.get('job_task', None) - - -class FabricReplicationGroupTaskDetails(JobTaskDetails): - """This class represents the fabric replication group task details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param job_task: The job entity. - :type job_task: ~azure.mgmt.recoveryservicessiterecovery.models.JobEntity - :param skipped_reason: The skipped reason. - :type skipped_reason: str - :param skipped_reason_string: The skipped reason string. - :type skipped_reason_string: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'job_task': {'key': 'jobTask', 'type': 'JobEntity'}, - 'skipped_reason': {'key': 'skippedReason', 'type': 'str'}, - 'skipped_reason_string': {'key': 'skippedReasonString', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FabricReplicationGroupTaskDetails, self).__init__(**kwargs) - self.instance_type = 'FabricReplicationGroupTaskDetails' # type: str - self.skipped_reason = kwargs.get('skipped_reason', None) - self.skipped_reason_string = kwargs.get('skipped_reason_string', None) - - -class FailoverJobDetails(JobDetails): - """This class represents the details for a failover job. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for - possible values).Constant filled by server. - :type instance_type: str - :param affected_object_details: The affected object properties like source server, source - cloud, target server, target cloud etc. based on the workflow object details. - :type affected_object_details: dict[str, str] - :param protected_item_details: The test VM details. - :type protected_item_details: - list[~azure.mgmt.recoveryservicessiterecovery.models.FailoverReplicationProtectedItemDetails] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'affected_object_details': {'key': 'affectedObjectDetails', 'type': '{str}'}, - 'protected_item_details': {'key': 'protectedItemDetails', 'type': '[FailoverReplicationProtectedItemDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(FailoverJobDetails, self).__init__(**kwargs) - self.instance_type = 'FailoverJobDetails' # type: str - self.protected_item_details = kwargs.get('protected_item_details', None) - - -class FailoverProcessServerRequest(msrest.serialization.Model): - """Request to failover a process server. - - :param properties: The properties of the PS Failover request. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.FailoverProcessServerRequestProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'FailoverProcessServerRequestProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(FailoverProcessServerRequest, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class FailoverProcessServerRequestProperties(msrest.serialization.Model): - """The properties of the Failover Process Server request. - - :param container_name: The container identifier. - :type container_name: str - :param source_process_server_id: The source process server. - :type source_process_server_id: str - :param target_process_server_id: The new process server. - :type target_process_server_id: str - :param vms_to_migrate: The VMS to migrate. - :type vms_to_migrate: list[str] - :param update_type: A value for failover type. It can be systemlevel/serverlevel. - :type update_type: str - """ - - _attribute_map = { - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'source_process_server_id': {'key': 'sourceProcessServerId', 'type': 'str'}, - 'target_process_server_id': {'key': 'targetProcessServerId', 'type': 'str'}, - 'vms_to_migrate': {'key': 'vmsToMigrate', 'type': '[str]'}, - 'update_type': {'key': 'updateType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FailoverProcessServerRequestProperties, self).__init__(**kwargs) - self.container_name = kwargs.get('container_name', None) - self.source_process_server_id = kwargs.get('source_process_server_id', None) - self.target_process_server_id = kwargs.get('target_process_server_id', None) - self.vms_to_migrate = kwargs.get('vms_to_migrate', None) - self.update_type = kwargs.get('update_type', None) - - -class FailoverReplicationProtectedItemDetails(msrest.serialization.Model): - """Failover details for a replication protected item. - - :param name: The name. - :type name: str - :param friendly_name: The friendly name. - :type friendly_name: str - :param test_vm_name: The test Vm name. - :type test_vm_name: str - :param test_vm_friendly_name: The test Vm friendly name. - :type test_vm_friendly_name: str - :param network_connection_status: The network connection status. - :type network_connection_status: str - :param network_friendly_name: The network friendly name. - :type network_friendly_name: str - :param subnet: The network subnet. - :type subnet: str - :param recovery_point_id: The recovery point Id. - :type recovery_point_id: str - :param recovery_point_time: The recovery point time. - :type recovery_point_time: ~datetime.datetime - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'test_vm_name': {'key': 'testVmName', 'type': 'str'}, - 'test_vm_friendly_name': {'key': 'testVmFriendlyName', 'type': 'str'}, - 'network_connection_status': {'key': 'networkConnectionStatus', 'type': 'str'}, - 'network_friendly_name': {'key': 'networkFriendlyName', 'type': 'str'}, - 'subnet': {'key': 'subnet', 'type': 'str'}, - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(FailoverReplicationProtectedItemDetails, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.test_vm_name = kwargs.get('test_vm_name', None) - self.test_vm_friendly_name = kwargs.get('test_vm_friendly_name', None) - self.network_connection_status = kwargs.get('network_connection_status', None) - self.network_friendly_name = kwargs.get('network_friendly_name', None) - self.subnet = kwargs.get('subnet', None) - self.recovery_point_id = kwargs.get('recovery_point_id', None) - self.recovery_point_time = kwargs.get('recovery_point_time', None) - - -class GroupTaskDetails(msrest.serialization.Model): - """This class represents the group task details when parent child relationship exists in the drill down. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: InlineWorkflowTaskDetails, RecoveryPlanGroupTaskDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param child_tasks: The child tasks. - :type child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'child_tasks': {'key': 'childTasks', 'type': '[ASRTask]'}, - } - - _subtype_map = { - 'instance_type': {'InlineWorkflowTaskDetails': 'InlineWorkflowTaskDetails', 'RecoveryPlanGroupTaskDetails': 'RecoveryPlanGroupTaskDetails'} - } - - def __init__( - self, - **kwargs - ): - super(GroupTaskDetails, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - self.child_tasks = kwargs.get('child_tasks', None) - - -class HealthError(msrest.serialization.Model): - """Health Error. - - :param inner_health_errors: The inner health errors. HealthError having a list of HealthError - as child errors is problematic. InnerHealthError is used because this will prevent an infinite - loop of structures when Hydra tries to auto-generate the contract. We are exposing the related - health errors as inner health errors and all API consumers can utilize this in the same fashion - as Exception -> InnerException. - :type inner_health_errors: - list[~azure.mgmt.recoveryservicessiterecovery.models.InnerHealthError] - :param error_source: Source of error. - :type error_source: str - :param error_type: Type of error. - :type error_type: str - :param error_level: Level of error. - :type error_level: str - :param error_category: Category of error. - :type error_category: str - :param error_code: Error code. - :type error_code: str - :param summary_message: Summary message of the entity. - :type summary_message: str - :param error_message: Error message. - :type error_message: str - :param possible_causes: Possible causes of error. - :type possible_causes: str - :param recommended_action: Recommended action to resolve error. - :type recommended_action: str - :param creation_time_utc: Error creation time (UTC). - :type creation_time_utc: ~datetime.datetime - :param recovery_provider_error_message: DRA error message. - :type recovery_provider_error_message: str - :param entity_id: ID of the entity. - :type entity_id: str - :param error_id: The health error unique id. - :type error_id: str - :param customer_resolvability: Value indicating whether the health error is customer - resolvable. Possible values include: "Allowed", "NotAllowed". - :type customer_resolvability: str or - ~azure.mgmt.recoveryservicessiterecovery.models.HealthErrorCustomerResolvability - """ - - _attribute_map = { - 'inner_health_errors': {'key': 'innerHealthErrors', 'type': '[InnerHealthError]'}, - 'error_source': {'key': 'errorSource', 'type': 'str'}, - 'error_type': {'key': 'errorType', 'type': 'str'}, - 'error_level': {'key': 'errorLevel', 'type': 'str'}, - 'error_category': {'key': 'errorCategory', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'str'}, - 'summary_message': {'key': 'summaryMessage', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'possible_causes': {'key': 'possibleCauses', 'type': 'str'}, - 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, - 'creation_time_utc': {'key': 'creationTimeUtc', 'type': 'iso-8601'}, - 'recovery_provider_error_message': {'key': 'recoveryProviderErrorMessage', 'type': 'str'}, - 'entity_id': {'key': 'entityId', 'type': 'str'}, - 'error_id': {'key': 'errorId', 'type': 'str'}, - 'customer_resolvability': {'key': 'customerResolvability', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HealthError, self).__init__(**kwargs) - self.inner_health_errors = kwargs.get('inner_health_errors', None) - self.error_source = kwargs.get('error_source', None) - self.error_type = kwargs.get('error_type', None) - self.error_level = kwargs.get('error_level', None) - self.error_category = kwargs.get('error_category', None) - self.error_code = kwargs.get('error_code', None) - self.summary_message = kwargs.get('summary_message', None) - self.error_message = kwargs.get('error_message', None) - self.possible_causes = kwargs.get('possible_causes', None) - self.recommended_action = kwargs.get('recommended_action', None) - self.creation_time_utc = kwargs.get('creation_time_utc', None) - self.recovery_provider_error_message = kwargs.get('recovery_provider_error_message', None) - self.entity_id = kwargs.get('entity_id', None) - self.error_id = kwargs.get('error_id', None) - self.customer_resolvability = kwargs.get('customer_resolvability', None) - - -class HealthErrorSummary(msrest.serialization.Model): - """class to define the summary of the health error details. - - :param summary_code: The code of the health error. - :type summary_code: str - :param category: The category of the health error. Possible values include: "None", - "Replication", "TestFailover", "Configuration", "FabricInfrastructure", "VersionExpiry", - "AgentAutoUpdateInfra", "AgentAutoUpdateArtifactDeleted", "AgentAutoUpdateRunAsAccount", - "AgentAutoUpdateRunAsAccountExpiry", "AgentAutoUpdateRunAsAccountExpired". - :type category: str or ~azure.mgmt.recoveryservicessiterecovery.models.HealthErrorCategory - :param severity: Severity of error. Possible values include: "NONE", "Warning", "Error", - "Info". - :type severity: str or ~azure.mgmt.recoveryservicessiterecovery.models.Severity - :param summary_message: The summary message of the health error. - :type summary_message: str - :param affected_resource_type: The type of affected ARM resource. - :type affected_resource_type: str - :param affected_resource_subtype: The sub type of any subcomponent within the ARM resource that - this might be applicable. Value remains null if not applicable. - :type affected_resource_subtype: str - :param affected_resource_correlation_ids: The list of affected resource correlation Ids. This - can be used to uniquely identify the count of items affected by a specific category and - severity as well as count of item affected by an specific issue. - :type affected_resource_correlation_ids: list[str] - """ - - _attribute_map = { - 'summary_code': {'key': 'summaryCode', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'severity': {'key': 'severity', 'type': 'str'}, - 'summary_message': {'key': 'summaryMessage', 'type': 'str'}, - 'affected_resource_type': {'key': 'affectedResourceType', 'type': 'str'}, - 'affected_resource_subtype': {'key': 'affectedResourceSubtype', 'type': 'str'}, - 'affected_resource_correlation_ids': {'key': 'affectedResourceCorrelationIds', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(HealthErrorSummary, self).__init__(**kwargs) - self.summary_code = kwargs.get('summary_code', None) - self.category = kwargs.get('category', None) - self.severity = kwargs.get('severity', None) - self.summary_message = kwargs.get('summary_message', None) - self.affected_resource_type = kwargs.get('affected_resource_type', None) - self.affected_resource_subtype = kwargs.get('affected_resource_subtype', None) - self.affected_resource_correlation_ids = kwargs.get('affected_resource_correlation_ids', None) - - -class HyperVHostDetails(msrest.serialization.Model): - """Hyper-V host details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The Hyper-V host Id. - :vartype id: str - :ivar name: The Hyper-V host name. - :vartype name: str - :ivar mars_agent_version: The Mars agent version. - :vartype mars_agent_version: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'mars_agent_version': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'mars_agent_version': {'key': 'marsAgentVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVHostDetails, self).__init__(**kwargs) - self.id = None - self.name = None - self.mars_agent_version = None - - -class HyperVReplica2012EventDetails(EventProviderSpecificDetails): - """Model class for event details of a HyperVReplica E2E event. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param container_name: The container friendly name. - :type container_name: str - :param fabric_name: The fabric friendly name. - :type fabric_name: str - :param remote_container_name: The remote container name. - :type remote_container_name: str - :param remote_fabric_name: The remote fabric name. - :type remote_fabric_name: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'fabric_name': {'key': 'fabricName', 'type': 'str'}, - 'remote_container_name': {'key': 'remoteContainerName', 'type': 'str'}, - 'remote_fabric_name': {'key': 'remoteFabricName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplica2012EventDetails, self).__init__(**kwargs) - self.instance_type = 'HyperVReplica2012' # type: str - self.container_name = kwargs.get('container_name', None) - self.fabric_name = kwargs.get('fabric_name', None) - self.remote_container_name = kwargs.get('remote_container_name', None) - self.remote_fabric_name = kwargs.get('remote_fabric_name', None) - - -class HyperVReplica2012R2EventDetails(EventProviderSpecificDetails): - """Model class for event details of a HyperVReplica blue E2E event. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param container_name: The container friendly name. - :type container_name: str - :param fabric_name: The fabric friendly name. - :type fabric_name: str - :param remote_container_name: The remote container name. - :type remote_container_name: str - :param remote_fabric_name: The remote fabric name. - :type remote_fabric_name: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'fabric_name': {'key': 'fabricName', 'type': 'str'}, - 'remote_container_name': {'key': 'remoteContainerName', 'type': 'str'}, - 'remote_fabric_name': {'key': 'remoteFabricName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplica2012R2EventDetails, self).__init__(**kwargs) - self.instance_type = 'HyperVReplica2012R2' # type: str - self.container_name = kwargs.get('container_name', None) - self.fabric_name = kwargs.get('fabric_name', None) - self.remote_container_name = kwargs.get('remote_container_name', None) - self.remote_fabric_name = kwargs.get('remote_fabric_name', None) - - -class HyperVReplicaAzureApplyRecoveryPointInput(ApplyRecoveryPointProviderSpecificInput): - """ApplyRecoveryPoint input specific to HyperVReplicaAzure provider. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param primary_kek_certificate_pfx: The primary kek certificate pfx. - :type primary_kek_certificate_pfx: str - :param secondary_kek_certificate_pfx: The secondary kek certificate pfx. - :type secondary_kek_certificate_pfx: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'primary_kek_certificate_pfx': {'key': 'primaryKekCertificatePfx', 'type': 'str'}, - 'secondary_kek_certificate_pfx': {'key': 'secondaryKekCertificatePfx', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaAzureApplyRecoveryPointInput, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaAzure' # type: str - self.primary_kek_certificate_pfx = kwargs.get('primary_kek_certificate_pfx', None) - self.secondary_kek_certificate_pfx = kwargs.get('secondary_kek_certificate_pfx', None) - - -class HyperVReplicaAzureDiskInputDetails(msrest.serialization.Model): - """Disk input details. - - :param disk_id: The DiskId. - :type disk_id: str - :param log_storage_account_id: The LogStorageAccountId. - :type log_storage_account_id: str - :param disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", - "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :param disk_encryption_set_id: The DiskEncryptionSet ARM ID. - :type disk_encryption_set_id: str - """ - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'log_storage_account_id': {'key': 'logStorageAccountId', 'type': 'str'}, - 'disk_type': {'key': 'diskType', 'type': 'str'}, - 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaAzureDiskInputDetails, self).__init__(**kwargs) - self.disk_id = kwargs.get('disk_id', None) - self.log_storage_account_id = kwargs.get('log_storage_account_id', None) - self.disk_type = kwargs.get('disk_type', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - - -class HyperVReplicaAzureEnableProtectionInput(EnableProtectionProviderSpecificInput): - """HyperVReplicaAzure specific enable protection input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param hv_host_vm_id: The Hyper-V host VM Id. - :type hv_host_vm_id: str - :param vm_name: The VM Name. - :type vm_name: str - :param os_type: The OS type associated with VM. - :type os_type: str - :param vhd_id: The OS disk VHD id associated with VM. - :type vhd_id: str - :param target_storage_account_id: The storage account Id. - :type target_storage_account_id: str - :param target_azure_network_id: The selected target Azure network Id. - :type target_azure_network_id: str - :param target_azure_subnet_id: The selected target Azure subnet Id. - :type target_azure_subnet_id: str - :param enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after - failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. - :type enable_rdp_on_target_option: str - :param target_azure_vm_name: The target azure VM Name. - :type target_azure_vm_name: str - :param log_storage_account_id: The storage account to be used for logging during replication. - :type log_storage_account_id: str - :param disks_to_include: The list of VHD Ids of disks to be protected. - :type disks_to_include: list[str] - :param target_azure_v1_resource_group_id: The Id of the target resource group (for classic - deployment) in which the failover VM is to be created. - :type target_azure_v1_resource_group_id: str - :param target_azure_v2_resource_group_id: The Id of the target resource group (for resource - manager deployment) in which the failover VM is to be created. - :type target_azure_v2_resource_group_id: str - :param use_managed_disks: A value indicating whether managed disks should be used during - failover. - :type use_managed_disks: str - :param target_availability_set_id: The target availability set ARM Id for resource manager - deployment. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", - "WindowsServer". - :type license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType - :param sql_server_license_type: The SQL Server license type. Possible values include: - "NotSpecified", "NoLicenseType", "PAYG", "AHUB". - :type sql_server_license_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType - :param target_vm_size: The target VM size. - :type target_vm_size: str - :param target_proximity_placement_group_id: The proximity placement group ARM Id. - :type target_proximity_placement_group_id: str - :param use_managed_disks_for_replication: A value indicating whether managed disks should be - used during replication. - :type use_managed_disks_for_replication: str - :param disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", - "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :param disks_to_include_for_managed_disks: The disks to include list for managed disks. - :type disks_to_include_for_managed_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.HyperVReplicaAzureDiskInputDetails] - :param disk_encryption_set_id: The DiskEncryptionSet ARM Id. - :type disk_encryption_set_id: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param seed_managed_disk_tags: The tags for the seed managed disks. - :type seed_managed_disk_tags: dict[str, str] - :param target_managed_disk_tags: The tags for the target managed disks. - :type target_managed_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'hv_host_vm_id': {'key': 'hvHostVmId', 'type': 'str'}, - 'vm_name': {'key': 'vmName', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vhd_id': {'key': 'vhdId', 'type': 'str'}, - 'target_storage_account_id': {'key': 'targetStorageAccountId', 'type': 'str'}, - 'target_azure_network_id': {'key': 'targetAzureNetworkId', 'type': 'str'}, - 'target_azure_subnet_id': {'key': 'targetAzureSubnetId', 'type': 'str'}, - 'enable_rdp_on_target_option': {'key': 'enableRdpOnTargetOption', 'type': 'str'}, - 'target_azure_vm_name': {'key': 'targetAzureVmName', 'type': 'str'}, - 'log_storage_account_id': {'key': 'logStorageAccountId', 'type': 'str'}, - 'disks_to_include': {'key': 'disksToInclude', 'type': '[str]'}, - 'target_azure_v1_resource_group_id': {'key': 'targetAzureV1ResourceGroupId', 'type': 'str'}, - 'target_azure_v2_resource_group_id': {'key': 'targetAzureV2ResourceGroupId', 'type': 'str'}, - 'use_managed_disks': {'key': 'useManagedDisks', 'type': 'str'}, - 'target_availability_set_id': {'key': 'targetAvailabilitySetId', 'type': 'str'}, - 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'sql_server_license_type': {'key': 'sqlServerLicenseType', 'type': 'str'}, - 'target_vm_size': {'key': 'targetVmSize', 'type': 'str'}, - 'target_proximity_placement_group_id': {'key': 'targetProximityPlacementGroupId', 'type': 'str'}, - 'use_managed_disks_for_replication': {'key': 'useManagedDisksForReplication', 'type': 'str'}, - 'disk_type': {'key': 'diskType', 'type': 'str'}, - 'disks_to_include_for_managed_disks': {'key': 'disksToIncludeForManagedDisks', 'type': '[HyperVReplicaAzureDiskInputDetails]'}, - 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, - 'target_vm_tags': {'key': 'targetVmTags', 'type': '{str}'}, - 'seed_managed_disk_tags': {'key': 'seedManagedDiskTags', 'type': '{str}'}, - 'target_managed_disk_tags': {'key': 'targetManagedDiskTags', 'type': '{str}'}, - 'target_nic_tags': {'key': 'targetNicTags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaAzureEnableProtectionInput, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaAzure' # type: str - self.hv_host_vm_id = kwargs.get('hv_host_vm_id', None) - self.vm_name = kwargs.get('vm_name', None) - self.os_type = kwargs.get('os_type', None) - self.vhd_id = kwargs.get('vhd_id', None) - self.target_storage_account_id = kwargs.get('target_storage_account_id', None) - self.target_azure_network_id = kwargs.get('target_azure_network_id', None) - self.target_azure_subnet_id = kwargs.get('target_azure_subnet_id', None) - self.enable_rdp_on_target_option = kwargs.get('enable_rdp_on_target_option', None) - self.target_azure_vm_name = kwargs.get('target_azure_vm_name', None) - self.log_storage_account_id = kwargs.get('log_storage_account_id', None) - self.disks_to_include = kwargs.get('disks_to_include', None) - self.target_azure_v1_resource_group_id = kwargs.get('target_azure_v1_resource_group_id', None) - self.target_azure_v2_resource_group_id = kwargs.get('target_azure_v2_resource_group_id', None) - self.use_managed_disks = kwargs.get('use_managed_disks', None) - self.target_availability_set_id = kwargs.get('target_availability_set_id', None) - self.target_availability_zone = kwargs.get('target_availability_zone', None) - self.license_type = kwargs.get('license_type', None) - self.sql_server_license_type = kwargs.get('sql_server_license_type', None) - self.target_vm_size = kwargs.get('target_vm_size', None) - self.target_proximity_placement_group_id = kwargs.get('target_proximity_placement_group_id', None) - self.use_managed_disks_for_replication = kwargs.get('use_managed_disks_for_replication', None) - self.disk_type = kwargs.get('disk_type', None) - self.disks_to_include_for_managed_disks = kwargs.get('disks_to_include_for_managed_disks', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.target_vm_tags = kwargs.get('target_vm_tags', None) - self.seed_managed_disk_tags = kwargs.get('seed_managed_disk_tags', None) - self.target_managed_disk_tags = kwargs.get('target_managed_disk_tags', None) - self.target_nic_tags = kwargs.get('target_nic_tags', None) - - -class HyperVReplicaAzureEventDetails(EventProviderSpecificDetails): - """Model class for event details of a HyperVReplica E2A event. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param container_name: The container friendly name. - :type container_name: str - :param fabric_name: The fabric friendly name. - :type fabric_name: str - :param remote_container_name: The remote container name. - :type remote_container_name: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'fabric_name': {'key': 'fabricName', 'type': 'str'}, - 'remote_container_name': {'key': 'remoteContainerName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaAzureEventDetails, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaAzure' # type: str - self.container_name = kwargs.get('container_name', None) - self.fabric_name = kwargs.get('fabric_name', None) - self.remote_container_name = kwargs.get('remote_container_name', None) - - -class PlannedFailoverProviderSpecificFailoverInput(msrest.serialization.Model): - """Provider specific failover input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: HyperVReplicaAzurePlannedFailoverProviderInput, HyperVReplicaAzureFailbackProviderInput, InMageRcmFailbackPlannedFailoverProviderInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'HyperVReplicaAzure': 'HyperVReplicaAzurePlannedFailoverProviderInput', 'HyperVReplicaAzureFailback': 'HyperVReplicaAzureFailbackProviderInput', 'InMageRcmFailback': 'InMageRcmFailbackPlannedFailoverProviderInput'} - } - - def __init__( - self, - **kwargs - ): - super(PlannedFailoverProviderSpecificFailoverInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class HyperVReplicaAzureFailbackProviderInput(PlannedFailoverProviderSpecificFailoverInput): - """HyperVReplicaAzureFailback specific planned failover input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param data_sync_option: Data sync option. - :type data_sync_option: str - :param recovery_vm_creation_option: ALR options to create alternate recovery. - :type recovery_vm_creation_option: str - :param provider_id_for_alternate_recovery: Provider Id for alternate location. - :type provider_id_for_alternate_recovery: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'data_sync_option': {'key': 'dataSyncOption', 'type': 'str'}, - 'recovery_vm_creation_option': {'key': 'recoveryVmCreationOption', 'type': 'str'}, - 'provider_id_for_alternate_recovery': {'key': 'providerIdForAlternateRecovery', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaAzureFailbackProviderInput, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaAzureFailback' # type: str - self.data_sync_option = kwargs.get('data_sync_option', None) - self.recovery_vm_creation_option = kwargs.get('recovery_vm_creation_option', None) - self.provider_id_for_alternate_recovery = kwargs.get('provider_id_for_alternate_recovery', None) - - -class HyperVReplicaAzureManagedDiskDetails(msrest.serialization.Model): - """Hyper-V Managed disk details. - - :param disk_id: The disk Id. - :type disk_id: str - :param seed_managed_disk_id: Seed managed disk Id. - :type seed_managed_disk_id: str - :param replica_disk_type: The replica disk type. - :type replica_disk_type: str - :param disk_encryption_set_id: The disk encryption set ARM Id. - :type disk_encryption_set_id: str - """ - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'seed_managed_disk_id': {'key': 'seedManagedDiskId', 'type': 'str'}, - 'replica_disk_type': {'key': 'replicaDiskType', 'type': 'str'}, - 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaAzureManagedDiskDetails, self).__init__(**kwargs) - self.disk_id = kwargs.get('disk_id', None) - self.seed_managed_disk_id = kwargs.get('seed_managed_disk_id', None) - self.replica_disk_type = kwargs.get('replica_disk_type', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - - -class HyperVReplicaAzurePlannedFailoverProviderInput(PlannedFailoverProviderSpecificFailoverInput): - """HyperVReplicaAzure specific planned failover input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param primary_kek_certificate_pfx: Primary kek certificate pfx. - :type primary_kek_certificate_pfx: str - :param secondary_kek_certificate_pfx: Secondary kek certificate pfx. - :type secondary_kek_certificate_pfx: str - :param recovery_point_id: The recovery point id to be passed to failover to a particular - recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'primary_kek_certificate_pfx': {'key': 'primaryKekCertificatePfx', 'type': 'str'}, - 'secondary_kek_certificate_pfx': {'key': 'secondaryKekCertificatePfx', 'type': 'str'}, - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaAzurePlannedFailoverProviderInput, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaAzure' # type: str - self.primary_kek_certificate_pfx = kwargs.get('primary_kek_certificate_pfx', None) - self.secondary_kek_certificate_pfx = kwargs.get('secondary_kek_certificate_pfx', None) - self.recovery_point_id = kwargs.get('recovery_point_id', None) - - -class HyperVReplicaAzurePolicyDetails(PolicyProviderSpecificDetails): - """Hyper-V Replica Azure specific protection profile details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param recovery_point_history_duration_in_hours: The duration (in hours) to which point the - recovery history needs to be maintained. - :type recovery_point_history_duration_in_hours: int - :param application_consistent_snapshot_frequency_in_hours: The interval (in hours) at which - Hyper-V Replica should create an application consistent snapshot within the VM. - :type application_consistent_snapshot_frequency_in_hours: int - :param replication_interval: The replication interval. - :type replication_interval: int - :param online_replication_start_time: The scheduled start time for the initial replication. If - this parameter is Null, the initial replication starts immediately. - :type online_replication_start_time: str - :param encryption: A value indicating whether encryption is enabled for virtual machines in - this cloud. - :type encryption: str - :param active_storage_account_id: The active storage account Id. - :type active_storage_account_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_history_duration_in_hours': {'key': 'recoveryPointHistoryDurationInHours', 'type': 'int'}, - 'application_consistent_snapshot_frequency_in_hours': {'key': 'applicationConsistentSnapshotFrequencyInHours', 'type': 'int'}, - 'replication_interval': {'key': 'replicationInterval', 'type': 'int'}, - 'online_replication_start_time': {'key': 'onlineReplicationStartTime', 'type': 'str'}, - 'encryption': {'key': 'encryption', 'type': 'str'}, - 'active_storage_account_id': {'key': 'activeStorageAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaAzurePolicyDetails, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaAzure' # type: str - self.recovery_point_history_duration_in_hours = kwargs.get('recovery_point_history_duration_in_hours', None) - self.application_consistent_snapshot_frequency_in_hours = kwargs.get('application_consistent_snapshot_frequency_in_hours', None) - self.replication_interval = kwargs.get('replication_interval', None) - self.online_replication_start_time = kwargs.get('online_replication_start_time', None) - self.encryption = kwargs.get('encryption', None) - self.active_storage_account_id = kwargs.get('active_storage_account_id', None) - - -class HyperVReplicaAzurePolicyInput(PolicyProviderSpecificInput): - """Hyper-V Replica Azure specific input for creating a protection profile. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_history_duration: The duration (in hours) to which point the recovery - history needs to be maintained. - :type recovery_point_history_duration: int - :param application_consistent_snapshot_frequency_in_hours: The interval (in hours) at which - Hyper-V Replica should create an application consistent snapshot within the VM. - :type application_consistent_snapshot_frequency_in_hours: int - :param replication_interval: The replication interval. - :type replication_interval: int - :param online_replication_start_time: The scheduled start time for the initial replication. If - this parameter is Null, the initial replication starts immediately. - :type online_replication_start_time: str - :param storage_accounts: The list of storage accounts to which the VMs in the primary cloud can - replicate to. - :type storage_accounts: list[str] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_history_duration': {'key': 'recoveryPointHistoryDuration', 'type': 'int'}, - 'application_consistent_snapshot_frequency_in_hours': {'key': 'applicationConsistentSnapshotFrequencyInHours', 'type': 'int'}, - 'replication_interval': {'key': 'replicationInterval', 'type': 'int'}, - 'online_replication_start_time': {'key': 'onlineReplicationStartTime', 'type': 'str'}, - 'storage_accounts': {'key': 'storageAccounts', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaAzurePolicyInput, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaAzure' # type: str - self.recovery_point_history_duration = kwargs.get('recovery_point_history_duration', None) - self.application_consistent_snapshot_frequency_in_hours = kwargs.get('application_consistent_snapshot_frequency_in_hours', None) - self.replication_interval = kwargs.get('replication_interval', None) - self.online_replication_start_time = kwargs.get('online_replication_start_time', None) - self.storage_accounts = kwargs.get('storage_accounts', None) - - -class HyperVReplicaAzureReplicationDetails(ReplicationProviderSpecificSettings): - """Hyper V Replica Azure provider specific settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param azure_vm_disk_details: Azure VM Disk details. - :type azure_vm_disk_details: - list[~azure.mgmt.recoveryservicessiterecovery.models.AzureVmDiskDetails] - :param recovery_azure_vm_name: Recovery Azure given name. - :type recovery_azure_vm_name: str - :param recovery_azure_vm_size: The Recovery Azure VM size. - :type recovery_azure_vm_size: str - :param recovery_azure_storage_account: The recovery Azure storage account. - :type recovery_azure_storage_account: str - :param recovery_azure_log_storage_account_id: The ARM id of the log storage account used for - replication. This will be set to null if no log storage account was provided during enable - protection. - :type recovery_azure_log_storage_account_id: str - :param last_replicated_time: The Last replication time. - :type last_replicated_time: ~datetime.datetime - :param rpo_in_seconds: Last RPO value. - :type rpo_in_seconds: long - :param last_rpo_calculated_time: The last RPO calculated time. - :type last_rpo_calculated_time: ~datetime.datetime - :param vm_id: The virtual machine Id. - :type vm_id: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param initial_replication_details: Initial replication details. - :type initial_replication_details: - ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails - :param vm_nics: The PE Network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] - :param selected_recovery_azure_network_id: The selected recovery azure network Id. - :type selected_recovery_azure_network_id: str - :param selected_source_nic_id: The selected source nic Id which will be used as the primary nic - during failover. - :type selected_source_nic_id: str - :param encryption: The encryption info. - :type encryption: str - :param o_s_details: The operating system info. - :type o_s_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDetails - :param source_vm_ram_size_in_mb: The RAM size of the VM on the primary side. - :type source_vm_ram_size_in_mb: int - :param source_vm_cpu_count: The CPU count of the VM on the primary side. - :type source_vm_cpu_count: int - :param enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after - failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. - :type enable_rdp_on_target_option: str - :param recovery_azure_resource_group_id: The target resource group Id. - :type recovery_azure_resource_group_id: str - :param recovery_availability_set_id: The recovery availability set Id. - :type recovery_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param use_managed_disks: A value indicating whether managed disks should be used during - failover. - :type use_managed_disks: str - :param license_type: License Type of the VM to be used. - :type license_type: str - :param sql_server_license_type: The SQL Server license type. - :type sql_server_license_type: str - :ivar last_recovery_point_received: The last recovery point received time. - :vartype last_recovery_point_received: ~datetime.datetime - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param seed_managed_disk_tags: The tags for the seed managed disks. - :type seed_managed_disk_tags: dict[str, str] - :param target_managed_disk_tags: The tags for the target managed disks. - :type target_managed_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] - :param protected_managed_disks: The list of protected managed disks. - :type protected_managed_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.HyperVReplicaAzureManagedDiskDetails] - """ - - _validation = { - 'instance_type': {'required': True}, - 'last_recovery_point_received': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'azure_vm_disk_details': {'key': 'azureVmDiskDetails', 'type': '[AzureVmDiskDetails]'}, - 'recovery_azure_vm_name': {'key': 'recoveryAzureVmName', 'type': 'str'}, - 'recovery_azure_vm_size': {'key': 'recoveryAzureVMSize', 'type': 'str'}, - 'recovery_azure_storage_account': {'key': 'recoveryAzureStorageAccount', 'type': 'str'}, - 'recovery_azure_log_storage_account_id': {'key': 'recoveryAzureLogStorageAccountId', 'type': 'str'}, - 'last_replicated_time': {'key': 'lastReplicatedTime', 'type': 'iso-8601'}, - 'rpo_in_seconds': {'key': 'rpoInSeconds', 'type': 'long'}, - 'last_rpo_calculated_time': {'key': 'lastRpoCalculatedTime', 'type': 'iso-8601'}, - 'vm_id': {'key': 'vmId', 'type': 'str'}, - 'vm_protection_state': {'key': 'vmProtectionState', 'type': 'str'}, - 'vm_protection_state_description': {'key': 'vmProtectionStateDescription', 'type': 'str'}, - 'initial_replication_details': {'key': 'initialReplicationDetails', 'type': 'InitialReplicationDetails'}, - 'vm_nics': {'key': 'vmNics', 'type': '[VMNicDetails]'}, - 'selected_recovery_azure_network_id': {'key': 'selectedRecoveryAzureNetworkId', 'type': 'str'}, - 'selected_source_nic_id': {'key': 'selectedSourceNicId', 'type': 'str'}, - 'encryption': {'key': 'encryption', 'type': 'str'}, - 'o_s_details': {'key': 'oSDetails', 'type': 'OSDetails'}, - 'source_vm_ram_size_in_mb': {'key': 'sourceVmRamSizeInMB', 'type': 'int'}, - 'source_vm_cpu_count': {'key': 'sourceVmCpuCount', 'type': 'int'}, - 'enable_rdp_on_target_option': {'key': 'enableRdpOnTargetOption', 'type': 'str'}, - 'recovery_azure_resource_group_id': {'key': 'recoveryAzureResourceGroupId', 'type': 'str'}, - 'recovery_availability_set_id': {'key': 'recoveryAvailabilitySetId', 'type': 'str'}, - 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, - 'target_proximity_placement_group_id': {'key': 'targetProximityPlacementGroupId', 'type': 'str'}, - 'use_managed_disks': {'key': 'useManagedDisks', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'sql_server_license_type': {'key': 'sqlServerLicenseType', 'type': 'str'}, - 'last_recovery_point_received': {'key': 'lastRecoveryPointReceived', 'type': 'iso-8601'}, - 'target_vm_tags': {'key': 'targetVmTags', 'type': '{str}'}, - 'seed_managed_disk_tags': {'key': 'seedManagedDiskTags', 'type': '{str}'}, - 'target_managed_disk_tags': {'key': 'targetManagedDiskTags', 'type': '{str}'}, - 'target_nic_tags': {'key': 'targetNicTags', 'type': '{str}'}, - 'protected_managed_disks': {'key': 'protectedManagedDisks', 'type': '[HyperVReplicaAzureManagedDiskDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaAzureReplicationDetails, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaAzure' # type: str - self.azure_vm_disk_details = kwargs.get('azure_vm_disk_details', None) - self.recovery_azure_vm_name = kwargs.get('recovery_azure_vm_name', None) - self.recovery_azure_vm_size = kwargs.get('recovery_azure_vm_size', None) - self.recovery_azure_storage_account = kwargs.get('recovery_azure_storage_account', None) - self.recovery_azure_log_storage_account_id = kwargs.get('recovery_azure_log_storage_account_id', None) - self.last_replicated_time = kwargs.get('last_replicated_time', None) - self.rpo_in_seconds = kwargs.get('rpo_in_seconds', None) - self.last_rpo_calculated_time = kwargs.get('last_rpo_calculated_time', None) - self.vm_id = kwargs.get('vm_id', None) - self.vm_protection_state = kwargs.get('vm_protection_state', None) - self.vm_protection_state_description = kwargs.get('vm_protection_state_description', None) - self.initial_replication_details = kwargs.get('initial_replication_details', None) - self.vm_nics = kwargs.get('vm_nics', None) - self.selected_recovery_azure_network_id = kwargs.get('selected_recovery_azure_network_id', None) - self.selected_source_nic_id = kwargs.get('selected_source_nic_id', None) - self.encryption = kwargs.get('encryption', None) - self.o_s_details = kwargs.get('o_s_details', None) - self.source_vm_ram_size_in_mb = kwargs.get('source_vm_ram_size_in_mb', None) - self.source_vm_cpu_count = kwargs.get('source_vm_cpu_count', None) - self.enable_rdp_on_target_option = kwargs.get('enable_rdp_on_target_option', None) - self.recovery_azure_resource_group_id = kwargs.get('recovery_azure_resource_group_id', None) - self.recovery_availability_set_id = kwargs.get('recovery_availability_set_id', None) - self.target_availability_zone = kwargs.get('target_availability_zone', None) - self.target_proximity_placement_group_id = kwargs.get('target_proximity_placement_group_id', None) - self.use_managed_disks = kwargs.get('use_managed_disks', None) - self.license_type = kwargs.get('license_type', None) - self.sql_server_license_type = kwargs.get('sql_server_license_type', None) - self.last_recovery_point_received = None - self.target_vm_tags = kwargs.get('target_vm_tags', None) - self.seed_managed_disk_tags = kwargs.get('seed_managed_disk_tags', None) - self.target_managed_disk_tags = kwargs.get('target_managed_disk_tags', None) - self.target_nic_tags = kwargs.get('target_nic_tags', None) - self.protected_managed_disks = kwargs.get('protected_managed_disks', None) - - -class HyperVReplicaAzureReprotectInput(ReverseReplicationProviderSpecificInput): - """Azure specific reprotect input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param hv_host_vm_id: The Hyper-V host Vm Id. - :type hv_host_vm_id: str - :param vm_name: The Vm Name. - :type vm_name: str - :param os_type: The OS type associated with vm. - :type os_type: str - :param v_hd_id: The OS disk VHD id associated with vm. - :type v_hd_id: str - :param storage_account_id: The storage account name. - :type storage_account_id: str - :param log_storage_account_id: The storage account to be used for logging during replication. - :type log_storage_account_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'hv_host_vm_id': {'key': 'hvHostVmId', 'type': 'str'}, - 'vm_name': {'key': 'vmName', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'v_hd_id': {'key': 'vHDId', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, - 'log_storage_account_id': {'key': 'logStorageAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaAzureReprotectInput, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaAzure' # type: str - self.hv_host_vm_id = kwargs.get('hv_host_vm_id', None) - self.vm_name = kwargs.get('vm_name', None) - self.os_type = kwargs.get('os_type', None) - self.v_hd_id = kwargs.get('v_hd_id', None) - self.storage_account_id = kwargs.get('storage_account_id', None) - self.log_storage_account_id = kwargs.get('log_storage_account_id', None) - - -class HyperVReplicaAzureTestFailoverInput(TestFailoverProviderSpecificInput): - """HvrA provider specific input for test failover. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param primary_kek_certificate_pfx: Primary kek certificate pfx. - :type primary_kek_certificate_pfx: str - :param secondary_kek_certificate_pfx: Secondary kek certificate pfx. - :type secondary_kek_certificate_pfx: str - :param recovery_point_id: The recovery point id to be passed to test failover to a particular - recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'primary_kek_certificate_pfx': {'key': 'primaryKekCertificatePfx', 'type': 'str'}, - 'secondary_kek_certificate_pfx': {'key': 'secondaryKekCertificatePfx', 'type': 'str'}, - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaAzureTestFailoverInput, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaAzure' # type: str - self.primary_kek_certificate_pfx = kwargs.get('primary_kek_certificate_pfx', None) - self.secondary_kek_certificate_pfx = kwargs.get('secondary_kek_certificate_pfx', None) - self.recovery_point_id = kwargs.get('recovery_point_id', None) - - -class HyperVReplicaAzureUnplannedFailoverInput(UnplannedFailoverProviderSpecificInput): - """HvrA provider specific input for unplanned failover. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param primary_kek_certificate_pfx: Primary kek certificate pfx. - :type primary_kek_certificate_pfx: str - :param secondary_kek_certificate_pfx: Secondary kek certificate pfx. - :type secondary_kek_certificate_pfx: str - :param recovery_point_id: The recovery point id to be passed to failover to a particular - recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'primary_kek_certificate_pfx': {'key': 'primaryKekCertificatePfx', 'type': 'str'}, - 'secondary_kek_certificate_pfx': {'key': 'secondaryKekCertificatePfx', 'type': 'str'}, - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaAzureUnplannedFailoverInput, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaAzure' # type: str - self.primary_kek_certificate_pfx = kwargs.get('primary_kek_certificate_pfx', None) - self.secondary_kek_certificate_pfx = kwargs.get('secondary_kek_certificate_pfx', None) - self.recovery_point_id = kwargs.get('recovery_point_id', None) - - -class HyperVReplicaAzureUpdateReplicationProtectedItemInput(UpdateReplicationProtectedItemProviderInput): - """HyperV replica Azure input to update replication protected item. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_azure_v1_resource_group_id: The recovery Azure resource group Id for classic - deployment. - :type recovery_azure_v1_resource_group_id: str - :param recovery_azure_v2_resource_group_id: The recovery Azure resource group Id for resource - manager deployment. - :type recovery_azure_v2_resource_group_id: str - :param use_managed_disks: A value indicating whether managed disks should be used during - failover. - :type use_managed_disks: str - :param disk_id_to_disk_encryption_map: The dictionary of disk resource Id to disk encryption - set ARM Id. - :type disk_id_to_disk_encryption_map: dict[str, str] - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param target_managed_disk_tags: The tags for the target managed disks. - :type target_managed_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] - :param sql_server_license_type: The SQL Server license type. Possible values include: - "NotSpecified", "NoLicenseType", "PAYG", "AHUB". - :type sql_server_license_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType - :param vm_disks: The list of disk update properties. - :type vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.UpdateDiskInput] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_azure_v1_resource_group_id': {'key': 'recoveryAzureV1ResourceGroupId', 'type': 'str'}, - 'recovery_azure_v2_resource_group_id': {'key': 'recoveryAzureV2ResourceGroupId', 'type': 'str'}, - 'use_managed_disks': {'key': 'useManagedDisks', 'type': 'str'}, - 'disk_id_to_disk_encryption_map': {'key': 'diskIdToDiskEncryptionMap', 'type': '{str}'}, - 'target_proximity_placement_group_id': {'key': 'targetProximityPlacementGroupId', 'type': 'str'}, - 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, - 'target_vm_tags': {'key': 'targetVmTags', 'type': '{str}'}, - 'target_managed_disk_tags': {'key': 'targetManagedDiskTags', 'type': '{str}'}, - 'target_nic_tags': {'key': 'targetNicTags', 'type': '{str}'}, - 'sql_server_license_type': {'key': 'sqlServerLicenseType', 'type': 'str'}, - 'vm_disks': {'key': 'vmDisks', 'type': '[UpdateDiskInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaAzureUpdateReplicationProtectedItemInput, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaAzure' # type: str - self.recovery_azure_v1_resource_group_id = kwargs.get('recovery_azure_v1_resource_group_id', None) - self.recovery_azure_v2_resource_group_id = kwargs.get('recovery_azure_v2_resource_group_id', None) - self.use_managed_disks = kwargs.get('use_managed_disks', None) - self.disk_id_to_disk_encryption_map = kwargs.get('disk_id_to_disk_encryption_map', None) - self.target_proximity_placement_group_id = kwargs.get('target_proximity_placement_group_id', None) - self.target_availability_zone = kwargs.get('target_availability_zone', None) - self.target_vm_tags = kwargs.get('target_vm_tags', None) - self.target_managed_disk_tags = kwargs.get('target_managed_disk_tags', None) - self.target_nic_tags = kwargs.get('target_nic_tags', None) - self.sql_server_license_type = kwargs.get('sql_server_license_type', None) - self.vm_disks = kwargs.get('vm_disks', None) - - -class HyperVReplicaBaseEventDetails(EventProviderSpecificDetails): - """Abstract model class for event details of a HyperVReplica E2E event. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param container_name: The container friendly name. - :type container_name: str - :param fabric_name: The fabric friendly name. - :type fabric_name: str - :param remote_container_name: The remote container name. - :type remote_container_name: str - :param remote_fabric_name: The remote fabric name. - :type remote_fabric_name: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'fabric_name': {'key': 'fabricName', 'type': 'str'}, - 'remote_container_name': {'key': 'remoteContainerName', 'type': 'str'}, - 'remote_fabric_name': {'key': 'remoteFabricName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaBaseEventDetails, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaBaseEventDetails' # type: str - self.container_name = kwargs.get('container_name', None) - self.fabric_name = kwargs.get('fabric_name', None) - self.remote_container_name = kwargs.get('remote_container_name', None) - self.remote_fabric_name = kwargs.get('remote_fabric_name', None) - - -class HyperVReplicaBasePolicyDetails(PolicyProviderSpecificDetails): - """Base class for HyperVReplica policy details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param recovery_points: A value indicating the number of recovery points. - :type recovery_points: int - :param application_consistent_snapshot_frequency_in_hours: A value indicating the application - consistent frequency. - :type application_consistent_snapshot_frequency_in_hours: int - :param compression: A value indicating whether compression has to be enabled. - :type compression: str - :param initial_replication_method: A value indicating whether IR is online. - :type initial_replication_method: str - :param online_replication_start_time: A value indicating the online IR start time. - :type online_replication_start_time: str - :param offline_replication_import_path: A value indicating the offline IR import path. - :type offline_replication_import_path: str - :param offline_replication_export_path: A value indicating the offline IR export path. - :type offline_replication_export_path: str - :param replication_port: A value indicating the recovery HTTPS port. - :type replication_port: int - :param allowed_authentication_type: A value indicating the authentication type. - :type allowed_authentication_type: int - :param replica_deletion_option: A value indicating whether the VM has to be auto deleted. - Supported Values: String.Empty, None, OnRecoveryCloud. - :type replica_deletion_option: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_points': {'key': 'recoveryPoints', 'type': 'int'}, - 'application_consistent_snapshot_frequency_in_hours': {'key': 'applicationConsistentSnapshotFrequencyInHours', 'type': 'int'}, - 'compression': {'key': 'compression', 'type': 'str'}, - 'initial_replication_method': {'key': 'initialReplicationMethod', 'type': 'str'}, - 'online_replication_start_time': {'key': 'onlineReplicationStartTime', 'type': 'str'}, - 'offline_replication_import_path': {'key': 'offlineReplicationImportPath', 'type': 'str'}, - 'offline_replication_export_path': {'key': 'offlineReplicationExportPath', 'type': 'str'}, - 'replication_port': {'key': 'replicationPort', 'type': 'int'}, - 'allowed_authentication_type': {'key': 'allowedAuthenticationType', 'type': 'int'}, - 'replica_deletion_option': {'key': 'replicaDeletionOption', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaBasePolicyDetails, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaBasePolicyDetails' # type: str - self.recovery_points = kwargs.get('recovery_points', None) - self.application_consistent_snapshot_frequency_in_hours = kwargs.get('application_consistent_snapshot_frequency_in_hours', None) - self.compression = kwargs.get('compression', None) - self.initial_replication_method = kwargs.get('initial_replication_method', None) - self.online_replication_start_time = kwargs.get('online_replication_start_time', None) - self.offline_replication_import_path = kwargs.get('offline_replication_import_path', None) - self.offline_replication_export_path = kwargs.get('offline_replication_export_path', None) - self.replication_port = kwargs.get('replication_port', None) - self.allowed_authentication_type = kwargs.get('allowed_authentication_type', None) - self.replica_deletion_option = kwargs.get('replica_deletion_option', None) - - -class HyperVReplicaBaseReplicationDetails(ReplicationProviderSpecificSettings): - """Hyper V replica provider specific settings base class. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param last_replicated_time: The Last replication time. - :type last_replicated_time: ~datetime.datetime - :param vm_nics: The PE Network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] - :param vm_id: The virtual machine Id. - :type vm_id: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param initial_replication_details: Initial replication details. - :type initial_replication_details: - ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails - :param v_m_disk_details: VM disk details. - :type v_m_disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'last_replicated_time': {'key': 'lastReplicatedTime', 'type': 'iso-8601'}, - 'vm_nics': {'key': 'vmNics', 'type': '[VMNicDetails]'}, - 'vm_id': {'key': 'vmId', 'type': 'str'}, - 'vm_protection_state': {'key': 'vmProtectionState', 'type': 'str'}, - 'vm_protection_state_description': {'key': 'vmProtectionStateDescription', 'type': 'str'}, - 'initial_replication_details': {'key': 'initialReplicationDetails', 'type': 'InitialReplicationDetails'}, - 'v_m_disk_details': {'key': 'vMDiskDetails', 'type': '[DiskDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaBaseReplicationDetails, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaBaseReplicationDetails' # type: str - self.last_replicated_time = kwargs.get('last_replicated_time', None) - self.vm_nics = kwargs.get('vm_nics', None) - self.vm_id = kwargs.get('vm_id', None) - self.vm_protection_state = kwargs.get('vm_protection_state', None) - self.vm_protection_state_description = kwargs.get('vm_protection_state_description', None) - self.initial_replication_details = kwargs.get('initial_replication_details', None) - self.v_m_disk_details = kwargs.get('v_m_disk_details', None) - - -class HyperVReplicaBluePolicyDetails(PolicyProviderSpecificDetails): - """Hyper-V Replica Blue specific protection profile details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param replication_frequency_in_seconds: A value indicating the replication interval. - :type replication_frequency_in_seconds: int - :param recovery_points: A value indicating the number of recovery points. - :type recovery_points: int - :param application_consistent_snapshot_frequency_in_hours: A value indicating the application - consistent frequency. - :type application_consistent_snapshot_frequency_in_hours: int - :param compression: A value indicating whether compression has to be enabled. - :type compression: str - :param initial_replication_method: A value indicating whether IR is online. - :type initial_replication_method: str - :param online_replication_start_time: A value indicating the online IR start time. - :type online_replication_start_time: str - :param offline_replication_import_path: A value indicating the offline IR import path. - :type offline_replication_import_path: str - :param offline_replication_export_path: A value indicating the offline IR export path. - :type offline_replication_export_path: str - :param replication_port: A value indicating the recovery HTTPS port. - :type replication_port: int - :param allowed_authentication_type: A value indicating the authentication type. - :type allowed_authentication_type: int - :param replica_deletion_option: A value indicating whether the VM has to be auto deleted. - Supported Values: String.Empty, None, OnRecoveryCloud. - :type replica_deletion_option: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'replication_frequency_in_seconds': {'key': 'replicationFrequencyInSeconds', 'type': 'int'}, - 'recovery_points': {'key': 'recoveryPoints', 'type': 'int'}, - 'application_consistent_snapshot_frequency_in_hours': {'key': 'applicationConsistentSnapshotFrequencyInHours', 'type': 'int'}, - 'compression': {'key': 'compression', 'type': 'str'}, - 'initial_replication_method': {'key': 'initialReplicationMethod', 'type': 'str'}, - 'online_replication_start_time': {'key': 'onlineReplicationStartTime', 'type': 'str'}, - 'offline_replication_import_path': {'key': 'offlineReplicationImportPath', 'type': 'str'}, - 'offline_replication_export_path': {'key': 'offlineReplicationExportPath', 'type': 'str'}, - 'replication_port': {'key': 'replicationPort', 'type': 'int'}, - 'allowed_authentication_type': {'key': 'allowedAuthenticationType', 'type': 'int'}, - 'replica_deletion_option': {'key': 'replicaDeletionOption', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaBluePolicyDetails, self).__init__(**kwargs) - self.instance_type = 'HyperVReplica2012R2' # type: str - self.replication_frequency_in_seconds = kwargs.get('replication_frequency_in_seconds', None) - self.recovery_points = kwargs.get('recovery_points', None) - self.application_consistent_snapshot_frequency_in_hours = kwargs.get('application_consistent_snapshot_frequency_in_hours', None) - self.compression = kwargs.get('compression', None) - self.initial_replication_method = kwargs.get('initial_replication_method', None) - self.online_replication_start_time = kwargs.get('online_replication_start_time', None) - self.offline_replication_import_path = kwargs.get('offline_replication_import_path', None) - self.offline_replication_export_path = kwargs.get('offline_replication_export_path', None) - self.replication_port = kwargs.get('replication_port', None) - self.allowed_authentication_type = kwargs.get('allowed_authentication_type', None) - self.replica_deletion_option = kwargs.get('replica_deletion_option', None) - - -class HyperVReplicaPolicyInput(PolicyProviderSpecificInput): - """Hyper-V Replica specific policy Input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: HyperVReplicaBluePolicyInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_points: A value indicating the number of recovery points. - :type recovery_points: int - :param application_consistent_snapshot_frequency_in_hours: A value indicating the application - consistent frequency. - :type application_consistent_snapshot_frequency_in_hours: int - :param compression: A value indicating whether compression has to be enabled. - :type compression: str - :param initial_replication_method: A value indicating whether IR is online. - :type initial_replication_method: str - :param online_replication_start_time: A value indicating the online IR start time. - :type online_replication_start_time: str - :param offline_replication_import_path: A value indicating the offline IR import path. - :type offline_replication_import_path: str - :param offline_replication_export_path: A value indicating the offline IR export path. - :type offline_replication_export_path: str - :param replication_port: A value indicating the recovery HTTPS port. - :type replication_port: int - :param allowed_authentication_type: A value indicating the authentication type. - :type allowed_authentication_type: int - :param replica_deletion: A value indicating whether the VM has to be auto deleted. - :type replica_deletion: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_points': {'key': 'recoveryPoints', 'type': 'int'}, - 'application_consistent_snapshot_frequency_in_hours': {'key': 'applicationConsistentSnapshotFrequencyInHours', 'type': 'int'}, - 'compression': {'key': 'compression', 'type': 'str'}, - 'initial_replication_method': {'key': 'initialReplicationMethod', 'type': 'str'}, - 'online_replication_start_time': {'key': 'onlineReplicationStartTime', 'type': 'str'}, - 'offline_replication_import_path': {'key': 'offlineReplicationImportPath', 'type': 'str'}, - 'offline_replication_export_path': {'key': 'offlineReplicationExportPath', 'type': 'str'}, - 'replication_port': {'key': 'replicationPort', 'type': 'int'}, - 'allowed_authentication_type': {'key': 'allowedAuthenticationType', 'type': 'int'}, - 'replica_deletion': {'key': 'replicaDeletion', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'HyperVReplica2012R2': 'HyperVReplicaBluePolicyInput'} - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaPolicyInput, self).__init__(**kwargs) - self.instance_type = 'HyperVReplica2012' # type: str - self.recovery_points = kwargs.get('recovery_points', None) - self.application_consistent_snapshot_frequency_in_hours = kwargs.get('application_consistent_snapshot_frequency_in_hours', None) - self.compression = kwargs.get('compression', None) - self.initial_replication_method = kwargs.get('initial_replication_method', None) - self.online_replication_start_time = kwargs.get('online_replication_start_time', None) - self.offline_replication_import_path = kwargs.get('offline_replication_import_path', None) - self.offline_replication_export_path = kwargs.get('offline_replication_export_path', None) - self.replication_port = kwargs.get('replication_port', None) - self.allowed_authentication_type = kwargs.get('allowed_authentication_type', None) - self.replica_deletion = kwargs.get('replica_deletion', None) - - -class HyperVReplicaBluePolicyInput(HyperVReplicaPolicyInput): - """HyperV Replica Blue policy input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_points: A value indicating the number of recovery points. - :type recovery_points: int - :param application_consistent_snapshot_frequency_in_hours: A value indicating the application - consistent frequency. - :type application_consistent_snapshot_frequency_in_hours: int - :param compression: A value indicating whether compression has to be enabled. - :type compression: str - :param initial_replication_method: A value indicating whether IR is online. - :type initial_replication_method: str - :param online_replication_start_time: A value indicating the online IR start time. - :type online_replication_start_time: str - :param offline_replication_import_path: A value indicating the offline IR import path. - :type offline_replication_import_path: str - :param offline_replication_export_path: A value indicating the offline IR export path. - :type offline_replication_export_path: str - :param replication_port: A value indicating the recovery HTTPS port. - :type replication_port: int - :param allowed_authentication_type: A value indicating the authentication type. - :type allowed_authentication_type: int - :param replica_deletion: A value indicating whether the VM has to be auto deleted. - :type replica_deletion: str - :param replication_frequency_in_seconds: A value indicating the replication interval. - :type replication_frequency_in_seconds: int - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_points': {'key': 'recoveryPoints', 'type': 'int'}, - 'application_consistent_snapshot_frequency_in_hours': {'key': 'applicationConsistentSnapshotFrequencyInHours', 'type': 'int'}, - 'compression': {'key': 'compression', 'type': 'str'}, - 'initial_replication_method': {'key': 'initialReplicationMethod', 'type': 'str'}, - 'online_replication_start_time': {'key': 'onlineReplicationStartTime', 'type': 'str'}, - 'offline_replication_import_path': {'key': 'offlineReplicationImportPath', 'type': 'str'}, - 'offline_replication_export_path': {'key': 'offlineReplicationExportPath', 'type': 'str'}, - 'replication_port': {'key': 'replicationPort', 'type': 'int'}, - 'allowed_authentication_type': {'key': 'allowedAuthenticationType', 'type': 'int'}, - 'replica_deletion': {'key': 'replicaDeletion', 'type': 'str'}, - 'replication_frequency_in_seconds': {'key': 'replicationFrequencyInSeconds', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaBluePolicyInput, self).__init__(**kwargs) - self.instance_type = 'HyperVReplica2012R2' # type: str - self.replication_frequency_in_seconds = kwargs.get('replication_frequency_in_seconds', None) - - -class HyperVReplicaBlueReplicationDetails(ReplicationProviderSpecificSettings): - """HyperV replica 2012 R2 (Blue) replication details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param last_replicated_time: The Last replication time. - :type last_replicated_time: ~datetime.datetime - :param vm_nics: The PE Network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] - :param vm_id: The virtual machine Id. - :type vm_id: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param initial_replication_details: Initial replication details. - :type initial_replication_details: - ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails - :param v_m_disk_details: VM disk details. - :type v_m_disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'last_replicated_time': {'key': 'lastReplicatedTime', 'type': 'iso-8601'}, - 'vm_nics': {'key': 'vmNics', 'type': '[VMNicDetails]'}, - 'vm_id': {'key': 'vmId', 'type': 'str'}, - 'vm_protection_state': {'key': 'vmProtectionState', 'type': 'str'}, - 'vm_protection_state_description': {'key': 'vmProtectionStateDescription', 'type': 'str'}, - 'initial_replication_details': {'key': 'initialReplicationDetails', 'type': 'InitialReplicationDetails'}, - 'v_m_disk_details': {'key': 'vMDiskDetails', 'type': '[DiskDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaBlueReplicationDetails, self).__init__(**kwargs) - self.instance_type = 'HyperVReplica2012R2' # type: str - self.last_replicated_time = kwargs.get('last_replicated_time', None) - self.vm_nics = kwargs.get('vm_nics', None) - self.vm_id = kwargs.get('vm_id', None) - self.vm_protection_state = kwargs.get('vm_protection_state', None) - self.vm_protection_state_description = kwargs.get('vm_protection_state_description', None) - self.initial_replication_details = kwargs.get('initial_replication_details', None) - self.v_m_disk_details = kwargs.get('v_m_disk_details', None) - - -class HyperVReplicaPolicyDetails(PolicyProviderSpecificDetails): - """Hyper-V Replica Blue specific protection profile details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param recovery_points: A value indicating the number of recovery points. - :type recovery_points: int - :param application_consistent_snapshot_frequency_in_hours: A value indicating the application - consistent frequency. - :type application_consistent_snapshot_frequency_in_hours: int - :param compression: A value indicating whether compression has to be enabled. - :type compression: str - :param initial_replication_method: A value indicating whether IR is online. - :type initial_replication_method: str - :param online_replication_start_time: A value indicating the online IR start time. - :type online_replication_start_time: str - :param offline_replication_import_path: A value indicating the offline IR import path. - :type offline_replication_import_path: str - :param offline_replication_export_path: A value indicating the offline IR export path. - :type offline_replication_export_path: str - :param replication_port: A value indicating the recovery HTTPS port. - :type replication_port: int - :param allowed_authentication_type: A value indicating the authentication type. - :type allowed_authentication_type: int - :param replica_deletion_option: A value indicating whether the VM has to be auto deleted. - Supported Values: String.Empty, None, OnRecoveryCloud. - :type replica_deletion_option: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_points': {'key': 'recoveryPoints', 'type': 'int'}, - 'application_consistent_snapshot_frequency_in_hours': {'key': 'applicationConsistentSnapshotFrequencyInHours', 'type': 'int'}, - 'compression': {'key': 'compression', 'type': 'str'}, - 'initial_replication_method': {'key': 'initialReplicationMethod', 'type': 'str'}, - 'online_replication_start_time': {'key': 'onlineReplicationStartTime', 'type': 'str'}, - 'offline_replication_import_path': {'key': 'offlineReplicationImportPath', 'type': 'str'}, - 'offline_replication_export_path': {'key': 'offlineReplicationExportPath', 'type': 'str'}, - 'replication_port': {'key': 'replicationPort', 'type': 'int'}, - 'allowed_authentication_type': {'key': 'allowedAuthenticationType', 'type': 'int'}, - 'replica_deletion_option': {'key': 'replicaDeletionOption', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaPolicyDetails, self).__init__(**kwargs) - self.instance_type = 'HyperVReplica2012' # type: str - self.recovery_points = kwargs.get('recovery_points', None) - self.application_consistent_snapshot_frequency_in_hours = kwargs.get('application_consistent_snapshot_frequency_in_hours', None) - self.compression = kwargs.get('compression', None) - self.initial_replication_method = kwargs.get('initial_replication_method', None) - self.online_replication_start_time = kwargs.get('online_replication_start_time', None) - self.offline_replication_import_path = kwargs.get('offline_replication_import_path', None) - self.offline_replication_export_path = kwargs.get('offline_replication_export_path', None) - self.replication_port = kwargs.get('replication_port', None) - self.allowed_authentication_type = kwargs.get('allowed_authentication_type', None) - self.replica_deletion_option = kwargs.get('replica_deletion_option', None) - - -class HyperVReplicaReplicationDetails(ReplicationProviderSpecificSettings): - """HyperV replica 2012 replication details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param last_replicated_time: The Last replication time. - :type last_replicated_time: ~datetime.datetime - :param vm_nics: The PE Network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] - :param vm_id: The virtual machine Id. - :type vm_id: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param initial_replication_details: Initial replication details. - :type initial_replication_details: - ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails - :param v_m_disk_details: VM disk details. - :type v_m_disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'last_replicated_time': {'key': 'lastReplicatedTime', 'type': 'iso-8601'}, - 'vm_nics': {'key': 'vmNics', 'type': '[VMNicDetails]'}, - 'vm_id': {'key': 'vmId', 'type': 'str'}, - 'vm_protection_state': {'key': 'vmProtectionState', 'type': 'str'}, - 'vm_protection_state_description': {'key': 'vmProtectionStateDescription', 'type': 'str'}, - 'initial_replication_details': {'key': 'initialReplicationDetails', 'type': 'InitialReplicationDetails'}, - 'v_m_disk_details': {'key': 'vMDiskDetails', 'type': '[DiskDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVReplicaReplicationDetails, self).__init__(**kwargs) - self.instance_type = 'HyperVReplica2012' # type: str - self.last_replicated_time = kwargs.get('last_replicated_time', None) - self.vm_nics = kwargs.get('vm_nics', None) - self.vm_id = kwargs.get('vm_id', None) - self.vm_protection_state = kwargs.get('vm_protection_state', None) - self.vm_protection_state_description = kwargs.get('vm_protection_state_description', None) - self.initial_replication_details = kwargs.get('initial_replication_details', None) - self.v_m_disk_details = kwargs.get('v_m_disk_details', None) - - -class HyperVSiteDetails(FabricSpecificDetails): - """HyperVSite fabric specific details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param hyper_v_hosts: The list of Hyper-V hosts associated with the fabric. - :type hyper_v_hosts: list[~azure.mgmt.recoveryservicessiterecovery.models.HyperVHostDetails] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'hyper_v_hosts': {'key': 'hyperVHosts', 'type': '[HyperVHostDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(HyperVSiteDetails, self).__init__(**kwargs) - self.instance_type = 'HyperVSite' # type: str - self.hyper_v_hosts = kwargs.get('hyper_v_hosts', None) - - -class HyperVVirtualMachineDetails(ConfigurationSettings): - """Single Host fabric provider specific VM settings. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: VmmVirtualMachineDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param source_item_id: The source id of the object. - :type source_item_id: str - :param generation: The id of the object in fabric. - :type generation: str - :param os_details: The Last replication time. - :type os_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDetails - :param disk_details: The Last successful failover time. - :type disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] - :param has_physical_disk: A value indicating whether the VM has a physical disk attached. - String value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", - "Present", "NotPresent". - :type has_physical_disk: str or ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus - :param has_fibre_channel_adapter: A value indicating whether the VM has a fibre channel adapter - attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: - "Unknown", "Present", "NotPresent". - :type has_fibre_channel_adapter: str or - ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus - :param has_shared_vhd: A value indicating whether the VM has a shared VHD attached. String - value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", "Present", - "NotPresent". - :type has_shared_vhd: str or ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'source_item_id': {'key': 'sourceItemId', 'type': 'str'}, - 'generation': {'key': 'generation', 'type': 'str'}, - 'os_details': {'key': 'osDetails', 'type': 'OSDetails'}, - 'disk_details': {'key': 'diskDetails', 'type': '[DiskDetails]'}, - 'has_physical_disk': {'key': 'hasPhysicalDisk', 'type': 'str'}, - 'has_fibre_channel_adapter': {'key': 'hasFibreChannelAdapter', 'type': 'str'}, - 'has_shared_vhd': {'key': 'hasSharedVhd', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'VmmVirtualMachine': 'VmmVirtualMachineDetails'} - } - - def __init__( - self, - **kwargs - ): - super(HyperVVirtualMachineDetails, self).__init__(**kwargs) - self.instance_type = 'HyperVVirtualMachine' # type: str - self.source_item_id = kwargs.get('source_item_id', None) - self.generation = kwargs.get('generation', None) - self.os_details = kwargs.get('os_details', None) - self.disk_details = kwargs.get('disk_details', None) - self.has_physical_disk = kwargs.get('has_physical_disk', None) - self.has_fibre_channel_adapter = kwargs.get('has_fibre_channel_adapter', None) - self.has_shared_vhd = kwargs.get('has_shared_vhd', None) - - -class IdentityProviderDetails(msrest.serialization.Model): - """Identity provider details. - - :param tenant_id: The tenant Id for the service principal with which the on-premise - management/data plane components would communicate with our Azure services. - :type tenant_id: str - :param application_id: The application/client Id for the service principal with which the - on-premise management/data plane components would communicate with our Azure services. - :type application_id: str - :param object_id: The object Id of the service principal with which the on-premise - management/data plane components would communicate with our Azure services. - :type object_id: str - :param audience: The intended Audience of the service principal with which the on-premise - management/data plane components would communicate with our Azure services. - :type audience: str - :param aad_authority: The base authority for Azure Active Directory authentication. - :type aad_authority: str - """ - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'application_id': {'key': 'applicationId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'audience': {'key': 'audience', 'type': 'str'}, - 'aad_authority': {'key': 'aadAuthority', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IdentityProviderDetails, self).__init__(**kwargs) - self.tenant_id = kwargs.get('tenant_id', None) - self.application_id = kwargs.get('application_id', None) - self.object_id = kwargs.get('object_id', None) - self.audience = kwargs.get('audience', None) - self.aad_authority = kwargs.get('aad_authority', None) - - -class IdentityProviderInput(msrest.serialization.Model): - """Identity provider input. - - All required parameters must be populated in order to send to Azure. - - :param tenant_id: Required. The tenant Id for the service principal with which the on-premise - management/data plane components would communicate with our Azure services. - :type tenant_id: str - :param application_id: Required. The application/client Id for the service principal with which - the on-premise management/data plane components would communicate with our Azure services. - :type application_id: str - :param object_id: Required. The object Id of the service principal with which the on-premise - management/data plane components would communicate with our Azure services. - :type object_id: str - :param audience: Required. The intended Audience of the service principal with which the - on-premise management/data plane components would communicate with our Azure services. - :type audience: str - :param aad_authority: Required. The base authority for Azure Active Directory authentication. - :type aad_authority: str - """ - - _validation = { - 'tenant_id': {'required': True}, - 'application_id': {'required': True}, - 'object_id': {'required': True}, - 'audience': {'required': True}, - 'aad_authority': {'required': True}, - } - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'application_id': {'key': 'applicationId', 'type': 'str'}, - 'object_id': {'key': 'objectId', 'type': 'str'}, - 'audience': {'key': 'audience', 'type': 'str'}, - 'aad_authority': {'key': 'aadAuthority', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IdentityProviderInput, self).__init__(**kwargs) - self.tenant_id = kwargs['tenant_id'] - self.application_id = kwargs['application_id'] - self.object_id = kwargs['object_id'] - self.audience = kwargs['audience'] - self.aad_authority = kwargs['aad_authority'] - - -class InconsistentVmDetails(msrest.serialization.Model): - """This class stores the monitoring details for consistency check of inconsistent Protected Entity. - - :param vm_name: The Vm name. - :type vm_name: str - :param cloud_name: The Cloud name. - :type cloud_name: str - :param details: The list of details regarding state of the Protected Entity in SRS and On prem. - :type details: list[str] - :param error_ids: The list of error ids. - :type error_ids: list[str] - """ - - _attribute_map = { - 'vm_name': {'key': 'vmName', 'type': 'str'}, - 'cloud_name': {'key': 'cloudName', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[str]'}, - 'error_ids': {'key': 'errorIds', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(InconsistentVmDetails, self).__init__(**kwargs) - self.vm_name = kwargs.get('vm_name', None) - self.cloud_name = kwargs.get('cloud_name', None) - self.details = kwargs.get('details', None) - self.error_ids = kwargs.get('error_ids', None) - - -class InitialReplicationDetails(msrest.serialization.Model): - """Initial replication details. - - :param initial_replication_type: Initial replication type. - :type initial_replication_type: str - :param initial_replication_progress_percentage: The initial replication progress percentage. - :type initial_replication_progress_percentage: str - """ - - _attribute_map = { - 'initial_replication_type': {'key': 'initialReplicationType', 'type': 'str'}, - 'initial_replication_progress_percentage': {'key': 'initialReplicationProgressPercentage', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InitialReplicationDetails, self).__init__(**kwargs) - self.initial_replication_type = kwargs.get('initial_replication_type', None) - self.initial_replication_progress_percentage = kwargs.get('initial_replication_progress_percentage', None) - - -class InlineWorkflowTaskDetails(GroupTaskDetails): - """This class represents the inline workflow task details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param child_tasks: The child tasks. - :type child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] - :param workflow_ids: The list of child workflow ids. - :type workflow_ids: list[str] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'child_tasks': {'key': 'childTasks', 'type': '[ASRTask]'}, - 'workflow_ids': {'key': 'workflowIds', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(InlineWorkflowTaskDetails, self).__init__(**kwargs) - self.instance_type = 'InlineWorkflowTaskDetails' # type: str - self.workflow_ids = kwargs.get('workflow_ids', None) - - -class InMageAgentDetails(msrest.serialization.Model): - """The details of the InMage agent. - - :param agent_version: The agent version. - :type agent_version: str - :param agent_update_status: A value indicating whether installed agent needs to be updated. - :type agent_update_status: str - :param post_update_reboot_status: A value indicating whether reboot is required after update is - applied. - :type post_update_reboot_status: str - :param agent_expiry_date: Agent expiry date. - :type agent_expiry_date: ~datetime.datetime - """ - - _attribute_map = { - 'agent_version': {'key': 'agentVersion', 'type': 'str'}, - 'agent_update_status': {'key': 'agentUpdateStatus', 'type': 'str'}, - 'post_update_reboot_status': {'key': 'postUpdateRebootStatus', 'type': 'str'}, - 'agent_expiry_date': {'key': 'agentExpiryDate', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAgentDetails, self).__init__(**kwargs) - self.agent_version = kwargs.get('agent_version', None) - self.agent_update_status = kwargs.get('agent_update_status', None) - self.post_update_reboot_status = kwargs.get('post_update_reboot_status', None) - self.agent_expiry_date = kwargs.get('agent_expiry_date', None) - - -class InMageAzureV2ApplyRecoveryPointInput(ApplyRecoveryPointProviderSpecificInput): - """ApplyRecoveryPoint input specific to InMageAzureV2 provider. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAzureV2ApplyRecoveryPointInput, self).__init__(**kwargs) - self.instance_type = 'InMageAzureV2' # type: str - - -class InMageAzureV2DiskInputDetails(msrest.serialization.Model): - """Disk input details. - - :param disk_id: The DiskId. - :type disk_id: str - :param log_storage_account_id: The LogStorageAccountId. - :type log_storage_account_id: str - :param disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", - "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :param disk_encryption_set_id: The DiskEncryptionSet ARM ID. - :type disk_encryption_set_id: str - """ - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'log_storage_account_id': {'key': 'logStorageAccountId', 'type': 'str'}, - 'disk_type': {'key': 'diskType', 'type': 'str'}, - 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAzureV2DiskInputDetails, self).__init__(**kwargs) - self.disk_id = kwargs.get('disk_id', None) - self.log_storage_account_id = kwargs.get('log_storage_account_id', None) - self.disk_type = kwargs.get('disk_type', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - - -class InMageAzureV2EnableProtectionInput(EnableProtectionProviderSpecificInput): - """VMware Azure specific enable protection input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param master_target_id: The Master target Id. - :type master_target_id: str - :param process_server_id: The Process Server Id. - :type process_server_id: str - :param storage_account_id: The storage account Id. - :type storage_account_id: str - :param run_as_account_id: The CS account Id. - :type run_as_account_id: str - :param multi_vm_group_id: The multi VM group Id. - :type multi_vm_group_id: str - :param multi_vm_group_name: The multi VM group name. - :type multi_vm_group_name: str - :param disks_to_include: The disks to include list. - :type disks_to_include: - list[~azure.mgmt.recoveryservicessiterecovery.models.InMageAzureV2DiskInputDetails] - :param target_azure_network_id: The selected target Azure network Id. - :type target_azure_network_id: str - :param target_azure_subnet_id: The selected target Azure subnet Id. - :type target_azure_subnet_id: str - :param enable_rdp_on_target_option: The selected option to enable RDP\SSH on target VM after - failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. - :type enable_rdp_on_target_option: str - :param target_azure_vm_name: The target azure VM Name. - :type target_azure_vm_name: str - :param log_storage_account_id: The storage account to be used for logging during replication. - :type log_storage_account_id: str - :param target_azure_v1_resource_group_id: The Id of the target resource group (for classic - deployment) in which the failover VM is to be created. - :type target_azure_v1_resource_group_id: str - :param target_azure_v2_resource_group_id: The Id of the target resource group (for resource - manager deployment) in which the failover VM is to be created. - :type target_azure_v2_resource_group_id: str - :param disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", - "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :param target_availability_set_id: The target availability set ARM Id for resource manager - deployment. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The proximity placement group ARM Id. - :type target_proximity_placement_group_id: str - :param license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", - "WindowsServer". - :type license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType - :param sql_server_license_type: The SQL Server license type. Possible values include: - "NotSpecified", "NoLicenseType", "PAYG", "AHUB". - :type sql_server_license_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType - :param target_vm_size: The target VM size. - :type target_vm_size: str - :param disk_encryption_set_id: The DiskEncryptionSet ARM Id. - :type disk_encryption_set_id: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param seed_managed_disk_tags: The tags for the seed managed disks. - :type seed_managed_disk_tags: dict[str, str] - :param target_managed_disk_tags: The tags for the target managed disks. - :type target_managed_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'master_target_id': {'key': 'masterTargetId', 'type': 'str'}, - 'process_server_id': {'key': 'processServerId', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, - 'run_as_account_id': {'key': 'runAsAccountId', 'type': 'str'}, - 'multi_vm_group_id': {'key': 'multiVmGroupId', 'type': 'str'}, - 'multi_vm_group_name': {'key': 'multiVmGroupName', 'type': 'str'}, - 'disks_to_include': {'key': 'disksToInclude', 'type': '[InMageAzureV2DiskInputDetails]'}, - 'target_azure_network_id': {'key': 'targetAzureNetworkId', 'type': 'str'}, - 'target_azure_subnet_id': {'key': 'targetAzureSubnetId', 'type': 'str'}, - 'enable_rdp_on_target_option': {'key': 'enableRdpOnTargetOption', 'type': 'str'}, - 'target_azure_vm_name': {'key': 'targetAzureVmName', 'type': 'str'}, - 'log_storage_account_id': {'key': 'logStorageAccountId', 'type': 'str'}, - 'target_azure_v1_resource_group_id': {'key': 'targetAzureV1ResourceGroupId', 'type': 'str'}, - 'target_azure_v2_resource_group_id': {'key': 'targetAzureV2ResourceGroupId', 'type': 'str'}, - 'disk_type': {'key': 'diskType', 'type': 'str'}, - 'target_availability_set_id': {'key': 'targetAvailabilitySetId', 'type': 'str'}, - 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, - 'target_proximity_placement_group_id': {'key': 'targetProximityPlacementGroupId', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'sql_server_license_type': {'key': 'sqlServerLicenseType', 'type': 'str'}, - 'target_vm_size': {'key': 'targetVmSize', 'type': 'str'}, - 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, - 'target_vm_tags': {'key': 'targetVmTags', 'type': '{str}'}, - 'seed_managed_disk_tags': {'key': 'seedManagedDiskTags', 'type': '{str}'}, - 'target_managed_disk_tags': {'key': 'targetManagedDiskTags', 'type': '{str}'}, - 'target_nic_tags': {'key': 'targetNicTags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAzureV2EnableProtectionInput, self).__init__(**kwargs) - self.instance_type = 'InMageAzureV2' # type: str - self.master_target_id = kwargs.get('master_target_id', None) - self.process_server_id = kwargs.get('process_server_id', None) - self.storage_account_id = kwargs.get('storage_account_id', None) - self.run_as_account_id = kwargs.get('run_as_account_id', None) - self.multi_vm_group_id = kwargs.get('multi_vm_group_id', None) - self.multi_vm_group_name = kwargs.get('multi_vm_group_name', None) - self.disks_to_include = kwargs.get('disks_to_include', None) - self.target_azure_network_id = kwargs.get('target_azure_network_id', None) - self.target_azure_subnet_id = kwargs.get('target_azure_subnet_id', None) - self.enable_rdp_on_target_option = kwargs.get('enable_rdp_on_target_option', None) - self.target_azure_vm_name = kwargs.get('target_azure_vm_name', None) - self.log_storage_account_id = kwargs.get('log_storage_account_id', None) - self.target_azure_v1_resource_group_id = kwargs.get('target_azure_v1_resource_group_id', None) - self.target_azure_v2_resource_group_id = kwargs.get('target_azure_v2_resource_group_id', None) - self.disk_type = kwargs.get('disk_type', None) - self.target_availability_set_id = kwargs.get('target_availability_set_id', None) - self.target_availability_zone = kwargs.get('target_availability_zone', None) - self.target_proximity_placement_group_id = kwargs.get('target_proximity_placement_group_id', None) - self.license_type = kwargs.get('license_type', None) - self.sql_server_license_type = kwargs.get('sql_server_license_type', None) - self.target_vm_size = kwargs.get('target_vm_size', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.target_vm_tags = kwargs.get('target_vm_tags', None) - self.seed_managed_disk_tags = kwargs.get('seed_managed_disk_tags', None) - self.target_managed_disk_tags = kwargs.get('target_managed_disk_tags', None) - self.target_nic_tags = kwargs.get('target_nic_tags', None) - - -class InMageAzureV2EventDetails(EventProviderSpecificDetails): - """Model class for event details of a VMwareAzureV2 event. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param event_type: InMage Event type. Takes one of the values of - InMageDataContract.InMageMonitoringEventType. - :type event_type: str - :param category: InMage Event Category. - :type category: str - :param component: InMage Event Component. - :type component: str - :param corrective_action: Corrective Action string for the event. - :type corrective_action: str - :param details: InMage Event Details. - :type details: str - :param summary: InMage Event Summary. - :type summary: str - :param site_name: VMware Site name. - :type site_name: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'event_type': {'key': 'eventType', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'component': {'key': 'component', 'type': 'str'}, - 'corrective_action': {'key': 'correctiveAction', 'type': 'str'}, - 'details': {'key': 'details', 'type': 'str'}, - 'summary': {'key': 'summary', 'type': 'str'}, - 'site_name': {'key': 'siteName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAzureV2EventDetails, self).__init__(**kwargs) - self.instance_type = 'InMageAzureV2' # type: str - self.event_type = kwargs.get('event_type', None) - self.category = kwargs.get('category', None) - self.component = kwargs.get('component', None) - self.corrective_action = kwargs.get('corrective_action', None) - self.details = kwargs.get('details', None) - self.summary = kwargs.get('summary', None) - self.site_name = kwargs.get('site_name', None) - - -class InMageAzureV2ManagedDiskDetails(msrest.serialization.Model): - """InMageAzureV2 Managed disk details. - - :param disk_id: The disk id. - :type disk_id: str - :param seed_managed_disk_id: Seed managed disk Id. - :type seed_managed_disk_id: str - :param replica_disk_type: The replica disk type. - :type replica_disk_type: str - :param disk_encryption_set_id: The DiskEncryptionSet ARM ID. - :type disk_encryption_set_id: str - :param target_disk_name: The target disk name. - :type target_disk_name: str - """ - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'seed_managed_disk_id': {'key': 'seedManagedDiskId', 'type': 'str'}, - 'replica_disk_type': {'key': 'replicaDiskType', 'type': 'str'}, - 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, - 'target_disk_name': {'key': 'targetDiskName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAzureV2ManagedDiskDetails, self).__init__(**kwargs) - self.disk_id = kwargs.get('disk_id', None) - self.seed_managed_disk_id = kwargs.get('seed_managed_disk_id', None) - self.replica_disk_type = kwargs.get('replica_disk_type', None) - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - self.target_disk_name = kwargs.get('target_disk_name', None) - - -class InMageAzureV2PolicyDetails(PolicyProviderSpecificDetails): - """InMage Azure v2 specific protection profile details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in - minutes. - :type crash_consistent_frequency_in_minutes: int - :param recovery_point_threshold_in_minutes: The recovery point threshold in minutes. - :type recovery_point_threshold_in_minutes: int - :param recovery_point_history: The duration in minutes until which the recovery points need to - be stored. - :type recovery_point_history: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. - :type multi_vm_sync_status: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'crash_consistent_frequency_in_minutes': {'key': 'crashConsistentFrequencyInMinutes', 'type': 'int'}, - 'recovery_point_threshold_in_minutes': {'key': 'recoveryPointThresholdInMinutes', 'type': 'int'}, - 'recovery_point_history': {'key': 'recoveryPointHistory', 'type': 'int'}, - 'app_consistent_frequency_in_minutes': {'key': 'appConsistentFrequencyInMinutes', 'type': 'int'}, - 'multi_vm_sync_status': {'key': 'multiVmSyncStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAzureV2PolicyDetails, self).__init__(**kwargs) - self.instance_type = 'InMageAzureV2' # type: str - self.crash_consistent_frequency_in_minutes = kwargs.get('crash_consistent_frequency_in_minutes', None) - self.recovery_point_threshold_in_minutes = kwargs.get('recovery_point_threshold_in_minutes', None) - self.recovery_point_history = kwargs.get('recovery_point_history', None) - self.app_consistent_frequency_in_minutes = kwargs.get('app_consistent_frequency_in_minutes', None) - self.multi_vm_sync_status = kwargs.get('multi_vm_sync_status', None) - - -class InMageAzureV2PolicyInput(PolicyProviderSpecificInput): - """VMWare Azure specific policy Input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_threshold_in_minutes: The recovery point threshold in minutes. - :type recovery_point_threshold_in_minutes: int - :param recovery_point_history: The duration in minutes until which the recovery points need to - be stored. - :type recovery_point_history: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in - minutes). - :type crash_consistent_frequency_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be - enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: "Enable", "Disable". - :type multi_vm_sync_status: str or - ~azure.mgmt.recoveryservicessiterecovery.models.SetMultiVmSyncStatus - """ - - _validation = { - 'instance_type': {'required': True}, - 'multi_vm_sync_status': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_threshold_in_minutes': {'key': 'recoveryPointThresholdInMinutes', 'type': 'int'}, - 'recovery_point_history': {'key': 'recoveryPointHistory', 'type': 'int'}, - 'crash_consistent_frequency_in_minutes': {'key': 'crashConsistentFrequencyInMinutes', 'type': 'int'}, - 'app_consistent_frequency_in_minutes': {'key': 'appConsistentFrequencyInMinutes', 'type': 'int'}, - 'multi_vm_sync_status': {'key': 'multiVmSyncStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAzureV2PolicyInput, self).__init__(**kwargs) - self.instance_type = 'InMageAzureV2' # type: str - self.recovery_point_threshold_in_minutes = kwargs.get('recovery_point_threshold_in_minutes', None) - self.recovery_point_history = kwargs.get('recovery_point_history', None) - self.crash_consistent_frequency_in_minutes = kwargs.get('crash_consistent_frequency_in_minutes', None) - self.app_consistent_frequency_in_minutes = kwargs.get('app_consistent_frequency_in_minutes', None) - self.multi_vm_sync_status = kwargs['multi_vm_sync_status'] - - -class InMageAzureV2ProtectedDiskDetails(msrest.serialization.Model): - """InMageAzureV2 protected disk details. - - :param disk_id: The disk id. - :type disk_id: str - :param disk_name: The disk name. - :type disk_name: str - :param protection_stage: The protection stage. - :type protection_stage: str - :param health_error_code: The health error code for the disk. - :type health_error_code: str - :param rpo_in_seconds: The RPO in seconds. - :type rpo_in_seconds: long - :param resync_required: A value indicating whether resync is required for this disk. - :type resync_required: str - :param resync_progress_percentage: The resync progress percentage. - :type resync_progress_percentage: int - :param resync_duration_in_seconds: The resync duration in seconds. - :type resync_duration_in_seconds: long - :param disk_capacity_in_bytes: The disk capacity in bytes. - :type disk_capacity_in_bytes: long - :param file_system_capacity_in_bytes: The disk file system capacity in bytes. - :type file_system_capacity_in_bytes: long - :param source_data_in_mega_bytes: The source data transit in MB. - :type source_data_in_mega_bytes: float - :param ps_data_in_mega_bytes: The PS data transit in MB. - :type ps_data_in_mega_bytes: float - :param target_data_in_mega_bytes: The target data transit in MB. - :type target_data_in_mega_bytes: float - :param disk_resized: A value indicating whether disk is resized. - :type disk_resized: str - :param last_rpo_calculated_time: The last RPO calculated time. - :type last_rpo_calculated_time: ~datetime.datetime - :param resync_processed_bytes: The resync processed bytes. - :type resync_processed_bytes: long - :param resync_total_transferred_bytes: The resync total transferred bytes. - :type resync_total_transferred_bytes: long - :param resync_last15_minutes_transferred_bytes: The resync last 15 minutes transferred bytes. - :type resync_last15_minutes_transferred_bytes: long - :param resync_last_data_transfer_time_utc: The last data transfer time in UTC. - :type resync_last_data_transfer_time_utc: ~datetime.datetime - :param resync_start_time: The resync start time. - :type resync_start_time: ~datetime.datetime - :param progress_health: The Progress Health. - :type progress_health: str - :param progress_status: The Progress Status. - :type progress_status: str - """ - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'disk_name': {'key': 'diskName', 'type': 'str'}, - 'protection_stage': {'key': 'protectionStage', 'type': 'str'}, - 'health_error_code': {'key': 'healthErrorCode', 'type': 'str'}, - 'rpo_in_seconds': {'key': 'rpoInSeconds', 'type': 'long'}, - 'resync_required': {'key': 'resyncRequired', 'type': 'str'}, - 'resync_progress_percentage': {'key': 'resyncProgressPercentage', 'type': 'int'}, - 'resync_duration_in_seconds': {'key': 'resyncDurationInSeconds', 'type': 'long'}, - 'disk_capacity_in_bytes': {'key': 'diskCapacityInBytes', 'type': 'long'}, - 'file_system_capacity_in_bytes': {'key': 'fileSystemCapacityInBytes', 'type': 'long'}, - 'source_data_in_mega_bytes': {'key': 'sourceDataInMegaBytes', 'type': 'float'}, - 'ps_data_in_mega_bytes': {'key': 'psDataInMegaBytes', 'type': 'float'}, - 'target_data_in_mega_bytes': {'key': 'targetDataInMegaBytes', 'type': 'float'}, - 'disk_resized': {'key': 'diskResized', 'type': 'str'}, - 'last_rpo_calculated_time': {'key': 'lastRpoCalculatedTime', 'type': 'iso-8601'}, - 'resync_processed_bytes': {'key': 'resyncProcessedBytes', 'type': 'long'}, - 'resync_total_transferred_bytes': {'key': 'resyncTotalTransferredBytes', 'type': 'long'}, - 'resync_last15_minutes_transferred_bytes': {'key': 'resyncLast15MinutesTransferredBytes', 'type': 'long'}, - 'resync_last_data_transfer_time_utc': {'key': 'resyncLastDataTransferTimeUTC', 'type': 'iso-8601'}, - 'resync_start_time': {'key': 'resyncStartTime', 'type': 'iso-8601'}, - 'progress_health': {'key': 'progressHealth', 'type': 'str'}, - 'progress_status': {'key': 'progressStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAzureV2ProtectedDiskDetails, self).__init__(**kwargs) - self.disk_id = kwargs.get('disk_id', None) - self.disk_name = kwargs.get('disk_name', None) - self.protection_stage = kwargs.get('protection_stage', None) - self.health_error_code = kwargs.get('health_error_code', None) - self.rpo_in_seconds = kwargs.get('rpo_in_seconds', None) - self.resync_required = kwargs.get('resync_required', None) - self.resync_progress_percentage = kwargs.get('resync_progress_percentage', None) - self.resync_duration_in_seconds = kwargs.get('resync_duration_in_seconds', None) - self.disk_capacity_in_bytes = kwargs.get('disk_capacity_in_bytes', None) - self.file_system_capacity_in_bytes = kwargs.get('file_system_capacity_in_bytes', None) - self.source_data_in_mega_bytes = kwargs.get('source_data_in_mega_bytes', None) - self.ps_data_in_mega_bytes = kwargs.get('ps_data_in_mega_bytes', None) - self.target_data_in_mega_bytes = kwargs.get('target_data_in_mega_bytes', None) - self.disk_resized = kwargs.get('disk_resized', None) - self.last_rpo_calculated_time = kwargs.get('last_rpo_calculated_time', None) - self.resync_processed_bytes = kwargs.get('resync_processed_bytes', None) - self.resync_total_transferred_bytes = kwargs.get('resync_total_transferred_bytes', None) - self.resync_last15_minutes_transferred_bytes = kwargs.get('resync_last15_minutes_transferred_bytes', None) - self.resync_last_data_transfer_time_utc = kwargs.get('resync_last_data_transfer_time_utc', None) - self.resync_start_time = kwargs.get('resync_start_time', None) - self.progress_health = kwargs.get('progress_health', None) - self.progress_status = kwargs.get('progress_status', None) - - -class InMageAzureV2RecoveryPointDetails(ProviderSpecificRecoveryPointDetails): - """InMage Azure V2 provider specific recovery point details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the provider type.Constant filled by server. - :type instance_type: str - :param is_multi_vm_sync_point: A value indicating whether the recovery point is multi VM - consistent. - :type is_multi_vm_sync_point: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'is_multi_vm_sync_point': {'key': 'isMultiVmSyncPoint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAzureV2RecoveryPointDetails, self).__init__(**kwargs) - self.instance_type = 'InMageAzureV2' # type: str - self.is_multi_vm_sync_point = kwargs.get('is_multi_vm_sync_point', None) - - -class InMageAzureV2ReplicationDetails(ReplicationProviderSpecificSettings): - """InMageAzureV2 provider specific settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param infrastructure_vm_id: The infrastructure VM Id. - :type infrastructure_vm_id: str - :param v_center_infrastructure_id: The vCenter infrastructure Id. - :type v_center_infrastructure_id: str - :param protection_stage: The protection stage. - :type protection_stage: str - :param vm_id: The virtual machine Id. - :type vm_id: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param resync_progress_percentage: The resync progress percentage. - :type resync_progress_percentage: int - :param rpo_in_seconds: The RPO in seconds. - :type rpo_in_seconds: long - :param compressed_data_rate_in_mb: The compressed data change rate in MB. - :type compressed_data_rate_in_mb: float - :param uncompressed_data_rate_in_mb: The uncompressed data change rate in MB. - :type uncompressed_data_rate_in_mb: float - :param ip_address: The source IP address. - :type ip_address: str - :param agent_version: The agent version. - :type agent_version: str - :param agent_expiry_date: Agent expiry date. - :type agent_expiry_date: ~datetime.datetime - :param is_agent_update_required: A value indicating whether installed agent needs to be - updated. - :type is_agent_update_required: str - :param is_reboot_after_update_required: A value indicating whether the source server requires a - restart after update. - :type is_reboot_after_update_required: str - :param last_heartbeat: The last heartbeat received from the source server. - :type last_heartbeat: ~datetime.datetime - :param process_server_id: The process server Id. - :type process_server_id: str - :param process_server_name: The process server name. - :type process_server_name: str - :param multi_vm_group_id: The multi vm group Id. - :type multi_vm_group_id: str - :param multi_vm_group_name: The multi vm group name. - :type multi_vm_group_name: str - :param multi_vm_sync_status: A value indicating whether multi vm sync is enabled or disabled. - :type multi_vm_sync_status: str - :param protected_disks: The list of protected disks. - :type protected_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.InMageAzureV2ProtectedDiskDetails] - :param disk_resized: A value indicating whether any disk is resized for this VM. - :type disk_resized: str - :param master_target_id: The master target Id. - :type master_target_id: str - :param source_vm_cpu_count: The CPU count of the VM on the primary side. - :type source_vm_cpu_count: int - :param source_vm_ram_size_in_mb: The RAM size of the VM on the primary side. - :type source_vm_ram_size_in_mb: int - :param os_type: The type of the OS on the VM. - :type os_type: str - :param vhd_name: The OS disk VHD name. - :type vhd_name: str - :param os_disk_id: The id of the disk containing the OS. - :type os_disk_id: str - :param azure_vm_disk_details: Azure VM Disk details. - :type azure_vm_disk_details: - list[~azure.mgmt.recoveryservicessiterecovery.models.AzureVmDiskDetails] - :param recovery_azure_vm_name: Recovery Azure given name. - :type recovery_azure_vm_name: str - :param recovery_azure_vm_size: The Recovery Azure VM size. - :type recovery_azure_vm_size: str - :param recovery_azure_storage_account: The recovery Azure storage account. - :type recovery_azure_storage_account: str - :param recovery_azure_log_storage_account_id: The ARM id of the log storage account used for - replication. This will be set to null if no log storage account was provided during enable - protection. - :type recovery_azure_log_storage_account_id: str - :param vm_nics: The PE Network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] - :param selected_recovery_azure_network_id: The selected recovery azure network Id. - :type selected_recovery_azure_network_id: str - :param selected_tfo_azure_network_id: The test failover virtual network. - :type selected_tfo_azure_network_id: str - :param selected_source_nic_id: The selected source nic Id which will be used as the primary nic - during failover. - :type selected_source_nic_id: str - :param discovery_type: A value indicating the discovery type of the machine. Value can be - vCenter or physical. - :type discovery_type: str - :param enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after - failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. - :type enable_rdp_on_target_option: str - :param datastores: The datastores of the on-premise machine. Value can be list of strings that - contain datastore names. - :type datastores: list[str] - :param target_vm_id: The ARM Id of the target Azure VM. This value will be null until the VM is - failed over. Only after failure it will be populated with the ARM Id of the Azure VM. - :type target_vm_id: str - :param recovery_azure_resource_group_id: The target resource group Id. - :type recovery_azure_resource_group_id: str - :param recovery_availability_set_id: The recovery availability set Id. - :type recovery_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param use_managed_disks: A value indicating whether managed disks should be used during - failover. - :type use_managed_disks: str - :param license_type: License Type of the VM to be used. - :type license_type: str - :param sql_server_license_type: The SQL Server license type. - :type sql_server_license_type: str - :param validation_errors: The validation errors of the on-premise machine Value can be list of - validation errors. - :type validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param last_rpo_calculated_time: The last RPO calculated time. - :type last_rpo_calculated_time: ~datetime.datetime - :param last_update_received_time: The last update time received from on-prem components. - :type last_update_received_time: ~datetime.datetime - :param replica_id: The replica id of the protected item. - :type replica_id: str - :param os_version: The OS Version of the protected item. - :type os_version: str - :param protected_managed_disks: The list of protected managed disks. - :type protected_managed_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.InMageAzureV2ManagedDiskDetails] - :ivar last_recovery_point_received: The last recovery point received time. - :vartype last_recovery_point_received: ~datetime.datetime - :param firmware_type: The firmware type of this protected item. - :type firmware_type: str - :param azure_vm_generation: The target generation for this protected item. - :type azure_vm_generation: str - :param is_additional_stats_available: A value indicating whether additional IR stats are - available or not. - :type is_additional_stats_available: bool - :param total_data_transferred: The total transferred data in bytes. - :type total_data_transferred: long - :param total_progress_health: The progress health. - :type total_progress_health: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param seed_managed_disk_tags: The tags for the seed managed disks. - :type seed_managed_disk_tags: dict[str, str] - :param target_managed_disk_tags: The tags for the target managed disks. - :type target_managed_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] - """ - - _validation = { - 'instance_type': {'required': True}, - 'last_recovery_point_received': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'infrastructure_vm_id': {'key': 'infrastructureVmId', 'type': 'str'}, - 'v_center_infrastructure_id': {'key': 'vCenterInfrastructureId', 'type': 'str'}, - 'protection_stage': {'key': 'protectionStage', 'type': 'str'}, - 'vm_id': {'key': 'vmId', 'type': 'str'}, - 'vm_protection_state': {'key': 'vmProtectionState', 'type': 'str'}, - 'vm_protection_state_description': {'key': 'vmProtectionStateDescription', 'type': 'str'}, - 'resync_progress_percentage': {'key': 'resyncProgressPercentage', 'type': 'int'}, - 'rpo_in_seconds': {'key': 'rpoInSeconds', 'type': 'long'}, - 'compressed_data_rate_in_mb': {'key': 'compressedDataRateInMB', 'type': 'float'}, - 'uncompressed_data_rate_in_mb': {'key': 'uncompressedDataRateInMB', 'type': 'float'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'agent_version': {'key': 'agentVersion', 'type': 'str'}, - 'agent_expiry_date': {'key': 'agentExpiryDate', 'type': 'iso-8601'}, - 'is_agent_update_required': {'key': 'isAgentUpdateRequired', 'type': 'str'}, - 'is_reboot_after_update_required': {'key': 'isRebootAfterUpdateRequired', 'type': 'str'}, - 'last_heartbeat': {'key': 'lastHeartbeat', 'type': 'iso-8601'}, - 'process_server_id': {'key': 'processServerId', 'type': 'str'}, - 'process_server_name': {'key': 'processServerName', 'type': 'str'}, - 'multi_vm_group_id': {'key': 'multiVmGroupId', 'type': 'str'}, - 'multi_vm_group_name': {'key': 'multiVmGroupName', 'type': 'str'}, - 'multi_vm_sync_status': {'key': 'multiVmSyncStatus', 'type': 'str'}, - 'protected_disks': {'key': 'protectedDisks', 'type': '[InMageAzureV2ProtectedDiskDetails]'}, - 'disk_resized': {'key': 'diskResized', 'type': 'str'}, - 'master_target_id': {'key': 'masterTargetId', 'type': 'str'}, - 'source_vm_cpu_count': {'key': 'sourceVmCpuCount', 'type': 'int'}, - 'source_vm_ram_size_in_mb': {'key': 'sourceVmRamSizeInMB', 'type': 'int'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vhd_name': {'key': 'vhdName', 'type': 'str'}, - 'os_disk_id': {'key': 'osDiskId', 'type': 'str'}, - 'azure_vm_disk_details': {'key': 'azureVMDiskDetails', 'type': '[AzureVmDiskDetails]'}, - 'recovery_azure_vm_name': {'key': 'recoveryAzureVMName', 'type': 'str'}, - 'recovery_azure_vm_size': {'key': 'recoveryAzureVMSize', 'type': 'str'}, - 'recovery_azure_storage_account': {'key': 'recoveryAzureStorageAccount', 'type': 'str'}, - 'recovery_azure_log_storage_account_id': {'key': 'recoveryAzureLogStorageAccountId', 'type': 'str'}, - 'vm_nics': {'key': 'vmNics', 'type': '[VMNicDetails]'}, - 'selected_recovery_azure_network_id': {'key': 'selectedRecoveryAzureNetworkId', 'type': 'str'}, - 'selected_tfo_azure_network_id': {'key': 'selectedTfoAzureNetworkId', 'type': 'str'}, - 'selected_source_nic_id': {'key': 'selectedSourceNicId', 'type': 'str'}, - 'discovery_type': {'key': 'discoveryType', 'type': 'str'}, - 'enable_rdp_on_target_option': {'key': 'enableRdpOnTargetOption', 'type': 'str'}, - 'datastores': {'key': 'datastores', 'type': '[str]'}, - 'target_vm_id': {'key': 'targetVmId', 'type': 'str'}, - 'recovery_azure_resource_group_id': {'key': 'recoveryAzureResourceGroupId', 'type': 'str'}, - 'recovery_availability_set_id': {'key': 'recoveryAvailabilitySetId', 'type': 'str'}, - 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, - 'target_proximity_placement_group_id': {'key': 'targetProximityPlacementGroupId', 'type': 'str'}, - 'use_managed_disks': {'key': 'useManagedDisks', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'sql_server_license_type': {'key': 'sqlServerLicenseType', 'type': 'str'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[HealthError]'}, - 'last_rpo_calculated_time': {'key': 'lastRpoCalculatedTime', 'type': 'iso-8601'}, - 'last_update_received_time': {'key': 'lastUpdateReceivedTime', 'type': 'iso-8601'}, - 'replica_id': {'key': 'replicaId', 'type': 'str'}, - 'os_version': {'key': 'osVersion', 'type': 'str'}, - 'protected_managed_disks': {'key': 'protectedManagedDisks', 'type': '[InMageAzureV2ManagedDiskDetails]'}, - 'last_recovery_point_received': {'key': 'lastRecoveryPointReceived', 'type': 'iso-8601'}, - 'firmware_type': {'key': 'firmwareType', 'type': 'str'}, - 'azure_vm_generation': {'key': 'azureVmGeneration', 'type': 'str'}, - 'is_additional_stats_available': {'key': 'isAdditionalStatsAvailable', 'type': 'bool'}, - 'total_data_transferred': {'key': 'totalDataTransferred', 'type': 'long'}, - 'total_progress_health': {'key': 'totalProgressHealth', 'type': 'str'}, - 'target_vm_tags': {'key': 'targetVmTags', 'type': '{str}'}, - 'seed_managed_disk_tags': {'key': 'seedManagedDiskTags', 'type': '{str}'}, - 'target_managed_disk_tags': {'key': 'targetManagedDiskTags', 'type': '{str}'}, - 'target_nic_tags': {'key': 'targetNicTags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAzureV2ReplicationDetails, self).__init__(**kwargs) - self.instance_type = 'InMageAzureV2' # type: str - self.infrastructure_vm_id = kwargs.get('infrastructure_vm_id', None) - self.v_center_infrastructure_id = kwargs.get('v_center_infrastructure_id', None) - self.protection_stage = kwargs.get('protection_stage', None) - self.vm_id = kwargs.get('vm_id', None) - self.vm_protection_state = kwargs.get('vm_protection_state', None) - self.vm_protection_state_description = kwargs.get('vm_protection_state_description', None) - self.resync_progress_percentage = kwargs.get('resync_progress_percentage', None) - self.rpo_in_seconds = kwargs.get('rpo_in_seconds', None) - self.compressed_data_rate_in_mb = kwargs.get('compressed_data_rate_in_mb', None) - self.uncompressed_data_rate_in_mb = kwargs.get('uncompressed_data_rate_in_mb', None) - self.ip_address = kwargs.get('ip_address', None) - self.agent_version = kwargs.get('agent_version', None) - self.agent_expiry_date = kwargs.get('agent_expiry_date', None) - self.is_agent_update_required = kwargs.get('is_agent_update_required', None) - self.is_reboot_after_update_required = kwargs.get('is_reboot_after_update_required', None) - self.last_heartbeat = kwargs.get('last_heartbeat', None) - self.process_server_id = kwargs.get('process_server_id', None) - self.process_server_name = kwargs.get('process_server_name', None) - self.multi_vm_group_id = kwargs.get('multi_vm_group_id', None) - self.multi_vm_group_name = kwargs.get('multi_vm_group_name', None) - self.multi_vm_sync_status = kwargs.get('multi_vm_sync_status', None) - self.protected_disks = kwargs.get('protected_disks', None) - self.disk_resized = kwargs.get('disk_resized', None) - self.master_target_id = kwargs.get('master_target_id', None) - self.source_vm_cpu_count = kwargs.get('source_vm_cpu_count', None) - self.source_vm_ram_size_in_mb = kwargs.get('source_vm_ram_size_in_mb', None) - self.os_type = kwargs.get('os_type', None) - self.vhd_name = kwargs.get('vhd_name', None) - self.os_disk_id = kwargs.get('os_disk_id', None) - self.azure_vm_disk_details = kwargs.get('azure_vm_disk_details', None) - self.recovery_azure_vm_name = kwargs.get('recovery_azure_vm_name', None) - self.recovery_azure_vm_size = kwargs.get('recovery_azure_vm_size', None) - self.recovery_azure_storage_account = kwargs.get('recovery_azure_storage_account', None) - self.recovery_azure_log_storage_account_id = kwargs.get('recovery_azure_log_storage_account_id', None) - self.vm_nics = kwargs.get('vm_nics', None) - self.selected_recovery_azure_network_id = kwargs.get('selected_recovery_azure_network_id', None) - self.selected_tfo_azure_network_id = kwargs.get('selected_tfo_azure_network_id', None) - self.selected_source_nic_id = kwargs.get('selected_source_nic_id', None) - self.discovery_type = kwargs.get('discovery_type', None) - self.enable_rdp_on_target_option = kwargs.get('enable_rdp_on_target_option', None) - self.datastores = kwargs.get('datastores', None) - self.target_vm_id = kwargs.get('target_vm_id', None) - self.recovery_azure_resource_group_id = kwargs.get('recovery_azure_resource_group_id', None) - self.recovery_availability_set_id = kwargs.get('recovery_availability_set_id', None) - self.target_availability_zone = kwargs.get('target_availability_zone', None) - self.target_proximity_placement_group_id = kwargs.get('target_proximity_placement_group_id', None) - self.use_managed_disks = kwargs.get('use_managed_disks', None) - self.license_type = kwargs.get('license_type', None) - self.sql_server_license_type = kwargs.get('sql_server_license_type', None) - self.validation_errors = kwargs.get('validation_errors', None) - self.last_rpo_calculated_time = kwargs.get('last_rpo_calculated_time', None) - self.last_update_received_time = kwargs.get('last_update_received_time', None) - self.replica_id = kwargs.get('replica_id', None) - self.os_version = kwargs.get('os_version', None) - self.protected_managed_disks = kwargs.get('protected_managed_disks', None) - self.last_recovery_point_received = None - self.firmware_type = kwargs.get('firmware_type', None) - self.azure_vm_generation = kwargs.get('azure_vm_generation', None) - self.is_additional_stats_available = kwargs.get('is_additional_stats_available', None) - self.total_data_transferred = kwargs.get('total_data_transferred', None) - self.total_progress_health = kwargs.get('total_progress_health', None) - self.target_vm_tags = kwargs.get('target_vm_tags', None) - self.seed_managed_disk_tags = kwargs.get('seed_managed_disk_tags', None) - self.target_managed_disk_tags = kwargs.get('target_managed_disk_tags', None) - self.target_nic_tags = kwargs.get('target_nic_tags', None) - - -class InMageAzureV2ReprotectInput(ReverseReplicationProviderSpecificInput): - """InMageAzureV2 specific provider input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param master_target_id: The Master target Id. - :type master_target_id: str - :param process_server_id: The Process Server Id. - :type process_server_id: str - :param storage_account_id: The storage account id. - :type storage_account_id: str - :param run_as_account_id: The CS account Id. - :type run_as_account_id: str - :param policy_id: The Policy Id. - :type policy_id: str - :param log_storage_account_id: The storage account to be used for logging during replication. - :type log_storage_account_id: str - :param disks_to_include: The disks to include list. - :type disks_to_include: list[str] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'master_target_id': {'key': 'masterTargetId', 'type': 'str'}, - 'process_server_id': {'key': 'processServerId', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, - 'run_as_account_id': {'key': 'runAsAccountId', 'type': 'str'}, - 'policy_id': {'key': 'policyId', 'type': 'str'}, - 'log_storage_account_id': {'key': 'logStorageAccountId', 'type': 'str'}, - 'disks_to_include': {'key': 'disksToInclude', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAzureV2ReprotectInput, self).__init__(**kwargs) - self.instance_type = 'InMageAzureV2' # type: str - self.master_target_id = kwargs.get('master_target_id', None) - self.process_server_id = kwargs.get('process_server_id', None) - self.storage_account_id = kwargs.get('storage_account_id', None) - self.run_as_account_id = kwargs.get('run_as_account_id', None) - self.policy_id = kwargs.get('policy_id', None) - self.log_storage_account_id = kwargs.get('log_storage_account_id', None) - self.disks_to_include = kwargs.get('disks_to_include', None) - - -class InMageAzureV2TestFailoverInput(TestFailoverProviderSpecificInput): - """InMageAzureV2 provider specific input for test failover. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_id: The recovery point id to be passed to test failover to a particular - recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAzureV2TestFailoverInput, self).__init__(**kwargs) - self.instance_type = 'InMageAzureV2' # type: str - self.recovery_point_id = kwargs.get('recovery_point_id', None) - - -class InMageAzureV2UnplannedFailoverInput(UnplannedFailoverProviderSpecificInput): - """InMageAzureV2 provider specific input for unplanned failover. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_id: The recovery point id to be passed to failover to a particular - recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAzureV2UnplannedFailoverInput, self).__init__(**kwargs) - self.instance_type = 'InMageAzureV2' # type: str - self.recovery_point_id = kwargs.get('recovery_point_id', None) - - -class InMageAzureV2UpdateReplicationProtectedItemInput(UpdateReplicationProtectedItemProviderInput): - """InMage Azure V2 input to update replication protected item. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_azure_v1_resource_group_id: The recovery Azure resource group Id for classic - deployment. - :type recovery_azure_v1_resource_group_id: str - :param recovery_azure_v2_resource_group_id: The recovery Azure resource group Id for resource - manager deployment. - :type recovery_azure_v2_resource_group_id: str - :param use_managed_disks: A value indicating whether managed disks should be used during - failover. - :type use_managed_disks: str - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param target_managed_disk_tags: The tags for the target managed disks. - :type target_managed_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] - :param sql_server_license_type: The SQL Server license type. Possible values include: - "NotSpecified", "NoLicenseType", "PAYG", "AHUB". - :type sql_server_license_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType - :param vm_disks: The list of disk update properties. - :type vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.UpdateDiskInput] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_azure_v1_resource_group_id': {'key': 'recoveryAzureV1ResourceGroupId', 'type': 'str'}, - 'recovery_azure_v2_resource_group_id': {'key': 'recoveryAzureV2ResourceGroupId', 'type': 'str'}, - 'use_managed_disks': {'key': 'useManagedDisks', 'type': 'str'}, - 'target_proximity_placement_group_id': {'key': 'targetProximityPlacementGroupId', 'type': 'str'}, - 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, - 'target_vm_tags': {'key': 'targetVmTags', 'type': '{str}'}, - 'target_managed_disk_tags': {'key': 'targetManagedDiskTags', 'type': '{str}'}, - 'target_nic_tags': {'key': 'targetNicTags', 'type': '{str}'}, - 'sql_server_license_type': {'key': 'sqlServerLicenseType', 'type': 'str'}, - 'vm_disks': {'key': 'vmDisks', 'type': '[UpdateDiskInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageAzureV2UpdateReplicationProtectedItemInput, self).__init__(**kwargs) - self.instance_type = 'InMageAzureV2' # type: str - self.recovery_azure_v1_resource_group_id = kwargs.get('recovery_azure_v1_resource_group_id', None) - self.recovery_azure_v2_resource_group_id = kwargs.get('recovery_azure_v2_resource_group_id', None) - self.use_managed_disks = kwargs.get('use_managed_disks', None) - self.target_proximity_placement_group_id = kwargs.get('target_proximity_placement_group_id', None) - self.target_availability_zone = kwargs.get('target_availability_zone', None) - self.target_vm_tags = kwargs.get('target_vm_tags', None) - self.target_managed_disk_tags = kwargs.get('target_managed_disk_tags', None) - self.target_nic_tags = kwargs.get('target_nic_tags', None) - self.sql_server_license_type = kwargs.get('sql_server_license_type', None) - self.vm_disks = kwargs.get('vm_disks', None) - - -class InMageBasePolicyDetails(PolicyProviderSpecificDetails): - """Base class for the policies of providers using InMage replication. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param recovery_point_threshold_in_minutes: The recovery point threshold in minutes. - :type recovery_point_threshold_in_minutes: int - :param recovery_point_history: The duration in minutes until which the recovery points need to - be stored. - :type recovery_point_history: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. - :type multi_vm_sync_status: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_threshold_in_minutes': {'key': 'recoveryPointThresholdInMinutes', 'type': 'int'}, - 'recovery_point_history': {'key': 'recoveryPointHistory', 'type': 'int'}, - 'app_consistent_frequency_in_minutes': {'key': 'appConsistentFrequencyInMinutes', 'type': 'int'}, - 'multi_vm_sync_status': {'key': 'multiVmSyncStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageBasePolicyDetails, self).__init__(**kwargs) - self.instance_type = 'InMageBasePolicyDetails' # type: str - self.recovery_point_threshold_in_minutes = kwargs.get('recovery_point_threshold_in_minutes', None) - self.recovery_point_history = kwargs.get('recovery_point_history', None) - self.app_consistent_frequency_in_minutes = kwargs.get('app_consistent_frequency_in_minutes', None) - self.multi_vm_sync_status = kwargs.get('multi_vm_sync_status', None) - - -class InMageDisableProtectionProviderSpecificInput(DisableProtectionProviderSpecificInput): - """InMage disable protection provider specific input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param replica_vm_deletion_status: A value indicating whether the replica VM should be - destroyed or retained. Values from Delete and Retain. - :type replica_vm_deletion_status: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'replica_vm_deletion_status': {'key': 'replicaVmDeletionStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageDisableProtectionProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = 'InMage' # type: str - self.replica_vm_deletion_status = kwargs.get('replica_vm_deletion_status', None) - - -class InMageDiskDetails(msrest.serialization.Model): - """VMware/Physical specific Disk Details. - - :param disk_id: The disk Id. - :type disk_id: str - :param disk_name: The disk name. - :type disk_name: str - :param disk_size_in_mb: The disk size in MB. - :type disk_size_in_mb: str - :param disk_type: Whether disk is system disk or data disk. - :type disk_type: str - :param disk_configuration: Whether disk is dynamic disk or basic disk. - :type disk_configuration: str - :param volume_list: Volumes of the disk. - :type volume_list: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskVolumeDetails] - """ - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'disk_name': {'key': 'diskName', 'type': 'str'}, - 'disk_size_in_mb': {'key': 'diskSizeInMB', 'type': 'str'}, - 'disk_type': {'key': 'diskType', 'type': 'str'}, - 'disk_configuration': {'key': 'diskConfiguration', 'type': 'str'}, - 'volume_list': {'key': 'volumeList', 'type': '[DiskVolumeDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageDiskDetails, self).__init__(**kwargs) - self.disk_id = kwargs.get('disk_id', None) - self.disk_name = kwargs.get('disk_name', None) - self.disk_size_in_mb = kwargs.get('disk_size_in_mb', None) - self.disk_type = kwargs.get('disk_type', None) - self.disk_configuration = kwargs.get('disk_configuration', None) - self.volume_list = kwargs.get('volume_list', None) - - -class InMageDiskExclusionInput(msrest.serialization.Model): - """DiskExclusionInput when doing enable protection of virtual machine in InMage provider. - - :param volume_options: The volume label based option for disk exclusion. - :type volume_options: - list[~azure.mgmt.recoveryservicessiterecovery.models.InMageVolumeExclusionOptions] - :param disk_signature_options: The guest disk signature based option for disk exclusion. - :type disk_signature_options: - list[~azure.mgmt.recoveryservicessiterecovery.models.InMageDiskSignatureExclusionOptions] - """ - - _attribute_map = { - 'volume_options': {'key': 'volumeOptions', 'type': '[InMageVolumeExclusionOptions]'}, - 'disk_signature_options': {'key': 'diskSignatureOptions', 'type': '[InMageDiskSignatureExclusionOptions]'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageDiskExclusionInput, self).__init__(**kwargs) - self.volume_options = kwargs.get('volume_options', None) - self.disk_signature_options = kwargs.get('disk_signature_options', None) - - -class InMageDiskSignatureExclusionOptions(msrest.serialization.Model): - """Guest disk signature based disk exclusion option when doing enable protection of virtual machine in InMage provider. - - :param disk_signature: The guest signature of disk to be excluded from replication. - :type disk_signature: str - """ - - _attribute_map = { - 'disk_signature': {'key': 'diskSignature', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageDiskSignatureExclusionOptions, self).__init__(**kwargs) - self.disk_signature = kwargs.get('disk_signature', None) - - -class InMageEnableProtectionInput(EnableProtectionProviderSpecificInput): - """VMware Azure specific enable protection input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param vm_friendly_name: The VM Name. - :type vm_friendly_name: str - :param master_target_id: Required. The Master Target Id. - :type master_target_id: str - :param process_server_id: Required. The Process Server Id. - :type process_server_id: str - :param retention_drive: Required. The retention drive to use on the MT. - :type retention_drive: str - :param run_as_account_id: The CS account Id. - :type run_as_account_id: str - :param multi_vm_group_id: Required. The multi VM group Id. - :type multi_vm_group_id: str - :param multi_vm_group_name: Required. The multi VM group name. - :type multi_vm_group_name: str - :param datastore_name: The target datastore name. - :type datastore_name: str - :param disk_exclusion_input: The enable disk exclusion input. - :type disk_exclusion_input: - ~azure.mgmt.recoveryservicessiterecovery.models.InMageDiskExclusionInput - :param disks_to_include: The disks to include list. - :type disks_to_include: list[str] - """ - - _validation = { - 'instance_type': {'required': True}, - 'master_target_id': {'required': True}, - 'process_server_id': {'required': True}, - 'retention_drive': {'required': True}, - 'multi_vm_group_id': {'required': True}, - 'multi_vm_group_name': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'vm_friendly_name': {'key': 'vmFriendlyName', 'type': 'str'}, - 'master_target_id': {'key': 'masterTargetId', 'type': 'str'}, - 'process_server_id': {'key': 'processServerId', 'type': 'str'}, - 'retention_drive': {'key': 'retentionDrive', 'type': 'str'}, - 'run_as_account_id': {'key': 'runAsAccountId', 'type': 'str'}, - 'multi_vm_group_id': {'key': 'multiVmGroupId', 'type': 'str'}, - 'multi_vm_group_name': {'key': 'multiVmGroupName', 'type': 'str'}, - 'datastore_name': {'key': 'datastoreName', 'type': 'str'}, - 'disk_exclusion_input': {'key': 'diskExclusionInput', 'type': 'InMageDiskExclusionInput'}, - 'disks_to_include': {'key': 'disksToInclude', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageEnableProtectionInput, self).__init__(**kwargs) - self.instance_type = 'InMage' # type: str - self.vm_friendly_name = kwargs.get('vm_friendly_name', None) - self.master_target_id = kwargs['master_target_id'] - self.process_server_id = kwargs['process_server_id'] - self.retention_drive = kwargs['retention_drive'] - self.run_as_account_id = kwargs.get('run_as_account_id', None) - self.multi_vm_group_id = kwargs['multi_vm_group_id'] - self.multi_vm_group_name = kwargs['multi_vm_group_name'] - self.datastore_name = kwargs.get('datastore_name', None) - self.disk_exclusion_input = kwargs.get('disk_exclusion_input', None) - self.disks_to_include = kwargs.get('disks_to_include', None) - - -class InMagePolicyDetails(PolicyProviderSpecificDetails): - """InMage specific protection profile details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param recovery_point_threshold_in_minutes: The recovery point threshold in minutes. - :type recovery_point_threshold_in_minutes: int - :param recovery_point_history: The duration in minutes until which the recovery points need to - be stored. - :type recovery_point_history: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. - :type multi_vm_sync_status: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_threshold_in_minutes': {'key': 'recoveryPointThresholdInMinutes', 'type': 'int'}, - 'recovery_point_history': {'key': 'recoveryPointHistory', 'type': 'int'}, - 'app_consistent_frequency_in_minutes': {'key': 'appConsistentFrequencyInMinutes', 'type': 'int'}, - 'multi_vm_sync_status': {'key': 'multiVmSyncStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMagePolicyDetails, self).__init__(**kwargs) - self.instance_type = 'InMage' # type: str - self.recovery_point_threshold_in_minutes = kwargs.get('recovery_point_threshold_in_minutes', None) - self.recovery_point_history = kwargs.get('recovery_point_history', None) - self.app_consistent_frequency_in_minutes = kwargs.get('app_consistent_frequency_in_minutes', None) - self.multi_vm_sync_status = kwargs.get('multi_vm_sync_status', None) - - -class InMagePolicyInput(PolicyProviderSpecificInput): - """VMWare Azure specific protection profile Input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_threshold_in_minutes: The recovery point threshold in minutes. - :type recovery_point_threshold_in_minutes: int - :param recovery_point_history: The duration in minutes until which the recovery points need to - be stored. - :type recovery_point_history: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be - enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: "Enable", "Disable". - :type multi_vm_sync_status: str or - ~azure.mgmt.recoveryservicessiterecovery.models.SetMultiVmSyncStatus - """ - - _validation = { - 'instance_type': {'required': True}, - 'multi_vm_sync_status': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_threshold_in_minutes': {'key': 'recoveryPointThresholdInMinutes', 'type': 'int'}, - 'recovery_point_history': {'key': 'recoveryPointHistory', 'type': 'int'}, - 'app_consistent_frequency_in_minutes': {'key': 'appConsistentFrequencyInMinutes', 'type': 'int'}, - 'multi_vm_sync_status': {'key': 'multiVmSyncStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMagePolicyInput, self).__init__(**kwargs) - self.instance_type = 'InMage' # type: str - self.recovery_point_threshold_in_minutes = kwargs.get('recovery_point_threshold_in_minutes', None) - self.recovery_point_history = kwargs.get('recovery_point_history', None) - self.app_consistent_frequency_in_minutes = kwargs.get('app_consistent_frequency_in_minutes', None) - self.multi_vm_sync_status = kwargs['multi_vm_sync_status'] - - -class InMageProtectedDiskDetails(msrest.serialization.Model): - """InMage protected disk details. - - :param disk_id: The disk id. - :type disk_id: str - :param disk_name: The disk name. - :type disk_name: str - :param protection_stage: The protection stage. - :type protection_stage: str - :param health_error_code: The health error code for the disk. - :type health_error_code: str - :param rpo_in_seconds: The RPO in seconds. - :type rpo_in_seconds: long - :param resync_required: A value indicating whether resync is required for this disk. - :type resync_required: str - :param resync_progress_percentage: The resync progress percentage. - :type resync_progress_percentage: int - :param resync_duration_in_seconds: The resync duration in seconds. - :type resync_duration_in_seconds: long - :param disk_capacity_in_bytes: The disk capacity in bytes. - :type disk_capacity_in_bytes: long - :param file_system_capacity_in_bytes: The file system capacity in bytes. - :type file_system_capacity_in_bytes: long - :param source_data_in_mb: The source data transit in MB. - :type source_data_in_mb: float - :param ps_data_in_mb: The PS data transit in MB. - :type ps_data_in_mb: float - :param target_data_in_mb: The target data transit in MB. - :type target_data_in_mb: float - :param disk_resized: A value indicating whether disk is resized. - :type disk_resized: str - :param last_rpo_calculated_time: The last RPO calculated time. - :type last_rpo_calculated_time: ~datetime.datetime - :param resync_processed_bytes: The resync processed bytes. - :type resync_processed_bytes: long - :param resync_total_transferred_bytes: The resync total transferred bytes. - :type resync_total_transferred_bytes: long - :param resync_last15_minutes_transferred_bytes: The resync last 15 minutes transferred bytes. - :type resync_last15_minutes_transferred_bytes: long - :param resync_last_data_transfer_time_utc: The last data transfer time in UTC. - :type resync_last_data_transfer_time_utc: ~datetime.datetime - :param resync_start_time: The resync start time. - :type resync_start_time: ~datetime.datetime - :param progress_health: The Progress Health. - :type progress_health: str - :param progress_status: The Progress Status. - :type progress_status: str - """ - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'disk_name': {'key': 'diskName', 'type': 'str'}, - 'protection_stage': {'key': 'protectionStage', 'type': 'str'}, - 'health_error_code': {'key': 'healthErrorCode', 'type': 'str'}, - 'rpo_in_seconds': {'key': 'rpoInSeconds', 'type': 'long'}, - 'resync_required': {'key': 'resyncRequired', 'type': 'str'}, - 'resync_progress_percentage': {'key': 'resyncProgressPercentage', 'type': 'int'}, - 'resync_duration_in_seconds': {'key': 'resyncDurationInSeconds', 'type': 'long'}, - 'disk_capacity_in_bytes': {'key': 'diskCapacityInBytes', 'type': 'long'}, - 'file_system_capacity_in_bytes': {'key': 'fileSystemCapacityInBytes', 'type': 'long'}, - 'source_data_in_mb': {'key': 'sourceDataInMB', 'type': 'float'}, - 'ps_data_in_mb': {'key': 'psDataInMB', 'type': 'float'}, - 'target_data_in_mb': {'key': 'targetDataInMB', 'type': 'float'}, - 'disk_resized': {'key': 'diskResized', 'type': 'str'}, - 'last_rpo_calculated_time': {'key': 'lastRpoCalculatedTime', 'type': 'iso-8601'}, - 'resync_processed_bytes': {'key': 'resyncProcessedBytes', 'type': 'long'}, - 'resync_total_transferred_bytes': {'key': 'resyncTotalTransferredBytes', 'type': 'long'}, - 'resync_last15_minutes_transferred_bytes': {'key': 'resyncLast15MinutesTransferredBytes', 'type': 'long'}, - 'resync_last_data_transfer_time_utc': {'key': 'resyncLastDataTransferTimeUTC', 'type': 'iso-8601'}, - 'resync_start_time': {'key': 'resyncStartTime', 'type': 'iso-8601'}, - 'progress_health': {'key': 'progressHealth', 'type': 'str'}, - 'progress_status': {'key': 'progressStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageProtectedDiskDetails, self).__init__(**kwargs) - self.disk_id = kwargs.get('disk_id', None) - self.disk_name = kwargs.get('disk_name', None) - self.protection_stage = kwargs.get('protection_stage', None) - self.health_error_code = kwargs.get('health_error_code', None) - self.rpo_in_seconds = kwargs.get('rpo_in_seconds', None) - self.resync_required = kwargs.get('resync_required', None) - self.resync_progress_percentage = kwargs.get('resync_progress_percentage', None) - self.resync_duration_in_seconds = kwargs.get('resync_duration_in_seconds', None) - self.disk_capacity_in_bytes = kwargs.get('disk_capacity_in_bytes', None) - self.file_system_capacity_in_bytes = kwargs.get('file_system_capacity_in_bytes', None) - self.source_data_in_mb = kwargs.get('source_data_in_mb', None) - self.ps_data_in_mb = kwargs.get('ps_data_in_mb', None) - self.target_data_in_mb = kwargs.get('target_data_in_mb', None) - self.disk_resized = kwargs.get('disk_resized', None) - self.last_rpo_calculated_time = kwargs.get('last_rpo_calculated_time', None) - self.resync_processed_bytes = kwargs.get('resync_processed_bytes', None) - self.resync_total_transferred_bytes = kwargs.get('resync_total_transferred_bytes', None) - self.resync_last15_minutes_transferred_bytes = kwargs.get('resync_last15_minutes_transferred_bytes', None) - self.resync_last_data_transfer_time_utc = kwargs.get('resync_last_data_transfer_time_utc', None) - self.resync_start_time = kwargs.get('resync_start_time', None) - self.progress_health = kwargs.get('progress_health', None) - self.progress_status = kwargs.get('progress_status', None) - - -class InMageRcmAgentUpgradeBlockingErrorDetails(msrest.serialization.Model): - """InMageRcm source agent upgrade blocking error details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error_code: The error code. - :vartype error_code: str - :ivar error_message: The error message. - :vartype error_message: str - :ivar possible_causes: The possible causes. - :vartype possible_causes: str - :ivar recommended_action: The recommended action. - :vartype recommended_action: str - :ivar error_message_parameters: The error message parameters. - :vartype error_message_parameters: dict[str, str] - :ivar error_tags: The error tags. - :vartype error_tags: dict[str, str] - """ - - _validation = { - 'error_code': {'readonly': True}, - 'error_message': {'readonly': True}, - 'possible_causes': {'readonly': True}, - 'recommended_action': {'readonly': True}, - 'error_message_parameters': {'readonly': True}, - 'error_tags': {'readonly': True}, - } - - _attribute_map = { - 'error_code': {'key': 'errorCode', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'possible_causes': {'key': 'possibleCauses', 'type': 'str'}, - 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, - 'error_message_parameters': {'key': 'errorMessageParameters', 'type': '{str}'}, - 'error_tags': {'key': 'errorTags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmAgentUpgradeBlockingErrorDetails, self).__init__(**kwargs) - self.error_code = None - self.error_message = None - self.possible_causes = None - self.recommended_action = None - self.error_message_parameters = None - self.error_tags = None - - -class InMageRcmApplyRecoveryPointInput(ApplyRecoveryPointProviderSpecificInput): - """ApplyRecoveryPoint input specific to InMageRcm provider. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_id: Required. The recovery point Id. - :type recovery_point_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'recovery_point_id': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmApplyRecoveryPointInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.recovery_point_id = kwargs['recovery_point_id'] - - -class InMageRcmDiscoveredProtectedVmDetails(msrest.serialization.Model): - """InMageRcm discovered protected VM details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar v_center_id: The VCenter Id. - :vartype v_center_id: str - :ivar v_center_fqdn: The VCenter fqdn. - :vartype v_center_fqdn: str - :ivar datastores: The list of datastores. - :vartype datastores: list[str] - :ivar ip_addresses: The list of IP addresses. - :vartype ip_addresses: list[str] - :ivar vmware_tools_status: The VMware tools status. - :vartype vmware_tools_status: str - :ivar power_status: The VM power status. - :vartype power_status: str - :ivar vm_fqdn: The VM fqdn. - :vartype vm_fqdn: str - :ivar os_name: The VM's OS name. - :vartype os_name: str - :ivar created_timestamp: The SDS created timestamp. - :vartype created_timestamp: ~datetime.datetime - :ivar updated_timestamp: The SDS updated timestamp. - :vartype updated_timestamp: ~datetime.datetime - :ivar is_deleted: A value indicating whether the VM is deleted. - :vartype is_deleted: bool - :ivar last_discovery_time_in_utc: The last time when SDS information discovered in SRS. - :vartype last_discovery_time_in_utc: ~datetime.datetime - """ - - _validation = { - 'v_center_id': {'readonly': True}, - 'v_center_fqdn': {'readonly': True}, - 'datastores': {'readonly': True}, - 'ip_addresses': {'readonly': True}, - 'vmware_tools_status': {'readonly': True}, - 'power_status': {'readonly': True}, - 'vm_fqdn': {'readonly': True}, - 'os_name': {'readonly': True}, - 'created_timestamp': {'readonly': True}, - 'updated_timestamp': {'readonly': True}, - 'is_deleted': {'readonly': True}, - 'last_discovery_time_in_utc': {'readonly': True}, - } - - _attribute_map = { - 'v_center_id': {'key': 'vCenterId', 'type': 'str'}, - 'v_center_fqdn': {'key': 'vCenterFqdn', 'type': 'str'}, - 'datastores': {'key': 'datastores', 'type': '[str]'}, - 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, - 'vmware_tools_status': {'key': 'vmwareToolsStatus', 'type': 'str'}, - 'power_status': {'key': 'powerStatus', 'type': 'str'}, - 'vm_fqdn': {'key': 'vmFqdn', 'type': 'str'}, - 'os_name': {'key': 'osName', 'type': 'str'}, - 'created_timestamp': {'key': 'createdTimestamp', 'type': 'iso-8601'}, - 'updated_timestamp': {'key': 'updatedTimestamp', 'type': 'iso-8601'}, - 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, - 'last_discovery_time_in_utc': {'key': 'lastDiscoveryTimeInUtc', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmDiscoveredProtectedVmDetails, self).__init__(**kwargs) - self.v_center_id = None - self.v_center_fqdn = None - self.datastores = None - self.ip_addresses = None - self.vmware_tools_status = None - self.power_status = None - self.vm_fqdn = None - self.os_name = None - self.created_timestamp = None - self.updated_timestamp = None - self.is_deleted = None - self.last_discovery_time_in_utc = None - - -class InMageRcmDiskInput(msrest.serialization.Model): - """InMageRcm disk input. - - All required parameters must be populated in order to send to Azure. - - :param disk_id: Required. The disk Id. - :type disk_id: str - :param log_storage_account_id: Required. The log storage account ARM Id. - :type log_storage_account_id: str - :param disk_type: Required. The disk type. Possible values include: "Standard_LRS", - "Premium_LRS", "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :param disk_encryption_set_id: The DiskEncryptionSet ARM Id. - :type disk_encryption_set_id: str - """ - - _validation = { - 'disk_id': {'required': True}, - 'log_storage_account_id': {'required': True}, - 'disk_type': {'required': True}, - } - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'log_storage_account_id': {'key': 'logStorageAccountId', 'type': 'str'}, - 'disk_type': {'key': 'diskType', 'type': 'str'}, - 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmDiskInput, self).__init__(**kwargs) - self.disk_id = kwargs['disk_id'] - self.log_storage_account_id = kwargs['log_storage_account_id'] - self.disk_type = kwargs['disk_type'] - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - - -class InMageRcmDisksDefaultInput(msrest.serialization.Model): - """InMageRcm disk input. - - All required parameters must be populated in order to send to Azure. - - :param log_storage_account_id: Required. The log storage account ARM Id. - :type log_storage_account_id: str - :param disk_type: Required. The disk type. Possible values include: "Standard_LRS", - "Premium_LRS", "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :param disk_encryption_set_id: The DiskEncryptionSet ARM Id. - :type disk_encryption_set_id: str - """ - - _validation = { - 'log_storage_account_id': {'required': True}, - 'disk_type': {'required': True}, - } - - _attribute_map = { - 'log_storage_account_id': {'key': 'logStorageAccountId', 'type': 'str'}, - 'disk_type': {'key': 'diskType', 'type': 'str'}, - 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmDisksDefaultInput, self).__init__(**kwargs) - self.log_storage_account_id = kwargs['log_storage_account_id'] - self.disk_type = kwargs['disk_type'] - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - - -class InMageRcmEnableProtectionInput(EnableProtectionProviderSpecificInput): - """InMageRcm specific enable protection input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param fabric_discovery_machine_id: Required. The ARM Id of discovered machine. - :type fabric_discovery_machine_id: str - :param disks_to_include: The disks to include list. - :type disks_to_include: - list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmDiskInput] - :param disks_default: The default disk input. - :type disks_default: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmDisksDefaultInput - :param target_resource_group_id: Required. The target resource group ARM Id. - :type target_resource_group_id: str - :param target_network_id: The selected target network ARM Id. - :type target_network_id: str - :param test_network_id: The selected test network ARM Id. - :type test_network_id: str - :param target_subnet_name: The selected target subnet name. - :type target_subnet_name: str - :param test_subnet_name: The selected test subnet name. - :type test_subnet_name: str - :param target_vm_name: The target VM name. - :type target_vm_name: str - :param target_vm_size: The target VM size. - :type target_vm_size: str - :param license_type: The license type. Possible values include: "NotSpecified", - "NoLicenseType", "WindowsServer". - :type license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType - :param target_availability_set_id: The target availability set ARM Id. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account - ARM Id. - :type target_boot_diagnostics_storage_account_id: str - :param run_as_account_id: The run-as account Id. - :type run_as_account_id: str - :param process_server_id: Required. The process server Id. - :type process_server_id: str - :param multi_vm_group_name: The multi VM group name. - :type multi_vm_group_name: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'fabric_discovery_machine_id': {'required': True}, - 'target_resource_group_id': {'required': True}, - 'process_server_id': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'fabric_discovery_machine_id': {'key': 'fabricDiscoveryMachineId', 'type': 'str'}, - 'disks_to_include': {'key': 'disksToInclude', 'type': '[InMageRcmDiskInput]'}, - 'disks_default': {'key': 'disksDefault', 'type': 'InMageRcmDisksDefaultInput'}, - 'target_resource_group_id': {'key': 'targetResourceGroupId', 'type': 'str'}, - 'target_network_id': {'key': 'targetNetworkId', 'type': 'str'}, - 'test_network_id': {'key': 'testNetworkId', 'type': 'str'}, - 'target_subnet_name': {'key': 'targetSubnetName', 'type': 'str'}, - 'test_subnet_name': {'key': 'testSubnetName', 'type': 'str'}, - 'target_vm_name': {'key': 'targetVmName', 'type': 'str'}, - 'target_vm_size': {'key': 'targetVmSize', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'target_availability_set_id': {'key': 'targetAvailabilitySetId', 'type': 'str'}, - 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, - 'target_proximity_placement_group_id': {'key': 'targetProximityPlacementGroupId', 'type': 'str'}, - 'target_boot_diagnostics_storage_account_id': {'key': 'targetBootDiagnosticsStorageAccountId', 'type': 'str'}, - 'run_as_account_id': {'key': 'runAsAccountId', 'type': 'str'}, - 'process_server_id': {'key': 'processServerId', 'type': 'str'}, - 'multi_vm_group_name': {'key': 'multiVmGroupName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmEnableProtectionInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.fabric_discovery_machine_id = kwargs['fabric_discovery_machine_id'] - self.disks_to_include = kwargs.get('disks_to_include', None) - self.disks_default = kwargs.get('disks_default', None) - self.target_resource_group_id = kwargs['target_resource_group_id'] - self.target_network_id = kwargs.get('target_network_id', None) - self.test_network_id = kwargs.get('test_network_id', None) - self.target_subnet_name = kwargs.get('target_subnet_name', None) - self.test_subnet_name = kwargs.get('test_subnet_name', None) - self.target_vm_name = kwargs.get('target_vm_name', None) - self.target_vm_size = kwargs.get('target_vm_size', None) - self.license_type = kwargs.get('license_type', None) - self.target_availability_set_id = kwargs.get('target_availability_set_id', None) - self.target_availability_zone = kwargs.get('target_availability_zone', None) - self.target_proximity_placement_group_id = kwargs.get('target_proximity_placement_group_id', None) - self.target_boot_diagnostics_storage_account_id = kwargs.get('target_boot_diagnostics_storage_account_id', None) - self.run_as_account_id = kwargs.get('run_as_account_id', None) - self.process_server_id = kwargs['process_server_id'] - self.multi_vm_group_name = kwargs.get('multi_vm_group_name', None) - - -class InMageRcmEventDetails(EventProviderSpecificDetails): - """Event details for InMageRcm provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :ivar protected_item_name: The protected item name. - :vartype protected_item_name: str - :ivar vm_name: The protected item name. - :vartype vm_name: str - :ivar latest_agent_version: The latest agent version. - :vartype latest_agent_version: str - :ivar job_id: The job Id. - :vartype job_id: str - :ivar fabric_name: The fabric name. - :vartype fabric_name: str - :ivar appliance_name: The appliance name. - :vartype appliance_name: str - :ivar server_type: The server type. - :vartype server_type: str - :ivar component_display_name: The component display name. - :vartype component_display_name: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'protected_item_name': {'readonly': True}, - 'vm_name': {'readonly': True}, - 'latest_agent_version': {'readonly': True}, - 'job_id': {'readonly': True}, - 'fabric_name': {'readonly': True}, - 'appliance_name': {'readonly': True}, - 'server_type': {'readonly': True}, - 'component_display_name': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'protected_item_name': {'key': 'protectedItemName', 'type': 'str'}, - 'vm_name': {'key': 'vmName', 'type': 'str'}, - 'latest_agent_version': {'key': 'latestAgentVersion', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'fabric_name': {'key': 'fabricName', 'type': 'str'}, - 'appliance_name': {'key': 'applianceName', 'type': 'str'}, - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'component_display_name': {'key': 'componentDisplayName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmEventDetails, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.protected_item_name = None - self.vm_name = None - self.latest_agent_version = None - self.job_id = None - self.fabric_name = None - self.appliance_name = None - self.server_type = None - self.component_display_name = None - - -class InMageRcmFabricCreationInput(FabricSpecificCreationInput): - """InMageRcm fabric provider specific settings. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type.Constant filled by server. - :type instance_type: str - :param vmware_site_id: Required. The ARM Id of the VMware site. - :type vmware_site_id: str - :param physical_site_id: Required. The ARM Id of the physical site. - :type physical_site_id: str - :param source_agent_identity: Required. The identity provider input for source agent - authentication. - :type source_agent_identity: - ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderInput - """ - - _validation = { - 'instance_type': {'required': True}, - 'vmware_site_id': {'required': True}, - 'physical_site_id': {'required': True}, - 'source_agent_identity': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'vmware_site_id': {'key': 'vmwareSiteId', 'type': 'str'}, - 'physical_site_id': {'key': 'physicalSiteId', 'type': 'str'}, - 'source_agent_identity': {'key': 'sourceAgentIdentity', 'type': 'IdentityProviderInput'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmFabricCreationInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.vmware_site_id = kwargs['vmware_site_id'] - self.physical_site_id = kwargs['physical_site_id'] - self.source_agent_identity = kwargs['source_agent_identity'] - - -class InMageRcmFabricSpecificDetails(FabricSpecificDetails): - """InMageRcm fabric specific details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :ivar vmware_site_id: The ARM Id of the VMware site. - :vartype vmware_site_id: str - :ivar physical_site_id: The ARM Id of the physical site. - :vartype physical_site_id: str - :ivar service_endpoint: The service endpoint. - :vartype service_endpoint: str - :ivar service_resource_id: The service resource Id. - :vartype service_resource_id: str - :ivar service_container_id: The service container Id. - :vartype service_container_id: str - :ivar data_plane_uri: The data plane Uri. - :vartype data_plane_uri: str - :ivar control_plane_uri: The control plane Uri. - :vartype control_plane_uri: str - :param source_agent_identity_details: The source agent identity details. - :type source_agent_identity_details: - ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderDetails - :ivar process_servers: The list of process servers. - :vartype process_servers: - list[~azure.mgmt.recoveryservicessiterecovery.models.ProcessServerDetails] - :ivar rcm_proxies: The list of RCM proxies. - :vartype rcm_proxies: list[~azure.mgmt.recoveryservicessiterecovery.models.RcmProxyDetails] - :ivar push_installers: The list of push installers. - :vartype push_installers: - list[~azure.mgmt.recoveryservicessiterecovery.models.PushInstallerDetails] - :ivar replication_agents: The list of replication agents. - :vartype replication_agents: - list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationAgentDetails] - :ivar reprotect_agents: The list of reprotect agents. - :vartype reprotect_agents: - list[~azure.mgmt.recoveryservicessiterecovery.models.ReprotectAgentDetails] - :ivar mars_agents: The list of Mars agents. - :vartype mars_agents: list[~azure.mgmt.recoveryservicessiterecovery.models.MarsAgentDetails] - :ivar dras: The list of DRAs. - :vartype dras: list[~azure.mgmt.recoveryservicessiterecovery.models.DraDetails] - :ivar agent_details: The list of agent details. - :vartype agent_details: list[~azure.mgmt.recoveryservicessiterecovery.models.AgentDetails] - """ - - _validation = { - 'instance_type': {'required': True}, - 'vmware_site_id': {'readonly': True}, - 'physical_site_id': {'readonly': True}, - 'service_endpoint': {'readonly': True}, - 'service_resource_id': {'readonly': True}, - 'service_container_id': {'readonly': True}, - 'data_plane_uri': {'readonly': True}, - 'control_plane_uri': {'readonly': True}, - 'process_servers': {'readonly': True}, - 'rcm_proxies': {'readonly': True}, - 'push_installers': {'readonly': True}, - 'replication_agents': {'readonly': True}, - 'reprotect_agents': {'readonly': True}, - 'mars_agents': {'readonly': True}, - 'dras': {'readonly': True}, - 'agent_details': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'vmware_site_id': {'key': 'vmwareSiteId', 'type': 'str'}, - 'physical_site_id': {'key': 'physicalSiteId', 'type': 'str'}, - 'service_endpoint': {'key': 'serviceEndpoint', 'type': 'str'}, - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'service_container_id': {'key': 'serviceContainerId', 'type': 'str'}, - 'data_plane_uri': {'key': 'dataPlaneUri', 'type': 'str'}, - 'control_plane_uri': {'key': 'controlPlaneUri', 'type': 'str'}, - 'source_agent_identity_details': {'key': 'sourceAgentIdentityDetails', 'type': 'IdentityProviderDetails'}, - 'process_servers': {'key': 'processServers', 'type': '[ProcessServerDetails]'}, - 'rcm_proxies': {'key': 'rcmProxies', 'type': '[RcmProxyDetails]'}, - 'push_installers': {'key': 'pushInstallers', 'type': '[PushInstallerDetails]'}, - 'replication_agents': {'key': 'replicationAgents', 'type': '[ReplicationAgentDetails]'}, - 'reprotect_agents': {'key': 'reprotectAgents', 'type': '[ReprotectAgentDetails]'}, - 'mars_agents': {'key': 'marsAgents', 'type': '[MarsAgentDetails]'}, - 'dras': {'key': 'dras', 'type': '[DraDetails]'}, - 'agent_details': {'key': 'agentDetails', 'type': '[AgentDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmFabricSpecificDetails, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.vmware_site_id = None - self.physical_site_id = None - self.service_endpoint = None - self.service_resource_id = None - self.service_container_id = None - self.data_plane_uri = None - self.control_plane_uri = None - self.source_agent_identity_details = kwargs.get('source_agent_identity_details', None) - self.process_servers = None - self.rcm_proxies = None - self.push_installers = None - self.replication_agents = None - self.reprotect_agents = None - self.mars_agents = None - self.dras = None - self.agent_details = None - - -class InMageRcmFailbackDiscoveredProtectedVmDetails(msrest.serialization.Model): - """InMageRcmFailback discovered VM details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar v_center_id: The VCenter Id. - :vartype v_center_id: str - :ivar v_center_fqdn: The VCenter fqdn. - :vartype v_center_fqdn: str - :ivar datastores: The list of datastores. - :vartype datastores: list[str] - :ivar ip_addresses: The list of IP addresses. - :vartype ip_addresses: list[str] - :ivar vmware_tools_status: The VMware tools status. - :vartype vmware_tools_status: str - :ivar power_status: The VM power status. - :vartype power_status: str - :ivar vm_fqdn: The VM fqdn. - :vartype vm_fqdn: str - :ivar os_name: The VM's OS name. - :vartype os_name: str - :ivar created_timestamp: The SDS created timestamp. - :vartype created_timestamp: ~datetime.datetime - :ivar updated_timestamp: The SDS updated timestamp. - :vartype updated_timestamp: ~datetime.datetime - :ivar is_deleted: A value indicating whether the VM is deleted. - :vartype is_deleted: bool - :ivar last_discovery_time_in_utc: The last time when SDS information discovered in SRS. - :vartype last_discovery_time_in_utc: ~datetime.datetime - """ - - _validation = { - 'v_center_id': {'readonly': True}, - 'v_center_fqdn': {'readonly': True}, - 'datastores': {'readonly': True}, - 'ip_addresses': {'readonly': True}, - 'vmware_tools_status': {'readonly': True}, - 'power_status': {'readonly': True}, - 'vm_fqdn': {'readonly': True}, - 'os_name': {'readonly': True}, - 'created_timestamp': {'readonly': True}, - 'updated_timestamp': {'readonly': True}, - 'is_deleted': {'readonly': True}, - 'last_discovery_time_in_utc': {'readonly': True}, - } - - _attribute_map = { - 'v_center_id': {'key': 'vCenterId', 'type': 'str'}, - 'v_center_fqdn': {'key': 'vCenterFqdn', 'type': 'str'}, - 'datastores': {'key': 'datastores', 'type': '[str]'}, - 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, - 'vmware_tools_status': {'key': 'vmwareToolsStatus', 'type': 'str'}, - 'power_status': {'key': 'powerStatus', 'type': 'str'}, - 'vm_fqdn': {'key': 'vmFqdn', 'type': 'str'}, - 'os_name': {'key': 'osName', 'type': 'str'}, - 'created_timestamp': {'key': 'createdTimestamp', 'type': 'iso-8601'}, - 'updated_timestamp': {'key': 'updatedTimestamp', 'type': 'iso-8601'}, - 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, - 'last_discovery_time_in_utc': {'key': 'lastDiscoveryTimeInUtc', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmFailbackDiscoveredProtectedVmDetails, self).__init__(**kwargs) - self.v_center_id = None - self.v_center_fqdn = None - self.datastores = None - self.ip_addresses = None - self.vmware_tools_status = None - self.power_status = None - self.vm_fqdn = None - self.os_name = None - self.created_timestamp = None - self.updated_timestamp = None - self.is_deleted = None - self.last_discovery_time_in_utc = None - - -class InMageRcmFailbackEventDetails(EventProviderSpecificDetails): - """Event details for InMageRcmFailback provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :ivar protected_item_name: The protected item name. - :vartype protected_item_name: str - :ivar vm_name: The protected item name. - :vartype vm_name: str - :ivar appliance_name: The appliance name. - :vartype appliance_name: str - :ivar server_type: The server type. - :vartype server_type: str - :ivar component_display_name: The component display name. - :vartype component_display_name: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'protected_item_name': {'readonly': True}, - 'vm_name': {'readonly': True}, - 'appliance_name': {'readonly': True}, - 'server_type': {'readonly': True}, - 'component_display_name': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'protected_item_name': {'key': 'protectedItemName', 'type': 'str'}, - 'vm_name': {'key': 'vmName', 'type': 'str'}, - 'appliance_name': {'key': 'applianceName', 'type': 'str'}, - 'server_type': {'key': 'serverType', 'type': 'str'}, - 'component_display_name': {'key': 'componentDisplayName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmFailbackEventDetails, self).__init__(**kwargs) - self.instance_type = 'InMageRcmFailback' # type: str - self.protected_item_name = None - self.vm_name = None - self.appliance_name = None - self.server_type = None - self.component_display_name = None - - -class InMageRcmFailbackMobilityAgentDetails(msrest.serialization.Model): - """InMageRcmFailback mobility agent details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar version: The agent version. - :vartype version: str - :ivar latest_version: The latest agent version available. - :vartype latest_version: str - :ivar driver_version: The driver version. - :vartype driver_version: str - :ivar latest_upgradable_version_without_reboot: The latest upgradeable version available - without reboot. - :vartype latest_upgradable_version_without_reboot: str - :ivar agent_version_expiry_date: The agent version expiry date. - :vartype agent_version_expiry_date: ~datetime.datetime - :ivar driver_version_expiry_date: The driver version expiry date. - :vartype driver_version_expiry_date: ~datetime.datetime - :ivar last_heartbeat_utc: The time of the last heartbeat received from the agent. - :vartype last_heartbeat_utc: ~datetime.datetime - :ivar reasons_blocking_upgrade: The whether update is possible or not. - :vartype reasons_blocking_upgrade: list[str or - ~azure.mgmt.recoveryservicessiterecovery.models.AgentUpgradeBlockedReason] - :ivar is_upgradeable: A value indicating whether agent is upgradeable or not. - :vartype is_upgradeable: str - """ - - _validation = { - 'version': {'readonly': True}, - 'latest_version': {'readonly': True}, - 'driver_version': {'readonly': True}, - 'latest_upgradable_version_without_reboot': {'readonly': True}, - 'agent_version_expiry_date': {'readonly': True}, - 'driver_version_expiry_date': {'readonly': True}, - 'last_heartbeat_utc': {'readonly': True}, - 'reasons_blocking_upgrade': {'readonly': True}, - 'is_upgradeable': {'readonly': True}, - } - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'driver_version': {'key': 'driverVersion', 'type': 'str'}, - 'latest_upgradable_version_without_reboot': {'key': 'latestUpgradableVersionWithoutReboot', 'type': 'str'}, - 'agent_version_expiry_date': {'key': 'agentVersionExpiryDate', 'type': 'iso-8601'}, - 'driver_version_expiry_date': {'key': 'driverVersionExpiryDate', 'type': 'iso-8601'}, - 'last_heartbeat_utc': {'key': 'lastHeartbeatUtc', 'type': 'iso-8601'}, - 'reasons_blocking_upgrade': {'key': 'reasonsBlockingUpgrade', 'type': '[str]'}, - 'is_upgradeable': {'key': 'isUpgradeable', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmFailbackMobilityAgentDetails, self).__init__(**kwargs) - self.version = None - self.latest_version = None - self.driver_version = None - self.latest_upgradable_version_without_reboot = None - self.agent_version_expiry_date = None - self.driver_version_expiry_date = None - self.last_heartbeat_utc = None - self.reasons_blocking_upgrade = None - self.is_upgradeable = None - - -class InMageRcmFailbackNicDetails(msrest.serialization.Model): - """InMageRcmFailback NIC details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar mac_address: The mac address. - :vartype mac_address: str - :ivar network_name: The network name. - :vartype network_name: str - :ivar adapter_type: The adapter type. - :vartype adapter_type: str - :ivar source_ip_address: The IP address. - :vartype source_ip_address: str - """ - - _validation = { - 'mac_address': {'readonly': True}, - 'network_name': {'readonly': True}, - 'adapter_type': {'readonly': True}, - 'source_ip_address': {'readonly': True}, - } - - _attribute_map = { - 'mac_address': {'key': 'macAddress', 'type': 'str'}, - 'network_name': {'key': 'networkName', 'type': 'str'}, - 'adapter_type': {'key': 'adapterType', 'type': 'str'}, - 'source_ip_address': {'key': 'sourceIpAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmFailbackNicDetails, self).__init__(**kwargs) - self.mac_address = None - self.network_name = None - self.adapter_type = None - self.source_ip_address = None - - -class InMageRcmFailbackPlannedFailoverProviderInput(PlannedFailoverProviderSpecificFailoverInput): - """Provider specific input for InMageRcmFailback failover. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: Required. The recovery point type. Possible values include: - "ApplicationConsistent", "CrashConsistent". - :type recovery_point_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackRecoveryPointType - """ - - _validation = { - 'instance_type': {'required': True}, - 'recovery_point_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmFailbackPlannedFailoverProviderInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcmFailback' # type: str - self.recovery_point_type = kwargs['recovery_point_type'] - - -class InMageRcmFailbackPolicyCreationInput(PolicyProviderSpecificInput): - """InMageRcmFailback policy creation input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in - minutes). - :type crash_consistent_frequency_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). - :type app_consistent_frequency_in_minutes: int - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'crash_consistent_frequency_in_minutes': {'key': 'crashConsistentFrequencyInMinutes', 'type': 'int'}, - 'app_consistent_frequency_in_minutes': {'key': 'appConsistentFrequencyInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmFailbackPolicyCreationInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcmFailback' # type: str - self.crash_consistent_frequency_in_minutes = kwargs.get('crash_consistent_frequency_in_minutes', None) - self.app_consistent_frequency_in_minutes = kwargs.get('app_consistent_frequency_in_minutes', None) - - -class InMageRcmFailbackPolicyDetails(PolicyProviderSpecificDetails): - """InMageRcm failback specific policy details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. - :type app_consistent_frequency_in_minutes: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in - minutes. - :type crash_consistent_frequency_in_minutes: int - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'app_consistent_frequency_in_minutes': {'key': 'appConsistentFrequencyInMinutes', 'type': 'int'}, - 'crash_consistent_frequency_in_minutes': {'key': 'crashConsistentFrequencyInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmFailbackPolicyDetails, self).__init__(**kwargs) - self.instance_type = 'InMageRcmFailback' # type: str - self.app_consistent_frequency_in_minutes = kwargs.get('app_consistent_frequency_in_minutes', None) - self.crash_consistent_frequency_in_minutes = kwargs.get('crash_consistent_frequency_in_minutes', None) - - -class InMageRcmFailbackProtectedDiskDetails(msrest.serialization.Model): - """InMageRcmFailback protected disk details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar disk_id: The disk Id (reported by source agent). - :vartype disk_id: str - :ivar disk_name: The disk name. - :vartype disk_name: str - :ivar is_os_disk: A value indicating whether the disk is the OS disk. - :vartype is_os_disk: str - :ivar capacity_in_bytes: The disk capacity in bytes. - :vartype capacity_in_bytes: long - :ivar disk_uuid: The disk Uuid (reported by vCenter). - :vartype disk_uuid: str - :ivar data_pending_in_log_data_store_in_mb: The data pending in log data store in MB. - :vartype data_pending_in_log_data_store_in_mb: float - :ivar data_pending_at_source_agent_in_mb: The data pending at source agent in MB. - :vartype data_pending_at_source_agent_in_mb: float - :ivar is_initial_replication_complete: A value indicating whether initial replication is - complete or not. - :vartype is_initial_replication_complete: str - :param ir_details: The initial replication details. - :type ir_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackSyncDetails - :param resync_details: The resync details. - :type resync_details: - ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackSyncDetails - :ivar last_sync_time: The last sync time. - :vartype last_sync_time: ~datetime.datetime - """ - - _validation = { - 'disk_id': {'readonly': True}, - 'disk_name': {'readonly': True}, - 'is_os_disk': {'readonly': True}, - 'capacity_in_bytes': {'readonly': True}, - 'disk_uuid': {'readonly': True}, - 'data_pending_in_log_data_store_in_mb': {'readonly': True}, - 'data_pending_at_source_agent_in_mb': {'readonly': True}, - 'is_initial_replication_complete': {'readonly': True}, - 'last_sync_time': {'readonly': True}, - } - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'disk_name': {'key': 'diskName', 'type': 'str'}, - 'is_os_disk': {'key': 'isOSDisk', 'type': 'str'}, - 'capacity_in_bytes': {'key': 'capacityInBytes', 'type': 'long'}, - 'disk_uuid': {'key': 'diskUuid', 'type': 'str'}, - 'data_pending_in_log_data_store_in_mb': {'key': 'dataPendingInLogDataStoreInMB', 'type': 'float'}, - 'data_pending_at_source_agent_in_mb': {'key': 'dataPendingAtSourceAgentInMB', 'type': 'float'}, - 'is_initial_replication_complete': {'key': 'isInitialReplicationComplete', 'type': 'str'}, - 'ir_details': {'key': 'irDetails', 'type': 'InMageRcmFailbackSyncDetails'}, - 'resync_details': {'key': 'resyncDetails', 'type': 'InMageRcmFailbackSyncDetails'}, - 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmFailbackProtectedDiskDetails, self).__init__(**kwargs) - self.disk_id = None - self.disk_name = None - self.is_os_disk = None - self.capacity_in_bytes = None - self.disk_uuid = None - self.data_pending_in_log_data_store_in_mb = None - self.data_pending_at_source_agent_in_mb = None - self.is_initial_replication_complete = None - self.ir_details = kwargs.get('ir_details', None) - self.resync_details = kwargs.get('resync_details', None) - self.last_sync_time = None - - -class InMageRcmFailbackReplicationDetails(ReplicationProviderSpecificSettings): - """InMageRcmFailback provider specific details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :ivar internal_identifier: The virtual machine internal identifier. - :vartype internal_identifier: str - :ivar azure_virtual_machine_id: The ARM Id of the azure VM. - :vartype azure_virtual_machine_id: str - :ivar multi_vm_group_name: The multi VM group name. - :vartype multi_vm_group_name: str - :ivar reprotect_agent_id: The reprotect agent Id. - :vartype reprotect_agent_id: str - :ivar reprotect_agent_name: The reprotect agent name. - :vartype reprotect_agent_name: str - :ivar os_type: The type of the OS on the VM. - :vartype os_type: str - :ivar log_storage_account_id: The log storage account ARM Id. - :vartype log_storage_account_id: str - :ivar targetv_center_id: The target vCenter Id. - :vartype targetv_center_id: str - :ivar target_data_store_name: The target datastore name. - :vartype target_data_store_name: str - :ivar target_vm_name: The target VM name. - :vartype target_vm_name: str - :ivar initial_replication_progress_percentage: The initial replication progress percentage. - :vartype initial_replication_progress_percentage: int - :ivar initial_replication_processed_bytes: The initial replication processed bytes. This - includes sum of total bytes transferred and matched bytes on all selected disks in source VM. - :vartype initial_replication_processed_bytes: long - :ivar initial_replication_transferred_bytes: The initial replication transferred bytes from - source VM to target for all selected disks on source VM. - :vartype initial_replication_transferred_bytes: long - :ivar initial_replication_progress_health: The initial replication progress health. Possible - values include: "None", "InProgress", "SlowProgress", "NoProgress". - :vartype initial_replication_progress_health: str or - ~azure.mgmt.recoveryservicessiterecovery.models.VmReplicationProgressHealth - :ivar resync_progress_percentage: The resync progress percentage. - :vartype resync_progress_percentage: int - :ivar resync_processed_bytes: The resync processed bytes. This includes sum of total bytes - transferred and matched bytes on all selected disks in source VM. - :vartype resync_processed_bytes: long - :ivar resync_transferred_bytes: The resync transferred bytes from source VM to target for all - selected disks on source VM. - :vartype resync_transferred_bytes: long - :ivar resync_progress_health: The resync progress health. Possible values include: "None", - "InProgress", "SlowProgress", "NoProgress". - :vartype resync_progress_health: str or - ~azure.mgmt.recoveryservicessiterecovery.models.VmReplicationProgressHealth - :ivar resync_required: A value indicating whether resync is required. - :vartype resync_required: str - :ivar resync_state: The resync state. Possible values include: "None", - "PreparedForResynchronization", "StartedResynchronization". - :vartype resync_state: str or ~azure.mgmt.recoveryservicessiterecovery.models.ResyncState - :param protected_disks: The list of protected disks. - :type protected_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackProtectedDiskDetails] - :param mobility_agent_details: The mobility agent information. - :type mobility_agent_details: - ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackMobilityAgentDetails - :param vm_nics: The network details. - :type vm_nics: - list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackNicDetails] - :ivar last_planned_failover_start_time: The last planned failover start time. - :vartype last_planned_failover_start_time: ~datetime.datetime - :ivar last_planned_failover_status: The last planned failover status. Possible values include: - "Succeeded", "Failed", "Cancelled", "Unknown". - :vartype last_planned_failover_status: str or - ~azure.mgmt.recoveryservicessiterecovery.models.PlannedFailoverStatus - :param discovered_vm_details: The discovered VM information. - :type discovered_vm_details: - ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackDiscoveredProtectedVmDetails - :ivar last_used_policy_id: The policy Id used by the forward replication. - :vartype last_used_policy_id: str - :ivar last_used_policy_friendly_name: The policy friendly name used by the forward replication. - :vartype last_used_policy_friendly_name: str - :ivar is_agent_registration_successful_after_failover: A value indicating whether agent - registration was successful after failover. - :vartype is_agent_registration_successful_after_failover: bool - """ - - _validation = { - 'instance_type': {'required': True}, - 'internal_identifier': {'readonly': True}, - 'azure_virtual_machine_id': {'readonly': True}, - 'multi_vm_group_name': {'readonly': True}, - 'reprotect_agent_id': {'readonly': True}, - 'reprotect_agent_name': {'readonly': True}, - 'os_type': {'readonly': True}, - 'log_storage_account_id': {'readonly': True}, - 'targetv_center_id': {'readonly': True}, - 'target_data_store_name': {'readonly': True}, - 'target_vm_name': {'readonly': True}, - 'initial_replication_progress_percentage': {'readonly': True}, - 'initial_replication_processed_bytes': {'readonly': True}, - 'initial_replication_transferred_bytes': {'readonly': True}, - 'initial_replication_progress_health': {'readonly': True}, - 'resync_progress_percentage': {'readonly': True}, - 'resync_processed_bytes': {'readonly': True}, - 'resync_transferred_bytes': {'readonly': True}, - 'resync_progress_health': {'readonly': True}, - 'resync_required': {'readonly': True}, - 'resync_state': {'readonly': True}, - 'last_planned_failover_start_time': {'readonly': True}, - 'last_planned_failover_status': {'readonly': True}, - 'last_used_policy_id': {'readonly': True}, - 'last_used_policy_friendly_name': {'readonly': True}, - 'is_agent_registration_successful_after_failover': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'internal_identifier': {'key': 'internalIdentifier', 'type': 'str'}, - 'azure_virtual_machine_id': {'key': 'azureVirtualMachineId', 'type': 'str'}, - 'multi_vm_group_name': {'key': 'multiVmGroupName', 'type': 'str'}, - 'reprotect_agent_id': {'key': 'reprotectAgentId', 'type': 'str'}, - 'reprotect_agent_name': {'key': 'reprotectAgentName', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'log_storage_account_id': {'key': 'logStorageAccountId', 'type': 'str'}, - 'targetv_center_id': {'key': 'targetvCenterId', 'type': 'str'}, - 'target_data_store_name': {'key': 'targetDataStoreName', 'type': 'str'}, - 'target_vm_name': {'key': 'targetVmName', 'type': 'str'}, - 'initial_replication_progress_percentage': {'key': 'initialReplicationProgressPercentage', 'type': 'int'}, - 'initial_replication_processed_bytes': {'key': 'initialReplicationProcessedBytes', 'type': 'long'}, - 'initial_replication_transferred_bytes': {'key': 'initialReplicationTransferredBytes', 'type': 'long'}, - 'initial_replication_progress_health': {'key': 'initialReplicationProgressHealth', 'type': 'str'}, - 'resync_progress_percentage': {'key': 'resyncProgressPercentage', 'type': 'int'}, - 'resync_processed_bytes': {'key': 'resyncProcessedBytes', 'type': 'long'}, - 'resync_transferred_bytes': {'key': 'resyncTransferredBytes', 'type': 'long'}, - 'resync_progress_health': {'key': 'resyncProgressHealth', 'type': 'str'}, - 'resync_required': {'key': 'resyncRequired', 'type': 'str'}, - 'resync_state': {'key': 'resyncState', 'type': 'str'}, - 'protected_disks': {'key': 'protectedDisks', 'type': '[InMageRcmFailbackProtectedDiskDetails]'}, - 'mobility_agent_details': {'key': 'mobilityAgentDetails', 'type': 'InMageRcmFailbackMobilityAgentDetails'}, - 'vm_nics': {'key': 'vmNics', 'type': '[InMageRcmFailbackNicDetails]'}, - 'last_planned_failover_start_time': {'key': 'lastPlannedFailoverStartTime', 'type': 'iso-8601'}, - 'last_planned_failover_status': {'key': 'lastPlannedFailoverStatus', 'type': 'str'}, - 'discovered_vm_details': {'key': 'discoveredVmDetails', 'type': 'InMageRcmFailbackDiscoveredProtectedVmDetails'}, - 'last_used_policy_id': {'key': 'lastUsedPolicyId', 'type': 'str'}, - 'last_used_policy_friendly_name': {'key': 'lastUsedPolicyFriendlyName', 'type': 'str'}, - 'is_agent_registration_successful_after_failover': {'key': 'isAgentRegistrationSuccessfulAfterFailover', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmFailbackReplicationDetails, self).__init__(**kwargs) - self.instance_type = 'InMageRcmFailback' # type: str - self.internal_identifier = None - self.azure_virtual_machine_id = None - self.multi_vm_group_name = None - self.reprotect_agent_id = None - self.reprotect_agent_name = None - self.os_type = None - self.log_storage_account_id = None - self.targetv_center_id = None - self.target_data_store_name = None - self.target_vm_name = None - self.initial_replication_progress_percentage = None - self.initial_replication_processed_bytes = None - self.initial_replication_transferred_bytes = None - self.initial_replication_progress_health = None - self.resync_progress_percentage = None - self.resync_processed_bytes = None - self.resync_transferred_bytes = None - self.resync_progress_health = None - self.resync_required = None - self.resync_state = None - self.protected_disks = kwargs.get('protected_disks', None) - self.mobility_agent_details = kwargs.get('mobility_agent_details', None) - self.vm_nics = kwargs.get('vm_nics', None) - self.last_planned_failover_start_time = None - self.last_planned_failover_status = None - self.discovered_vm_details = kwargs.get('discovered_vm_details', None) - self.last_used_policy_id = None - self.last_used_policy_friendly_name = None - self.is_agent_registration_successful_after_failover = None - - -class InMageRcmFailbackReprotectInput(ReverseReplicationProviderSpecificInput): - """InMageRcmFailback specific provider input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param process_server_id: Required. The process server Id. - :type process_server_id: str - :param run_as_account_id: The run as account Id. - :type run_as_account_id: str - :param policy_id: Required. The Policy Id. - :type policy_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'process_server_id': {'required': True}, - 'policy_id': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'process_server_id': {'key': 'processServerId', 'type': 'str'}, - 'run_as_account_id': {'key': 'runAsAccountId', 'type': 'str'}, - 'policy_id': {'key': 'policyId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmFailbackReprotectInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcmFailback' # type: str - self.process_server_id = kwargs['process_server_id'] - self.run_as_account_id = kwargs.get('run_as_account_id', None) - self.policy_id = kwargs['policy_id'] - - -class InMageRcmFailbackSyncDetails(msrest.serialization.Model): - """InMageRcmFailback disk level sync details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar progress_health: The progress health. Possible values include: "None", "InProgress", - "SlowProgress", "NoProgress", "Queued". - :vartype progress_health: str or - ~azure.mgmt.recoveryservicessiterecovery.models.DiskReplicationProgressHealth - :ivar transferred_bytes: The transferred bytes from source VM to azure for the disk. - :vartype transferred_bytes: long - :ivar last15_minutes_transferred_bytes: The bytes transferred in last 15 minutes from source VM - to target. - :vartype last15_minutes_transferred_bytes: long - :ivar last_data_transfer_time_utc: The time of the last data transfer from source VM to target. - :vartype last_data_transfer_time_utc: str - :ivar processed_bytes: The total processed bytes. This includes bytes that are transferred from - source VM to target and matched bytes. - :vartype processed_bytes: long - :ivar start_time: The start time. - :vartype start_time: str - :ivar last_refresh_time: The last refresh time. - :vartype last_refresh_time: str - :ivar progress_percentage: Progress in percentage. Progress percentage is calculated based on - processed bytes. - :vartype progress_percentage: int - """ - - _validation = { - 'progress_health': {'readonly': True}, - 'transferred_bytes': {'readonly': True}, - 'last15_minutes_transferred_bytes': {'readonly': True}, - 'last_data_transfer_time_utc': {'readonly': True}, - 'processed_bytes': {'readonly': True}, - 'start_time': {'readonly': True}, - 'last_refresh_time': {'readonly': True}, - 'progress_percentage': {'readonly': True}, - } - - _attribute_map = { - 'progress_health': {'key': 'progressHealth', 'type': 'str'}, - 'transferred_bytes': {'key': 'transferredBytes', 'type': 'long'}, - 'last15_minutes_transferred_bytes': {'key': 'last15MinutesTransferredBytes', 'type': 'long'}, - 'last_data_transfer_time_utc': {'key': 'lastDataTransferTimeUtc', 'type': 'str'}, - 'processed_bytes': {'key': 'processedBytes', 'type': 'long'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'last_refresh_time': {'key': 'lastRefreshTime', 'type': 'str'}, - 'progress_percentage': {'key': 'progressPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmFailbackSyncDetails, self).__init__(**kwargs) - self.progress_health = None - self.transferred_bytes = None - self.last15_minutes_transferred_bytes = None - self.last_data_transfer_time_utc = None - self.processed_bytes = None - self.start_time = None - self.last_refresh_time = None - self.progress_percentage = None - - -class InMageRcmLastAgentUpgradeErrorDetails(msrest.serialization.Model): - """InMageRcm last source agent upgrade error details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error_code: The error code. - :vartype error_code: str - :ivar error_message: The error message. - :vartype error_message: str - :ivar possible_causes: The possible causes. - :vartype possible_causes: str - :ivar recommended_action: The recommended action. - :vartype recommended_action: str - :ivar error_message_parameters: The error message parameters. - :vartype error_message_parameters: dict[str, str] - :ivar error_tags: The error tags. - :vartype error_tags: dict[str, str] - """ - - _validation = { - 'error_code': {'readonly': True}, - 'error_message': {'readonly': True}, - 'possible_causes': {'readonly': True}, - 'recommended_action': {'readonly': True}, - 'error_message_parameters': {'readonly': True}, - 'error_tags': {'readonly': True}, - } - - _attribute_map = { - 'error_code': {'key': 'errorCode', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'possible_causes': {'key': 'possibleCauses', 'type': 'str'}, - 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, - 'error_message_parameters': {'key': 'errorMessageParameters', 'type': '{str}'}, - 'error_tags': {'key': 'errorTags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmLastAgentUpgradeErrorDetails, self).__init__(**kwargs) - self.error_code = None - self.error_message = None - self.possible_causes = None - self.recommended_action = None - self.error_message_parameters = None - self.error_tags = None - - -class InMageRcmMobilityAgentDetails(msrest.serialization.Model): - """InMageRcm mobility agent details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar version: The agent version. - :vartype version: str - :ivar latest_version: The latest agent version available. - :vartype latest_version: str - :ivar latest_agent_release_date: The latest agent version release date. - :vartype latest_agent_release_date: str - :ivar driver_version: The driver version. - :vartype driver_version: str - :ivar latest_upgradable_version_without_reboot: The latest upgradeable version available - without reboot. - :vartype latest_upgradable_version_without_reboot: str - :ivar agent_version_expiry_date: The agent version expiry date. - :vartype agent_version_expiry_date: ~datetime.datetime - :ivar driver_version_expiry_date: The driver version expiry date. - :vartype driver_version_expiry_date: ~datetime.datetime - :ivar last_heartbeat_utc: The time of the last heartbeat received from the agent. - :vartype last_heartbeat_utc: ~datetime.datetime - :ivar reasons_blocking_upgrade: The whether update is possible or not. - :vartype reasons_blocking_upgrade: list[str or - ~azure.mgmt.recoveryservicessiterecovery.models.AgentUpgradeBlockedReason] - :ivar is_upgradeable: A value indicating whether agent is upgradeable or not. - :vartype is_upgradeable: str - """ - - _validation = { - 'version': {'readonly': True}, - 'latest_version': {'readonly': True}, - 'latest_agent_release_date': {'readonly': True}, - 'driver_version': {'readonly': True}, - 'latest_upgradable_version_without_reboot': {'readonly': True}, - 'agent_version_expiry_date': {'readonly': True}, - 'driver_version_expiry_date': {'readonly': True}, - 'last_heartbeat_utc': {'readonly': True}, - 'reasons_blocking_upgrade': {'readonly': True}, - 'is_upgradeable': {'readonly': True}, - } - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'latest_version': {'key': 'latestVersion', 'type': 'str'}, - 'latest_agent_release_date': {'key': 'latestAgentReleaseDate', 'type': 'str'}, - 'driver_version': {'key': 'driverVersion', 'type': 'str'}, - 'latest_upgradable_version_without_reboot': {'key': 'latestUpgradableVersionWithoutReboot', 'type': 'str'}, - 'agent_version_expiry_date': {'key': 'agentVersionExpiryDate', 'type': 'iso-8601'}, - 'driver_version_expiry_date': {'key': 'driverVersionExpiryDate', 'type': 'iso-8601'}, - 'last_heartbeat_utc': {'key': 'lastHeartbeatUtc', 'type': 'iso-8601'}, - 'reasons_blocking_upgrade': {'key': 'reasonsBlockingUpgrade', 'type': '[str]'}, - 'is_upgradeable': {'key': 'isUpgradeable', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmMobilityAgentDetails, self).__init__(**kwargs) - self.version = None - self.latest_version = None - self.latest_agent_release_date = None - self.driver_version = None - self.latest_upgradable_version_without_reboot = None - self.agent_version_expiry_date = None - self.driver_version_expiry_date = None - self.last_heartbeat_utc = None - self.reasons_blocking_upgrade = None - self.is_upgradeable = None - - -class InMageRcmNicDetails(msrest.serialization.Model): - """InMageRcm NIC details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nic_id: The NIC Id. - :vartype nic_id: str - :param is_primary_nic: A value indicating whether this is the primary NIC. - :type is_primary_nic: str - :param is_selected_for_failover: A value indicating whether this NIC is selected for failover. - :type is_selected_for_failover: str - :ivar source_ip_address: The source IP address. - :vartype source_ip_address: str - :ivar source_ip_address_type: The source IP address type. Possible values include: "Dynamic", - "Static". - :vartype source_ip_address_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.EthernetAddressType - :ivar source_network_id: Source network Id. - :vartype source_network_id: str - :ivar source_subnet_name: Source subnet name. - :vartype source_subnet_name: str - :param target_ip_address: The target IP address. - :type target_ip_address: str - :param target_ip_address_type: The target IP address type. Possible values include: "Dynamic", - "Static". - :type target_ip_address_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.EthernetAddressType - :param target_subnet_name: Target subnet name. - :type target_subnet_name: str - :param test_subnet_name: Test subnet name. - :type test_subnet_name: str - :param test_ip_address: The test IP address. - :type test_ip_address: str - :param test_ip_address_type: The test IP address type. Possible values include: "Dynamic", - "Static". - :type test_ip_address_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.EthernetAddressType - """ - - _validation = { - 'nic_id': {'readonly': True}, - 'source_ip_address': {'readonly': True}, - 'source_ip_address_type': {'readonly': True}, - 'source_network_id': {'readonly': True}, - 'source_subnet_name': {'readonly': True}, - } - - _attribute_map = { - 'nic_id': {'key': 'nicId', 'type': 'str'}, - 'is_primary_nic': {'key': 'isPrimaryNic', 'type': 'str'}, - 'is_selected_for_failover': {'key': 'isSelectedForFailover', 'type': 'str'}, - 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, - 'source_ip_address_type': {'key': 'sourceIPAddressType', 'type': 'str'}, - 'source_network_id': {'key': 'sourceNetworkId', 'type': 'str'}, - 'source_subnet_name': {'key': 'sourceSubnetName', 'type': 'str'}, - 'target_ip_address': {'key': 'targetIPAddress', 'type': 'str'}, - 'target_ip_address_type': {'key': 'targetIPAddressType', 'type': 'str'}, - 'target_subnet_name': {'key': 'targetSubnetName', 'type': 'str'}, - 'test_subnet_name': {'key': 'testSubnetName', 'type': 'str'}, - 'test_ip_address': {'key': 'testIPAddress', 'type': 'str'}, - 'test_ip_address_type': {'key': 'testIPAddressType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmNicDetails, self).__init__(**kwargs) - self.nic_id = None - self.is_primary_nic = kwargs.get('is_primary_nic', None) - self.is_selected_for_failover = kwargs.get('is_selected_for_failover', None) - self.source_ip_address = None - self.source_ip_address_type = None - self.source_network_id = None - self.source_subnet_name = None - self.target_ip_address = kwargs.get('target_ip_address', None) - self.target_ip_address_type = kwargs.get('target_ip_address_type', None) - self.target_subnet_name = kwargs.get('target_subnet_name', None) - self.test_subnet_name = kwargs.get('test_subnet_name', None) - self.test_ip_address = kwargs.get('test_ip_address', None) - self.test_ip_address_type = kwargs.get('test_ip_address_type', None) - - -class InMageRcmNicInput(msrest.serialization.Model): - """InMageRcm NIC input. - - All required parameters must be populated in order to send to Azure. - - :param nic_id: Required. The NIC Id. - :type nic_id: str - :param is_primary_nic: Required. A value indicating whether this is the primary NIC. - :type is_primary_nic: str - :param is_selected_for_failover: A value indicating whether this NIC is selected for failover. - :type is_selected_for_failover: str - :param target_subnet_name: Target subnet name. - :type target_subnet_name: str - :param target_static_ip_address: The target static IP address. - :type target_static_ip_address: str - :param test_subnet_name: The test subnet name. - :type test_subnet_name: str - :param test_static_ip_address: The test static IP address. - :type test_static_ip_address: str - """ - - _validation = { - 'nic_id': {'required': True}, - 'is_primary_nic': {'required': True}, - } - - _attribute_map = { - 'nic_id': {'key': 'nicId', 'type': 'str'}, - 'is_primary_nic': {'key': 'isPrimaryNic', 'type': 'str'}, - 'is_selected_for_failover': {'key': 'isSelectedForFailover', 'type': 'str'}, - 'target_subnet_name': {'key': 'targetSubnetName', 'type': 'str'}, - 'target_static_ip_address': {'key': 'targetStaticIPAddress', 'type': 'str'}, - 'test_subnet_name': {'key': 'testSubnetName', 'type': 'str'}, - 'test_static_ip_address': {'key': 'testStaticIPAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmNicInput, self).__init__(**kwargs) - self.nic_id = kwargs['nic_id'] - self.is_primary_nic = kwargs['is_primary_nic'] - self.is_selected_for_failover = kwargs.get('is_selected_for_failover', None) - self.target_subnet_name = kwargs.get('target_subnet_name', None) - self.target_static_ip_address = kwargs.get('target_static_ip_address', None) - self.test_subnet_name = kwargs.get('test_subnet_name', None) - self.test_static_ip_address = kwargs.get('test_static_ip_address', None) - - -class InMageRcmPolicyCreationInput(PolicyProviderSpecificInput): - """InMageRcm policy creation input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_history_in_minutes: The duration in minutes until which the recovery - points need to be stored. - :type recovery_point_history_in_minutes: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in - minutes). - :type crash_consistent_frequency_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). - :type app_consistent_frequency_in_minutes: int - :param enable_multi_vm_sync: A value indicating whether multi-VM sync has to be enabled. - :type enable_multi_vm_sync: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_history_in_minutes': {'key': 'recoveryPointHistoryInMinutes', 'type': 'int'}, - 'crash_consistent_frequency_in_minutes': {'key': 'crashConsistentFrequencyInMinutes', 'type': 'int'}, - 'app_consistent_frequency_in_minutes': {'key': 'appConsistentFrequencyInMinutes', 'type': 'int'}, - 'enable_multi_vm_sync': {'key': 'enableMultiVmSync', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmPolicyCreationInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.recovery_point_history_in_minutes = kwargs.get('recovery_point_history_in_minutes', None) - self.crash_consistent_frequency_in_minutes = kwargs.get('crash_consistent_frequency_in_minutes', None) - self.app_consistent_frequency_in_minutes = kwargs.get('app_consistent_frequency_in_minutes', None) - self.enable_multi_vm_sync = kwargs.get('enable_multi_vm_sync', None) - - -class InMageRcmPolicyDetails(PolicyProviderSpecificDetails): - """InMageRcm specific policy details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param recovery_point_history_in_minutes: The duration in minutes until which the recovery - points need to be stored. - :type recovery_point_history_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. - :type app_consistent_frequency_in_minutes: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in - minutes. - :type crash_consistent_frequency_in_minutes: int - :param enable_multi_vm_sync: A value indicating whether multi-VM sync has to be enabled. - :type enable_multi_vm_sync: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_history_in_minutes': {'key': 'recoveryPointHistoryInMinutes', 'type': 'int'}, - 'app_consistent_frequency_in_minutes': {'key': 'appConsistentFrequencyInMinutes', 'type': 'int'}, - 'crash_consistent_frequency_in_minutes': {'key': 'crashConsistentFrequencyInMinutes', 'type': 'int'}, - 'enable_multi_vm_sync': {'key': 'enableMultiVmSync', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmPolicyDetails, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.recovery_point_history_in_minutes = kwargs.get('recovery_point_history_in_minutes', None) - self.app_consistent_frequency_in_minutes = kwargs.get('app_consistent_frequency_in_minutes', None) - self.crash_consistent_frequency_in_minutes = kwargs.get('crash_consistent_frequency_in_minutes', None) - self.enable_multi_vm_sync = kwargs.get('enable_multi_vm_sync', None) - - -class InMageRcmProtectedDiskDetails(msrest.serialization.Model): - """InMageRcm protected disk details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar disk_id: The disk Id. - :vartype disk_id: str - :ivar disk_name: The disk name. - :vartype disk_name: str - :ivar is_os_disk: A value indicating whether the disk is the OS disk. - :vartype is_os_disk: str - :ivar capacity_in_bytes: The disk capacity in bytes. - :vartype capacity_in_bytes: long - :ivar log_storage_account_id: The log storage account ARM Id. - :vartype log_storage_account_id: str - :ivar disk_encryption_set_id: The DiskEncryptionSet ARM Id. - :vartype disk_encryption_set_id: str - :ivar seed_managed_disk_id: The ARM Id of the seed managed disk. - :vartype seed_managed_disk_id: str - :ivar target_managed_disk_id: The ARM Id of the target managed disk. - :vartype target_managed_disk_id: str - :param disk_type: The disk type. Possible values include: "Standard_LRS", "Premium_LRS", - "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :ivar data_pending_in_log_data_store_in_mb: The data pending in log data store in MB. - :vartype data_pending_in_log_data_store_in_mb: float - :ivar data_pending_at_source_agent_in_mb: The data pending at source agent in MB. - :vartype data_pending_at_source_agent_in_mb: float - :ivar is_initial_replication_complete: A value indicating whether initial replication is - complete or not. - :vartype is_initial_replication_complete: str - :param ir_details: The initial replication details. - :type ir_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmSyncDetails - :param resync_details: The resync details. - :type resync_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmSyncDetails - """ - - _validation = { - 'disk_id': {'readonly': True}, - 'disk_name': {'readonly': True}, - 'is_os_disk': {'readonly': True}, - 'capacity_in_bytes': {'readonly': True}, - 'log_storage_account_id': {'readonly': True}, - 'disk_encryption_set_id': {'readonly': True}, - 'seed_managed_disk_id': {'readonly': True}, - 'target_managed_disk_id': {'readonly': True}, - 'data_pending_in_log_data_store_in_mb': {'readonly': True}, - 'data_pending_at_source_agent_in_mb': {'readonly': True}, - 'is_initial_replication_complete': {'readonly': True}, - } - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'disk_name': {'key': 'diskName', 'type': 'str'}, - 'is_os_disk': {'key': 'isOSDisk', 'type': 'str'}, - 'capacity_in_bytes': {'key': 'capacityInBytes', 'type': 'long'}, - 'log_storage_account_id': {'key': 'logStorageAccountId', 'type': 'str'}, - 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, - 'seed_managed_disk_id': {'key': 'seedManagedDiskId', 'type': 'str'}, - 'target_managed_disk_id': {'key': 'targetManagedDiskId', 'type': 'str'}, - 'disk_type': {'key': 'diskType', 'type': 'str'}, - 'data_pending_in_log_data_store_in_mb': {'key': 'dataPendingInLogDataStoreInMB', 'type': 'float'}, - 'data_pending_at_source_agent_in_mb': {'key': 'dataPendingAtSourceAgentInMB', 'type': 'float'}, - 'is_initial_replication_complete': {'key': 'isInitialReplicationComplete', 'type': 'str'}, - 'ir_details': {'key': 'irDetails', 'type': 'InMageRcmSyncDetails'}, - 'resync_details': {'key': 'resyncDetails', 'type': 'InMageRcmSyncDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmProtectedDiskDetails, self).__init__(**kwargs) - self.disk_id = None - self.disk_name = None - self.is_os_disk = None - self.capacity_in_bytes = None - self.log_storage_account_id = None - self.disk_encryption_set_id = None - self.seed_managed_disk_id = None - self.target_managed_disk_id = None - self.disk_type = kwargs.get('disk_type', None) - self.data_pending_in_log_data_store_in_mb = None - self.data_pending_at_source_agent_in_mb = None - self.is_initial_replication_complete = None - self.ir_details = kwargs.get('ir_details', None) - self.resync_details = kwargs.get('resync_details', None) - - -class InMageRcmProtectionContainerMappingDetails(ProtectionContainerMappingProviderSpecificDetails): - """InMageRcm provider specific container mapping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :ivar enable_agent_auto_upgrade: A value indicating whether the flag for enable agent auto - upgrade. - :vartype enable_agent_auto_upgrade: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'enable_agent_auto_upgrade': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'enable_agent_auto_upgrade': {'key': 'enableAgentAutoUpgrade', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmProtectionContainerMappingDetails, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.enable_agent_auto_upgrade = None - - -class InMageRcmRecoveryPointDetails(ProviderSpecificRecoveryPointDetails): - """InMageRcm provider specific recovery point details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the provider type.Constant filled by server. - :type instance_type: str - :ivar is_multi_vm_sync_point: A value indicating whether the recovery point is multi VM - consistent. - :vartype is_multi_vm_sync_point: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'is_multi_vm_sync_point': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'is_multi_vm_sync_point': {'key': 'isMultiVmSyncPoint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmRecoveryPointDetails, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.is_multi_vm_sync_point = None - - -class InMageRcmReplicationDetails(ReplicationProviderSpecificSettings): - """InMageRcm provider specific details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :ivar internal_identifier: The virtual machine internal identifier. - :vartype internal_identifier: str - :ivar fabric_discovery_machine_id: The ARM Id of the discovered VM. - :vartype fabric_discovery_machine_id: str - :ivar multi_vm_group_name: The multi VM group name. - :vartype multi_vm_group_name: str - :ivar discovery_type: The type of the discovered VM. - :vartype discovery_type: str - :ivar process_server_id: The process server Id. - :vartype process_server_id: str - :ivar processor_core_count: The processor core count. - :vartype processor_core_count: int - :ivar allocated_memory_in_mb: The allocated memory in MB. - :vartype allocated_memory_in_mb: float - :ivar process_server_name: The process server name. - :vartype process_server_name: str - :ivar run_as_account_id: The run-as account Id. - :vartype run_as_account_id: str - :ivar os_type: The type of the OS on the VM. - :vartype os_type: str - :ivar firmware_type: The firmware type. - :vartype firmware_type: str - :ivar primary_nic_ip_address: The IP address of the primary network interface. - :vartype primary_nic_ip_address: str - :ivar target_generation: The target generation. - :vartype target_generation: str - :param license_type: License Type of the VM to be used. - :type license_type: str - :param target_vm_name: Target VM name. - :type target_vm_name: str - :param target_vm_size: The target VM size. - :type target_vm_size: str - :param target_resource_group_id: The target resource group Id. - :type target_resource_group_id: str - :param target_location: The target location. - :type target_location: str - :param target_availability_set_id: The target availability set Id. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account - ARM Id. - :type target_boot_diagnostics_storage_account_id: str - :param target_network_id: The target network Id. - :type target_network_id: str - :param test_network_id: The test network Id. - :type test_network_id: str - :ivar failover_recovery_point_id: The recovery point Id to which the VM was failed over. - :vartype failover_recovery_point_id: str - :ivar last_recovery_point_received: The last recovery point received time. - :vartype last_recovery_point_received: ~datetime.datetime - :ivar last_rpo_in_seconds: The last recovery point objective value. - :vartype last_rpo_in_seconds: long - :ivar last_rpo_calculated_time: The last recovery point objective calculated time. - :vartype last_rpo_calculated_time: ~datetime.datetime - :ivar last_recovery_point_id: The last recovery point Id. - :vartype last_recovery_point_id: str - :ivar initial_replication_progress_percentage: The initial replication progress percentage. - This is calculated based on total bytes processed for all disks in the source VM. - :vartype initial_replication_progress_percentage: int - :ivar initial_replication_processed_bytes: The initial replication processed bytes. This - includes sum of total bytes transferred and matched bytes on all selected disks in source VM. - :vartype initial_replication_processed_bytes: long - :ivar initial_replication_transferred_bytes: The initial replication transferred bytes from - source VM to azure for all selected disks on source VM. - :vartype initial_replication_transferred_bytes: long - :ivar initial_replication_progress_health: The initial replication progress health. Possible - values include: "None", "InProgress", "SlowProgress", "NoProgress". - :vartype initial_replication_progress_health: str or - ~azure.mgmt.recoveryservicessiterecovery.models.VmReplicationProgressHealth - :ivar resync_progress_percentage: The resync progress percentage. This is calculated based on - total bytes processed for all disks in the source VM. - :vartype resync_progress_percentage: int - :ivar resync_processed_bytes: The resync processed bytes. This includes sum of total bytes - transferred and matched bytes on all selected disks in source VM. - :vartype resync_processed_bytes: long - :ivar resync_transferred_bytes: The resync transferred bytes from source VM to azure for all - selected disks on source VM. - :vartype resync_transferred_bytes: long - :ivar resync_progress_health: The resync progress health. Possible values include: "None", - "InProgress", "SlowProgress", "NoProgress". - :vartype resync_progress_health: str or - ~azure.mgmt.recoveryservicessiterecovery.models.VmReplicationProgressHealth - :ivar resync_required: A value indicating whether resync is required. - :vartype resync_required: str - :ivar resync_state: The resync state. Possible values include: "None", - "PreparedForResynchronization", "StartedResynchronization". - :vartype resync_state: str or ~azure.mgmt.recoveryservicessiterecovery.models.ResyncState - :ivar agent_upgrade_state: The agent auto upgrade state. Possible values include: "None", - "Started", "Completed", "Commit". - :vartype agent_upgrade_state: str or - ~azure.mgmt.recoveryservicessiterecovery.models.MobilityAgentUpgradeState - :ivar last_agent_upgrade_type: The last agent upgrade type. - :vartype last_agent_upgrade_type: str - :ivar agent_upgrade_job_id: The agent upgrade job Id. - :vartype agent_upgrade_job_id: str - :ivar agent_upgrade_attempt_to_version: The agent version to which last agent upgrade was - attempted. - :vartype agent_upgrade_attempt_to_version: str - :param protected_disks: The list of protected disks. - :type protected_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmProtectedDiskDetails] - :ivar is_last_upgrade_successful: A value indicating whether last agent upgrade was successful - or not. - :vartype is_last_upgrade_successful: str - :ivar is_agent_registration_successful_after_failover: A value indicating whether agent - registration was successful after failover. - :vartype is_agent_registration_successful_after_failover: bool - :param mobility_agent_details: The mobility agent information. - :type mobility_agent_details: - ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmMobilityAgentDetails - :param last_agent_upgrade_error_details: The last agent upgrade error information. - :type last_agent_upgrade_error_details: - list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmLastAgentUpgradeErrorDetails] - :param agent_upgrade_blocking_error_details: The agent upgrade blocking error information. - :type agent_upgrade_blocking_error_details: - list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmAgentUpgradeBlockingErrorDetails] - :param vm_nics: The network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmNicDetails] - :param discovered_vm_details: The discovered VM details. - :type discovered_vm_details: - ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmDiscoveredProtectedVmDetails - """ - - _validation = { - 'instance_type': {'required': True}, - 'internal_identifier': {'readonly': True}, - 'fabric_discovery_machine_id': {'readonly': True}, - 'multi_vm_group_name': {'readonly': True}, - 'discovery_type': {'readonly': True}, - 'process_server_id': {'readonly': True}, - 'processor_core_count': {'readonly': True}, - 'allocated_memory_in_mb': {'readonly': True}, - 'process_server_name': {'readonly': True}, - 'run_as_account_id': {'readonly': True}, - 'os_type': {'readonly': True}, - 'firmware_type': {'readonly': True}, - 'primary_nic_ip_address': {'readonly': True}, - 'target_generation': {'readonly': True}, - 'failover_recovery_point_id': {'readonly': True}, - 'last_recovery_point_received': {'readonly': True}, - 'last_rpo_in_seconds': {'readonly': True}, - 'last_rpo_calculated_time': {'readonly': True}, - 'last_recovery_point_id': {'readonly': True}, - 'initial_replication_progress_percentage': {'readonly': True}, - 'initial_replication_processed_bytes': {'readonly': True}, - 'initial_replication_transferred_bytes': {'readonly': True}, - 'initial_replication_progress_health': {'readonly': True}, - 'resync_progress_percentage': {'readonly': True}, - 'resync_processed_bytes': {'readonly': True}, - 'resync_transferred_bytes': {'readonly': True}, - 'resync_progress_health': {'readonly': True}, - 'resync_required': {'readonly': True}, - 'resync_state': {'readonly': True}, - 'agent_upgrade_state': {'readonly': True}, - 'last_agent_upgrade_type': {'readonly': True}, - 'agent_upgrade_job_id': {'readonly': True}, - 'agent_upgrade_attempt_to_version': {'readonly': True}, - 'is_last_upgrade_successful': {'readonly': True}, - 'is_agent_registration_successful_after_failover': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'internal_identifier': {'key': 'internalIdentifier', 'type': 'str'}, - 'fabric_discovery_machine_id': {'key': 'fabricDiscoveryMachineId', 'type': 'str'}, - 'multi_vm_group_name': {'key': 'multiVmGroupName', 'type': 'str'}, - 'discovery_type': {'key': 'discoveryType', 'type': 'str'}, - 'process_server_id': {'key': 'processServerId', 'type': 'str'}, - 'processor_core_count': {'key': 'processorCoreCount', 'type': 'int'}, - 'allocated_memory_in_mb': {'key': 'allocatedMemoryInMB', 'type': 'float'}, - 'process_server_name': {'key': 'processServerName', 'type': 'str'}, - 'run_as_account_id': {'key': 'runAsAccountId', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'firmware_type': {'key': 'firmwareType', 'type': 'str'}, - 'primary_nic_ip_address': {'key': 'primaryNicIpAddress', 'type': 'str'}, - 'target_generation': {'key': 'targetGeneration', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'target_vm_name': {'key': 'targetVmName', 'type': 'str'}, - 'target_vm_size': {'key': 'targetVmSize', 'type': 'str'}, - 'target_resource_group_id': {'key': 'targetResourceGroupId', 'type': 'str'}, - 'target_location': {'key': 'targetLocation', 'type': 'str'}, - 'target_availability_set_id': {'key': 'targetAvailabilitySetId', 'type': 'str'}, - 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, - 'target_proximity_placement_group_id': {'key': 'targetProximityPlacementGroupId', 'type': 'str'}, - 'target_boot_diagnostics_storage_account_id': {'key': 'targetBootDiagnosticsStorageAccountId', 'type': 'str'}, - 'target_network_id': {'key': 'targetNetworkId', 'type': 'str'}, - 'test_network_id': {'key': 'testNetworkId', 'type': 'str'}, - 'failover_recovery_point_id': {'key': 'failoverRecoveryPointId', 'type': 'str'}, - 'last_recovery_point_received': {'key': 'lastRecoveryPointReceived', 'type': 'iso-8601'}, - 'last_rpo_in_seconds': {'key': 'lastRpoInSeconds', 'type': 'long'}, - 'last_rpo_calculated_time': {'key': 'lastRpoCalculatedTime', 'type': 'iso-8601'}, - 'last_recovery_point_id': {'key': 'lastRecoveryPointId', 'type': 'str'}, - 'initial_replication_progress_percentage': {'key': 'initialReplicationProgressPercentage', 'type': 'int'}, - 'initial_replication_processed_bytes': {'key': 'initialReplicationProcessedBytes', 'type': 'long'}, - 'initial_replication_transferred_bytes': {'key': 'initialReplicationTransferredBytes', 'type': 'long'}, - 'initial_replication_progress_health': {'key': 'initialReplicationProgressHealth', 'type': 'str'}, - 'resync_progress_percentage': {'key': 'resyncProgressPercentage', 'type': 'int'}, - 'resync_processed_bytes': {'key': 'resyncProcessedBytes', 'type': 'long'}, - 'resync_transferred_bytes': {'key': 'resyncTransferredBytes', 'type': 'long'}, - 'resync_progress_health': {'key': 'resyncProgressHealth', 'type': 'str'}, - 'resync_required': {'key': 'resyncRequired', 'type': 'str'}, - 'resync_state': {'key': 'resyncState', 'type': 'str'}, - 'agent_upgrade_state': {'key': 'agentUpgradeState', 'type': 'str'}, - 'last_agent_upgrade_type': {'key': 'lastAgentUpgradeType', 'type': 'str'}, - 'agent_upgrade_job_id': {'key': 'agentUpgradeJobId', 'type': 'str'}, - 'agent_upgrade_attempt_to_version': {'key': 'agentUpgradeAttemptToVersion', 'type': 'str'}, - 'protected_disks': {'key': 'protectedDisks', 'type': '[InMageRcmProtectedDiskDetails]'}, - 'is_last_upgrade_successful': {'key': 'isLastUpgradeSuccessful', 'type': 'str'}, - 'is_agent_registration_successful_after_failover': {'key': 'isAgentRegistrationSuccessfulAfterFailover', 'type': 'bool'}, - 'mobility_agent_details': {'key': 'mobilityAgentDetails', 'type': 'InMageRcmMobilityAgentDetails'}, - 'last_agent_upgrade_error_details': {'key': 'lastAgentUpgradeErrorDetails', 'type': '[InMageRcmLastAgentUpgradeErrorDetails]'}, - 'agent_upgrade_blocking_error_details': {'key': 'agentUpgradeBlockingErrorDetails', 'type': '[InMageRcmAgentUpgradeBlockingErrorDetails]'}, - 'vm_nics': {'key': 'vmNics', 'type': '[InMageRcmNicDetails]'}, - 'discovered_vm_details': {'key': 'discoveredVmDetails', 'type': 'InMageRcmDiscoveredProtectedVmDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmReplicationDetails, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.internal_identifier = None - self.fabric_discovery_machine_id = None - self.multi_vm_group_name = None - self.discovery_type = None - self.process_server_id = None - self.processor_core_count = None - self.allocated_memory_in_mb = None - self.process_server_name = None - self.run_as_account_id = None - self.os_type = None - self.firmware_type = None - self.primary_nic_ip_address = None - self.target_generation = None - self.license_type = kwargs.get('license_type', None) - self.target_vm_name = kwargs.get('target_vm_name', None) - self.target_vm_size = kwargs.get('target_vm_size', None) - self.target_resource_group_id = kwargs.get('target_resource_group_id', None) - self.target_location = kwargs.get('target_location', None) - self.target_availability_set_id = kwargs.get('target_availability_set_id', None) - self.target_availability_zone = kwargs.get('target_availability_zone', None) - self.target_proximity_placement_group_id = kwargs.get('target_proximity_placement_group_id', None) - self.target_boot_diagnostics_storage_account_id = kwargs.get('target_boot_diagnostics_storage_account_id', None) - self.target_network_id = kwargs.get('target_network_id', None) - self.test_network_id = kwargs.get('test_network_id', None) - self.failover_recovery_point_id = None - self.last_recovery_point_received = None - self.last_rpo_in_seconds = None - self.last_rpo_calculated_time = None - self.last_recovery_point_id = None - self.initial_replication_progress_percentage = None - self.initial_replication_processed_bytes = None - self.initial_replication_transferred_bytes = None - self.initial_replication_progress_health = None - self.resync_progress_percentage = None - self.resync_processed_bytes = None - self.resync_transferred_bytes = None - self.resync_progress_health = None - self.resync_required = None - self.resync_state = None - self.agent_upgrade_state = None - self.last_agent_upgrade_type = None - self.agent_upgrade_job_id = None - self.agent_upgrade_attempt_to_version = None - self.protected_disks = kwargs.get('protected_disks', None) - self.is_last_upgrade_successful = None - self.is_agent_registration_successful_after_failover = None - self.mobility_agent_details = kwargs.get('mobility_agent_details', None) - self.last_agent_upgrade_error_details = kwargs.get('last_agent_upgrade_error_details', None) - self.agent_upgrade_blocking_error_details = kwargs.get('agent_upgrade_blocking_error_details', None) - self.vm_nics = kwargs.get('vm_nics', None) - self.discovered_vm_details = kwargs.get('discovered_vm_details', None) - - -class InMageRcmReprotectInput(ReverseReplicationProviderSpecificInput): - """InMageRcm specific provider input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param reprotect_agent_id: Required. The reprotect agent Id. - :type reprotect_agent_id: str - :param datastore_name: Required. The target datastore name. - :type datastore_name: str - :param log_storage_account_id: Required. The log storage account ARM Id. - :type log_storage_account_id: str - :param policy_id: The Policy Id. - :type policy_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'reprotect_agent_id': {'required': True}, - 'datastore_name': {'required': True}, - 'log_storage_account_id': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'reprotect_agent_id': {'key': 'reprotectAgentId', 'type': 'str'}, - 'datastore_name': {'key': 'datastoreName', 'type': 'str'}, - 'log_storage_account_id': {'key': 'logStorageAccountId', 'type': 'str'}, - 'policy_id': {'key': 'policyId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmReprotectInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.reprotect_agent_id = kwargs['reprotect_agent_id'] - self.datastore_name = kwargs['datastore_name'] - self.log_storage_account_id = kwargs['log_storage_account_id'] - self.policy_id = kwargs.get('policy_id', None) - - -class InMageRcmSyncDetails(msrest.serialization.Model): - """InMageRcm disk level sync details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar progress_health: The progress health. Possible values include: "None", "InProgress", - "SlowProgress", "NoProgress", "Queued". - :vartype progress_health: str or - ~azure.mgmt.recoveryservicessiterecovery.models.DiskReplicationProgressHealth - :ivar transferred_bytes: The transferred bytes from source VM to azure for the disk. - :vartype transferred_bytes: long - :ivar last15_minutes_transferred_bytes: The bytes transferred in last 15 minutes from source VM - to azure. - :vartype last15_minutes_transferred_bytes: long - :ivar last_data_transfer_time_utc: The time of the last data transfer from source VM to azure. - :vartype last_data_transfer_time_utc: str - :ivar processed_bytes: The total processed bytes. This includes bytes that are transferred from - source VM to azure and matched bytes. - :vartype processed_bytes: long - :ivar start_time: The start time. - :vartype start_time: str - :ivar last_refresh_time: The last refresh time. - :vartype last_refresh_time: str - :ivar progress_percentage: Progress in percentage. Progress percentage is calculated based on - processed bytes. - :vartype progress_percentage: int - """ - - _validation = { - 'progress_health': {'readonly': True}, - 'transferred_bytes': {'readonly': True}, - 'last15_minutes_transferred_bytes': {'readonly': True}, - 'last_data_transfer_time_utc': {'readonly': True}, - 'processed_bytes': {'readonly': True}, - 'start_time': {'readonly': True}, - 'last_refresh_time': {'readonly': True}, - 'progress_percentage': {'readonly': True}, - } - - _attribute_map = { - 'progress_health': {'key': 'progressHealth', 'type': 'str'}, - 'transferred_bytes': {'key': 'transferredBytes', 'type': 'long'}, - 'last15_minutes_transferred_bytes': {'key': 'last15MinutesTransferredBytes', 'type': 'long'}, - 'last_data_transfer_time_utc': {'key': 'lastDataTransferTimeUtc', 'type': 'str'}, - 'processed_bytes': {'key': 'processedBytes', 'type': 'long'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'last_refresh_time': {'key': 'lastRefreshTime', 'type': 'str'}, - 'progress_percentage': {'key': 'progressPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmSyncDetails, self).__init__(**kwargs) - self.progress_health = None - self.transferred_bytes = None - self.last15_minutes_transferred_bytes = None - self.last_data_transfer_time_utc = None - self.processed_bytes = None - self.start_time = None - self.last_refresh_time = None - self.progress_percentage = None - - -class InMageRcmTestFailoverInput(TestFailoverProviderSpecificInput): - """InMageRcm provider specific input for test failover. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param network_id: The test network Id. - :type network_id: str - :param recovery_point_id: The recovery point id to be passed to test failover to a particular - recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmTestFailoverInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.network_id = kwargs.get('network_id', None) - self.recovery_point_id = kwargs.get('recovery_point_id', None) - - -class InMageRcmUnplannedFailoverInput(UnplannedFailoverProviderSpecificInput): - """InMageRcm provider specific input for unplanned failover. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param perform_shutdown: Required. A value indicating whether VM is to be shutdown. - :type perform_shutdown: str - :param recovery_point_id: The recovery point id to be passed to failover to a particular - recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'perform_shutdown': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'perform_shutdown': {'key': 'performShutdown', 'type': 'str'}, - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmUnplannedFailoverInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.perform_shutdown = kwargs['perform_shutdown'] - self.recovery_point_id = kwargs.get('recovery_point_id', None) - - -class UpdateApplianceForReplicationProtectedItemProviderSpecificInput(msrest.serialization.Model): - """Update replication protected item provider specific input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: InMageRcmUpdateApplianceForReplicationProtectedItemInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'InMageRcm': 'InMageRcmUpdateApplianceForReplicationProtectedItemInput'} - } - - def __init__( - self, - **kwargs - ): - super(UpdateApplianceForReplicationProtectedItemProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class InMageRcmUpdateApplianceForReplicationProtectedItemInput(UpdateApplianceForReplicationProtectedItemProviderSpecificInput): - """InMageRcm provider specific input to update appliance for replication protected item. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param run_as_account_id: The run as account Id. - :type run_as_account_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'run_as_account_id': {'key': 'runAsAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmUpdateApplianceForReplicationProtectedItemInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.run_as_account_id = kwargs.get('run_as_account_id', None) - - -class InMageRcmUpdateContainerMappingInput(ReplicationProviderSpecificUpdateContainerMappingInput): - """InMageRcm update protection container mapping. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param enable_agent_auto_upgrade: Required. A value indicating whether agent auto upgrade has - to be enabled. - :type enable_agent_auto_upgrade: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'enable_agent_auto_upgrade': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'enable_agent_auto_upgrade': {'key': 'enableAgentAutoUpgrade', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmUpdateContainerMappingInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.enable_agent_auto_upgrade = kwargs['enable_agent_auto_upgrade'] - - -class InMageRcmUpdateReplicationProtectedItemInput(UpdateReplicationProtectedItemProviderInput): - """InMageRcm provider specific input to update replication protected item. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param target_vm_name: The target VM name. - :type target_vm_name: str - :param target_vm_size: The target VM size. - :type target_vm_size: str - :param target_resource_group_id: The target resource group ARM Id. - :type target_resource_group_id: str - :param target_availability_set_id: The target availability set ARM Id. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account - ARM Id. - :type target_boot_diagnostics_storage_account_id: str - :param target_network_id: The target network ARM Id. - :type target_network_id: str - :param test_network_id: The test network ARM Id. - :type test_network_id: str - :param vm_nics: The list of NIC details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmNicInput] - :param license_type: The license type. Possible values include: "NotSpecified", - "NoLicenseType", "WindowsServer". - :type license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'target_vm_name': {'key': 'targetVmName', 'type': 'str'}, - 'target_vm_size': {'key': 'targetVmSize', 'type': 'str'}, - 'target_resource_group_id': {'key': 'targetResourceGroupId', 'type': 'str'}, - 'target_availability_set_id': {'key': 'targetAvailabilitySetId', 'type': 'str'}, - 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, - 'target_proximity_placement_group_id': {'key': 'targetProximityPlacementGroupId', 'type': 'str'}, - 'target_boot_diagnostics_storage_account_id': {'key': 'targetBootDiagnosticsStorageAccountId', 'type': 'str'}, - 'target_network_id': {'key': 'targetNetworkId', 'type': 'str'}, - 'test_network_id': {'key': 'testNetworkId', 'type': 'str'}, - 'vm_nics': {'key': 'vmNics', 'type': '[InMageRcmNicInput]'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageRcmUpdateReplicationProtectedItemInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.target_vm_name = kwargs.get('target_vm_name', None) - self.target_vm_size = kwargs.get('target_vm_size', None) - self.target_resource_group_id = kwargs.get('target_resource_group_id', None) - self.target_availability_set_id = kwargs.get('target_availability_set_id', None) - self.target_availability_zone = kwargs.get('target_availability_zone', None) - self.target_proximity_placement_group_id = kwargs.get('target_proximity_placement_group_id', None) - self.target_boot_diagnostics_storage_account_id = kwargs.get('target_boot_diagnostics_storage_account_id', None) - self.target_network_id = kwargs.get('target_network_id', None) - self.test_network_id = kwargs.get('test_network_id', None) - self.vm_nics = kwargs.get('vm_nics', None) - self.license_type = kwargs.get('license_type', None) - - -class InMageReplicationDetails(ReplicationProviderSpecificSettings): - """InMage provider specific settings. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param active_site_type: The active location of the VM. If the VM is being protected from - Azure, this field will take values from { Azure, OnPrem }. If the VM is being protected between - two data-centers, this field will be OnPrem always. - :type active_site_type: str - :param source_vm_cpu_count: The CPU count of the VM on the primary side. - :type source_vm_cpu_count: int - :param source_vm_ram_size_in_mb: The RAM size of the VM on the primary side. - :type source_vm_ram_size_in_mb: int - :param os_details: The OS details. - :type os_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDiskDetails - :param protection_stage: The protection stage. - :type protection_stage: str - :param vm_id: The virtual machine Id. - :type vm_id: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param resync_details: The resync details of the machine. - :type resync_details: ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails - :param retention_window_start: The retention window start time. - :type retention_window_start: ~datetime.datetime - :param retention_window_end: The retention window end time. - :type retention_window_end: ~datetime.datetime - :param compressed_data_rate_in_mb: The compressed data change rate in MB. - :type compressed_data_rate_in_mb: float - :param uncompressed_data_rate_in_mb: The uncompressed data change rate in MB. - :type uncompressed_data_rate_in_mb: float - :param rpo_in_seconds: The RPO in seconds. - :type rpo_in_seconds: long - :param protected_disks: The list of protected disks. - :type protected_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.InMageProtectedDiskDetails] - :param ip_address: The source IP address. - :type ip_address: str - :param last_heartbeat: The last heartbeat received from the source server. - :type last_heartbeat: ~datetime.datetime - :param process_server_id: The process server Id. - :type process_server_id: str - :param master_target_id: The master target Id. - :type master_target_id: str - :param consistency_points: The collection of Consistency points. - :type consistency_points: dict[str, ~datetime.datetime] - :param disk_resized: A value indicating whether any disk is resized for this VM. - :type disk_resized: str - :param reboot_after_update_status: A value indicating whether the source server requires a - restart after update. - :type reboot_after_update_status: str - :param multi_vm_group_id: The multi vm group Id, if any. - :type multi_vm_group_id: str - :param multi_vm_group_name: The multi vm group name, if any. - :type multi_vm_group_name: str - :param multi_vm_sync_status: A value indicating whether the multi vm sync is enabled or - disabled. - :type multi_vm_sync_status: str - :param agent_details: The agent details. - :type agent_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageAgentDetails - :param v_center_infrastructure_id: The vCenter infrastructure Id. - :type v_center_infrastructure_id: str - :param infrastructure_vm_id: The infrastructure VM Id. - :type infrastructure_vm_id: str - :param vm_nics: The PE Network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] - :param discovery_type: A value indicating the discovery type of the machine. - :type discovery_type: str - :param azure_storage_account_id: A value indicating the underlying Azure storage account. If - the VM is not running in Azure, this value shall be set to null. - :type azure_storage_account_id: str - :param datastores: The datastores of the on-premise machine Value can be list of strings that - contain datastore names. - :type datastores: list[str] - :param validation_errors: The validation errors of the on-premise machine Value can be list of - validation errors. - :type validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param last_rpo_calculated_time: The last RPO calculated time. - :type last_rpo_calculated_time: ~datetime.datetime - :param last_update_received_time: The last update time received from on-prem components. - :type last_update_received_time: ~datetime.datetime - :param replica_id: The replica id of the protected item. - :type replica_id: str - :param os_version: The OS Version of the protected item. - :type os_version: str - :param is_additional_stats_available: A value indicating whether additional IR stats are - available or not. - :type is_additional_stats_available: bool - :param total_data_transferred: The total transferred data in bytes. - :type total_data_transferred: long - :param total_progress_health: The progress health. - :type total_progress_health: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'active_site_type': {'key': 'activeSiteType', 'type': 'str'}, - 'source_vm_cpu_count': {'key': 'sourceVmCpuCount', 'type': 'int'}, - 'source_vm_ram_size_in_mb': {'key': 'sourceVmRamSizeInMB', 'type': 'int'}, - 'os_details': {'key': 'osDetails', 'type': 'OSDiskDetails'}, - 'protection_stage': {'key': 'protectionStage', 'type': 'str'}, - 'vm_id': {'key': 'vmId', 'type': 'str'}, - 'vm_protection_state': {'key': 'vmProtectionState', 'type': 'str'}, - 'vm_protection_state_description': {'key': 'vmProtectionStateDescription', 'type': 'str'}, - 'resync_details': {'key': 'resyncDetails', 'type': 'InitialReplicationDetails'}, - 'retention_window_start': {'key': 'retentionWindowStart', 'type': 'iso-8601'}, - 'retention_window_end': {'key': 'retentionWindowEnd', 'type': 'iso-8601'}, - 'compressed_data_rate_in_mb': {'key': 'compressedDataRateInMB', 'type': 'float'}, - 'uncompressed_data_rate_in_mb': {'key': 'uncompressedDataRateInMB', 'type': 'float'}, - 'rpo_in_seconds': {'key': 'rpoInSeconds', 'type': 'long'}, - 'protected_disks': {'key': 'protectedDisks', 'type': '[InMageProtectedDiskDetails]'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'last_heartbeat': {'key': 'lastHeartbeat', 'type': 'iso-8601'}, - 'process_server_id': {'key': 'processServerId', 'type': 'str'}, - 'master_target_id': {'key': 'masterTargetId', 'type': 'str'}, - 'consistency_points': {'key': 'consistencyPoints', 'type': '{iso-8601}'}, - 'disk_resized': {'key': 'diskResized', 'type': 'str'}, - 'reboot_after_update_status': {'key': 'rebootAfterUpdateStatus', 'type': 'str'}, - 'multi_vm_group_id': {'key': 'multiVmGroupId', 'type': 'str'}, - 'multi_vm_group_name': {'key': 'multiVmGroupName', 'type': 'str'}, - 'multi_vm_sync_status': {'key': 'multiVmSyncStatus', 'type': 'str'}, - 'agent_details': {'key': 'agentDetails', 'type': 'InMageAgentDetails'}, - 'v_center_infrastructure_id': {'key': 'vCenterInfrastructureId', 'type': 'str'}, - 'infrastructure_vm_id': {'key': 'infrastructureVmId', 'type': 'str'}, - 'vm_nics': {'key': 'vmNics', 'type': '[VMNicDetails]'}, - 'discovery_type': {'key': 'discoveryType', 'type': 'str'}, - 'azure_storage_account_id': {'key': 'azureStorageAccountId', 'type': 'str'}, - 'datastores': {'key': 'datastores', 'type': '[str]'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[HealthError]'}, - 'last_rpo_calculated_time': {'key': 'lastRpoCalculatedTime', 'type': 'iso-8601'}, - 'last_update_received_time': {'key': 'lastUpdateReceivedTime', 'type': 'iso-8601'}, - 'replica_id': {'key': 'replicaId', 'type': 'str'}, - 'os_version': {'key': 'osVersion', 'type': 'str'}, - 'is_additional_stats_available': {'key': 'isAdditionalStatsAvailable', 'type': 'bool'}, - 'total_data_transferred': {'key': 'totalDataTransferred', 'type': 'long'}, - 'total_progress_health': {'key': 'totalProgressHealth', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageReplicationDetails, self).__init__(**kwargs) - self.instance_type = 'InMage' # type: str - self.active_site_type = kwargs.get('active_site_type', None) - self.source_vm_cpu_count = kwargs.get('source_vm_cpu_count', None) - self.source_vm_ram_size_in_mb = kwargs.get('source_vm_ram_size_in_mb', None) - self.os_details = kwargs.get('os_details', None) - self.protection_stage = kwargs.get('protection_stage', None) - self.vm_id = kwargs.get('vm_id', None) - self.vm_protection_state = kwargs.get('vm_protection_state', None) - self.vm_protection_state_description = kwargs.get('vm_protection_state_description', None) - self.resync_details = kwargs.get('resync_details', None) - self.retention_window_start = kwargs.get('retention_window_start', None) - self.retention_window_end = kwargs.get('retention_window_end', None) - self.compressed_data_rate_in_mb = kwargs.get('compressed_data_rate_in_mb', None) - self.uncompressed_data_rate_in_mb = kwargs.get('uncompressed_data_rate_in_mb', None) - self.rpo_in_seconds = kwargs.get('rpo_in_seconds', None) - self.protected_disks = kwargs.get('protected_disks', None) - self.ip_address = kwargs.get('ip_address', None) - self.last_heartbeat = kwargs.get('last_heartbeat', None) - self.process_server_id = kwargs.get('process_server_id', None) - self.master_target_id = kwargs.get('master_target_id', None) - self.consistency_points = kwargs.get('consistency_points', None) - self.disk_resized = kwargs.get('disk_resized', None) - self.reboot_after_update_status = kwargs.get('reboot_after_update_status', None) - self.multi_vm_group_id = kwargs.get('multi_vm_group_id', None) - self.multi_vm_group_name = kwargs.get('multi_vm_group_name', None) - self.multi_vm_sync_status = kwargs.get('multi_vm_sync_status', None) - self.agent_details = kwargs.get('agent_details', None) - self.v_center_infrastructure_id = kwargs.get('v_center_infrastructure_id', None) - self.infrastructure_vm_id = kwargs.get('infrastructure_vm_id', None) - self.vm_nics = kwargs.get('vm_nics', None) - self.discovery_type = kwargs.get('discovery_type', None) - self.azure_storage_account_id = kwargs.get('azure_storage_account_id', None) - self.datastores = kwargs.get('datastores', None) - self.validation_errors = kwargs.get('validation_errors', None) - self.last_rpo_calculated_time = kwargs.get('last_rpo_calculated_time', None) - self.last_update_received_time = kwargs.get('last_update_received_time', None) - self.replica_id = kwargs.get('replica_id', None) - self.os_version = kwargs.get('os_version', None) - self.is_additional_stats_available = kwargs.get('is_additional_stats_available', None) - self.total_data_transferred = kwargs.get('total_data_transferred', None) - self.total_progress_health = kwargs.get('total_progress_health', None) - - -class InMageReprotectInput(ReverseReplicationProviderSpecificInput): - """InMageAzureV2 specific provider input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param master_target_id: Required. The Master Target Id. - :type master_target_id: str - :param process_server_id: Required. The Process Server Id. - :type process_server_id: str - :param retention_drive: Required. The retention drive to use on the MT. - :type retention_drive: str - :param run_as_account_id: The CS account Id. - :type run_as_account_id: str - :param datastore_name: The target datastore name. - :type datastore_name: str - :param disk_exclusion_input: The enable disk exclusion input. - :type disk_exclusion_input: - ~azure.mgmt.recoveryservicessiterecovery.models.InMageDiskExclusionInput - :param profile_id: Required. The Policy Id. - :type profile_id: str - :param disks_to_include: The disks to include list. - :type disks_to_include: list[str] - """ - - _validation = { - 'instance_type': {'required': True}, - 'master_target_id': {'required': True}, - 'process_server_id': {'required': True}, - 'retention_drive': {'required': True}, - 'profile_id': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'master_target_id': {'key': 'masterTargetId', 'type': 'str'}, - 'process_server_id': {'key': 'processServerId', 'type': 'str'}, - 'retention_drive': {'key': 'retentionDrive', 'type': 'str'}, - 'run_as_account_id': {'key': 'runAsAccountId', 'type': 'str'}, - 'datastore_name': {'key': 'datastoreName', 'type': 'str'}, - 'disk_exclusion_input': {'key': 'diskExclusionInput', 'type': 'InMageDiskExclusionInput'}, - 'profile_id': {'key': 'profileId', 'type': 'str'}, - 'disks_to_include': {'key': 'disksToInclude', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageReprotectInput, self).__init__(**kwargs) - self.instance_type = 'InMage' # type: str - self.master_target_id = kwargs['master_target_id'] - self.process_server_id = kwargs['process_server_id'] - self.retention_drive = kwargs['retention_drive'] - self.run_as_account_id = kwargs.get('run_as_account_id', None) - self.datastore_name = kwargs.get('datastore_name', None) - self.disk_exclusion_input = kwargs.get('disk_exclusion_input', None) - self.profile_id = kwargs['profile_id'] - self.disks_to_include = kwargs.get('disks_to_include', None) - - -class InMageTestFailoverInput(TestFailoverProviderSpecificInput): - """Provider specific input for InMage test failover. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: The recovery point type. Values from LatestTime, LatestTag or - Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In - the other two cases, recovery point id will be ignored. Possible values include: "LatestTime", - "LatestTag", "Custom". - :type recovery_point_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointType - :param recovery_point_id: The recovery point id to be passed to test failover to a particular - recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageTestFailoverInput, self).__init__(**kwargs) - self.instance_type = 'InMage' # type: str - self.recovery_point_type = kwargs.get('recovery_point_type', None) - self.recovery_point_id = kwargs.get('recovery_point_id', None) - - -class InMageUnplannedFailoverInput(UnplannedFailoverProviderSpecificInput): - """Provider specific input for InMage unplanned failover. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: The recovery point type. Values from LatestTime, LatestTag or - Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In - the other two cases, recovery point id will be ignored. Possible values include: "LatestTime", - "LatestTag", "Custom". - :type recovery_point_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointType - :param recovery_point_id: The recovery point id to be passed to failover to a particular - recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageUnplannedFailoverInput, self).__init__(**kwargs) - self.instance_type = 'InMage' # type: str - self.recovery_point_type = kwargs.get('recovery_point_type', None) - self.recovery_point_id = kwargs.get('recovery_point_id', None) - - -class InMageVolumeExclusionOptions(msrest.serialization.Model): - """Guest disk signature based disk exclusion option when doing enable protection of virtual machine in InMage provider. - - :param volume_label: The volume label. The disk having any volume with this label will be - excluded from replication. - :type volume_label: str - :param only_exclude_if_single_volume: The value indicating whether to exclude multi volume disk - or not. If a disk has multiple volumes and one of the volume has label matching with - VolumeLabel this disk will be excluded from replication if OnlyExcludeIfSingleVolume is false. - :type only_exclude_if_single_volume: str - """ - - _attribute_map = { - 'volume_label': {'key': 'volumeLabel', 'type': 'str'}, - 'only_exclude_if_single_volume': {'key': 'onlyExcludeIfSingleVolume', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InMageVolumeExclusionOptions, self).__init__(**kwargs) - self.volume_label = kwargs.get('volume_label', None) - self.only_exclude_if_single_volume = kwargs.get('only_exclude_if_single_volume', None) - - -class InnerHealthError(msrest.serialization.Model): - """Implements InnerHealthError class. HealthError object has a list of InnerHealthErrors as child errors. InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. - - :param error_source: Source of error. - :type error_source: str - :param error_type: Type of error. - :type error_type: str - :param error_level: Level of error. - :type error_level: str - :param error_category: Category of error. - :type error_category: str - :param error_code: Error code. - :type error_code: str - :param summary_message: Summary message of the entity. - :type summary_message: str - :param error_message: Error message. - :type error_message: str - :param possible_causes: Possible causes of error. - :type possible_causes: str - :param recommended_action: Recommended action to resolve error. - :type recommended_action: str - :param creation_time_utc: Error creation time (UTC). - :type creation_time_utc: ~datetime.datetime - :param recovery_provider_error_message: DRA error message. - :type recovery_provider_error_message: str - :param entity_id: ID of the entity. - :type entity_id: str - :param error_id: The health error unique id. - :type error_id: str - :param customer_resolvability: Value indicating whether the health error is customer - resolvable. Possible values include: "Allowed", "NotAllowed". - :type customer_resolvability: str or - ~azure.mgmt.recoveryservicessiterecovery.models.HealthErrorCustomerResolvability - """ - - _attribute_map = { - 'error_source': {'key': 'errorSource', 'type': 'str'}, - 'error_type': {'key': 'errorType', 'type': 'str'}, - 'error_level': {'key': 'errorLevel', 'type': 'str'}, - 'error_category': {'key': 'errorCategory', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'str'}, - 'summary_message': {'key': 'summaryMessage', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'possible_causes': {'key': 'possibleCauses', 'type': 'str'}, - 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, - 'creation_time_utc': {'key': 'creationTimeUtc', 'type': 'iso-8601'}, - 'recovery_provider_error_message': {'key': 'recoveryProviderErrorMessage', 'type': 'str'}, - 'entity_id': {'key': 'entityId', 'type': 'str'}, - 'error_id': {'key': 'errorId', 'type': 'str'}, - 'customer_resolvability': {'key': 'customerResolvability', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InnerHealthError, self).__init__(**kwargs) - self.error_source = kwargs.get('error_source', None) - self.error_type = kwargs.get('error_type', None) - self.error_level = kwargs.get('error_level', None) - self.error_category = kwargs.get('error_category', None) - self.error_code = kwargs.get('error_code', None) - self.summary_message = kwargs.get('summary_message', None) - self.error_message = kwargs.get('error_message', None) - self.possible_causes = kwargs.get('possible_causes', None) - self.recommended_action = kwargs.get('recommended_action', None) - self.creation_time_utc = kwargs.get('creation_time_utc', None) - self.recovery_provider_error_message = kwargs.get('recovery_provider_error_message', None) - self.entity_id = kwargs.get('entity_id', None) - self.error_id = kwargs.get('error_id', None) - self.customer_resolvability = kwargs.get('customer_resolvability', None) - - -class InputEndpoint(msrest.serialization.Model): - """InputEndpoint. - - :param endpoint_name: - :type endpoint_name: str - :param private_port: - :type private_port: int - :param public_port: - :type public_port: int - :param protocol: - :type protocol: str - """ - - _attribute_map = { - 'endpoint_name': {'key': 'endpointName', 'type': 'str'}, - 'private_port': {'key': 'privatePort', 'type': 'int'}, - 'public_port': {'key': 'publicPort', 'type': 'int'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InputEndpoint, self).__init__(**kwargs) - self.endpoint_name = kwargs.get('endpoint_name', None) - self.private_port = kwargs.get('private_port', None) - self.public_port = kwargs.get('public_port', None) - self.protocol = kwargs.get('protocol', None) - - -class IPConfigDetails(msrest.serialization.Model): - """IPConfigDetails. - - :param name: - :type name: str - :param is_primary: - :type is_primary: bool - :param subnet_name: - :type subnet_name: str - :param static_ip_address: - :type static_ip_address: str - :param ip_address_type: - :type ip_address_type: str - :param is_seleted_for_failover: - :type is_seleted_for_failover: bool - :param recovery_subnet_name: - :type recovery_subnet_name: str - :param recovery_static_ip_address: - :type recovery_static_ip_address: str - :param recovery_ip_address_type: - :type recovery_ip_address_type: str - :param recovery_public_ip_address_id: - :type recovery_public_ip_address_id: str - :param recovery_lb_backend_address_pool_ids: - :type recovery_lb_backend_address_pool_ids: list[str] - :param tfo_subnet_name: - :type tfo_subnet_name: str - :param tfo_static_ip_address: - :type tfo_static_ip_address: str - :param tfo_public_ip_address_id: - :type tfo_public_ip_address_id: str - :param tfo_lb_backend_address_pool_ids: - :type tfo_lb_backend_address_pool_ids: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_primary': {'key': 'isPrimary', 'type': 'bool'}, - 'subnet_name': {'key': 'subnetName', 'type': 'str'}, - 'static_ip_address': {'key': 'staticIPAddress', 'type': 'str'}, - 'ip_address_type': {'key': 'ipAddressType', 'type': 'str'}, - 'is_seleted_for_failover': {'key': 'isSeletedForFailover', 'type': 'bool'}, - 'recovery_subnet_name': {'key': 'recoverySubnetName', 'type': 'str'}, - 'recovery_static_ip_address': {'key': 'recoveryStaticIPAddress', 'type': 'str'}, - 'recovery_ip_address_type': {'key': 'recoveryIPAddressType', 'type': 'str'}, - 'recovery_public_ip_address_id': {'key': 'recoveryPublicIPAddressId', 'type': 'str'}, - 'recovery_lb_backend_address_pool_ids': {'key': 'recoveryLBBackendAddressPoolIds', 'type': '[str]'}, - 'tfo_subnet_name': {'key': 'tfoSubnetName', 'type': 'str'}, - 'tfo_static_ip_address': {'key': 'tfoStaticIPAddress', 'type': 'str'}, - 'tfo_public_ip_address_id': {'key': 'tfoPublicIPAddressId', 'type': 'str'}, - 'tfo_lb_backend_address_pool_ids': {'key': 'tfoLBBackendAddressPoolIds', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(IPConfigDetails, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.is_primary = kwargs.get('is_primary', None) - self.subnet_name = kwargs.get('subnet_name', None) - self.static_ip_address = kwargs.get('static_ip_address', None) - self.ip_address_type = kwargs.get('ip_address_type', None) - self.is_seleted_for_failover = kwargs.get('is_seleted_for_failover', None) - self.recovery_subnet_name = kwargs.get('recovery_subnet_name', None) - self.recovery_static_ip_address = kwargs.get('recovery_static_ip_address', None) - self.recovery_ip_address_type = kwargs.get('recovery_ip_address_type', None) - self.recovery_public_ip_address_id = kwargs.get('recovery_public_ip_address_id', None) - self.recovery_lb_backend_address_pool_ids = kwargs.get('recovery_lb_backend_address_pool_ids', None) - self.tfo_subnet_name = kwargs.get('tfo_subnet_name', None) - self.tfo_static_ip_address = kwargs.get('tfo_static_ip_address', None) - self.tfo_public_ip_address_id = kwargs.get('tfo_public_ip_address_id', None) - self.tfo_lb_backend_address_pool_ids = kwargs.get('tfo_lb_backend_address_pool_ids', None) - - -class IPConfigInputDetails(msrest.serialization.Model): - """IPConfigInputDetails. - - :param ip_config_name: - :type ip_config_name: str - :param is_primary: - :type is_primary: bool - :param is_seleted_for_failover: - :type is_seleted_for_failover: bool - :param recovery_subnet_name: - :type recovery_subnet_name: str - :param recovery_static_ip_address: - :type recovery_static_ip_address: str - :param recovery_public_ip_address_id: - :type recovery_public_ip_address_id: str - :param recovery_lb_backend_address_pool_ids: - :type recovery_lb_backend_address_pool_ids: list[str] - :param tfo_subnet_name: - :type tfo_subnet_name: str - :param tfo_static_ip_address: - :type tfo_static_ip_address: str - :param tfo_public_ip_address_id: - :type tfo_public_ip_address_id: str - :param tfo_lb_backend_address_pool_ids: - :type tfo_lb_backend_address_pool_ids: list[str] - """ - - _attribute_map = { - 'ip_config_name': {'key': 'ipConfigName', 'type': 'str'}, - 'is_primary': {'key': 'isPrimary', 'type': 'bool'}, - 'is_seleted_for_failover': {'key': 'isSeletedForFailover', 'type': 'bool'}, - 'recovery_subnet_name': {'key': 'recoverySubnetName', 'type': 'str'}, - 'recovery_static_ip_address': {'key': 'recoveryStaticIPAddress', 'type': 'str'}, - 'recovery_public_ip_address_id': {'key': 'recoveryPublicIPAddressId', 'type': 'str'}, - 'recovery_lb_backend_address_pool_ids': {'key': 'recoveryLBBackendAddressPoolIds', 'type': '[str]'}, - 'tfo_subnet_name': {'key': 'tfoSubnetName', 'type': 'str'}, - 'tfo_static_ip_address': {'key': 'tfoStaticIPAddress', 'type': 'str'}, - 'tfo_public_ip_address_id': {'key': 'tfoPublicIPAddressId', 'type': 'str'}, - 'tfo_lb_backend_address_pool_ids': {'key': 'tfoLBBackendAddressPoolIds', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(IPConfigInputDetails, self).__init__(**kwargs) - self.ip_config_name = kwargs.get('ip_config_name', None) - self.is_primary = kwargs.get('is_primary', None) - self.is_seleted_for_failover = kwargs.get('is_seleted_for_failover', None) - self.recovery_subnet_name = kwargs.get('recovery_subnet_name', None) - self.recovery_static_ip_address = kwargs.get('recovery_static_ip_address', None) - self.recovery_public_ip_address_id = kwargs.get('recovery_public_ip_address_id', None) - self.recovery_lb_backend_address_pool_ids = kwargs.get('recovery_lb_backend_address_pool_ids', None) - self.tfo_subnet_name = kwargs.get('tfo_subnet_name', None) - self.tfo_static_ip_address = kwargs.get('tfo_static_ip_address', None) - self.tfo_public_ip_address_id = kwargs.get('tfo_public_ip_address_id', None) - self.tfo_lb_backend_address_pool_ids = kwargs.get('tfo_lb_backend_address_pool_ids', None) - - -class Job(Resource): - """Job details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.JobProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'JobProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(Job, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class JobCollection(msrest.serialization.Model): - """Collection of jobs. - - :param value: The list of jobs. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.Job] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Job]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class JobEntity(msrest.serialization.Model): - """This class contains the minimal job details required to navigate to the desired drill down. - - :param job_id: The job id. - :type job_id: str - :param job_friendly_name: The job display name. - :type job_friendly_name: str - :param target_object_id: The object id. - :type target_object_id: str - :param target_object_name: The object name. - :type target_object_name: str - :param target_instance_type: The workflow affected object type. - :type target_instance_type: str - :param job_scenario_name: The job name. Enum type ScenarioName. - :type job_scenario_name: str - """ - - _attribute_map = { - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'job_friendly_name': {'key': 'jobFriendlyName', 'type': 'str'}, - 'target_object_id': {'key': 'targetObjectId', 'type': 'str'}, - 'target_object_name': {'key': 'targetObjectName', 'type': 'str'}, - 'target_instance_type': {'key': 'targetInstanceType', 'type': 'str'}, - 'job_scenario_name': {'key': 'jobScenarioName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobEntity, self).__init__(**kwargs) - self.job_id = kwargs.get('job_id', None) - self.job_friendly_name = kwargs.get('job_friendly_name', None) - self.target_object_id = kwargs.get('target_object_id', None) - self.target_object_name = kwargs.get('target_object_name', None) - self.target_instance_type = kwargs.get('target_instance_type', None) - self.job_scenario_name = kwargs.get('job_scenario_name', None) - - -class JobErrorDetails(msrest.serialization.Model): - """This class contains the error details per object. - - :param service_error_details: The Service error details. - :type service_error_details: ~azure.mgmt.recoveryservicessiterecovery.models.ServiceError - :param provider_error_details: The Provider error details. - :type provider_error_details: ~azure.mgmt.recoveryservicessiterecovery.models.ProviderError - :param error_level: Error level of error. - :type error_level: str - :param creation_time: The creation time of job error. - :type creation_time: ~datetime.datetime - :param task_id: The Id of the task. - :type task_id: str - """ - - _attribute_map = { - 'service_error_details': {'key': 'serviceErrorDetails', 'type': 'ServiceError'}, - 'provider_error_details': {'key': 'providerErrorDetails', 'type': 'ProviderError'}, - 'error_level': {'key': 'errorLevel', 'type': 'str'}, - 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, - 'task_id': {'key': 'taskId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobErrorDetails, self).__init__(**kwargs) - self.service_error_details = kwargs.get('service_error_details', None) - self.provider_error_details = kwargs.get('provider_error_details', None) - self.error_level = kwargs.get('error_level', None) - self.creation_time = kwargs.get('creation_time', None) - self.task_id = kwargs.get('task_id', None) - - -class JobProperties(msrest.serialization.Model): - """Job custom data details. - - :param activity_id: The activity id. - :type activity_id: str - :param scenario_name: The ScenarioName. - :type scenario_name: str - :param friendly_name: The DisplayName. - :type friendly_name: str - :param state: The status of the Job. It is one of these values - NotStarted, InProgress, - Succeeded, Failed, Cancelled, Suspended or Other. - :type state: str - :param state_description: The description of the state of the Job. For e.g. - For Succeeded - state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. - :type state_description: str - :param tasks: The tasks. - :type tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] - :param errors: The errors. - :type errors: list[~azure.mgmt.recoveryservicessiterecovery.models.JobErrorDetails] - :param start_time: The start time. - :type start_time: ~datetime.datetime - :param end_time: The end time. - :type end_time: ~datetime.datetime - :param allowed_actions: The Allowed action the job. - :type allowed_actions: list[str] - :param target_object_id: The affected Object Id. - :type target_object_id: str - :param target_object_name: The name of the affected object. - :type target_object_name: str - :param target_instance_type: The type of the affected object which is of - Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class. - :type target_instance_type: str - :param custom_details: The custom job details like test failover job details. - :type custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.JobDetails - """ - - _attribute_map = { - 'activity_id': {'key': 'activityId', 'type': 'str'}, - 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'state_description': {'key': 'stateDescription', 'type': 'str'}, - 'tasks': {'key': 'tasks', 'type': '[ASRTask]'}, - 'errors': {'key': 'errors', 'type': '[JobErrorDetails]'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'allowed_actions': {'key': 'allowedActions', 'type': '[str]'}, - 'target_object_id': {'key': 'targetObjectId', 'type': 'str'}, - 'target_object_name': {'key': 'targetObjectName', 'type': 'str'}, - 'target_instance_type': {'key': 'targetInstanceType', 'type': 'str'}, - 'custom_details': {'key': 'customDetails', 'type': 'JobDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(JobProperties, self).__init__(**kwargs) - self.activity_id = kwargs.get('activity_id', None) - self.scenario_name = kwargs.get('scenario_name', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.state = kwargs.get('state', None) - self.state_description = kwargs.get('state_description', None) - self.tasks = kwargs.get('tasks', None) - self.errors = kwargs.get('errors', None) - self.start_time = kwargs.get('start_time', None) - self.end_time = kwargs.get('end_time', None) - self.allowed_actions = kwargs.get('allowed_actions', None) - self.target_object_id = kwargs.get('target_object_id', None) - self.target_object_name = kwargs.get('target_object_name', None) - self.target_instance_type = kwargs.get('target_instance_type', None) - self.custom_details = kwargs.get('custom_details', None) - - -class JobQueryParameter(msrest.serialization.Model): - """Query parameter to enumerate jobs. - - :param start_time: Date time to get jobs from. - :type start_time: str - :param end_time: Date time to get jobs upto. - :type end_time: str - :param fabric_id: The Id of the fabric to search jobs under. - :type fabric_id: str - :param affected_object_types: The type of objects. - :type affected_object_types: str - :param job_status: The states of the job to be filtered can be in. - :type job_status: str - :param job_output_type: The output type of the jobs. Possible values include: "Json", "Xml", - "Excel". - :type job_output_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.ExportJobOutputSerializationType - :param job_name: The job Name. - :type job_name: str - :param timezone_offset: The timezone offset for the location of the request (in minutes). - :type timezone_offset: float - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'fabric_id': {'key': 'fabricId', 'type': 'str'}, - 'affected_object_types': {'key': 'affectedObjectTypes', 'type': 'str'}, - 'job_status': {'key': 'jobStatus', 'type': 'str'}, - 'job_output_type': {'key': 'jobOutputType', 'type': 'str'}, - 'job_name': {'key': 'jobName', 'type': 'str'}, - 'timezone_offset': {'key': 'timezoneOffset', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(JobQueryParameter, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.end_time = kwargs.get('end_time', None) - self.fabric_id = kwargs.get('fabric_id', None) - self.affected_object_types = kwargs.get('affected_object_types', None) - self.job_status = kwargs.get('job_status', None) - self.job_output_type = kwargs.get('job_output_type', None) - self.job_name = kwargs.get('job_name', None) - self.timezone_offset = kwargs.get('timezone_offset', None) - - -class JobStatusEventDetails(EventSpecificDetails): - """Model class for event details of a job status event. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param job_id: Job arm id for the event. - :type job_id: str - :param job_friendly_name: JobName for the Event. - :type job_friendly_name: str - :param job_status: JobStatus for the Event. - :type job_status: str - :param affected_object_type: AffectedObjectType for the event. - :type affected_object_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'job_friendly_name': {'key': 'jobFriendlyName', 'type': 'str'}, - 'job_status': {'key': 'jobStatus', 'type': 'str'}, - 'affected_object_type': {'key': 'affectedObjectType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobStatusEventDetails, self).__init__(**kwargs) - self.instance_type = 'JobStatus' # type: str - self.job_id = kwargs.get('job_id', None) - self.job_friendly_name = kwargs.get('job_friendly_name', None) - self.job_status = kwargs.get('job_status', None) - self.affected_object_type = kwargs.get('affected_object_type', None) - - -class KeyEncryptionKeyInfo(msrest.serialization.Model): - """Key Encryption Key (KEK) information. - - :param key_identifier: The key URL / identifier. - :type key_identifier: str - :param key_vault_resource_arm_id: The KeyVault resource ARM Id for key. - :type key_vault_resource_arm_id: str - """ - - _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'key_vault_resource_arm_id': {'key': 'keyVaultResourceArmId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(KeyEncryptionKeyInfo, self).__init__(**kwargs) - self.key_identifier = kwargs.get('key_identifier', None) - self.key_vault_resource_arm_id = kwargs.get('key_vault_resource_arm_id', None) - - -class LogicalNetwork(Resource): - """Logical network data model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The Logical Network Properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.LogicalNetworkProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'LogicalNetworkProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(LogicalNetwork, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class LogicalNetworkCollection(msrest.serialization.Model): - """List of logical networks. - - :param value: The Logical Networks list details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.LogicalNetwork] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LogicalNetwork]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LogicalNetworkCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class LogicalNetworkProperties(msrest.serialization.Model): - """Logical Network Properties. - - :param friendly_name: The Friendly Name. - :type friendly_name: str - :param network_virtualization_status: A value indicating whether Network Virtualization is - enabled for the logical network. - :type network_virtualization_status: str - :param logical_network_usage: A value indicating whether logical network is used as private - test network by test failover. - :type logical_network_usage: str - :param logical_network_definitions_status: A value indicating whether logical network - definitions are isolated. - :type logical_network_definitions_status: str - """ - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'network_virtualization_status': {'key': 'networkVirtualizationStatus', 'type': 'str'}, - 'logical_network_usage': {'key': 'logicalNetworkUsage', 'type': 'str'}, - 'logical_network_definitions_status': {'key': 'logicalNetworkDefinitionsStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LogicalNetworkProperties, self).__init__(**kwargs) - self.friendly_name = kwargs.get('friendly_name', None) - self.network_virtualization_status = kwargs.get('network_virtualization_status', None) - self.logical_network_usage = kwargs.get('logical_network_usage', None) - self.logical_network_definitions_status = kwargs.get('logical_network_definitions_status', None) - - -class ManualActionTaskDetails(TaskTypeDetails): - """This class represents the manual action task details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param name: The name. - :type name: str - :param instructions: The instructions. - :type instructions: str - :param observation: The observation. - :type observation: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'instructions': {'key': 'instructions', 'type': 'str'}, - 'observation': {'key': 'observation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ManualActionTaskDetails, self).__init__(**kwargs) - self.instance_type = 'ManualActionTaskDetails' # type: str - self.name = kwargs.get('name', None) - self.instructions = kwargs.get('instructions', None) - self.observation = kwargs.get('observation', None) - - -class MarsAgentDetails(msrest.serialization.Model): - """Mars agent details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The Mars agent Id. - :vartype id: str - :ivar name: The Mars agent name. - :vartype name: str - :ivar bios_id: The Mars agent Bios Id. - :vartype bios_id: str - :ivar fabric_object_id: The fabric object Id. - :vartype fabric_object_id: str - :ivar fqdn: The Mars agent Fqdn. - :vartype fqdn: str - :ivar version: The version. - :vartype version: str - :ivar last_heartbeat_utc: The last heartbeat received from the Mars agent. - :vartype last_heartbeat_utc: ~datetime.datetime - :ivar health: The health of the Mars agent. Possible values include: "None", "Normal", - "Warning", "Critical". - :vartype health: str or ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionHealth - :ivar health_errors: The health errors. - :vartype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'bios_id': {'readonly': True}, - 'fabric_object_id': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'version': {'readonly': True}, - 'last_heartbeat_utc': {'readonly': True}, - 'health': {'readonly': True}, - 'health_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'bios_id': {'key': 'biosId', 'type': 'str'}, - 'fabric_object_id': {'key': 'fabricObjectId', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'last_heartbeat_utc': {'key': 'lastHeartbeatUtc', 'type': 'iso-8601'}, - 'health': {'key': 'health', 'type': 'str'}, - 'health_errors': {'key': 'healthErrors', 'type': '[HealthError]'}, - } - - def __init__( - self, - **kwargs - ): - super(MarsAgentDetails, self).__init__(**kwargs) - self.id = None - self.name = None - self.bios_id = None - self.fabric_object_id = None - self.fqdn = None - self.version = None - self.last_heartbeat_utc = None - self.health = None - self.health_errors = None - - -class MasterTargetServer(msrest.serialization.Model): - """Details of a Master Target Server. - - :param id: The server Id. - :type id: str - :param ip_address: The IP address of the server. - :type ip_address: str - :param name: The server name. - :type name: str - :param os_type: The OS type of the server. - :type os_type: str - :param agent_version: The version of the scout component on the server. - :type agent_version: str - :param last_heartbeat: The last heartbeat received from the server. - :type last_heartbeat: ~datetime.datetime - :param version_status: Version status. - :type version_status: str - :param retention_volumes: The retention volumes of Master target Server. - :type retention_volumes: list[~azure.mgmt.recoveryservicessiterecovery.models.RetentionVolume] - :param data_stores: The list of data stores in the fabric. - :type data_stores: list[~azure.mgmt.recoveryservicessiterecovery.models.DataStore] - :param validation_errors: Validation errors. - :type validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param health_errors: Health errors. - :type health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param disk_count: Disk count of the master target. - :type disk_count: int - :param os_version: OS Version of the master target. - :type os_version: str - :param agent_expiry_date: Agent expiry date. - :type agent_expiry_date: ~datetime.datetime - :param mars_agent_version: MARS agent version. - :type mars_agent_version: str - :param mars_agent_expiry_date: MARS agent expiry date. - :type mars_agent_expiry_date: ~datetime.datetime - :param agent_version_details: Agent version details. - :type agent_version_details: ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails - :param mars_agent_version_details: Mars agent version details. - :type mars_agent_version_details: - ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'agent_version': {'key': 'agentVersion', 'type': 'str'}, - 'last_heartbeat': {'key': 'lastHeartbeat', 'type': 'iso-8601'}, - 'version_status': {'key': 'versionStatus', 'type': 'str'}, - 'retention_volumes': {'key': 'retentionVolumes', 'type': '[RetentionVolume]'}, - 'data_stores': {'key': 'dataStores', 'type': '[DataStore]'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[HealthError]'}, - 'health_errors': {'key': 'healthErrors', 'type': '[HealthError]'}, - 'disk_count': {'key': 'diskCount', 'type': 'int'}, - 'os_version': {'key': 'osVersion', 'type': 'str'}, - 'agent_expiry_date': {'key': 'agentExpiryDate', 'type': 'iso-8601'}, - 'mars_agent_version': {'key': 'marsAgentVersion', 'type': 'str'}, - 'mars_agent_expiry_date': {'key': 'marsAgentExpiryDate', 'type': 'iso-8601'}, - 'agent_version_details': {'key': 'agentVersionDetails', 'type': 'VersionDetails'}, - 'mars_agent_version_details': {'key': 'marsAgentVersionDetails', 'type': 'VersionDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(MasterTargetServer, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.ip_address = kwargs.get('ip_address', None) - self.name = kwargs.get('name', None) - self.os_type = kwargs.get('os_type', None) - self.agent_version = kwargs.get('agent_version', None) - self.last_heartbeat = kwargs.get('last_heartbeat', None) - self.version_status = kwargs.get('version_status', None) - self.retention_volumes = kwargs.get('retention_volumes', None) - self.data_stores = kwargs.get('data_stores', None) - self.validation_errors = kwargs.get('validation_errors', None) - self.health_errors = kwargs.get('health_errors', None) - self.disk_count = kwargs.get('disk_count', None) - self.os_version = kwargs.get('os_version', None) - self.agent_expiry_date = kwargs.get('agent_expiry_date', None) - self.mars_agent_version = kwargs.get('mars_agent_version', None) - self.mars_agent_expiry_date = kwargs.get('mars_agent_expiry_date', None) - self.agent_version_details = kwargs.get('agent_version_details', None) - self.mars_agent_version_details = kwargs.get('mars_agent_version_details', None) - - -class MigrateInput(msrest.serialization.Model): - """Input for migrate. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. Migrate input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.MigrateInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'MigrateInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class MigrateInputProperties(msrest.serialization.Model): - """Migrate input properties. - - All required parameters must be populated in order to send to Azure. - - :param provider_specific_details: Required. The provider specific details. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.MigrateProviderSpecificInput - """ - - _validation = { - 'provider_specific_details': {'required': True}, - } - - _attribute_map = { - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'MigrateProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrateInputProperties, self).__init__(**kwargs) - self.provider_specific_details = kwargs['provider_specific_details'] - - -class MigrateProviderSpecificInput(msrest.serialization.Model): - """Migrate provider specific input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: VMwareCbtMigrateInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'VMwareCbt': 'VMwareCbtMigrateInput'} - } - - def __init__( - self, - **kwargs - ): - super(MigrateProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class MigrationItem(Resource): - """Migration item. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The migration item properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.MigrationItemProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'MigrationItemProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationItem, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class MigrationItemCollection(msrest.serialization.Model): - """Migration item collection. - - :param value: The list of migration items. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MigrationItem]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationItemCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class MigrationItemProperties(msrest.serialization.Model): - """Migration item properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar machine_name: The on-premise virtual machine name. - :vartype machine_name: str - :ivar policy_id: The ARM Id of policy governing this item. - :vartype policy_id: str - :ivar policy_friendly_name: The name of policy governing this item. - :vartype policy_friendly_name: str - :ivar migration_state: The migration status. Possible values include: "None", - "EnableMigrationInProgress", "EnableMigrationFailed", "DisableMigrationInProgress", - "DisableMigrationFailed", "InitialSeedingInProgress", "InitialSeedingFailed", "Replicating", - "MigrationInProgress", "MigrationSucceeded", "MigrationFailed". - :vartype migration_state: str or ~azure.mgmt.recoveryservicessiterecovery.models.MigrationState - :ivar migration_state_description: The migration state description. - :vartype migration_state_description: str - :ivar last_test_migration_time: The last test migration time. - :vartype last_test_migration_time: ~datetime.datetime - :ivar last_test_migration_status: The status of the last test migration. - :vartype last_test_migration_status: str - :ivar test_migrate_state: The test migrate state. Possible values include: "None", - "TestMigrationInProgress", "TestMigrationSucceeded", "TestMigrationFailed", - "TestMigrationCleanupInProgress". - :vartype test_migrate_state: str or - ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrationState - :ivar test_migrate_state_description: The test migrate state description. - :vartype test_migrate_state_description: str - :ivar health: The consolidated health. Possible values include: "None", "Normal", "Warning", - "Critical". - :vartype health: str or ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionHealth - :ivar health_errors: The list of health errors. - :vartype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :ivar allowed_operations: The allowed operations on the migration item based on the current - migration state of the item. - :vartype allowed_operations: list[str or - ~azure.mgmt.recoveryservicessiterecovery.models.MigrationItemOperation] - :ivar current_job: The current job details. - :vartype current_job: ~azure.mgmt.recoveryservicessiterecovery.models.CurrentJobDetails - :ivar event_correlation_id: The correlation Id for events associated with this migration item. - :vartype event_correlation_id: str - :param provider_specific_details: The migration provider custom settings. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.MigrationProviderSpecificSettings - """ - - _validation = { - 'machine_name': {'readonly': True}, - 'policy_id': {'readonly': True}, - 'policy_friendly_name': {'readonly': True}, - 'migration_state': {'readonly': True}, - 'migration_state_description': {'readonly': True}, - 'last_test_migration_time': {'readonly': True}, - 'last_test_migration_status': {'readonly': True}, - 'test_migrate_state': {'readonly': True}, - 'test_migrate_state_description': {'readonly': True}, - 'health': {'readonly': True}, - 'health_errors': {'readonly': True}, - 'allowed_operations': {'readonly': True}, - 'current_job': {'readonly': True}, - 'event_correlation_id': {'readonly': True}, - } - - _attribute_map = { - 'machine_name': {'key': 'machineName', 'type': 'str'}, - 'policy_id': {'key': 'policyId', 'type': 'str'}, - 'policy_friendly_name': {'key': 'policyFriendlyName', 'type': 'str'}, - 'migration_state': {'key': 'migrationState', 'type': 'str'}, - 'migration_state_description': {'key': 'migrationStateDescription', 'type': 'str'}, - 'last_test_migration_time': {'key': 'lastTestMigrationTime', 'type': 'iso-8601'}, - 'last_test_migration_status': {'key': 'lastTestMigrationStatus', 'type': 'str'}, - 'test_migrate_state': {'key': 'testMigrateState', 'type': 'str'}, - 'test_migrate_state_description': {'key': 'testMigrateStateDescription', 'type': 'str'}, - 'health': {'key': 'health', 'type': 'str'}, - 'health_errors': {'key': 'healthErrors', 'type': '[HealthError]'}, - 'allowed_operations': {'key': 'allowedOperations', 'type': '[str]'}, - 'current_job': {'key': 'currentJob', 'type': 'CurrentJobDetails'}, - 'event_correlation_id': {'key': 'eventCorrelationId', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'MigrationProviderSpecificSettings'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationItemProperties, self).__init__(**kwargs) - self.machine_name = None - self.policy_id = None - self.policy_friendly_name = None - self.migration_state = None - self.migration_state_description = None - self.last_test_migration_time = None - self.last_test_migration_status = None - self.test_migrate_state = None - self.test_migrate_state_description = None - self.health = None - self.health_errors = None - self.allowed_operations = None - self.current_job = None - self.event_correlation_id = None - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class MigrationItemsQueryParameter(msrest.serialization.Model): - """Query parameter to enumerate migration items. - - :param source_fabric_name: The source fabric name filter. - :type source_fabric_name: str - :param source_container_name: The source container name filter. - :type source_container_name: str - :param instance_type: The replication provider type. - :type instance_type: str - """ - - _attribute_map = { - 'source_fabric_name': {'key': 'sourceFabricName', 'type': 'str'}, - 'source_container_name': {'key': 'sourceContainerName', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationItemsQueryParameter, self).__init__(**kwargs) - self.source_fabric_name = kwargs.get('source_fabric_name', None) - self.source_container_name = kwargs.get('source_container_name', None) - self.instance_type = kwargs.get('instance_type', None) - - -class MigrationProviderSpecificSettings(msrest.serialization.Model): - """Migration provider specific settings. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: VMwareCbtMigrationDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'VMwareCbt': 'VMwareCbtMigrationDetails'} - } - - def __init__( - self, - **kwargs - ): - super(MigrationProviderSpecificSettings, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class MigrationRecoveryPoint(Resource): - """Recovery point for a migration item. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: Recovery point properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.MigrationRecoveryPointProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'MigrationRecoveryPointProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationRecoveryPoint, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class MigrationRecoveryPointCollection(msrest.serialization.Model): - """Collection of migration recovery points. - - :param value: The migration recovery point details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.MigrationRecoveryPoint] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MigrationRecoveryPoint]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationRecoveryPointCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class MigrationRecoveryPointProperties(msrest.serialization.Model): - """Migration item recovery point properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar recovery_point_time: The recovery point time. - :vartype recovery_point_time: ~datetime.datetime - :ivar recovery_point_type: The recovery point type. Possible values include: "NotSpecified", - "ApplicationConsistent", "CrashConsistent". - :vartype recovery_point_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.MigrationRecoveryPointType - """ - - _validation = { - 'recovery_point_time': {'readonly': True}, - 'recovery_point_type': {'readonly': True}, - } - - _attribute_map = { - 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, - 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MigrationRecoveryPointProperties, self).__init__(**kwargs) - self.recovery_point_time = None - self.recovery_point_type = None - - -class MobilityServiceUpdate(msrest.serialization.Model): - """The Mobility Service update details. - - :param version: The version of the latest update. - :type version: str - :param reboot_status: The reboot status of the update - whether it is required or not. - :type reboot_status: str - :param os_type: The OS type. - :type os_type: str - """ - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'reboot_status': {'key': 'rebootStatus', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(MobilityServiceUpdate, self).__init__(**kwargs) - self.version = kwargs.get('version', None) - self.reboot_status = kwargs.get('reboot_status', None) - self.os_type = kwargs.get('os_type', None) - - -class Network(Resource): - """Network model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The Network Properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.NetworkProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'NetworkProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(Network, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class NetworkCollection(msrest.serialization.Model): - """List of networks. - - :param value: The Networks list details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.Network] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Network]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class NetworkMapping(Resource): - """Network Mapping model. Ideally it should have been possible to inherit this class from prev version in InheritedModels as long as there is no difference in structure or method signature. Since there were no base Models for certain fields and methods viz NetworkMappingProperties and Load with required return type, the class has been introduced in its entirety with references to base models to facilitate extensions in subsequent versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The Network Mapping Properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'NetworkMappingProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkMapping, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class NetworkMappingCollection(msrest.serialization.Model): - """List of network mappings. As with NetworkMapping, it should be possible to reuse a prev version of this class. It doesn't seem likely this class could be anything more than a slightly bespoke collection of NetworkMapping. Hence it makes sense to override Load with Base.NetworkMapping instead of existing CurrentVersion.NetworkMapping. - - :param value: The Network Mappings list. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMapping] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkMapping]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkMappingCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class NetworkMappingProperties(msrest.serialization.Model): - """Network Mapping Properties. - - :param state: The pairing state for network mapping. - :type state: str - :param primary_network_friendly_name: The primary network friendly name. - :type primary_network_friendly_name: str - :param primary_network_id: The primary network id for network mapping. - :type primary_network_id: str - :param primary_fabric_friendly_name: The primary fabric friendly name. - :type primary_fabric_friendly_name: str - :param recovery_network_friendly_name: The recovery network friendly name. - :type recovery_network_friendly_name: str - :param recovery_network_id: The recovery network id for network mapping. - :type recovery_network_id: str - :param recovery_fabric_arm_id: The recovery fabric ARM id. - :type recovery_fabric_arm_id: str - :param recovery_fabric_friendly_name: The recovery fabric friendly name. - :type recovery_fabric_friendly_name: str - :param fabric_specific_settings: The fabric specific settings. - :type fabric_specific_settings: - ~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingFabricSpecificSettings - """ - - _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, - 'primary_network_friendly_name': {'key': 'primaryNetworkFriendlyName', 'type': 'str'}, - 'primary_network_id': {'key': 'primaryNetworkId', 'type': 'str'}, - 'primary_fabric_friendly_name': {'key': 'primaryFabricFriendlyName', 'type': 'str'}, - 'recovery_network_friendly_name': {'key': 'recoveryNetworkFriendlyName', 'type': 'str'}, - 'recovery_network_id': {'key': 'recoveryNetworkId', 'type': 'str'}, - 'recovery_fabric_arm_id': {'key': 'recoveryFabricArmId', 'type': 'str'}, - 'recovery_fabric_friendly_name': {'key': 'recoveryFabricFriendlyName', 'type': 'str'}, - 'fabric_specific_settings': {'key': 'fabricSpecificSettings', 'type': 'NetworkMappingFabricSpecificSettings'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkMappingProperties, self).__init__(**kwargs) - self.state = kwargs.get('state', None) - self.primary_network_friendly_name = kwargs.get('primary_network_friendly_name', None) - self.primary_network_id = kwargs.get('primary_network_id', None) - self.primary_fabric_friendly_name = kwargs.get('primary_fabric_friendly_name', None) - self.recovery_network_friendly_name = kwargs.get('recovery_network_friendly_name', None) - self.recovery_network_id = kwargs.get('recovery_network_id', None) - self.recovery_fabric_arm_id = kwargs.get('recovery_fabric_arm_id', None) - self.recovery_fabric_friendly_name = kwargs.get('recovery_fabric_friendly_name', None) - self.fabric_specific_settings = kwargs.get('fabric_specific_settings', None) - - -class NetworkProperties(msrest.serialization.Model): - """Network Properties. - - :param fabric_type: The Fabric Type. - :type fabric_type: str - :param subnets: The List of subnets. - :type subnets: list[~azure.mgmt.recoveryservicessiterecovery.models.Subnet] - :param friendly_name: The Friendly Name. - :type friendly_name: str - :param network_type: The Network Type. - :type network_type: str - """ - - _attribute_map = { - 'fabric_type': {'key': 'fabricType', 'type': 'str'}, - 'subnets': {'key': 'subnets', 'type': '[Subnet]'}, - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'network_type': {'key': 'networkType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkProperties, self).__init__(**kwargs) - self.fabric_type = kwargs.get('fabric_type', None) - self.subnets = kwargs.get('subnets', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.network_type = kwargs.get('network_type', None) - - -class NewProtectionProfile(ProtectionProfileCustomDetails): - """New Protection profile input. - - All required parameters must be populated in order to send to Azure. - - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param policy_name: Required. The protection profile input. - :type policy_name: str - :param recovery_point_history: The duration in minutes until which the recovery points need to - be stored. - :type recovery_point_history: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in - minutes). - :type crash_consistent_frequency_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be - enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: "Enable", "Disable". - :type multi_vm_sync_status: str or - ~azure.mgmt.recoveryservicessiterecovery.models.SetMultiVmSyncStatus - """ - - _validation = { - 'resource_type': {'required': True}, - 'policy_name': {'required': True}, - 'multi_vm_sync_status': {'required': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'policy_name': {'key': 'policyName', 'type': 'str'}, - 'recovery_point_history': {'key': 'recoveryPointHistory', 'type': 'int'}, - 'crash_consistent_frequency_in_minutes': {'key': 'crashConsistentFrequencyInMinutes', 'type': 'int'}, - 'app_consistent_frequency_in_minutes': {'key': 'appConsistentFrequencyInMinutes', 'type': 'int'}, - 'multi_vm_sync_status': {'key': 'multiVmSyncStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NewProtectionProfile, self).__init__(**kwargs) - self.resource_type = 'New' # type: str - self.policy_name = kwargs['policy_name'] - self.recovery_point_history = kwargs.get('recovery_point_history', None) - self.crash_consistent_frequency_in_minutes = kwargs.get('crash_consistent_frequency_in_minutes', None) - self.app_consistent_frequency_in_minutes = kwargs.get('app_consistent_frequency_in_minutes', None) - self.multi_vm_sync_status = kwargs['multi_vm_sync_status'] - - -class NewRecoveryVirtualNetwork(RecoveryVirtualNetworkCustomDetails): - """Recovery virtual network input to create new virtual network from given source network. - - All required parameters must be populated in order to send to Azure. - - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param recovery_virtual_network_resource_group_name: The name of the resource group to be used - to create the recovery virtual network. If absent, target network would be created in the same - resource group as target VM. - :type recovery_virtual_network_resource_group_name: str - :param recovery_virtual_network_name: The recovery virtual network name. - :type recovery_virtual_network_name: str - """ - - _validation = { - 'resource_type': {'required': True}, - } - - _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'recovery_virtual_network_resource_group_name': {'key': 'recoveryVirtualNetworkResourceGroupName', 'type': 'str'}, - 'recovery_virtual_network_name': {'key': 'recoveryVirtualNetworkName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NewRecoveryVirtualNetwork, self).__init__(**kwargs) - self.resource_type = 'New' # type: str - self.recovery_virtual_network_resource_group_name = kwargs.get('recovery_virtual_network_resource_group_name', None) - self.recovery_virtual_network_name = kwargs.get('recovery_virtual_network_name', None) - - -class OperationsDiscovery(msrest.serialization.Model): - """Operations discovery class. - - :param name: Name of the API. The name of the operation being performed on this particular - object. It should match the action name that appears in RBAC / the event service. Examples of - operations include: * Microsoft.Compute/virtualMachine/capture/action * - Microsoft.Compute/virtualMachine/restart/action * Microsoft.Compute/virtualMachine/write * - Microsoft.Compute/virtualMachine/read * Microsoft.Compute/virtualMachine/delete Each action - should include, in order: (1) Resource Provider Namespace (2) Type hierarchy for which the - action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, Action or - Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, - Write should be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be - used. If it is a POST, Action should be used. As a note: all resource providers would need to - include the "{Resource Provider Namespace}/register/action" operation in their response. This - API is used to register for their service, and should include details about the operation (e.g. - a localized name for the resource provider + any special considerations like PII release). - :type name: str - :param display: Object type. - :type display: ~azure.mgmt.recoveryservicessiterecovery.models.Display - :param origin: Origin. The intended executor of the operation; governs the display of the - operation in the RBAC UX and the audit logs UX. Default value is "user,system". - :type origin: str - :param properties: Properties. Reserved for future use. - :type properties: any - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'Display'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationsDiscovery, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.properties = kwargs.get('properties', None) - - -class OperationsDiscoveryCollection(msrest.serialization.Model): - """Collection of ClientDiscovery details. - - :param value: The ClientDiscovery details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.OperationsDiscovery] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[OperationsDiscovery]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationsDiscoveryCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class OSDetails(msrest.serialization.Model): - """Disk Details. - - :param os_type: VM Disk details. - :type os_type: str - :param product_type: Product type. - :type product_type: str - :param os_edition: The OSEdition. - :type os_edition: str - :param o_s_version: The OS Version. - :type o_s_version: str - :param o_s_major_version: The OS Major Version. - :type o_s_major_version: str - :param o_s_minor_version: The OS Minor Version. - :type o_s_minor_version: str - """ - - _attribute_map = { - 'os_type': {'key': 'osType', 'type': 'str'}, - 'product_type': {'key': 'productType', 'type': 'str'}, - 'os_edition': {'key': 'osEdition', 'type': 'str'}, - 'o_s_version': {'key': 'oSVersion', 'type': 'str'}, - 'o_s_major_version': {'key': 'oSMajorVersion', 'type': 'str'}, - 'o_s_minor_version': {'key': 'oSMinorVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OSDetails, self).__init__(**kwargs) - self.os_type = kwargs.get('os_type', None) - self.product_type = kwargs.get('product_type', None) - self.os_edition = kwargs.get('os_edition', None) - self.o_s_version = kwargs.get('o_s_version', None) - self.o_s_major_version = kwargs.get('o_s_major_version', None) - self.o_s_minor_version = kwargs.get('o_s_minor_version', None) - - -class OSDiskDetails(msrest.serialization.Model): - """Details of the OS Disk. - - :param os_vhd_id: The id of the disk containing the OS. - :type os_vhd_id: str - :param os_type: The type of the OS on the VM. - :type os_type: str - :param vhd_name: The OS disk VHD name. - :type vhd_name: str - """ - - _attribute_map = { - 'os_vhd_id': {'key': 'osVhdId', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'vhd_name': {'key': 'vhdName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OSDiskDetails, self).__init__(**kwargs) - self.os_vhd_id = kwargs.get('os_vhd_id', None) - self.os_type = kwargs.get('os_type', None) - self.vhd_name = kwargs.get('vhd_name', None) - - -class OSVersionWrapper(msrest.serialization.Model): - """Wrapper model for OSVersion to include version and service pack info. - - :param version: The version. - :type version: str - :param service_pack: The service pack. - :type service_pack: str - """ - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'service_pack': {'key': 'servicePack', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OSVersionWrapper, self).__init__(**kwargs) - self.version = kwargs.get('version', None) - self.service_pack = kwargs.get('service_pack', None) - - -class PlannedFailoverInput(msrest.serialization.Model): - """Input definition for planned failover. - - :param properties: Planned failover input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.PlannedFailoverInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'PlannedFailoverInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(PlannedFailoverInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class PlannedFailoverInputProperties(msrest.serialization.Model): - """Input definition for planned failover input properties. - - :param failover_direction: Failover direction. - :type failover_direction: str - :param provider_specific_details: Provider specific settings. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.PlannedFailoverProviderSpecificFailoverInput - """ - - _attribute_map = { - 'failover_direction': {'key': 'failoverDirection', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'PlannedFailoverProviderSpecificFailoverInput'}, - } - - def __init__( - self, - **kwargs - ): - super(PlannedFailoverInputProperties, self).__init__(**kwargs) - self.failover_direction = kwargs.get('failover_direction', None) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class Policy(Resource): - """Protection profile details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.PolicyProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'PolicyProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(Policy, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class PolicyCollection(msrest.serialization.Model): - """Protection Profile Collection details. - - :param value: The policy details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.Policy] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Policy]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PolicyCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class PolicyProperties(msrest.serialization.Model): - """Protection profile custom data details. - - :param friendly_name: The FriendlyName. - :type friendly_name: str - :param provider_specific_details: The ReplicationChannelSetting. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.PolicyProviderSpecificDetails - """ - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'PolicyProviderSpecificDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(PolicyProperties, self).__init__(**kwargs) - self.friendly_name = kwargs.get('friendly_name', None) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class ProcessServer(msrest.serialization.Model): - """Details of the Process Server. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param friendly_name: The Process Server's friendly name. - :type friendly_name: str - :param id: The Process Server Id. - :type id: str - :param ip_address: The IP address of the server. - :type ip_address: str - :param os_type: The OS type of the server. - :type os_type: str - :param agent_version: The version of the scout component on the server. - :type agent_version: str - :param last_heartbeat: The last heartbeat received from the server. - :type last_heartbeat: ~datetime.datetime - :param version_status: Version status. - :type version_status: str - :param mobility_service_updates: The list of the mobility service updates available on the - Process Server. - :type mobility_service_updates: - list[~azure.mgmt.recoveryservicessiterecovery.models.MobilityServiceUpdate] - :param host_id: The agent generated Id. - :type host_id: str - :param machine_count: The servers configured with this PS. - :type machine_count: str - :param replication_pair_count: The number of replication pairs configured in this PS. - :type replication_pair_count: str - :param system_load: The percentage of the system load. - :type system_load: str - :param system_load_status: The system load status. - :type system_load_status: str - :param cpu_load: The percentage of the CPU load. - :type cpu_load: str - :param cpu_load_status: The CPU load status. - :type cpu_load_status: str - :param total_memory_in_bytes: The total memory. - :type total_memory_in_bytes: long - :param available_memory_in_bytes: The available memory. - :type available_memory_in_bytes: long - :param memory_usage_status: The memory usage status. - :type memory_usage_status: str - :param total_space_in_bytes: The total space. - :type total_space_in_bytes: long - :param available_space_in_bytes: The available space. - :type available_space_in_bytes: long - :param space_usage_status: The space usage status. - :type space_usage_status: str - :param ps_service_status: The PS service status. - :type ps_service_status: str - :param ssl_cert_expiry_date: The PS SSL cert expiry date. - :type ssl_cert_expiry_date: ~datetime.datetime - :param ssl_cert_expiry_remaining_days: CS SSL cert expiry date. - :type ssl_cert_expiry_remaining_days: int - :param os_version: OS Version of the process server. Note: This will get populated if user has - CS version greater than 9.12.0.0. - :type os_version: str - :param health_errors: Health errors. - :type health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param agent_expiry_date: Agent expiry date. - :type agent_expiry_date: ~datetime.datetime - :param agent_version_details: The agent version details. - :type agent_version_details: ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails - :ivar health: The health of Process Server. Possible values include: "None", "Normal", - "Warning", "Critical". - :vartype health: str or ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionHealth - :ivar ps_stats_refresh_time: The process server stats refresh time. - :vartype ps_stats_refresh_time: ~datetime.datetime - :ivar throughput_upload_pending_data_in_bytes: The uploading pending data in bytes. - :vartype throughput_upload_pending_data_in_bytes: long - :ivar throughput_in_m_bps: The throughput in MBps. - :vartype throughput_in_m_bps: long - :ivar throughput_in_bytes: The throughput in bytes. - :vartype throughput_in_bytes: long - :ivar throughput_status: The throughput status. - :vartype throughput_status: str - :ivar mars_communication_status: The MARS communication status. - :vartype mars_communication_status: str - :ivar mars_registration_status: The MARS registration status. - :vartype mars_registration_status: str - """ - - _validation = { - 'health': {'readonly': True}, - 'ps_stats_refresh_time': {'readonly': True}, - 'throughput_upload_pending_data_in_bytes': {'readonly': True}, - 'throughput_in_m_bps': {'readonly': True}, - 'throughput_in_bytes': {'readonly': True}, - 'throughput_status': {'readonly': True}, - 'mars_communication_status': {'readonly': True}, - 'mars_registration_status': {'readonly': True}, - } - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'agent_version': {'key': 'agentVersion', 'type': 'str'}, - 'last_heartbeat': {'key': 'lastHeartbeat', 'type': 'iso-8601'}, - 'version_status': {'key': 'versionStatus', 'type': 'str'}, - 'mobility_service_updates': {'key': 'mobilityServiceUpdates', 'type': '[MobilityServiceUpdate]'}, - 'host_id': {'key': 'hostId', 'type': 'str'}, - 'machine_count': {'key': 'machineCount', 'type': 'str'}, - 'replication_pair_count': {'key': 'replicationPairCount', 'type': 'str'}, - 'system_load': {'key': 'systemLoad', 'type': 'str'}, - 'system_load_status': {'key': 'systemLoadStatus', 'type': 'str'}, - 'cpu_load': {'key': 'cpuLoad', 'type': 'str'}, - 'cpu_load_status': {'key': 'cpuLoadStatus', 'type': 'str'}, - 'total_memory_in_bytes': {'key': 'totalMemoryInBytes', 'type': 'long'}, - 'available_memory_in_bytes': {'key': 'availableMemoryInBytes', 'type': 'long'}, - 'memory_usage_status': {'key': 'memoryUsageStatus', 'type': 'str'}, - 'total_space_in_bytes': {'key': 'totalSpaceInBytes', 'type': 'long'}, - 'available_space_in_bytes': {'key': 'availableSpaceInBytes', 'type': 'long'}, - 'space_usage_status': {'key': 'spaceUsageStatus', 'type': 'str'}, - 'ps_service_status': {'key': 'psServiceStatus', 'type': 'str'}, - 'ssl_cert_expiry_date': {'key': 'sslCertExpiryDate', 'type': 'iso-8601'}, - 'ssl_cert_expiry_remaining_days': {'key': 'sslCertExpiryRemainingDays', 'type': 'int'}, - 'os_version': {'key': 'osVersion', 'type': 'str'}, - 'health_errors': {'key': 'healthErrors', 'type': '[HealthError]'}, - 'agent_expiry_date': {'key': 'agentExpiryDate', 'type': 'iso-8601'}, - 'agent_version_details': {'key': 'agentVersionDetails', 'type': 'VersionDetails'}, - 'health': {'key': 'health', 'type': 'str'}, - 'ps_stats_refresh_time': {'key': 'psStatsRefreshTime', 'type': 'iso-8601'}, - 'throughput_upload_pending_data_in_bytes': {'key': 'throughputUploadPendingDataInBytes', 'type': 'long'}, - 'throughput_in_m_bps': {'key': 'throughputInMBps', 'type': 'long'}, - 'throughput_in_bytes': {'key': 'throughputInBytes', 'type': 'long'}, - 'throughput_status': {'key': 'throughputStatus', 'type': 'str'}, - 'mars_communication_status': {'key': 'marsCommunicationStatus', 'type': 'str'}, - 'mars_registration_status': {'key': 'marsRegistrationStatus', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProcessServer, self).__init__(**kwargs) - self.friendly_name = kwargs.get('friendly_name', None) - self.id = kwargs.get('id', None) - self.ip_address = kwargs.get('ip_address', None) - self.os_type = kwargs.get('os_type', None) - self.agent_version = kwargs.get('agent_version', None) - self.last_heartbeat = kwargs.get('last_heartbeat', None) - self.version_status = kwargs.get('version_status', None) - self.mobility_service_updates = kwargs.get('mobility_service_updates', None) - self.host_id = kwargs.get('host_id', None) - self.machine_count = kwargs.get('machine_count', None) - self.replication_pair_count = kwargs.get('replication_pair_count', None) - self.system_load = kwargs.get('system_load', None) - self.system_load_status = kwargs.get('system_load_status', None) - self.cpu_load = kwargs.get('cpu_load', None) - self.cpu_load_status = kwargs.get('cpu_load_status', None) - self.total_memory_in_bytes = kwargs.get('total_memory_in_bytes', None) - self.available_memory_in_bytes = kwargs.get('available_memory_in_bytes', None) - self.memory_usage_status = kwargs.get('memory_usage_status', None) - self.total_space_in_bytes = kwargs.get('total_space_in_bytes', None) - self.available_space_in_bytes = kwargs.get('available_space_in_bytes', None) - self.space_usage_status = kwargs.get('space_usage_status', None) - self.ps_service_status = kwargs.get('ps_service_status', None) - self.ssl_cert_expiry_date = kwargs.get('ssl_cert_expiry_date', None) - self.ssl_cert_expiry_remaining_days = kwargs.get('ssl_cert_expiry_remaining_days', None) - self.os_version = kwargs.get('os_version', None) - self.health_errors = kwargs.get('health_errors', None) - self.agent_expiry_date = kwargs.get('agent_expiry_date', None) - self.agent_version_details = kwargs.get('agent_version_details', None) - self.health = None - self.ps_stats_refresh_time = None - self.throughput_upload_pending_data_in_bytes = None - self.throughput_in_m_bps = None - self.throughput_in_bytes = None - self.throughput_status = None - self.mars_communication_status = None - self.mars_registration_status = None - - -class ProcessServerDetails(msrest.serialization.Model): - """Process server details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The process server Id. - :vartype id: str - :ivar name: The process server name. - :vartype name: str - :ivar bios_id: The process server Bios Id. - :vartype bios_id: str - :ivar fabric_object_id: The fabric object Id. - :vartype fabric_object_id: str - :ivar fqdn: The process server Fqdn. - :vartype fqdn: str - :ivar ip_addresses: The list of IP addresses for communicating with the RCM component. - :vartype ip_addresses: list[str] - :ivar version: The version. - :vartype version: str - :ivar last_heartbeat_utc: The last heartbeat received from the process server. - :vartype last_heartbeat_utc: ~datetime.datetime - :ivar total_memory_in_bytes: The total memory. - :vartype total_memory_in_bytes: long - :ivar available_memory_in_bytes: The available memory. - :vartype available_memory_in_bytes: long - :ivar used_memory_in_bytes: The used memory. - :vartype used_memory_in_bytes: long - :ivar memory_usage_percentage: The memory usage percentage. - :vartype memory_usage_percentage: float - :ivar total_space_in_bytes: The total disk space. - :vartype total_space_in_bytes: long - :ivar available_space_in_bytes: The available disk space. - :vartype available_space_in_bytes: long - :ivar used_space_in_bytes: The used disk space. - :vartype used_space_in_bytes: long - :ivar free_space_percentage: The free disk space percentage. - :vartype free_space_percentage: float - :ivar throughput_upload_pending_data_in_bytes: The uploading pending data in bytes. - :vartype throughput_upload_pending_data_in_bytes: long - :ivar throughput_in_bytes: The throughput in bytes. - :vartype throughput_in_bytes: long - :ivar processor_usage_percentage: The processor usage percentage. - :vartype processor_usage_percentage: float - :ivar throughput_status: The throughput status. Possible values include: "Healthy", "Warning", - "Critical", "Unknown". - :vartype throughput_status: str or - ~azure.mgmt.recoveryservicessiterecovery.models.RcmComponentStatus - :ivar system_load: The system load. - :vartype system_load: long - :ivar system_load_status: The system load status. Possible values include: "Healthy", - "Warning", "Critical", "Unknown". - :vartype system_load_status: str or - ~azure.mgmt.recoveryservicessiterecovery.models.RcmComponentStatus - :ivar disk_usage_status: The disk usage status. Possible values include: "Healthy", "Warning", - "Critical", "Unknown". - :vartype disk_usage_status: str or - ~azure.mgmt.recoveryservicessiterecovery.models.RcmComponentStatus - :ivar memory_usage_status: The memory usage status. Possible values include: "Healthy", - "Warning", "Critical", "Unknown". - :vartype memory_usage_status: str or - ~azure.mgmt.recoveryservicessiterecovery.models.RcmComponentStatus - :ivar processor_usage_status: The processor usage status. Possible values include: "Healthy", - "Warning", "Critical", "Unknown". - :vartype processor_usage_status: str or - ~azure.mgmt.recoveryservicessiterecovery.models.RcmComponentStatus - :ivar health: The health of the process server. Possible values include: "None", "Normal", - "Warning", "Critical". - :vartype health: str or ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionHealth - :ivar health_errors: The health errors. - :vartype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :ivar protected_item_count: The protected item count. - :vartype protected_item_count: int - :ivar historic_health: The historic health of the process server based on the health in last 24 - hours. Possible values include: "None", "Normal", "Warning", "Critical". - :vartype historic_health: str or - ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionHealth - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'bios_id': {'readonly': True}, - 'fabric_object_id': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'ip_addresses': {'readonly': True}, - 'version': {'readonly': True}, - 'last_heartbeat_utc': {'readonly': True}, - 'total_memory_in_bytes': {'readonly': True}, - 'available_memory_in_bytes': {'readonly': True}, - 'used_memory_in_bytes': {'readonly': True}, - 'memory_usage_percentage': {'readonly': True}, - 'total_space_in_bytes': {'readonly': True}, - 'available_space_in_bytes': {'readonly': True}, - 'used_space_in_bytes': {'readonly': True}, - 'free_space_percentage': {'readonly': True}, - 'throughput_upload_pending_data_in_bytes': {'readonly': True}, - 'throughput_in_bytes': {'readonly': True}, - 'processor_usage_percentage': {'readonly': True}, - 'throughput_status': {'readonly': True}, - 'system_load': {'readonly': True}, - 'system_load_status': {'readonly': True}, - 'disk_usage_status': {'readonly': True}, - 'memory_usage_status': {'readonly': True}, - 'processor_usage_status': {'readonly': True}, - 'health': {'readonly': True}, - 'health_errors': {'readonly': True}, - 'protected_item_count': {'readonly': True}, - 'historic_health': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'bios_id': {'key': 'biosId', 'type': 'str'}, - 'fabric_object_id': {'key': 'fabricObjectId', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, - 'version': {'key': 'version', 'type': 'str'}, - 'last_heartbeat_utc': {'key': 'lastHeartbeatUtc', 'type': 'iso-8601'}, - 'total_memory_in_bytes': {'key': 'totalMemoryInBytes', 'type': 'long'}, - 'available_memory_in_bytes': {'key': 'availableMemoryInBytes', 'type': 'long'}, - 'used_memory_in_bytes': {'key': 'usedMemoryInBytes', 'type': 'long'}, - 'memory_usage_percentage': {'key': 'memoryUsagePercentage', 'type': 'float'}, - 'total_space_in_bytes': {'key': 'totalSpaceInBytes', 'type': 'long'}, - 'available_space_in_bytes': {'key': 'availableSpaceInBytes', 'type': 'long'}, - 'used_space_in_bytes': {'key': 'usedSpaceInBytes', 'type': 'long'}, - 'free_space_percentage': {'key': 'freeSpacePercentage', 'type': 'float'}, - 'throughput_upload_pending_data_in_bytes': {'key': 'throughputUploadPendingDataInBytes', 'type': 'long'}, - 'throughput_in_bytes': {'key': 'throughputInBytes', 'type': 'long'}, - 'processor_usage_percentage': {'key': 'processorUsagePercentage', 'type': 'float'}, - 'throughput_status': {'key': 'throughputStatus', 'type': 'str'}, - 'system_load': {'key': 'systemLoad', 'type': 'long'}, - 'system_load_status': {'key': 'systemLoadStatus', 'type': 'str'}, - 'disk_usage_status': {'key': 'diskUsageStatus', 'type': 'str'}, - 'memory_usage_status': {'key': 'memoryUsageStatus', 'type': 'str'}, - 'processor_usage_status': {'key': 'processorUsageStatus', 'type': 'str'}, - 'health': {'key': 'health', 'type': 'str'}, - 'health_errors': {'key': 'healthErrors', 'type': '[HealthError]'}, - 'protected_item_count': {'key': 'protectedItemCount', 'type': 'int'}, - 'historic_health': {'key': 'historicHealth', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProcessServerDetails, self).__init__(**kwargs) - self.id = None - self.name = None - self.bios_id = None - self.fabric_object_id = None - self.fqdn = None - self.ip_addresses = None - self.version = None - self.last_heartbeat_utc = None - self.total_memory_in_bytes = None - self.available_memory_in_bytes = None - self.used_memory_in_bytes = None - self.memory_usage_percentage = None - self.total_space_in_bytes = None - self.available_space_in_bytes = None - self.used_space_in_bytes = None - self.free_space_percentage = None - self.throughput_upload_pending_data_in_bytes = None - self.throughput_in_bytes = None - self.processor_usage_percentage = None - self.throughput_status = None - self.system_load = None - self.system_load_status = None - self.disk_usage_status = None - self.memory_usage_status = None - self.processor_usage_status = None - self.health = None - self.health_errors = None - self.protected_item_count = None - self.historic_health = None - - -class ProtectableItem(Resource): - """Replication protected item. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.ProtectableItemProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ProtectableItemProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ProtectableItem, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ProtectableItemCollection(msrest.serialization.Model): - """Protectable item collection. - - :param value: The Protectable item details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.ProtectableItem] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ProtectableItem]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProtectableItemCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ProtectableItemProperties(msrest.serialization.Model): - """Replication protected item custom data details. - - :param friendly_name: The name. - :type friendly_name: str - :param protection_status: The protection status. - :type protection_status: str - :param replication_protected_item_id: The ARM resource of protected items. - :type replication_protected_item_id: str - :param recovery_services_provider_id: The recovery provider ARM Id. - :type recovery_services_provider_id: str - :param protection_readiness_errors: The Current protection readiness errors. - :type protection_readiness_errors: list[str] - :param supported_replication_providers: The list of replication providers supported for the - protectable item. - :type supported_replication_providers: list[str] - :param custom_details: The Replication provider custom settings. - :type custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.ConfigurationSettings - """ - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, - 'replication_protected_item_id': {'key': 'replicationProtectedItemId', 'type': 'str'}, - 'recovery_services_provider_id': {'key': 'recoveryServicesProviderId', 'type': 'str'}, - 'protection_readiness_errors': {'key': 'protectionReadinessErrors', 'type': '[str]'}, - 'supported_replication_providers': {'key': 'supportedReplicationProviders', 'type': '[str]'}, - 'custom_details': {'key': 'customDetails', 'type': 'ConfigurationSettings'}, - } - - def __init__( - self, - **kwargs - ): - super(ProtectableItemProperties, self).__init__(**kwargs) - self.friendly_name = kwargs.get('friendly_name', None) - self.protection_status = kwargs.get('protection_status', None) - self.replication_protected_item_id = kwargs.get('replication_protected_item_id', None) - self.recovery_services_provider_id = kwargs.get('recovery_services_provider_id', None) - self.protection_readiness_errors = kwargs.get('protection_readiness_errors', None) - self.supported_replication_providers = kwargs.get('supported_replication_providers', None) - self.custom_details = kwargs.get('custom_details', None) - - -class ProtectableItemQueryParameter(msrest.serialization.Model): - """Query parameter to enumerate Protectable items. - - :param state: State of the Protectable item query filter. - :type state: str - """ - - _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProtectableItemQueryParameter, self).__init__(**kwargs) - self.state = kwargs.get('state', None) - - -class ProtectedItemsQueryParameter(msrest.serialization.Model): - """Query parameter to enumerate protected items. - - :param source_fabric_name: The source fabric name filter. - :type source_fabric_name: str - :param recovery_plan_name: The recovery plan filter. - :type recovery_plan_name: str - :param source_fabric_location: The source fabric location filter. - :type source_fabric_location: str - :param fabric_object_id: The fabric object Id filter. - :type fabric_object_id: str - :param v_center_name: The vCenter name filter. - :type v_center_name: str - :param instance_type: The replication provider type. - :type instance_type: str - :param multi_vm_group_create_option: Whether Multi VM group is auto created or specified by - user. Possible values include: "AutoCreated", "UserSpecified". - :type multi_vm_group_create_option: str or - ~azure.mgmt.recoveryservicessiterecovery.models.MultiVmGroupCreateOption - :param process_server_id: The process server Id filter. - :type process_server_id: str - """ - - _attribute_map = { - 'source_fabric_name': {'key': 'sourceFabricName', 'type': 'str'}, - 'recovery_plan_name': {'key': 'recoveryPlanName', 'type': 'str'}, - 'source_fabric_location': {'key': 'sourceFabricLocation', 'type': 'str'}, - 'fabric_object_id': {'key': 'fabricObjectId', 'type': 'str'}, - 'v_center_name': {'key': 'vCenterName', 'type': 'str'}, - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'multi_vm_group_create_option': {'key': 'multiVmGroupCreateOption', 'type': 'str'}, - 'process_server_id': {'key': 'processServerId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProtectedItemsQueryParameter, self).__init__(**kwargs) - self.source_fabric_name = kwargs.get('source_fabric_name', None) - self.recovery_plan_name = kwargs.get('recovery_plan_name', None) - self.source_fabric_location = kwargs.get('source_fabric_location', None) - self.fabric_object_id = kwargs.get('fabric_object_id', None) - self.v_center_name = kwargs.get('v_center_name', None) - self.instance_type = kwargs.get('instance_type', None) - self.multi_vm_group_create_option = kwargs.get('multi_vm_group_create_option', None) - self.process_server_id = kwargs.get('process_server_id', None) - - -class ProtectionContainer(Resource): - """Protection container details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ProtectionContainerProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ProtectionContainer, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ProtectionContainerCollection(msrest.serialization.Model): - """Protection Container collection. - - :param value: The Protection Container details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ProtectionContainer]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProtectionContainerCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ProtectionContainerFabricSpecificDetails(msrest.serialization.Model): - """Base class for fabric specific details of container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar instance_type: Gets the class type. Overridden in derived classes. - :vartype instance_type: str - """ - - _validation = { - 'instance_type': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProtectionContainerFabricSpecificDetails, self).__init__(**kwargs) - self.instance_type = None - - -class ProtectionContainerMapping(Resource): - """Protection container mapping object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom data. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMappingProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ProtectionContainerMappingProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ProtectionContainerMapping, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ProtectionContainerMappingCollection(msrest.serialization.Model): - """Protection container mapping collection class. - - :param value: List of container mappings. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMapping] - :param next_link: Link to fetch rest of the data. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ProtectionContainerMapping]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProtectionContainerMappingCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ProtectionContainerMappingProperties(msrest.serialization.Model): - """Protection container mapping properties. - - :param target_protection_container_id: Paired protection container ARM ID. - :type target_protection_container_id: str - :param target_protection_container_friendly_name: Friendly name of paired container. - :type target_protection_container_friendly_name: str - :param provider_specific_details: Provider specific provider details. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMappingProviderSpecificDetails - :param health: Health of pairing. - :type health: str - :param health_error_details: Health error. - :type health_error_details: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param policy_id: Policy ARM Id. - :type policy_id: str - :param state: Association Status. - :type state: str - :param source_protection_container_friendly_name: Friendly name of source protection container. - :type source_protection_container_friendly_name: str - :param source_fabric_friendly_name: Friendly name of source fabric. - :type source_fabric_friendly_name: str - :param target_fabric_friendly_name: Friendly name of target fabric. - :type target_fabric_friendly_name: str - :param policy_friendly_name: Friendly name of replication policy. - :type policy_friendly_name: str - """ - - _attribute_map = { - 'target_protection_container_id': {'key': 'targetProtectionContainerId', 'type': 'str'}, - 'target_protection_container_friendly_name': {'key': 'targetProtectionContainerFriendlyName', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'ProtectionContainerMappingProviderSpecificDetails'}, - 'health': {'key': 'health', 'type': 'str'}, - 'health_error_details': {'key': 'healthErrorDetails', 'type': '[HealthError]'}, - 'policy_id': {'key': 'policyId', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'source_protection_container_friendly_name': {'key': 'sourceProtectionContainerFriendlyName', 'type': 'str'}, - 'source_fabric_friendly_name': {'key': 'sourceFabricFriendlyName', 'type': 'str'}, - 'target_fabric_friendly_name': {'key': 'targetFabricFriendlyName', 'type': 'str'}, - 'policy_friendly_name': {'key': 'policyFriendlyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProtectionContainerMappingProperties, self).__init__(**kwargs) - self.target_protection_container_id = kwargs.get('target_protection_container_id', None) - self.target_protection_container_friendly_name = kwargs.get('target_protection_container_friendly_name', None) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - self.health = kwargs.get('health', None) - self.health_error_details = kwargs.get('health_error_details', None) - self.policy_id = kwargs.get('policy_id', None) - self.state = kwargs.get('state', None) - self.source_protection_container_friendly_name = kwargs.get('source_protection_container_friendly_name', None) - self.source_fabric_friendly_name = kwargs.get('source_fabric_friendly_name', None) - self.target_fabric_friendly_name = kwargs.get('target_fabric_friendly_name', None) - self.policy_friendly_name = kwargs.get('policy_friendly_name', None) - - -class ProtectionContainerProperties(msrest.serialization.Model): - """Protection profile custom data details. - - :param fabric_friendly_name: Fabric friendly name. - :type fabric_friendly_name: str - :param friendly_name: The name. - :type friendly_name: str - :param fabric_type: The fabric type. - :type fabric_type: str - :param protected_item_count: Number of protected PEs. - :type protected_item_count: int - :param pairing_status: The pairing status of this cloud. - :type pairing_status: str - :param role: The role of this cloud. - :type role: str - :param fabric_specific_details: Fabric specific details. - :type fabric_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerFabricSpecificDetails - """ - - _attribute_map = { - 'fabric_friendly_name': {'key': 'fabricFriendlyName', 'type': 'str'}, - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'fabric_type': {'key': 'fabricType', 'type': 'str'}, - 'protected_item_count': {'key': 'protectedItemCount', 'type': 'int'}, - 'pairing_status': {'key': 'pairingStatus', 'type': 'str'}, - 'role': {'key': 'role', 'type': 'str'}, - 'fabric_specific_details': {'key': 'fabricSpecificDetails', 'type': 'ProtectionContainerFabricSpecificDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(ProtectionContainerProperties, self).__init__(**kwargs) - self.fabric_friendly_name = kwargs.get('fabric_friendly_name', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.fabric_type = kwargs.get('fabric_type', None) - self.protected_item_count = kwargs.get('protected_item_count', None) - self.pairing_status = kwargs.get('pairing_status', None) - self.role = kwargs.get('role', None) - self.fabric_specific_details = kwargs.get('fabric_specific_details', None) - - -class ProviderError(msrest.serialization.Model): - """This class contains the error details per object. - - :param error_code: The Error code. - :type error_code: int - :param error_message: The Error message. - :type error_message: str - :param error_id: The Provider error Id. - :type error_id: str - :param possible_causes: The possible causes for the error. - :type possible_causes: str - :param recommended_action: The recommended action to resolve the error. - :type recommended_action: str - """ - - _attribute_map = { - 'error_code': {'key': 'errorCode', 'type': 'int'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'error_id': {'key': 'errorId', 'type': 'str'}, - 'possible_causes': {'key': 'possibleCauses', 'type': 'str'}, - 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ProviderError, self).__init__(**kwargs) - self.error_code = kwargs.get('error_code', None) - self.error_message = kwargs.get('error_message', None) - self.error_id = kwargs.get('error_id', None) - self.possible_causes = kwargs.get('possible_causes', None) - self.recommended_action = kwargs.get('recommended_action', None) - - -class PushInstallerDetails(msrest.serialization.Model): - """Push installer details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The push installer Id. - :vartype id: str - :ivar name: The push installer name. - :vartype name: str - :ivar bios_id: The push installer Bios Id. - :vartype bios_id: str - :ivar fabric_object_id: The fabric object Id. - :vartype fabric_object_id: str - :ivar fqdn: The push installer Fqdn. - :vartype fqdn: str - :ivar version: The version. - :vartype version: str - :ivar last_heartbeat_utc: The last heartbeat received from the push installer. - :vartype last_heartbeat_utc: ~datetime.datetime - :ivar health: The health of the push installer. Possible values include: "None", "Normal", - "Warning", "Critical". - :vartype health: str or ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionHealth - :ivar health_errors: The health errors. - :vartype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'bios_id': {'readonly': True}, - 'fabric_object_id': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'version': {'readonly': True}, - 'last_heartbeat_utc': {'readonly': True}, - 'health': {'readonly': True}, - 'health_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'bios_id': {'key': 'biosId', 'type': 'str'}, - 'fabric_object_id': {'key': 'fabricObjectId', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'last_heartbeat_utc': {'key': 'lastHeartbeatUtc', 'type': 'iso-8601'}, - 'health': {'key': 'health', 'type': 'str'}, - 'health_errors': {'key': 'healthErrors', 'type': '[HealthError]'}, - } - - def __init__( - self, - **kwargs - ): - super(PushInstallerDetails, self).__init__(**kwargs) - self.id = None - self.name = None - self.bios_id = None - self.fabric_object_id = None - self.fqdn = None - self.version = None - self.last_heartbeat_utc = None - self.health = None - self.health_errors = None - - -class RcmProxyDetails(msrest.serialization.Model): - """RCM proxy details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The RCM proxy Id. - :vartype id: str - :ivar name: The RCM proxy name. - :vartype name: str - :ivar bios_id: The RCM proxy Bios Id. - :vartype bios_id: str - :ivar fabric_object_id: The fabric object Id. - :vartype fabric_object_id: str - :ivar fqdn: The RCM proxy Fqdn. - :vartype fqdn: str - :ivar client_authentication_type: The client authentication type. - :vartype client_authentication_type: str - :ivar version: The version. - :vartype version: str - :ivar last_heartbeat_utc: The last heartbeat received from the RCM proxy. - :vartype last_heartbeat_utc: ~datetime.datetime - :ivar health: The health of the RCM proxy. Possible values include: "None", "Normal", - "Warning", "Critical". - :vartype health: str or ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionHealth - :ivar health_errors: The health errors. - :vartype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'bios_id': {'readonly': True}, - 'fabric_object_id': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'client_authentication_type': {'readonly': True}, - 'version': {'readonly': True}, - 'last_heartbeat_utc': {'readonly': True}, - 'health': {'readonly': True}, - 'health_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'bios_id': {'key': 'biosId', 'type': 'str'}, - 'fabric_object_id': {'key': 'fabricObjectId', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'client_authentication_type': {'key': 'clientAuthenticationType', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'last_heartbeat_utc': {'key': 'lastHeartbeatUtc', 'type': 'iso-8601'}, - 'health': {'key': 'health', 'type': 'str'}, - 'health_errors': {'key': 'healthErrors', 'type': '[HealthError]'}, - } - - def __init__( - self, - **kwargs - ): - super(RcmProxyDetails, self).__init__(**kwargs) - self.id = None - self.name = None - self.bios_id = None - self.fabric_object_id = None - self.fqdn = None - self.client_authentication_type = None - self.version = None - self.last_heartbeat_utc = None - self.health = None - self.health_errors = None - - -class RecoveryPlan(Resource): - """Recovery plan details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom details. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'RecoveryPlanProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlan, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class RecoveryPlanProviderSpecificDetails(msrest.serialization.Model): - """Recovery plan provider specific details. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: RecoveryPlanA2ADetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'RecoveryPlanA2ADetails'} - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanProviderSpecificDetails, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class RecoveryPlanA2ADetails(RecoveryPlanProviderSpecificDetails): - """Recovery plan A2A specific details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param primary_zone: The primary zone. - :type primary_zone: str - :param recovery_zone: The recovery zone. - :type recovery_zone: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'primary_zone': {'key': 'primaryZone', 'type': 'str'}, - 'recovery_zone': {'key': 'recoveryZone', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanA2ADetails, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.primary_zone = kwargs.get('primary_zone', None) - self.recovery_zone = kwargs.get('recovery_zone', None) - - -class RecoveryPlanProviderSpecificFailoverInput(msrest.serialization.Model): - """Recovery plan provider specific failover input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: RecoveryPlanA2AFailoverInput, RecoveryPlanHyperVReplicaAzureFailoverInput, RecoveryPlanHyperVReplicaAzureFailbackInput, RecoveryPlanInMageFailoverInput, RecoveryPlanInMageAzureV2FailoverInput, RecoveryPlanInMageRcmFailoverInput, RecoveryPlanInMageRcmFailbackFailoverInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'RecoveryPlanA2AFailoverInput', 'HyperVReplicaAzure': 'RecoveryPlanHyperVReplicaAzureFailoverInput', 'HyperVReplicaAzureFailback': 'RecoveryPlanHyperVReplicaAzureFailbackInput', 'InMage': 'RecoveryPlanInMageFailoverInput', 'InMageAzureV2': 'RecoveryPlanInMageAzureV2FailoverInput', 'InMageRcm': 'RecoveryPlanInMageRcmFailoverInput', 'InMageRcmFailback': 'RecoveryPlanInMageRcmFailbackFailoverInput'} - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanProviderSpecificFailoverInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class RecoveryPlanA2AFailoverInput(RecoveryPlanProviderSpecificFailoverInput): - """Recovery plan A2A failover input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: Required. The recovery point type. Possible values include: - "Latest", "LatestApplicationConsistent", "LatestCrashConsistent", "LatestProcessed". - :type recovery_point_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.A2ARpRecoveryPointType - :param cloud_service_creation_option: A value indicating whether to use recovery cloud service - for TFO or not. - :type cloud_service_creation_option: str - :param multi_vm_sync_point_option: A value indicating whether multi VM sync enabled VMs should - use multi VM sync points for failover. Possible values include: "UseMultiVmSyncRecoveryPoint", - "UsePerVmRecoveryPoint". - :type multi_vm_sync_point_option: str or - ~azure.mgmt.recoveryservicessiterecovery.models.MultiVmSyncPointOption - """ - - _validation = { - 'instance_type': {'required': True}, - 'recovery_point_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, - 'cloud_service_creation_option': {'key': 'cloudServiceCreationOption', 'type': 'str'}, - 'multi_vm_sync_point_option': {'key': 'multiVmSyncPointOption', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanA2AFailoverInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.recovery_point_type = kwargs['recovery_point_type'] - self.cloud_service_creation_option = kwargs.get('cloud_service_creation_option', None) - self.multi_vm_sync_point_option = kwargs.get('multi_vm_sync_point_option', None) - - -class RecoveryPlanProviderSpecificInput(msrest.serialization.Model): - """Recovery plan provider specific input base class. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: RecoveryPlanA2AInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'A2A': 'RecoveryPlanA2AInput'} - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class RecoveryPlanA2AInput(RecoveryPlanProviderSpecificInput): - """Recovery plan A2A input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param primary_zone: The primary zone. - :type primary_zone: str - :param recovery_zone: The recovery zone. - :type recovery_zone: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'primary_zone': {'key': 'primaryZone', 'type': 'str'}, - 'recovery_zone': {'key': 'recoveryZone', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanA2AInput, self).__init__(**kwargs) - self.instance_type = 'A2A' # type: str - self.primary_zone = kwargs.get('primary_zone', None) - self.recovery_zone = kwargs.get('recovery_zone', None) - - -class RecoveryPlanAction(msrest.serialization.Model): - """Recovery plan action details. - - All required parameters must be populated in order to send to Azure. - - :param action_name: Required. The action name. - :type action_name: str - :param failover_types: Required. The list of failover types. - :type failover_types: list[str or - ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItemOperation] - :param failover_directions: Required. The list of failover directions. - :type failover_directions: list[str or - ~azure.mgmt.recoveryservicessiterecovery.models.PossibleOperationsDirections] - :param custom_details: Required. The custom details. - :type custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanActionDetails - """ - - _validation = { - 'action_name': {'required': True}, - 'failover_types': {'required': True}, - 'failover_directions': {'required': True}, - 'custom_details': {'required': True}, - } - - _attribute_map = { - 'action_name': {'key': 'actionName', 'type': 'str'}, - 'failover_types': {'key': 'failoverTypes', 'type': '[str]'}, - 'failover_directions': {'key': 'failoverDirections', 'type': '[str]'}, - 'custom_details': {'key': 'customDetails', 'type': 'RecoveryPlanActionDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanAction, self).__init__(**kwargs) - self.action_name = kwargs['action_name'] - self.failover_types = kwargs['failover_types'] - self.failover_directions = kwargs['failover_directions'] - self.custom_details = kwargs['custom_details'] - - -class RecoveryPlanActionDetails(msrest.serialization.Model): - """Recovery plan action custom details. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: RecoveryPlanAutomationRunbookActionDetails, RecoveryPlanManualActionDetails, RecoveryPlanScriptActionDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the type of action details (see - RecoveryPlanActionDetailsTypes enum for possible values).Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'AutomationRunbookActionDetails': 'RecoveryPlanAutomationRunbookActionDetails', 'ManualActionDetails': 'RecoveryPlanManualActionDetails', 'ScriptActionDetails': 'RecoveryPlanScriptActionDetails'} - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanActionDetails, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class RecoveryPlanAutomationRunbookActionDetails(RecoveryPlanActionDetails): - """Recovery plan Automation runbook action details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the type of action details (see - RecoveryPlanActionDetailsTypes enum for possible values).Constant filled by server. - :type instance_type: str - :param runbook_id: The runbook ARM Id. - :type runbook_id: str - :param timeout: The runbook timeout. - :type timeout: str - :param fabric_location: Required. The fabric location. Possible values include: "Primary", - "Recovery". - :type fabric_location: str or - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanActionLocation - """ - - _validation = { - 'instance_type': {'required': True}, - 'fabric_location': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'runbook_id': {'key': 'runbookId', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - 'fabric_location': {'key': 'fabricLocation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanAutomationRunbookActionDetails, self).__init__(**kwargs) - self.instance_type = 'AutomationRunbookActionDetails' # type: str - self.runbook_id = kwargs.get('runbook_id', None) - self.timeout = kwargs.get('timeout', None) - self.fabric_location = kwargs['fabric_location'] - - -class RecoveryPlanCollection(msrest.serialization.Model): - """Recovery plan collection details. - - :param value: The list of recovery plans. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[RecoveryPlan]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class RecoveryPlanGroup(msrest.serialization.Model): - """Recovery plan group details. - - All required parameters must be populated in order to send to Azure. - - :param group_type: Required. The group type. Possible values include: "Shutdown", "Boot", - "Failover". - :type group_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroupType - :param replication_protected_items: The list of protected items. - :type replication_protected_items: - list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProtectedItem] - :param start_group_actions: The start group actions. - :type start_group_actions: - list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanAction] - :param end_group_actions: The end group actions. - :type end_group_actions: - list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanAction] - """ - - _validation = { - 'group_type': {'required': True}, - } - - _attribute_map = { - 'group_type': {'key': 'groupType', 'type': 'str'}, - 'replication_protected_items': {'key': 'replicationProtectedItems', 'type': '[RecoveryPlanProtectedItem]'}, - 'start_group_actions': {'key': 'startGroupActions', 'type': '[RecoveryPlanAction]'}, - 'end_group_actions': {'key': 'endGroupActions', 'type': '[RecoveryPlanAction]'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanGroup, self).__init__(**kwargs) - self.group_type = kwargs['group_type'] - self.replication_protected_items = kwargs.get('replication_protected_items', None) - self.start_group_actions = kwargs.get('start_group_actions', None) - self.end_group_actions = kwargs.get('end_group_actions', None) - - -class RecoveryPlanGroupTaskDetails(GroupTaskDetails): - """This class represents the recovery plan group task. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: RecoveryPlanShutdownGroupTaskDetails. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param child_tasks: The child tasks. - :type child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] - :param name: The name. - :type name: str - :param group_id: The group identifier. - :type group_id: str - :param rp_group_type: The group type. - :type rp_group_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'child_tasks': {'key': 'childTasks', 'type': '[ASRTask]'}, - 'name': {'key': 'name', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'rp_group_type': {'key': 'rpGroupType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'RecoveryPlanShutdownGroupTaskDetails': 'RecoveryPlanShutdownGroupTaskDetails'} - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanGroupTaskDetails, self).__init__(**kwargs) - self.instance_type = 'RecoveryPlanGroupTaskDetails' # type: str - self.name = kwargs.get('name', None) - self.group_id = kwargs.get('group_id', None) - self.rp_group_type = kwargs.get('rp_group_type', None) - - -class RecoveryPlanHyperVReplicaAzureFailbackInput(RecoveryPlanProviderSpecificFailoverInput): - """Recovery plan HVR Azure failback input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param data_sync_option: Required. The data sync option. Possible values include: - "ForDownTime", "ForSynchronization". - :type data_sync_option: str or ~azure.mgmt.recoveryservicessiterecovery.models.DataSyncStatus - :param recovery_vm_creation_option: Required. The ALR option. Possible values include: - "CreateVmIfNotFound", "NoAction". - :type recovery_vm_creation_option: str or - ~azure.mgmt.recoveryservicessiterecovery.models.AlternateLocationRecoveryOption - """ - - _validation = { - 'instance_type': {'required': True}, - 'data_sync_option': {'required': True}, - 'recovery_vm_creation_option': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'data_sync_option': {'key': 'dataSyncOption', 'type': 'str'}, - 'recovery_vm_creation_option': {'key': 'recoveryVmCreationOption', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanHyperVReplicaAzureFailbackInput, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaAzureFailback' # type: str - self.data_sync_option = kwargs['data_sync_option'] - self.recovery_vm_creation_option = kwargs['recovery_vm_creation_option'] - - -class RecoveryPlanHyperVReplicaAzureFailoverInput(RecoveryPlanProviderSpecificFailoverInput): - """Recovery plan HVR Azure failover input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param primary_kek_certificate_pfx: The primary KEK certificate PFX. - :type primary_kek_certificate_pfx: str - :param secondary_kek_certificate_pfx: The secondary KEK certificate PFX. - :type secondary_kek_certificate_pfx: str - :param recovery_point_type: The recovery point type. Possible values include: "Latest", - "LatestApplicationConsistent", "LatestProcessed". - :type recovery_point_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.HyperVReplicaAzureRpRecoveryPointType - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'primary_kek_certificate_pfx': {'key': 'primaryKekCertificatePfx', 'type': 'str'}, - 'secondary_kek_certificate_pfx': {'key': 'secondaryKekCertificatePfx', 'type': 'str'}, - 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanHyperVReplicaAzureFailoverInput, self).__init__(**kwargs) - self.instance_type = 'HyperVReplicaAzure' # type: str - self.primary_kek_certificate_pfx = kwargs.get('primary_kek_certificate_pfx', None) - self.secondary_kek_certificate_pfx = kwargs.get('secondary_kek_certificate_pfx', None) - self.recovery_point_type = kwargs.get('recovery_point_type', None) - - -class RecoveryPlanInMageAzureV2FailoverInput(RecoveryPlanProviderSpecificFailoverInput): - """Recovery plan InMageAzureV2 failover input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: Required. The recovery point type. Possible values include: - "Latest", "LatestApplicationConsistent", "LatestCrashConsistent", "LatestProcessed". - :type recovery_point_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.InMageV2RpRecoveryPointType - :param use_multi_vm_sync_point: A value indicating whether multi VM sync enabled VMs should use - multi VM sync points for failover. - :type use_multi_vm_sync_point: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'recovery_point_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, - 'use_multi_vm_sync_point': {'key': 'useMultiVmSyncPoint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanInMageAzureV2FailoverInput, self).__init__(**kwargs) - self.instance_type = 'InMageAzureV2' # type: str - self.recovery_point_type = kwargs['recovery_point_type'] - self.use_multi_vm_sync_point = kwargs.get('use_multi_vm_sync_point', None) - - -class RecoveryPlanInMageFailoverInput(RecoveryPlanProviderSpecificFailoverInput): - """Recovery plan InMage failover input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: Required. The recovery point type. Possible values include: - "LatestTime", "LatestTag", "Custom". - :type recovery_point_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.RpInMageRecoveryPointType - """ - - _validation = { - 'instance_type': {'required': True}, - 'recovery_point_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanInMageFailoverInput, self).__init__(**kwargs) - self.instance_type = 'InMage' # type: str - self.recovery_point_type = kwargs['recovery_point_type'] - - -class RecoveryPlanInMageRcmFailbackFailoverInput(RecoveryPlanProviderSpecificFailoverInput): - """Recovery plan InMageRcmFailback failover input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: Required. The recovery point type. Possible values include: - "ApplicationConsistent", "CrashConsistent". - :type recovery_point_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackRecoveryPointType - :param use_multi_vm_sync_point: A value indicating whether multi VM sync enabled VMs should use - multi VM sync points for failover. - :type use_multi_vm_sync_point: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'recovery_point_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, - 'use_multi_vm_sync_point': {'key': 'useMultiVmSyncPoint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanInMageRcmFailbackFailoverInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcmFailback' # type: str - self.recovery_point_type = kwargs['recovery_point_type'] - self.use_multi_vm_sync_point = kwargs.get('use_multi_vm_sync_point', None) - - -class RecoveryPlanInMageRcmFailoverInput(RecoveryPlanProviderSpecificFailoverInput): - """Recovery plan InMageRcm failover input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: Required. The recovery point type. Possible values include: - "Latest", "LatestApplicationConsistent", "LatestCrashConsistent", "LatestProcessed". - :type recovery_point_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanPointType - :param use_multi_vm_sync_point: A value indicating whether multi VM sync enabled VMs should use - multi VM sync points for failover. - :type use_multi_vm_sync_point: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'recovery_point_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, - 'use_multi_vm_sync_point': {'key': 'useMultiVmSyncPoint', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanInMageRcmFailoverInput, self).__init__(**kwargs) - self.instance_type = 'InMageRcm' # type: str - self.recovery_point_type = kwargs['recovery_point_type'] - self.use_multi_vm_sync_point = kwargs.get('use_multi_vm_sync_point', None) - - -class RecoveryPlanManualActionDetails(RecoveryPlanActionDetails): - """Recovery plan manual action details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the type of action details (see - RecoveryPlanActionDetailsTypes enum for possible values).Constant filled by server. - :type instance_type: str - :param description: The manual action description. - :type description: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanManualActionDetails, self).__init__(**kwargs) - self.instance_type = 'ManualActionDetails' # type: str - self.description = kwargs.get('description', None) - - -class RecoveryPlanPlannedFailoverInput(msrest.serialization.Model): - """Recovery plan planned failover input. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. The recovery plan planned failover input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'RecoveryPlanPlannedFailoverInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanPlannedFailoverInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class RecoveryPlanPlannedFailoverInputProperties(msrest.serialization.Model): - """Recovery plan planned failover input properties. - - All required parameters must be populated in order to send to Azure. - - :param failover_direction: Required. The failover direction. Possible values include: - "PrimaryToRecovery", "RecoveryToPrimary". - :type failover_direction: str or - ~azure.mgmt.recoveryservicessiterecovery.models.PossibleOperationsDirections - :param provider_specific_details: The provider specific properties. - :type provider_specific_details: - list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput] - """ - - _validation = { - 'failover_direction': {'required': True}, - } - - _attribute_map = { - 'failover_direction': {'key': 'failoverDirection', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': '[RecoveryPlanProviderSpecificFailoverInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanPlannedFailoverInputProperties, self).__init__(**kwargs) - self.failover_direction = kwargs['failover_direction'] - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class RecoveryPlanProperties(msrest.serialization.Model): - """Recovery plan properties. - - :param friendly_name: The friendly name. - :type friendly_name: str - :param primary_fabric_id: The primary fabric Id. - :type primary_fabric_id: str - :param primary_fabric_friendly_name: The primary fabric friendly name. - :type primary_fabric_friendly_name: str - :param recovery_fabric_id: The recovery fabric Id. - :type recovery_fabric_id: str - :param recovery_fabric_friendly_name: The recovery fabric friendly name. - :type recovery_fabric_friendly_name: str - :param failover_deployment_model: The failover deployment model. - :type failover_deployment_model: str - :param replication_providers: The list of replication providers. - :type replication_providers: list[str] - :param allowed_operations: The list of allowed operations. - :type allowed_operations: list[str] - :param last_planned_failover_time: The start time of the last planned failover. - :type last_planned_failover_time: ~datetime.datetime - :param last_unplanned_failover_time: The start time of the last unplanned failover. - :type last_unplanned_failover_time: ~datetime.datetime - :param last_test_failover_time: The start time of the last test failover. - :type last_test_failover_time: ~datetime.datetime - :param current_scenario: The current scenario details. - :type current_scenario: ~azure.mgmt.recoveryservicessiterecovery.models.CurrentScenarioDetails - :param current_scenario_status: The recovery plan status. - :type current_scenario_status: str - :param current_scenario_status_description: The recovery plan status description. - :type current_scenario_status_description: str - :param groups: The recovery plan groups. - :type groups: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroup] - :param provider_specific_details: The provider id and provider specific details. - :type provider_specific_details: - list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificDetails] - """ - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'primary_fabric_id': {'key': 'primaryFabricId', 'type': 'str'}, - 'primary_fabric_friendly_name': {'key': 'primaryFabricFriendlyName', 'type': 'str'}, - 'recovery_fabric_id': {'key': 'recoveryFabricId', 'type': 'str'}, - 'recovery_fabric_friendly_name': {'key': 'recoveryFabricFriendlyName', 'type': 'str'}, - 'failover_deployment_model': {'key': 'failoverDeploymentModel', 'type': 'str'}, - 'replication_providers': {'key': 'replicationProviders', 'type': '[str]'}, - 'allowed_operations': {'key': 'allowedOperations', 'type': '[str]'}, - 'last_planned_failover_time': {'key': 'lastPlannedFailoverTime', 'type': 'iso-8601'}, - 'last_unplanned_failover_time': {'key': 'lastUnplannedFailoverTime', 'type': 'iso-8601'}, - 'last_test_failover_time': {'key': 'lastTestFailoverTime', 'type': 'iso-8601'}, - 'current_scenario': {'key': 'currentScenario', 'type': 'CurrentScenarioDetails'}, - 'current_scenario_status': {'key': 'currentScenarioStatus', 'type': 'str'}, - 'current_scenario_status_description': {'key': 'currentScenarioStatusDescription', 'type': 'str'}, - 'groups': {'key': 'groups', 'type': '[RecoveryPlanGroup]'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': '[RecoveryPlanProviderSpecificDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanProperties, self).__init__(**kwargs) - self.friendly_name = kwargs.get('friendly_name', None) - self.primary_fabric_id = kwargs.get('primary_fabric_id', None) - self.primary_fabric_friendly_name = kwargs.get('primary_fabric_friendly_name', None) - self.recovery_fabric_id = kwargs.get('recovery_fabric_id', None) - self.recovery_fabric_friendly_name = kwargs.get('recovery_fabric_friendly_name', None) - self.failover_deployment_model = kwargs.get('failover_deployment_model', None) - self.replication_providers = kwargs.get('replication_providers', None) - self.allowed_operations = kwargs.get('allowed_operations', None) - self.last_planned_failover_time = kwargs.get('last_planned_failover_time', None) - self.last_unplanned_failover_time = kwargs.get('last_unplanned_failover_time', None) - self.last_test_failover_time = kwargs.get('last_test_failover_time', None) - self.current_scenario = kwargs.get('current_scenario', None) - self.current_scenario_status = kwargs.get('current_scenario_status', None) - self.current_scenario_status_description = kwargs.get('current_scenario_status_description', None) - self.groups = kwargs.get('groups', None) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class RecoveryPlanProtectedItem(msrest.serialization.Model): - """Recovery plan protected item. - - :param id: The ARM Id of the recovery plan protected item. - :type id: str - :param virtual_machine_id: The virtual machine Id. - :type virtual_machine_id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanProtectedItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.virtual_machine_id = kwargs.get('virtual_machine_id', None) - - -class RecoveryPlanScriptActionDetails(RecoveryPlanActionDetails): - """Recovery plan script action details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the type of action details (see - RecoveryPlanActionDetailsTypes enum for possible values).Constant filled by server. - :type instance_type: str - :param path: Required. The script path. - :type path: str - :param timeout: The script timeout. - :type timeout: str - :param fabric_location: Required. The fabric location. Possible values include: "Primary", - "Recovery". - :type fabric_location: str or - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanActionLocation - """ - - _validation = { - 'instance_type': {'required': True}, - 'path': {'required': True}, - 'fabric_location': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'timeout': {'key': 'timeout', 'type': 'str'}, - 'fabric_location': {'key': 'fabricLocation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanScriptActionDetails, self).__init__(**kwargs) - self.instance_type = 'ScriptActionDetails' # type: str - self.path = kwargs['path'] - self.timeout = kwargs.get('timeout', None) - self.fabric_location = kwargs['fabric_location'] - - -class RecoveryPlanShutdownGroupTaskDetails(RecoveryPlanGroupTaskDetails): - """This class represents the recovery plan shutdown group task details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param child_tasks: The child tasks. - :type child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] - :param name: The name. - :type name: str - :param group_id: The group identifier. - :type group_id: str - :param rp_group_type: The group type. - :type rp_group_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'child_tasks': {'key': 'childTasks', 'type': '[ASRTask]'}, - 'name': {'key': 'name', 'type': 'str'}, - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'rp_group_type': {'key': 'rpGroupType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanShutdownGroupTaskDetails, self).__init__(**kwargs) - self.instance_type = 'RecoveryPlanShutdownGroupTaskDetails' # type: str - - -class RecoveryPlanTestFailoverCleanupInput(msrest.serialization.Model): - """Recovery plan test failover cleanup input. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. The recovery plan test failover cleanup input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'RecoveryPlanTestFailoverCleanupInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanTestFailoverCleanupInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class RecoveryPlanTestFailoverCleanupInputProperties(msrest.serialization.Model): - """Recovery plan test failover cleanup input properties. - - :param comments: The test failover cleanup comments. - :type comments: str - """ - - _validation = { - 'comments': {'max_length': 1024, 'min_length': 0}, - } - - _attribute_map = { - 'comments': {'key': 'comments', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanTestFailoverCleanupInputProperties, self).__init__(**kwargs) - self.comments = kwargs.get('comments', None) - - -class RecoveryPlanTestFailoverInput(msrest.serialization.Model): - """Recovery plan test failover input. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. The recovery plan test failover input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'RecoveryPlanTestFailoverInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanTestFailoverInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class RecoveryPlanTestFailoverInputProperties(msrest.serialization.Model): - """Recovery plan test failover input properties. - - All required parameters must be populated in order to send to Azure. - - :param failover_direction: Required. The failover direction. Possible values include: - "PrimaryToRecovery", "RecoveryToPrimary". - :type failover_direction: str or - ~azure.mgmt.recoveryservicessiterecovery.models.PossibleOperationsDirections - :param network_type: Required. The network type to be used for test failover. - :type network_type: str - :param network_id: The Id of the network to be used for test failover. - :type network_id: str - :param provider_specific_details: The provider specific properties. - :type provider_specific_details: - list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput] - """ - - _validation = { - 'failover_direction': {'required': True}, - 'network_type': {'required': True}, - } - - _attribute_map = { - 'failover_direction': {'key': 'failoverDirection', 'type': 'str'}, - 'network_type': {'key': 'networkType', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': '[RecoveryPlanProviderSpecificFailoverInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanTestFailoverInputProperties, self).__init__(**kwargs) - self.failover_direction = kwargs['failover_direction'] - self.network_type = kwargs['network_type'] - self.network_id = kwargs.get('network_id', None) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class RecoveryPlanUnplannedFailoverInput(msrest.serialization.Model): - """Recovery plan unplanned failover input. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. The recovery plan unplanned failover input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'RecoveryPlanUnplannedFailoverInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanUnplannedFailoverInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class RecoveryPlanUnplannedFailoverInputProperties(msrest.serialization.Model): - """Recovery plan unplanned failover input properties. - - All required parameters must be populated in order to send to Azure. - - :param failover_direction: Required. The failover direction. Possible values include: - "PrimaryToRecovery", "RecoveryToPrimary". - :type failover_direction: str or - ~azure.mgmt.recoveryservicessiterecovery.models.PossibleOperationsDirections - :param source_site_operations: Required. A value indicating whether source site operations are - required. Possible values include: "Required", "NotRequired". - :type source_site_operations: str or - ~azure.mgmt.recoveryservicessiterecovery.models.SourceSiteOperations - :param provider_specific_details: The provider specific properties. - :type provider_specific_details: - list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput] - """ - - _validation = { - 'failover_direction': {'required': True}, - 'source_site_operations': {'required': True}, - } - - _attribute_map = { - 'failover_direction': {'key': 'failoverDirection', 'type': 'str'}, - 'source_site_operations': {'key': 'sourceSiteOperations', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': '[RecoveryPlanProviderSpecificFailoverInput]'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPlanUnplannedFailoverInputProperties, self).__init__(**kwargs) - self.failover_direction = kwargs['failover_direction'] - self.source_site_operations = kwargs['source_site_operations'] - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class RecoveryPoint(Resource): - """Recovery point. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The recovery point properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'RecoveryPointProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPoint, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class RecoveryPointCollection(msrest.serialization.Model): - """Collection of recovery point details. - - :param value: The recovery point details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPoint] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[RecoveryPoint]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPointCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class RecoveryPointProperties(msrest.serialization.Model): - """Recovery point properties. - - :param recovery_point_time: The recovery point time. - :type recovery_point_time: ~datetime.datetime - :param recovery_point_type: The recovery point type: ApplicationConsistent, CrashConsistent. - :type recovery_point_type: str - :param provider_specific_details: The provider specific details for the recovery point. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.ProviderSpecificRecoveryPointDetails - """ - - _attribute_map = { - 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, - 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'ProviderSpecificRecoveryPointDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryPointProperties, self).__init__(**kwargs) - self.recovery_point_time = kwargs.get('recovery_point_time', None) - self.recovery_point_type = kwargs.get('recovery_point_type', None) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class RecoveryServicesProvider(Resource): - """Provider details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: Provider properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProviderProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'RecoveryServicesProviderProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryServicesProvider, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class RecoveryServicesProviderCollection(msrest.serialization.Model): - """Collection of providers. - - :param value: The Servers details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProvider] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[RecoveryServicesProvider]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryServicesProviderCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class RecoveryServicesProviderProperties(msrest.serialization.Model): - """Recovery services provider properties. - - :param fabric_type: Type of the site. - :type fabric_type: str - :param friendly_name: Friendly name of the DRA. - :type friendly_name: str - :param provider_version: The provider version. - :type provider_version: str - :param server_version: The fabric provider. - :type server_version: str - :param provider_version_state: DRA version status. - :type provider_version_state: str - :param provider_version_expiry_date: Expiry date of the version. - :type provider_version_expiry_date: ~datetime.datetime - :param fabric_friendly_name: The fabric friendly name. - :type fabric_friendly_name: str - :param last_heart_beat: Time when last heartbeat was sent by the DRA. - :type last_heart_beat: ~datetime.datetime - :param connection_status: A value indicating whether DRA is responsive. - :type connection_status: str - :param protected_item_count: Number of protected VMs currently managed by the DRA. - :type protected_item_count: int - :param allowed_scenarios: The scenarios allowed on this provider. - :type allowed_scenarios: list[str] - :param health_error_details: The recovery services provider health error details. - :type health_error_details: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param dra_identifier: The DRA Id. - :type dra_identifier: str - :param machine_id: The machine Id. - :type machine_id: str - :param machine_name: The machine name. - :type machine_name: str - :param bios_id: The Bios Id. - :type bios_id: str - :param authentication_identity_details: The authentication identity details. - :type authentication_identity_details: - ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderDetails - :param resource_access_identity_details: The resource access identity details. - :type resource_access_identity_details: - ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderDetails - :param data_plane_authentication_identity_details: The data plane authentication identity - details. - :type data_plane_authentication_identity_details: - ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderDetails - :param provider_version_details: The provider version details. - :type provider_version_details: ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails - """ - - _attribute_map = { - 'fabric_type': {'key': 'fabricType', 'type': 'str'}, - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'provider_version': {'key': 'providerVersion', 'type': 'str'}, - 'server_version': {'key': 'serverVersion', 'type': 'str'}, - 'provider_version_state': {'key': 'providerVersionState', 'type': 'str'}, - 'provider_version_expiry_date': {'key': 'providerVersionExpiryDate', 'type': 'iso-8601'}, - 'fabric_friendly_name': {'key': 'fabricFriendlyName', 'type': 'str'}, - 'last_heart_beat': {'key': 'lastHeartBeat', 'type': 'iso-8601'}, - 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, - 'protected_item_count': {'key': 'protectedItemCount', 'type': 'int'}, - 'allowed_scenarios': {'key': 'allowedScenarios', 'type': '[str]'}, - 'health_error_details': {'key': 'healthErrorDetails', 'type': '[HealthError]'}, - 'dra_identifier': {'key': 'draIdentifier', 'type': 'str'}, - 'machine_id': {'key': 'machineId', 'type': 'str'}, - 'machine_name': {'key': 'machineName', 'type': 'str'}, - 'bios_id': {'key': 'biosId', 'type': 'str'}, - 'authentication_identity_details': {'key': 'authenticationIdentityDetails', 'type': 'IdentityProviderDetails'}, - 'resource_access_identity_details': {'key': 'resourceAccessIdentityDetails', 'type': 'IdentityProviderDetails'}, - 'data_plane_authentication_identity_details': {'key': 'dataPlaneAuthenticationIdentityDetails', 'type': 'IdentityProviderDetails'}, - 'provider_version_details': {'key': 'providerVersionDetails', 'type': 'VersionDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(RecoveryServicesProviderProperties, self).__init__(**kwargs) - self.fabric_type = kwargs.get('fabric_type', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.provider_version = kwargs.get('provider_version', None) - self.server_version = kwargs.get('server_version', None) - self.provider_version_state = kwargs.get('provider_version_state', None) - self.provider_version_expiry_date = kwargs.get('provider_version_expiry_date', None) - self.fabric_friendly_name = kwargs.get('fabric_friendly_name', None) - self.last_heart_beat = kwargs.get('last_heart_beat', None) - self.connection_status = kwargs.get('connection_status', None) - self.protected_item_count = kwargs.get('protected_item_count', None) - self.allowed_scenarios = kwargs.get('allowed_scenarios', None) - self.health_error_details = kwargs.get('health_error_details', None) - self.dra_identifier = kwargs.get('dra_identifier', None) - self.machine_id = kwargs.get('machine_id', None) - self.machine_name = kwargs.get('machine_name', None) - self.bios_id = kwargs.get('bios_id', None) - self.authentication_identity_details = kwargs.get('authentication_identity_details', None) - self.resource_access_identity_details = kwargs.get('resource_access_identity_details', None) - self.data_plane_authentication_identity_details = kwargs.get('data_plane_authentication_identity_details', None) - self.provider_version_details = kwargs.get('provider_version_details', None) - - -class RemoveDisksInput(msrest.serialization.Model): - """Input for remove disk(s) operation. - - :param properties: Remove disk input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.RemoveDisksInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'RemoveDisksInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(RemoveDisksInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class RemoveDisksInputProperties(msrest.serialization.Model): - """Remove Disk input properties. - - :param provider_specific_details: The ReplicationProviderInput. For HyperVReplicaAzure - provider, it will be AzureEnableProtectionInput object. For San provider, it will be - SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.RemoveDisksProviderSpecificInput - """ - - _attribute_map = { - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'RemoveDisksProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(RemoveDisksInputProperties, self).__init__(**kwargs) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class RemoveProtectionContainerMappingInput(msrest.serialization.Model): - """Container unpairing input. - - :param properties: Configure protection input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'RemoveProtectionContainerMappingInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(RemoveProtectionContainerMappingInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class RemoveProtectionContainerMappingInputProperties(msrest.serialization.Model): - """Unpairing input properties. - - :param provider_specific_input: Provider specific input for unpairing. - :type provider_specific_input: - ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderContainerUnmappingInput - """ - - _attribute_map = { - 'provider_specific_input': {'key': 'providerSpecificInput', 'type': 'ReplicationProviderContainerUnmappingInput'}, - } - - def __init__( - self, - **kwargs - ): - super(RemoveProtectionContainerMappingInputProperties, self).__init__(**kwargs) - self.provider_specific_input = kwargs.get('provider_specific_input', None) - - -class RenewCertificateInput(msrest.serialization.Model): - """Certificate renewal input. - - :param properties: Renew certificate input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.RenewCertificateInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'RenewCertificateInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(RenewCertificateInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class RenewCertificateInputProperties(msrest.serialization.Model): - """Renew Certificate input properties. - - :param renew_certificate_type: Renew certificate type. - :type renew_certificate_type: str - """ - - _attribute_map = { - 'renew_certificate_type': {'key': 'renewCertificateType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RenewCertificateInputProperties, self).__init__(**kwargs) - self.renew_certificate_type = kwargs.get('renew_certificate_type', None) - - -class ReplicationAgentDetails(msrest.serialization.Model): - """Replication agent details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The replication agent Id. - :vartype id: str - :ivar name: The replication agent name. - :vartype name: str - :ivar bios_id: The replication agent Bios Id. - :vartype bios_id: str - :ivar fabric_object_id: The fabric object Id. - :vartype fabric_object_id: str - :ivar fqdn: The replication agent Fqdn. - :vartype fqdn: str - :ivar version: The version. - :vartype version: str - :ivar last_heartbeat_utc: The last heartbeat received from the replication agent. - :vartype last_heartbeat_utc: ~datetime.datetime - :ivar health: The health of the replication agent. Possible values include: "None", "Normal", - "Warning", "Critical". - :vartype health: str or ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionHealth - :ivar health_errors: The health errors. - :vartype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'bios_id': {'readonly': True}, - 'fabric_object_id': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'version': {'readonly': True}, - 'last_heartbeat_utc': {'readonly': True}, - 'health': {'readonly': True}, - 'health_errors': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'bios_id': {'key': 'biosId', 'type': 'str'}, - 'fabric_object_id': {'key': 'fabricObjectId', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'last_heartbeat_utc': {'key': 'lastHeartbeatUtc', 'type': 'iso-8601'}, - 'health': {'key': 'health', 'type': 'str'}, - 'health_errors': {'key': 'healthErrors', 'type': '[HealthError]'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationAgentDetails, self).__init__(**kwargs) - self.id = None - self.name = None - self.bios_id = None - self.fabric_object_id = None - self.fqdn = None - self.version = None - self.last_heartbeat_utc = None - self.health = None - self.health_errors = None - - -class ReplicationEligibilityResults(msrest.serialization.Model): - """Replication eligibility results response model. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Gets the name of this object. - :vartype name: str - :ivar type: Gets the object type. - :vartype type: str - :ivar id: Gets Unique ARM identifier for this object. - :vartype id: str - :ivar properties: Gets properties model for replication eligibility results API. - :vartype properties: - ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationEligibilityResultsProperties - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'id': {'readonly': True}, - 'properties': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ReplicationEligibilityResultsProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationEligibilityResults, self).__init__(**kwargs) - self.name = None - self.type = None - self.id = None - self.properties = None - - -class ReplicationEligibilityResultsCollection(msrest.serialization.Model): - """Replication eligibility results collection response model. - - :param value: The replication eligibility results details. - :type value: - list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationEligibilityResults] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ReplicationEligibilityResults]'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationEligibilityResultsCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class ReplicationEligibilityResultsErrorInfo(msrest.serialization.Model): - """Error model that can be exposed to the user. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param code: The error code. - :type code: str - :param message: The error message. - :type message: str - :param possible_causes: The possible causes. - :type possible_causes: str - :param recommended_action: The recommended action. - :type recommended_action: str - :ivar status: The error status. - :vartype status: str - """ - - _validation = { - 'status': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'possible_causes': {'key': 'possibleCauses', 'type': 'str'}, - 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationEligibilityResultsErrorInfo, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.possible_causes = kwargs.get('possible_causes', None) - self.recommended_action = kwargs.get('recommended_action', None) - self.status = None - - -class ReplicationEligibilityResultsProperties(msrest.serialization.Model): - """Properties model for replication eligibility results API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar client_request_id: The client request Id. - :vartype client_request_id: str - :param errors: The error details. - :type errors: - list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationEligibilityResultsErrorInfo] - """ - - _validation = { - 'client_request_id': {'readonly': True}, - } - - _attribute_map = { - 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, - 'errors': {'key': 'errors', 'type': '[ReplicationEligibilityResultsErrorInfo]'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationEligibilityResultsProperties, self).__init__(**kwargs) - self.client_request_id = None - self.errors = kwargs.get('errors', None) - - -class ReplicationGroupDetails(ConfigurationSettings): - """Replication group details. This will be used in case of San. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationGroupDetails, self).__init__(**kwargs) - self.instance_type = 'ReplicationGroupDetails' # type: str - - -class ReplicationProtectedItem(Resource): - """Replication protected item. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom data. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItemProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ReplicationProtectedItemProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationProtectedItem, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ReplicationProtectedItemCollection(msrest.serialization.Model): - """Replication protected item collection. - - :param value: The Replication protected item details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ReplicationProtectedItem]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationProtectedItemCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ReplicationProtectedItemProperties(msrest.serialization.Model): - """Replication protected item custom data details. - - :param friendly_name: The name. - :type friendly_name: str - :param protected_item_type: The type of protected item type. - :type protected_item_type: str - :param protectable_item_id: The protected item ARM Id. - :type protectable_item_id: str - :param recovery_services_provider_id: The recovery provider ARM Id. - :type recovery_services_provider_id: str - :param primary_fabric_friendly_name: The friendly name of the primary fabric. - :type primary_fabric_friendly_name: str - :param primary_fabric_provider: The fabric provider of the primary fabric. - :type primary_fabric_provider: str - :param recovery_fabric_friendly_name: The friendly name of recovery fabric. - :type recovery_fabric_friendly_name: str - :param recovery_fabric_id: The Arm Id of recovery fabric. - :type recovery_fabric_id: str - :param primary_protection_container_friendly_name: The name of primary protection container - friendly name. - :type primary_protection_container_friendly_name: str - :param recovery_protection_container_friendly_name: The name of recovery container friendly - name. - :type recovery_protection_container_friendly_name: str - :param protection_state: The protection status. - :type protection_state: str - :param protection_state_description: The protection state description. - :type protection_state_description: str - :param active_location: The Current active location of the PE. - :type active_location: str - :param test_failover_state: The Test failover state. - :type test_failover_state: str - :param test_failover_state_description: The Test failover state description. - :type test_failover_state_description: str - :param allowed_operations: The allowed operations on the Replication protected item. - :type allowed_operations: list[str] - :param replication_health: The consolidated protection health for the VM taking any issues with - SRS as well as all the replication units associated with the VM's replication group into - account. This is a string representation of the ProtectionHealth enumeration. - :type replication_health: str - :param failover_health: The consolidated failover health for the VM. - :type failover_health: str - :param health_errors: List of health errors. - :type health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param policy_id: The ID of Policy governing this PE. - :type policy_id: str - :param policy_friendly_name: The name of Policy governing this PE. - :type policy_friendly_name: str - :param last_successful_failover_time: The Last successful failover time. - :type last_successful_failover_time: ~datetime.datetime - :param last_successful_test_failover_time: The Last successful test failover time. - :type last_successful_test_failover_time: ~datetime.datetime - :param current_scenario: The current scenario. - :type current_scenario: ~azure.mgmt.recoveryservicessiterecovery.models.CurrentScenarioDetails - :param failover_recovery_point_id: The recovery point ARM Id to which the Vm was failed over. - :type failover_recovery_point_id: str - :param provider_specific_details: The Replication provider custom settings. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderSpecificSettings - :param recovery_container_id: The recovery container Id. - :type recovery_container_id: str - :param event_correlation_id: The correlation Id for events associated with this protected item. - :type event_correlation_id: str - """ - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, - 'protectable_item_id': {'key': 'protectableItemId', 'type': 'str'}, - 'recovery_services_provider_id': {'key': 'recoveryServicesProviderId', 'type': 'str'}, - 'primary_fabric_friendly_name': {'key': 'primaryFabricFriendlyName', 'type': 'str'}, - 'primary_fabric_provider': {'key': 'primaryFabricProvider', 'type': 'str'}, - 'recovery_fabric_friendly_name': {'key': 'recoveryFabricFriendlyName', 'type': 'str'}, - 'recovery_fabric_id': {'key': 'recoveryFabricId', 'type': 'str'}, - 'primary_protection_container_friendly_name': {'key': 'primaryProtectionContainerFriendlyName', 'type': 'str'}, - 'recovery_protection_container_friendly_name': {'key': 'recoveryProtectionContainerFriendlyName', 'type': 'str'}, - 'protection_state': {'key': 'protectionState', 'type': 'str'}, - 'protection_state_description': {'key': 'protectionStateDescription', 'type': 'str'}, - 'active_location': {'key': 'activeLocation', 'type': 'str'}, - 'test_failover_state': {'key': 'testFailoverState', 'type': 'str'}, - 'test_failover_state_description': {'key': 'testFailoverStateDescription', 'type': 'str'}, - 'allowed_operations': {'key': 'allowedOperations', 'type': '[str]'}, - 'replication_health': {'key': 'replicationHealth', 'type': 'str'}, - 'failover_health': {'key': 'failoverHealth', 'type': 'str'}, - 'health_errors': {'key': 'healthErrors', 'type': '[HealthError]'}, - 'policy_id': {'key': 'policyId', 'type': 'str'}, - 'policy_friendly_name': {'key': 'policyFriendlyName', 'type': 'str'}, - 'last_successful_failover_time': {'key': 'lastSuccessfulFailoverTime', 'type': 'iso-8601'}, - 'last_successful_test_failover_time': {'key': 'lastSuccessfulTestFailoverTime', 'type': 'iso-8601'}, - 'current_scenario': {'key': 'currentScenario', 'type': 'CurrentScenarioDetails'}, - 'failover_recovery_point_id': {'key': 'failoverRecoveryPointId', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'ReplicationProviderSpecificSettings'}, - 'recovery_container_id': {'key': 'recoveryContainerId', 'type': 'str'}, - 'event_correlation_id': {'key': 'eventCorrelationId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationProtectedItemProperties, self).__init__(**kwargs) - self.friendly_name = kwargs.get('friendly_name', None) - self.protected_item_type = kwargs.get('protected_item_type', None) - self.protectable_item_id = kwargs.get('protectable_item_id', None) - self.recovery_services_provider_id = kwargs.get('recovery_services_provider_id', None) - self.primary_fabric_friendly_name = kwargs.get('primary_fabric_friendly_name', None) - self.primary_fabric_provider = kwargs.get('primary_fabric_provider', None) - self.recovery_fabric_friendly_name = kwargs.get('recovery_fabric_friendly_name', None) - self.recovery_fabric_id = kwargs.get('recovery_fabric_id', None) - self.primary_protection_container_friendly_name = kwargs.get('primary_protection_container_friendly_name', None) - self.recovery_protection_container_friendly_name = kwargs.get('recovery_protection_container_friendly_name', None) - self.protection_state = kwargs.get('protection_state', None) - self.protection_state_description = kwargs.get('protection_state_description', None) - self.active_location = kwargs.get('active_location', None) - self.test_failover_state = kwargs.get('test_failover_state', None) - self.test_failover_state_description = kwargs.get('test_failover_state_description', None) - self.allowed_operations = kwargs.get('allowed_operations', None) - self.replication_health = kwargs.get('replication_health', None) - self.failover_health = kwargs.get('failover_health', None) - self.health_errors = kwargs.get('health_errors', None) - self.policy_id = kwargs.get('policy_id', None) - self.policy_friendly_name = kwargs.get('policy_friendly_name', None) - self.last_successful_failover_time = kwargs.get('last_successful_failover_time', None) - self.last_successful_test_failover_time = kwargs.get('last_successful_test_failover_time', None) - self.current_scenario = kwargs.get('current_scenario', None) - self.failover_recovery_point_id = kwargs.get('failover_recovery_point_id', None) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - self.recovery_container_id = kwargs.get('recovery_container_id', None) - self.event_correlation_id = kwargs.get('event_correlation_id', None) - - -class ReplicationProtectionIntent(Resource): - """Replication protection intent. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom data. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectionIntentProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ReplicationProtectionIntentProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationProtectionIntent, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ReplicationProtectionIntentCollection(msrest.serialization.Model): - """Replication protection intent objects collection. - - :param value: The Replication protection intent details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectionIntent] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ReplicationProtectionIntent]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationProtectionIntentCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ReplicationProtectionIntentProperties(msrest.serialization.Model): - """Replication protection intent custom data details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param friendly_name: The name. - :type friendly_name: str - :ivar job_id: The job Id. - :vartype job_id: str - :ivar job_state: The job state. - :vartype job_state: str - :ivar is_active: A value indicating whether the intent object is active. - :vartype is_active: bool - :ivar creation_time_utc: The creation time in UTC. - :vartype creation_time_utc: str - :param provider_specific_details: The Replication provider custom settings. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectionIntentProviderSpecificSettings - """ - - _validation = { - 'job_id': {'readonly': True}, - 'job_state': {'readonly': True}, - 'is_active': {'readonly': True}, - 'creation_time_utc': {'readonly': True}, - } - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'job_id': {'key': 'jobId', 'type': 'str'}, - 'job_state': {'key': 'jobState', 'type': 'str'}, - 'is_active': {'key': 'isActive', 'type': 'bool'}, - 'creation_time_utc': {'key': 'creationTimeUTC', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'ReplicationProtectionIntentProviderSpecificSettings'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationProtectionIntentProperties, self).__init__(**kwargs) - self.friendly_name = kwargs.get('friendly_name', None) - self.job_id = None - self.job_state = None - self.is_active = None - self.creation_time_utc = None - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class ReplicationProviderContainerUnmappingInput(msrest.serialization.Model): - """Provider specific input for unpairing operations. - - :param instance_type: The class type. - :type instance_type: str - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReplicationProviderContainerUnmappingInput, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - - -class ReprotectAgentDetails(msrest.serialization.Model): - """Reprotect agent details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The reprotect agent Id. - :vartype id: str - :ivar name: The reprotect agent name. - :vartype name: str - :ivar bios_id: The reprotect agent Bios Id. - :vartype bios_id: str - :ivar fabric_object_id: The fabric object Id. - :vartype fabric_object_id: str - :ivar fqdn: The reprotect agent Fqdn. - :vartype fqdn: str - :ivar version: The version. - :vartype version: str - :ivar last_heartbeat_utc: The last heartbeat received from the reprotect agent. - :vartype last_heartbeat_utc: ~datetime.datetime - :ivar health: The health of the reprotect agent. Possible values include: "None", "Normal", - "Warning", "Critical". - :vartype health: str or ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionHealth - :ivar health_errors: The health errors. - :vartype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :ivar protected_item_count: The protected item count. - :vartype protected_item_count: int - :ivar accessible_datastores: The list of accessible datastores fetched from discovery. - :vartype accessible_datastores: list[str] - :ivar vcenter_id: The Vcenter Id. - :vartype vcenter_id: str - :ivar last_discovery_in_utc: The last time when SDS information discovered in SRS. - :vartype last_discovery_in_utc: ~datetime.datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'bios_id': {'readonly': True}, - 'fabric_object_id': {'readonly': True}, - 'fqdn': {'readonly': True}, - 'version': {'readonly': True}, - 'last_heartbeat_utc': {'readonly': True}, - 'health': {'readonly': True}, - 'health_errors': {'readonly': True}, - 'protected_item_count': {'readonly': True}, - 'accessible_datastores': {'readonly': True}, - 'vcenter_id': {'readonly': True}, - 'last_discovery_in_utc': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'bios_id': {'key': 'biosId', 'type': 'str'}, - 'fabric_object_id': {'key': 'fabricObjectId', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'str'}, - 'last_heartbeat_utc': {'key': 'lastHeartbeatUtc', 'type': 'iso-8601'}, - 'health': {'key': 'health', 'type': 'str'}, - 'health_errors': {'key': 'healthErrors', 'type': '[HealthError]'}, - 'protected_item_count': {'key': 'protectedItemCount', 'type': 'int'}, - 'accessible_datastores': {'key': 'accessibleDatastores', 'type': '[str]'}, - 'vcenter_id': {'key': 'vcenterId', 'type': 'str'}, - 'last_discovery_in_utc': {'key': 'lastDiscoveryInUtc', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(ReprotectAgentDetails, self).__init__(**kwargs) - self.id = None - self.name = None - self.bios_id = None - self.fabric_object_id = None - self.fqdn = None - self.version = None - self.last_heartbeat_utc = None - self.health = None - self.health_errors = None - self.protected_item_count = None - self.accessible_datastores = None - self.vcenter_id = None - self.last_discovery_in_utc = None - - -class ResolveHealthError(msrest.serialization.Model): - """Resolve health errors input properties. - - :param health_error_id: Health error id. - :type health_error_id: str - """ - - _attribute_map = { - 'health_error_id': {'key': 'healthErrorId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResolveHealthError, self).__init__(**kwargs) - self.health_error_id = kwargs.get('health_error_id', None) - - -class ResolveHealthInput(msrest.serialization.Model): - """Resolve health input. - - :param properties: Disable resolve health input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.ResolveHealthInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ResolveHealthInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ResolveHealthInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ResolveHealthInputProperties(msrest.serialization.Model): - """Resolve health input properties. - - :param health_errors: Health errors. - :type health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.ResolveHealthError] - """ - - _attribute_map = { - 'health_errors': {'key': 'healthErrors', 'type': '[ResolveHealthError]'}, - } - - def __init__( - self, - **kwargs - ): - super(ResolveHealthInputProperties, self).__init__(**kwargs) - self.health_errors = kwargs.get('health_errors', None) - - -class ResourceHealthSummary(msrest.serialization.Model): - """Base class to define the health summary of the resources contained under an Arm resource. - - :param resource_count: The count of total resources under the container. - :type resource_count: int - :param issues: The list of summary of health errors across the resources under the container. - :type issues: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthErrorSummary] - :param categorized_resource_counts: The categorized resource counts. - :type categorized_resource_counts: dict[str, int] - """ - - _attribute_map = { - 'resource_count': {'key': 'resourceCount', 'type': 'int'}, - 'issues': {'key': 'issues', 'type': '[HealthErrorSummary]'}, - 'categorized_resource_counts': {'key': 'categorizedResourceCounts', 'type': '{int}'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceHealthSummary, self).__init__(**kwargs) - self.resource_count = kwargs.get('resource_count', None) - self.issues = kwargs.get('issues', None) - self.categorized_resource_counts = kwargs.get('categorized_resource_counts', None) - - -class ResumeJobParams(msrest.serialization.Model): - """Resume job params. - - :param properties: Resume job properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.ResumeJobParamsProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ResumeJobParamsProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ResumeJobParams, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ResumeJobParamsProperties(msrest.serialization.Model): - """Resume job properties. - - :param comments: Resume job comments. - :type comments: str - """ - - _attribute_map = { - 'comments': {'key': 'comments', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResumeJobParamsProperties, self).__init__(**kwargs) - self.comments = kwargs.get('comments', None) - - -class ResyncInput(msrest.serialization.Model): - """Resync input. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. Resync input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.ResyncInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ResyncInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ResyncInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class ResyncInputProperties(msrest.serialization.Model): - """Resync input properties. - - All required parameters must be populated in order to send to Azure. - - :param provider_specific_details: Required. The provider specific details. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.ResyncProviderSpecificInput - """ - - _validation = { - 'provider_specific_details': {'required': True}, - } - - _attribute_map = { - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'ResyncProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(ResyncInputProperties, self).__init__(**kwargs) - self.provider_specific_details = kwargs['provider_specific_details'] - - -class ResyncProviderSpecificInput(msrest.serialization.Model): - """Resync provider specific input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: VMwareCbtResyncInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'VMwareCbt': 'VMwareCbtResyncInput'} - } - - def __init__( - self, - **kwargs - ): - super(ResyncProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class RetentionVolume(msrest.serialization.Model): - """The retention details of the MT. - - :param volume_name: The volume name. - :type volume_name: str - :param capacity_in_bytes: The volume capacity. - :type capacity_in_bytes: long - :param free_space_in_bytes: The free space available in this volume. - :type free_space_in_bytes: long - :param threshold_percentage: The threshold percentage. - :type threshold_percentage: int - """ - - _attribute_map = { - 'volume_name': {'key': 'volumeName', 'type': 'str'}, - 'capacity_in_bytes': {'key': 'capacityInBytes', 'type': 'long'}, - 'free_space_in_bytes': {'key': 'freeSpaceInBytes', 'type': 'long'}, - 'threshold_percentage': {'key': 'thresholdPercentage', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(RetentionVolume, self).__init__(**kwargs) - self.volume_name = kwargs.get('volume_name', None) - self.capacity_in_bytes = kwargs.get('capacity_in_bytes', None) - self.free_space_in_bytes = kwargs.get('free_space_in_bytes', None) - self.threshold_percentage = kwargs.get('threshold_percentage', None) - - -class ReverseReplicationInput(msrest.serialization.Model): - """Reverse replication input. - - :param properties: Reverse replication properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.ReverseReplicationInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ReverseReplicationInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ReverseReplicationInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class ReverseReplicationInputProperties(msrest.serialization.Model): - """Reverse replication input properties. - - :param failover_direction: Failover direction. - :type failover_direction: str - :param provider_specific_details: Provider specific reverse replication input. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.ReverseReplicationProviderSpecificInput - """ - - _attribute_map = { - 'failover_direction': {'key': 'failoverDirection', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'ReverseReplicationProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(ReverseReplicationInputProperties, self).__init__(**kwargs) - self.failover_direction = kwargs.get('failover_direction', None) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class RoleAssignment(msrest.serialization.Model): - """Azure role assignment details. - - :param id: The ARM Id of the role assignment. - :type id: str - :param name: The name of the role assignment. - :type name: str - :param scope: Role assignment scope. - :type scope: str - :param principal_id: Principal Id. - :type principal_id: str - :param role_definition_id: Role definition id. - :type role_definition_id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'scope': {'key': 'scope', 'type': 'str'}, - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RoleAssignment, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.scope = kwargs.get('scope', None) - self.principal_id = kwargs.get('principal_id', None) - self.role_definition_id = kwargs.get('role_definition_id', None) - - -class RunAsAccount(msrest.serialization.Model): - """CS Accounts Details. - - :param account_id: The CS RunAs account Id. - :type account_id: str - :param account_name: The CS RunAs account name. - :type account_name: str - """ - - _attribute_map = { - 'account_id': {'key': 'accountId', 'type': 'str'}, - 'account_name': {'key': 'accountName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RunAsAccount, self).__init__(**kwargs) - self.account_id = kwargs.get('account_id', None) - self.account_name = kwargs.get('account_name', None) - - -class ScriptActionTaskDetails(TaskTypeDetails): - """This class represents the script action task details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param name: The name. - :type name: str - :param path: The path. - :type path: str - :param output: The output. - :type output: str - :param is_primary_side_script: A value indicating whether it is a primary side script or not. - :type is_primary_side_script: bool - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'path': {'key': 'path', 'type': 'str'}, - 'output': {'key': 'output', 'type': 'str'}, - 'is_primary_side_script': {'key': 'isPrimarySideScript', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ScriptActionTaskDetails, self).__init__(**kwargs) - self.instance_type = 'ScriptActionTaskDetails' # type: str - self.name = kwargs.get('name', None) - self.path = kwargs.get('path', None) - self.output = kwargs.get('output', None) - self.is_primary_side_script = kwargs.get('is_primary_side_script', None) - - -class ServiceError(msrest.serialization.Model): - """ASR error model. - - :param code: Error code. - :type code: str - :param message: Error message. - :type message: str - :param possible_causes: Possible causes of error. - :type possible_causes: str - :param recommended_action: Recommended action to resolve error. - :type recommended_action: str - :param activity_id: Activity Id. - :type activity_id: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'possible_causes': {'key': 'possibleCauses', 'type': 'str'}, - 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, - 'activity_id': {'key': 'activityId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ServiceError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.possible_causes = kwargs.get('possible_causes', None) - self.recommended_action = kwargs.get('recommended_action', None) - self.activity_id = kwargs.get('activity_id', None) - - -class StorageClassification(Resource): - """Storage object definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: Properties of the storage object. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'StorageClassificationProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(StorageClassification, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class StorageClassificationCollection(msrest.serialization.Model): - """Collection of storage details. - - :param value: The storage details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassification] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[StorageClassification]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(StorageClassificationCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class StorageClassificationMapping(Resource): - """Storage mapping object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: Properties of the storage mapping object. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'StorageClassificationMappingProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(StorageClassificationMapping, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class StorageClassificationMappingCollection(msrest.serialization.Model): - """Collection of storage mapping details. - - :param value: The storage details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMapping] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[StorageClassificationMapping]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(StorageClassificationMappingCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class StorageClassificationMappingInput(msrest.serialization.Model): - """Storage mapping input. - - :param properties: Storage mapping input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.StorageMappingInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'StorageMappingInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(StorageClassificationMappingInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class StorageClassificationMappingProperties(msrest.serialization.Model): - """Storage mapping properties. - - :param target_storage_classification_id: Target storage object Id. - :type target_storage_classification_id: str - """ - - _attribute_map = { - 'target_storage_classification_id': {'key': 'targetStorageClassificationId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(StorageClassificationMappingProperties, self).__init__(**kwargs) - self.target_storage_classification_id = kwargs.get('target_storage_classification_id', None) - - -class StorageClassificationProperties(msrest.serialization.Model): - """Storage object properties. - - :param friendly_name: Friendly name of the Storage classification. - :type friendly_name: str - """ - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(StorageClassificationProperties, self).__init__(**kwargs) - self.friendly_name = kwargs.get('friendly_name', None) - - -class StorageMappingInputProperties(msrest.serialization.Model): - """Storage mapping input properties. - - :param target_storage_classification_id: The ID of the storage object. - :type target_storage_classification_id: str - """ - - _attribute_map = { - 'target_storage_classification_id': {'key': 'targetStorageClassificationId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(StorageMappingInputProperties, self).__init__(**kwargs) - self.target_storage_classification_id = kwargs.get('target_storage_classification_id', None) - - -class Subnet(msrest.serialization.Model): - """Subnets of the network. - - :param name: The subnet name. - :type name: str - :param friendly_name: The subnet friendly name. - :type friendly_name: str - :param address_list: The list of addresses for the subnet. - :type address_list: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'address_list': {'key': 'addressList', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(Subnet, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.address_list = kwargs.get('address_list', None) - - -class SupportedOperatingSystems(Resource): - """Supported operating systems. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The supported operating systems properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.SupportedOSProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'SupportedOSProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(SupportedOperatingSystems, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class SupportedOSDetails(msrest.serialization.Model): - """Supported operating system details. - - :param os_name: The name. - :type os_name: str - :param os_type: The type. - :type os_type: str - :param os_versions: The list of version for operating system. - :type os_versions: list[~azure.mgmt.recoveryservicessiterecovery.models.OSVersionWrapper] - """ - - _attribute_map = { - 'os_name': {'key': 'osName', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'os_versions': {'key': 'osVersions', 'type': '[OSVersionWrapper]'}, - } - - def __init__( - self, - **kwargs - ): - super(SupportedOSDetails, self).__init__(**kwargs) - self.os_name = kwargs.get('os_name', None) - self.os_type = kwargs.get('os_type', None) - self.os_versions = kwargs.get('os_versions', None) - - -class SupportedOSProperties(msrest.serialization.Model): - """Supported operating systems properties. - - :param supported_os_list: The supported operating systems property list. - :type supported_os_list: - list[~azure.mgmt.recoveryservicessiterecovery.models.SupportedOSProperty] - """ - - _attribute_map = { - 'supported_os_list': {'key': 'supportedOsList', 'type': '[SupportedOSProperty]'}, - } - - def __init__( - self, - **kwargs - ): - super(SupportedOSProperties, self).__init__(**kwargs) - self.supported_os_list = kwargs.get('supported_os_list', None) - - -class SupportedOSProperty(msrest.serialization.Model): - """Supported operating systems property. - - :param instance_type: The replication provider type. - :type instance_type: str - :param supported_os: The list of supported operating systems. - :type supported_os: list[~azure.mgmt.recoveryservicessiterecovery.models.SupportedOSDetails] - """ - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'supported_os': {'key': 'supportedOs', 'type': '[SupportedOSDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(SupportedOSProperty, self).__init__(**kwargs) - self.instance_type = kwargs.get('instance_type', None) - self.supported_os = kwargs.get('supported_os', None) - - -class SwitchProtectionInput(msrest.serialization.Model): - """Switch protection input. - - :param properties: Switch protection properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.SwitchProtectionInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'SwitchProtectionInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(SwitchProtectionInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class SwitchProtectionInputProperties(msrest.serialization.Model): - """Switch protection input properties. - - :param replication_protected_item_name: The unique replication protected item name. - :type replication_protected_item_name: str - :param provider_specific_details: Provider specific switch protection input. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.SwitchProtectionProviderSpecificInput - """ - - _attribute_map = { - 'replication_protected_item_name': {'key': 'replicationProtectedItemName', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'SwitchProtectionProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(SwitchProtectionInputProperties, self).__init__(**kwargs) - self.replication_protected_item_name = kwargs.get('replication_protected_item_name', None) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class SwitchProtectionJobDetails(JobDetails): - """This class represents details for switch protection job. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for - possible values).Constant filled by server. - :type instance_type: str - :param affected_object_details: The affected object properties like source server, source - cloud, target server, target cloud etc. based on the workflow object details. - :type affected_object_details: dict[str, str] - :param new_replication_protected_item_id: ARM Id of the new replication protected item. - :type new_replication_protected_item_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'affected_object_details': {'key': 'affectedObjectDetails', 'type': '{str}'}, - 'new_replication_protected_item_id': {'key': 'newReplicationProtectedItemId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SwitchProtectionJobDetails, self).__init__(**kwargs) - self.instance_type = 'SwitchProtectionJobDetails' # type: str - self.new_replication_protected_item_id = kwargs.get('new_replication_protected_item_id', None) - - -class TargetComputeSize(msrest.serialization.Model): - """Represents applicable recovery vm sizes. - - :param id: The Id. - :type id: str - :param name: The name. - :type name: str - :param type: The Type of the object. - :type type: str - :param properties: The custom data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.TargetComputeSizeProperties - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'TargetComputeSizeProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(TargetComputeSize, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.properties = kwargs.get('properties', None) - - -class TargetComputeSizeCollection(msrest.serialization.Model): - """Target compute size collection. - - :param value: The list of target compute sizes. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.TargetComputeSize] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[TargetComputeSize]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TargetComputeSizeCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class TargetComputeSizeProperties(msrest.serialization.Model): - """Represents applicable recovery vm sizes properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param name: Target compute size name. - :type name: str - :param friendly_name: Target compute size display name. - :type friendly_name: str - :param cpu_cores_count: The maximum cpu cores count supported by target compute size. - :type cpu_cores_count: int - :ivar v_cpus_available: The Available vCPUs supported by target compute size. - :vartype v_cpus_available: int - :param memory_in_gb: The maximum memory in GB supported by target compute size. - :type memory_in_gb: float - :param max_data_disk_count: The maximum data disks count supported by target compute size. - :type max_data_disk_count: int - :param max_nics_count: The maximum Nics count supported by target compute size. - :type max_nics_count: int - :param errors: The reasons why the target compute size is not applicable for the protected - item. - :type errors: list[~azure.mgmt.recoveryservicessiterecovery.models.ComputeSizeErrorDetails] - :param high_iops_supported: The value indicating whether the target compute size supports high - Iops. - :type high_iops_supported: str - :param hyper_v_generations: The supported HyperV Generations. - :type hyper_v_generations: list[str] - """ - - _validation = { - 'v_cpus_available': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'cpu_cores_count': {'key': 'cpuCoresCount', 'type': 'int'}, - 'v_cpus_available': {'key': 'vCPUsAvailable', 'type': 'int'}, - 'memory_in_gb': {'key': 'memoryInGB', 'type': 'float'}, - 'max_data_disk_count': {'key': 'maxDataDiskCount', 'type': 'int'}, - 'max_nics_count': {'key': 'maxNicsCount', 'type': 'int'}, - 'errors': {'key': 'errors', 'type': '[ComputeSizeErrorDetails]'}, - 'high_iops_supported': {'key': 'highIopsSupported', 'type': 'str'}, - 'hyper_v_generations': {'key': 'hyperVGenerations', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(TargetComputeSizeProperties, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.friendly_name = kwargs.get('friendly_name', None) - self.cpu_cores_count = kwargs.get('cpu_cores_count', None) - self.v_cpus_available = None - self.memory_in_gb = kwargs.get('memory_in_gb', None) - self.max_data_disk_count = kwargs.get('max_data_disk_count', None) - self.max_nics_count = kwargs.get('max_nics_count', None) - self.errors = kwargs.get('errors', None) - self.high_iops_supported = kwargs.get('high_iops_supported', None) - self.hyper_v_generations = kwargs.get('hyper_v_generations', None) - - -class TestFailoverCleanupInput(msrest.serialization.Model): - """Input definition for test failover cleanup. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. Test failover cleanup input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.TestFailoverCleanupInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'TestFailoverCleanupInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(TestFailoverCleanupInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class TestFailoverCleanupInputProperties(msrest.serialization.Model): - """Input definition for test failover cleanup input properties. - - :param comments: Test failover cleanup comments. - :type comments: str - """ - - _validation = { - 'comments': {'max_length': 1024, 'min_length': 0}, - } - - _attribute_map = { - 'comments': {'key': 'comments', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TestFailoverCleanupInputProperties, self).__init__(**kwargs) - self.comments = kwargs.get('comments', None) - - -class TestFailoverInput(msrest.serialization.Model): - """Input definition for test failover. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. Test failover input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.TestFailoverInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'TestFailoverInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(TestFailoverInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class TestFailoverInputProperties(msrest.serialization.Model): - """Input definition for test failover input properties. - - :param failover_direction: Test failover direction. - :type failover_direction: str - :param network_type: Network type to be used for test failover. - :type network_type: str - :param network_id: The id of the network to be used for test failover. - :type network_id: str - :param provider_specific_details: Provider specific settings. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.TestFailoverProviderSpecificInput - """ - - _attribute_map = { - 'failover_direction': {'key': 'failoverDirection', 'type': 'str'}, - 'network_type': {'key': 'networkType', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'TestFailoverProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(TestFailoverInputProperties, self).__init__(**kwargs) - self.failover_direction = kwargs.get('failover_direction', None) - self.network_type = kwargs.get('network_type', None) - self.network_id = kwargs.get('network_id', None) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class TestFailoverJobDetails(JobDetails): - """This class represents the details for a test failover job. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for - possible values).Constant filled by server. - :type instance_type: str - :param affected_object_details: The affected object properties like source server, source - cloud, target server, target cloud etc. based on the workflow object details. - :type affected_object_details: dict[str, str] - :param test_failover_status: The test failover status. - :type test_failover_status: str - :param comments: The test failover comments. - :type comments: str - :param network_name: The test network name. - :type network_name: str - :param network_friendly_name: The test network friendly name. - :type network_friendly_name: str - :param network_type: The test network type (see TestFailoverInput enum for possible values). - :type network_type: str - :param protected_item_details: The test VM details. - :type protected_item_details: - list[~azure.mgmt.recoveryservicessiterecovery.models.FailoverReplicationProtectedItemDetails] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'affected_object_details': {'key': 'affectedObjectDetails', 'type': '{str}'}, - 'test_failover_status': {'key': 'testFailoverStatus', 'type': 'str'}, - 'comments': {'key': 'comments', 'type': 'str'}, - 'network_name': {'key': 'networkName', 'type': 'str'}, - 'network_friendly_name': {'key': 'networkFriendlyName', 'type': 'str'}, - 'network_type': {'key': 'networkType', 'type': 'str'}, - 'protected_item_details': {'key': 'protectedItemDetails', 'type': '[FailoverReplicationProtectedItemDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(TestFailoverJobDetails, self).__init__(**kwargs) - self.instance_type = 'TestFailoverJobDetails' # type: str - self.test_failover_status = kwargs.get('test_failover_status', None) - self.comments = kwargs.get('comments', None) - self.network_name = kwargs.get('network_name', None) - self.network_friendly_name = kwargs.get('network_friendly_name', None) - self.network_type = kwargs.get('network_type', None) - self.protected_item_details = kwargs.get('protected_item_details', None) - - -class TestMigrateCleanupInput(msrest.serialization.Model): - """Input for test migrate cleanup. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. Test migrate cleanup input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateCleanupInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'TestMigrateCleanupInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(TestMigrateCleanupInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class TestMigrateCleanupInputProperties(msrest.serialization.Model): - """Test migrate cleanup input properties. - - :param comments: Test migrate cleanup comments. - :type comments: str - """ - - _validation = { - 'comments': {'max_length': 1024, 'min_length': 0}, - } - - _attribute_map = { - 'comments': {'key': 'comments', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TestMigrateCleanupInputProperties, self).__init__(**kwargs) - self.comments = kwargs.get('comments', None) - - -class TestMigrateInput(msrest.serialization.Model): - """Input for test migrate. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. Test migrate input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'TestMigrateInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(TestMigrateInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class TestMigrateInputProperties(msrest.serialization.Model): - """Test migrate input properties. - - All required parameters must be populated in order to send to Azure. - - :param provider_specific_details: Required. The provider specific details. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateProviderSpecificInput - """ - - _validation = { - 'provider_specific_details': {'required': True}, - } - - _attribute_map = { - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'TestMigrateProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(TestMigrateInputProperties, self).__init__(**kwargs) - self.provider_specific_details = kwargs['provider_specific_details'] - - -class TestMigrateProviderSpecificInput(msrest.serialization.Model): - """Test migrate provider specific input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: VMwareCbtTestMigrateInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'VMwareCbt': 'VMwareCbtTestMigrateInput'} - } - - def __init__( - self, - **kwargs - ): - super(TestMigrateProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class UnplannedFailoverInput(msrest.serialization.Model): - """Input definition for unplanned failover. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. Unplanned failover input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.UnplannedFailoverInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'UnplannedFailoverInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(UnplannedFailoverInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class UnplannedFailoverInputProperties(msrest.serialization.Model): - """Input definition for unplanned failover input properties. - - :param failover_direction: Failover direction. - :type failover_direction: str - :param source_site_operations: Source site operations status. - :type source_site_operations: str - :param provider_specific_details: Provider specific settings. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.UnplannedFailoverProviderSpecificInput - """ - - _attribute_map = { - 'failover_direction': {'key': 'failoverDirection', 'type': 'str'}, - 'source_site_operations': {'key': 'sourceSiteOperations', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'UnplannedFailoverProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(UnplannedFailoverInputProperties, self).__init__(**kwargs) - self.failover_direction = kwargs.get('failover_direction', None) - self.source_site_operations = kwargs.get('source_site_operations', None) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class UpdateApplianceForReplicationProtectedItemInput(msrest.serialization.Model): - """Update appliance for replication protected item input. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. Update appliance replication protected item properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'UpdateApplianceForReplicationProtectedItemInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateApplianceForReplicationProtectedItemInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class UpdateApplianceForReplicationProtectedItemInputProperties(msrest.serialization.Model): - """Update appliance for protected item input properties. - - All required parameters must be populated in order to send to Azure. - - :param target_appliance_id: Required. The target appliance Id. - :type target_appliance_id: str - :param provider_specific_details: Required. The provider specific input to update replication - protected item. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemProviderSpecificInput - """ - - _validation = { - 'target_appliance_id': {'required': True}, - 'provider_specific_details': {'required': True}, - } - - _attribute_map = { - 'target_appliance_id': {'key': 'targetApplianceId', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'UpdateApplianceForReplicationProtectedItemProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateApplianceForReplicationProtectedItemInputProperties, self).__init__(**kwargs) - self.target_appliance_id = kwargs['target_appliance_id'] - self.provider_specific_details = kwargs['provider_specific_details'] - - -class UpdateDiskInput(msrest.serialization.Model): - """Disk input for update. - - All required parameters must be populated in order to send to Azure. - - :param disk_id: Required. The disk Id. - :type disk_id: str - :param target_disk_name: The target disk name. - :type target_disk_name: str - """ - - _validation = { - 'disk_id': {'required': True}, - } - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'target_disk_name': {'key': 'targetDiskName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateDiskInput, self).__init__(**kwargs) - self.disk_id = kwargs['disk_id'] - self.target_disk_name = kwargs.get('target_disk_name', None) - - -class UpdateMigrationItemInput(msrest.serialization.Model): - """Update migration item input. - - :param properties: Update migration item input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMigrationItemInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'UpdateMigrationItemInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateMigrationItemInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class UpdateMigrationItemInputProperties(msrest.serialization.Model): - """Update migration item input properties. - - All required parameters must be populated in order to send to Azure. - - :param provider_specific_details: Required. The provider specific input to update migration - item. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMigrationItemProviderSpecificInput - """ - - _validation = { - 'provider_specific_details': {'required': True}, - } - - _attribute_map = { - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'UpdateMigrationItemProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateMigrationItemInputProperties, self).__init__(**kwargs) - self.provider_specific_details = kwargs['provider_specific_details'] - - -class UpdateMigrationItemProviderSpecificInput(msrest.serialization.Model): - """Update migration item provider specific input. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: VMwareCbtUpdateMigrationItemInput. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - _subtype_map = { - 'instance_type': {'VMwareCbt': 'VMwareCbtUpdateMigrationItemInput'} - } - - def __init__( - self, - **kwargs - ): - super(UpdateMigrationItemProviderSpecificInput, self).__init__(**kwargs) - self.instance_type = None # type: Optional[str] - - -class UpdateMobilityServiceRequest(msrest.serialization.Model): - """Request to update the mobility service on a protected item. - - :param properties: The properties of the update mobility service request. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMobilityServiceRequestProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'UpdateMobilityServiceRequestProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateMobilityServiceRequest, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class UpdateMobilityServiceRequestProperties(msrest.serialization.Model): - """The properties of an update mobility service request. - - :param run_as_account_id: The CS run as account Id. - :type run_as_account_id: str - """ - - _attribute_map = { - 'run_as_account_id': {'key': 'runAsAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateMobilityServiceRequestProperties, self).__init__(**kwargs) - self.run_as_account_id = kwargs.get('run_as_account_id', None) - - -class UpdateNetworkMappingInput(msrest.serialization.Model): - """Update network mapping input. - - :param properties: The input properties needed to update network mapping. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.UpdateNetworkMappingInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'UpdateNetworkMappingInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateNetworkMappingInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class UpdateNetworkMappingInputProperties(msrest.serialization.Model): - """Common input details for network mapping operation. - - :param recovery_fabric_name: Recovery fabric name. - :type recovery_fabric_name: str - :param recovery_network_id: Recovery network Id. - :type recovery_network_id: str - :param fabric_specific_details: Fabrics specific input network Id. - :type fabric_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.FabricSpecificUpdateNetworkMappingInput - """ - - _attribute_map = { - 'recovery_fabric_name': {'key': 'recoveryFabricName', 'type': 'str'}, - 'recovery_network_id': {'key': 'recoveryNetworkId', 'type': 'str'}, - 'fabric_specific_details': {'key': 'fabricSpecificDetails', 'type': 'FabricSpecificUpdateNetworkMappingInput'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateNetworkMappingInputProperties, self).__init__(**kwargs) - self.recovery_fabric_name = kwargs.get('recovery_fabric_name', None) - self.recovery_network_id = kwargs.get('recovery_network_id', None) - self.fabric_specific_details = kwargs.get('fabric_specific_details', None) - - -class UpdatePolicyInput(msrest.serialization.Model): - """Update policy input. - - :param properties: The ReplicationProviderSettings. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.UpdatePolicyInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'UpdatePolicyInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdatePolicyInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class UpdatePolicyInputProperties(msrest.serialization.Model): - """Policy update properties. - - :param replication_provider_settings: The ReplicationProviderSettings. - :type replication_provider_settings: - ~azure.mgmt.recoveryservicessiterecovery.models.PolicyProviderSpecificInput - """ - - _attribute_map = { - 'replication_provider_settings': {'key': 'replicationProviderSettings', 'type': 'PolicyProviderSpecificInput'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdatePolicyInputProperties, self).__init__(**kwargs) - self.replication_provider_settings = kwargs.get('replication_provider_settings', None) - - -class UpdateProtectionContainerMappingInput(msrest.serialization.Model): - """Container pairing update input. - - :param properties: Update protection container mapping input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'UpdateProtectionContainerMappingInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateProtectionContainerMappingInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class UpdateProtectionContainerMappingInputProperties(msrest.serialization.Model): - """Container pairing update input. - - :param provider_specific_input: Provider specific input for updating protection container - mapping. - :type provider_specific_input: - ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderSpecificUpdateContainerMappingInput - """ - - _attribute_map = { - 'provider_specific_input': {'key': 'providerSpecificInput', 'type': 'ReplicationProviderSpecificUpdateContainerMappingInput'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateProtectionContainerMappingInputProperties, self).__init__(**kwargs) - self.provider_specific_input = kwargs.get('provider_specific_input', None) - - -class UpdateRecoveryPlanInput(msrest.serialization.Model): - """Update recovery plan input class. - - :param properties: Recovery plan update properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.UpdateRecoveryPlanInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'UpdateRecoveryPlanInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateRecoveryPlanInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class UpdateRecoveryPlanInputProperties(msrest.serialization.Model): - """Recovery plan update properties. - - :param groups: The recovery plan groups. - :type groups: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroup] - """ - - _attribute_map = { - 'groups': {'key': 'groups', 'type': '[RecoveryPlanGroup]'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateRecoveryPlanInputProperties, self).__init__(**kwargs) - self.groups = kwargs.get('groups', None) - - -class UpdateReplicationProtectedItemInput(msrest.serialization.Model): - """Update replication protected item input. - - :param properties: Update replication protected item properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInputProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'UpdateReplicationProtectedItemInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateReplicationProtectedItemInput, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class UpdateReplicationProtectedItemInputProperties(msrest.serialization.Model): - """Update protected item input properties. - - :param recovery_azure_vm_name: Target Azure VM name given by the user. - :type recovery_azure_vm_name: str - :param recovery_azure_vm_size: Target Azure VM size. - :type recovery_azure_vm_size: str - :param selected_recovery_azure_network_id: Target Azure Network Id. - :type selected_recovery_azure_network_id: str - :param selected_tfo_azure_network_id: The Azure Network Id for test failover. - :type selected_tfo_azure_network_id: str - :param selected_source_nic_id: The selected source nic Id which will be used as the primary nic - during failover. - :type selected_source_nic_id: str - :param enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after - failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. - :type enable_rdp_on_target_option: str - :param vm_nics: The list of VM nic details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicInputDetails] - :param license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", - "WindowsServer". - :type license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType - :param recovery_availability_set_id: The target availability set Id. - :type recovery_availability_set_id: str - :param provider_specific_details: The provider specific input to update replication protected - item. - :type provider_specific_details: - ~azure.mgmt.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemProviderInput - """ - - _attribute_map = { - 'recovery_azure_vm_name': {'key': 'recoveryAzureVMName', 'type': 'str'}, - 'recovery_azure_vm_size': {'key': 'recoveryAzureVMSize', 'type': 'str'}, - 'selected_recovery_azure_network_id': {'key': 'selectedRecoveryAzureNetworkId', 'type': 'str'}, - 'selected_tfo_azure_network_id': {'key': 'selectedTfoAzureNetworkId', 'type': 'str'}, - 'selected_source_nic_id': {'key': 'selectedSourceNicId', 'type': 'str'}, - 'enable_rdp_on_target_option': {'key': 'enableRdpOnTargetOption', 'type': 'str'}, - 'vm_nics': {'key': 'vmNics', 'type': '[VMNicInputDetails]'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'recovery_availability_set_id': {'key': 'recoveryAvailabilitySetId', 'type': 'str'}, - 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'UpdateReplicationProtectedItemProviderInput'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateReplicationProtectedItemInputProperties, self).__init__(**kwargs) - self.recovery_azure_vm_name = kwargs.get('recovery_azure_vm_name', None) - self.recovery_azure_vm_size = kwargs.get('recovery_azure_vm_size', None) - self.selected_recovery_azure_network_id = kwargs.get('selected_recovery_azure_network_id', None) - self.selected_tfo_azure_network_id = kwargs.get('selected_tfo_azure_network_id', None) - self.selected_source_nic_id = kwargs.get('selected_source_nic_id', None) - self.enable_rdp_on_target_option = kwargs.get('enable_rdp_on_target_option', None) - self.vm_nics = kwargs.get('vm_nics', None) - self.license_type = kwargs.get('license_type', None) - self.recovery_availability_set_id = kwargs.get('recovery_availability_set_id', None) - self.provider_specific_details = kwargs.get('provider_specific_details', None) - - -class UpdateVCenterRequest(msrest.serialization.Model): - """Input required to update vCenter. - - :param properties: The update VCenter Request Properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.UpdateVCenterRequestProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'UpdateVCenterRequestProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateVCenterRequest, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class UpdateVCenterRequestProperties(msrest.serialization.Model): - """The properties of an update vCenter request. - - :param friendly_name: The friendly name of the vCenter. - :type friendly_name: str - :param ip_address: The IP address of the vCenter to be discovered. - :type ip_address: str - :param process_server_id: The process server Id from where the update can be orchestrated. - :type process_server_id: str - :param port: The port number for discovery. - :type port: str - :param run_as_account_id: The CS account Id which has privileges to update the vCenter. - :type run_as_account_id: str - """ - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'process_server_id': {'key': 'processServerId', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'str'}, - 'run_as_account_id': {'key': 'runAsAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateVCenterRequestProperties, self).__init__(**kwargs) - self.friendly_name = kwargs.get('friendly_name', None) - self.ip_address = kwargs.get('ip_address', None) - self.process_server_id = kwargs.get('process_server_id', None) - self.port = kwargs.get('port', None) - self.run_as_account_id = kwargs.get('run_as_account_id', None) - - -class VaultHealthDetails(Resource): - """Vault health details definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The vault health related data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.VaultHealthProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'VaultHealthProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(VaultHealthDetails, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class VaultHealthProperties(msrest.serialization.Model): - """class to define the health summary of the Vault. - - :param vault_errors: The list of errors on the vault. - :type vault_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param protected_items_health: The list of the health detail of the protected items in the - vault. - :type protected_items_health: - ~azure.mgmt.recoveryservicessiterecovery.models.ResourceHealthSummary - :param fabrics_health: The list of the health detail of the fabrics in the vault. - :type fabrics_health: ~azure.mgmt.recoveryservicessiterecovery.models.ResourceHealthSummary - :param containers_health: The list of the health detail of the containers in the vault. - :type containers_health: ~azure.mgmt.recoveryservicessiterecovery.models.ResourceHealthSummary - """ - - _attribute_map = { - 'vault_errors': {'key': 'vaultErrors', 'type': '[HealthError]'}, - 'protected_items_health': {'key': 'protectedItemsHealth', 'type': 'ResourceHealthSummary'}, - 'fabrics_health': {'key': 'fabricsHealth', 'type': 'ResourceHealthSummary'}, - 'containers_health': {'key': 'containersHealth', 'type': 'ResourceHealthSummary'}, - } - - def __init__( - self, - **kwargs - ): - super(VaultHealthProperties, self).__init__(**kwargs) - self.vault_errors = kwargs.get('vault_errors', None) - self.protected_items_health = kwargs.get('protected_items_health', None) - self.fabrics_health = kwargs.get('fabrics_health', None) - self.containers_health = kwargs.get('containers_health', None) - - -class VaultSetting(Resource): - """Vault setting. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The vault setting properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.VaultSettingProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'VaultSettingProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(VaultSetting, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class VaultSettingCollection(msrest.serialization.Model): - """Vault setting collection. - - :param value: The list of vault setting. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.VaultSetting] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VaultSetting]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VaultSettingCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class VaultSettingCreationInput(msrest.serialization.Model): - """Input to create vault setting. - - All required parameters must be populated in order to send to Azure. - - :param properties: Required. Vault setting creation input properties. - :type properties: - ~azure.mgmt.recoveryservicessiterecovery.models.VaultSettingCreationInputProperties - """ - - _validation = { - 'properties': {'required': True}, - } - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'VaultSettingCreationInputProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(VaultSettingCreationInput, self).__init__(**kwargs) - self.properties = kwargs['properties'] - - -class VaultSettingCreationInputProperties(msrest.serialization.Model): - """Input to create vault setting. - - :param migration_solution_id: The migration solution Id. - :type migration_solution_id: str - :param vmware_to_azure_provider_type: VMware to Azure provider type. - :type vmware_to_azure_provider_type: str - """ - - _attribute_map = { - 'migration_solution_id': {'key': 'migrationSolutionId', 'type': 'str'}, - 'vmware_to_azure_provider_type': {'key': 'vmwareToAzureProviderType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VaultSettingCreationInputProperties, self).__init__(**kwargs) - self.migration_solution_id = kwargs.get('migration_solution_id', None) - self.vmware_to_azure_provider_type = kwargs.get('vmware_to_azure_provider_type', None) - - -class VaultSettingProperties(msrest.serialization.Model): - """Vault setting properties. - - :param migration_solution_id: The migration solution ARM Id. - :type migration_solution_id: str - :param vmware_to_azure_provider_type: VMware to Azure provider type. - :type vmware_to_azure_provider_type: str - """ - - _attribute_map = { - 'migration_solution_id': {'key': 'migrationSolutionId', 'type': 'str'}, - 'vmware_to_azure_provider_type': {'key': 'vmwareToAzureProviderType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VaultSettingProperties, self).__init__(**kwargs) - self.migration_solution_id = kwargs.get('migration_solution_id', None) - self.vmware_to_azure_provider_type = kwargs.get('vmware_to_azure_provider_type', None) - - -class VCenter(Resource): - """vCenter definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource Name. - :vartype name: str - :ivar type: Resource Type. - :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: VCenter related data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.VCenterProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'VCenterProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(VCenter, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) - - -class VCenterCollection(msrest.serialization.Model): - """Collection of vCenter details. - - :param value: The vCenter details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.VCenter] - :param next_link: The value of next link. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VCenter]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VCenterCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class VCenterProperties(msrest.serialization.Model): - """vCenter properties. - - :param friendly_name: Friendly name of the vCenter. - :type friendly_name: str - :param internal_id: VCenter internal ID. - :type internal_id: str - :param last_heartbeat: The time when the last heartbeat was received by vCenter. - :type last_heartbeat: ~datetime.datetime - :param discovery_status: The VCenter discovery status. - :type discovery_status: str - :param process_server_id: The process server Id. - :type process_server_id: str - :param ip_address: The IP address of the vCenter. - :type ip_address: str - :param infrastructure_id: The infrastructure Id of vCenter. - :type infrastructure_id: str - :param port: The port number for discovery. - :type port: str - :param run_as_account_id: The account Id which has privileges to discover the vCenter. - :type run_as_account_id: str - :param fabric_arm_resource_name: The ARM resource name of the fabric containing this VCenter. - :type fabric_arm_resource_name: str - :param health_errors: The health errors for this VCenter. - :type health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - """ - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'internal_id': {'key': 'internalId', 'type': 'str'}, - 'last_heartbeat': {'key': 'lastHeartbeat', 'type': 'iso-8601'}, - 'discovery_status': {'key': 'discoveryStatus', 'type': 'str'}, - 'process_server_id': {'key': 'processServerId', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'infrastructure_id': {'key': 'infrastructureId', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'str'}, - 'run_as_account_id': {'key': 'runAsAccountId', 'type': 'str'}, - 'fabric_arm_resource_name': {'key': 'fabricArmResourceName', 'type': 'str'}, - 'health_errors': {'key': 'healthErrors', 'type': '[HealthError]'}, - } - - def __init__( - self, - **kwargs - ): - super(VCenterProperties, self).__init__(**kwargs) - self.friendly_name = kwargs.get('friendly_name', None) - self.internal_id = kwargs.get('internal_id', None) - self.last_heartbeat = kwargs.get('last_heartbeat', None) - self.discovery_status = kwargs.get('discovery_status', None) - self.process_server_id = kwargs.get('process_server_id', None) - self.ip_address = kwargs.get('ip_address', None) - self.infrastructure_id = kwargs.get('infrastructure_id', None) - self.port = kwargs.get('port', None) - self.run_as_account_id = kwargs.get('run_as_account_id', None) - self.fabric_arm_resource_name = kwargs.get('fabric_arm_resource_name', None) - self.health_errors = kwargs.get('health_errors', None) - - -class VersionDetails(msrest.serialization.Model): - """Version related details. - - :param version: The agent version. - :type version: str - :param expiry_date: Version expiry date. - :type expiry_date: ~datetime.datetime - :param status: A value indicating whether security update required. Possible values include: - "Supported", "NotSupported", "Deprecated", "UpdateRequired", "SecurityUpdateRequired". - :type status: str or ~azure.mgmt.recoveryservicessiterecovery.models.AgentVersionStatus - """ - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'expiry_date': {'key': 'expiryDate', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VersionDetails, self).__init__(**kwargs) - self.version = kwargs.get('version', None) - self.expiry_date = kwargs.get('expiry_date', None) - self.status = kwargs.get('status', None) - - -class VirtualMachineTaskDetails(JobTaskDetails): - """This class represents the virtual machine task details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param job_task: The job entity. - :type job_task: ~azure.mgmt.recoveryservicessiterecovery.models.JobEntity - :param skipped_reason: The skipped reason. - :type skipped_reason: str - :param skipped_reason_string: The skipped reason string. - :type skipped_reason_string: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'job_task': {'key': 'jobTask', 'type': 'JobEntity'}, - 'skipped_reason': {'key': 'skippedReason', 'type': 'str'}, - 'skipped_reason_string': {'key': 'skippedReasonString', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualMachineTaskDetails, self).__init__(**kwargs) - self.instance_type = 'VirtualMachineTaskDetails' # type: str - self.skipped_reason = kwargs.get('skipped_reason', None) - self.skipped_reason_string = kwargs.get('skipped_reason_string', None) - - -class VmmDetails(FabricSpecificDetails): - """VMM fabric specific details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VmmDetails, self).__init__(**kwargs) - self.instance_type = 'VMM' # type: str - - -class VmmToAzureCreateNetworkMappingInput(FabricSpecificCreateNetworkMappingInput): - """Create network mappings input properties/behavior specific to Vmm to Azure Network mapping. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VmmToAzureCreateNetworkMappingInput, self).__init__(**kwargs) - self.instance_type = 'VmmToAzure' # type: str - - -class VmmToAzureNetworkMappingSettings(NetworkMappingFabricSpecificSettings): - """E2A Network Mapping fabric specific settings. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VmmToAzureNetworkMappingSettings, self).__init__(**kwargs) - self.instance_type = 'VmmToAzure' # type: str - - -class VmmToAzureUpdateNetworkMappingInput(FabricSpecificUpdateNetworkMappingInput): - """Update network mappings input properties/behavior specific to vmm to azure. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VmmToAzureUpdateNetworkMappingInput, self).__init__(**kwargs) - self.instance_type = 'VmmToAzure' # type: str - - -class VmmToVmmCreateNetworkMappingInput(FabricSpecificCreateNetworkMappingInput): - """Create network mappings input properties/behavior specific to vmm to vmm Network mapping. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VmmToVmmCreateNetworkMappingInput, self).__init__(**kwargs) - self.instance_type = 'VmmToVmm' # type: str - - -class VmmToVmmNetworkMappingSettings(NetworkMappingFabricSpecificSettings): - """E2E Network Mapping fabric specific settings. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VmmToVmmNetworkMappingSettings, self).__init__(**kwargs) - self.instance_type = 'VmmToVmm' # type: str - - -class VmmToVmmUpdateNetworkMappingInput(FabricSpecificUpdateNetworkMappingInput): - """Update network mappings input properties/behavior specific to vmm to vmm. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VmmToVmmUpdateNetworkMappingInput, self).__init__(**kwargs) - self.instance_type = 'VmmToVmm' # type: str - - -class VmmVirtualMachineDetails(HyperVVirtualMachineDetails): - """VMM fabric provider specific VM settings. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param source_item_id: The source id of the object. - :type source_item_id: str - :param generation: The id of the object in fabric. - :type generation: str - :param os_details: The Last replication time. - :type os_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDetails - :param disk_details: The Last successful failover time. - :type disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] - :param has_physical_disk: A value indicating whether the VM has a physical disk attached. - String value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", - "Present", "NotPresent". - :type has_physical_disk: str or ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus - :param has_fibre_channel_adapter: A value indicating whether the VM has a fibre channel adapter - attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: - "Unknown", "Present", "NotPresent". - :type has_fibre_channel_adapter: str or - ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus - :param has_shared_vhd: A value indicating whether the VM has a shared VHD attached. String - value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", "Present", - "NotPresent". - :type has_shared_vhd: str or ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'source_item_id': {'key': 'sourceItemId', 'type': 'str'}, - 'generation': {'key': 'generation', 'type': 'str'}, - 'os_details': {'key': 'osDetails', 'type': 'OSDetails'}, - 'disk_details': {'key': 'diskDetails', 'type': '[DiskDetails]'}, - 'has_physical_disk': {'key': 'hasPhysicalDisk', 'type': 'str'}, - 'has_fibre_channel_adapter': {'key': 'hasFibreChannelAdapter', 'type': 'str'}, - 'has_shared_vhd': {'key': 'hasSharedVhd', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VmmVirtualMachineDetails, self).__init__(**kwargs) - self.instance_type = 'VmmVirtualMachine' # type: str - - -class VMNicDetails(msrest.serialization.Model): - """Hyper V VM network details. - - :param nic_id: The nic Id. - :type nic_id: str - :param replica_nic_id: The replica nic Id. - :type replica_nic_id: str - :param source_nic_arm_id: The source nic ARM Id. - :type source_nic_arm_id: str - :param v_m_network_name: VM network name. - :type v_m_network_name: str - :param recovery_vm_network_id: Recovery VM network Id. - :type recovery_vm_network_id: str - :param ip_configs: The IP configurations of the NIC. - :type ip_configs: list[~azure.mgmt.recoveryservicessiterecovery.models.IPConfigDetails] - :param selection_type: Selection type for failover. - :type selection_type: str - :param recovery_network_security_group_id: The id of the NSG associated with the NIC. - :type recovery_network_security_group_id: str - :param enable_accelerated_networking_on_recovery: A value indicating whether the NIC has - accelerated networking enabled. - :type enable_accelerated_networking_on_recovery: bool - :param tfo_vm_network_id: The network to be used by NIC during test failover. - :type tfo_vm_network_id: str - :param tfo_network_security_group_id: The NSG to be used by NIC during test failover. - :type tfo_network_security_group_id: str - :param enable_accelerated_networking_on_tfo: Whether the TFO NIC has accelerated networking - enabled. - :type enable_accelerated_networking_on_tfo: bool - :param recovery_nic_name: The name of the NIC to be used when creating target NICs. - :type recovery_nic_name: str - :param recovery_nic_resource_group_name: The resource group of the NIC to be used when creating - target NICs. - :type recovery_nic_resource_group_name: str - :param reuse_existing_nic: A value indicating whether an existing NIC is allowed to be reused - during failover subject to availability. - :type reuse_existing_nic: bool - :param tfo_recovery_nic_name: The name of the NIC to be used when creating target NICs in TFO. - :type tfo_recovery_nic_name: str - :param tfo_recovery_nic_resource_group_name: The resource group of the NIC to be used when - creating target NICs in TFO. - :type tfo_recovery_nic_resource_group_name: str - :param tfo_reuse_existing_nic: A value indicating whether an existing NIC is allowed to be - reused during test failover subject to availability. - :type tfo_reuse_existing_nic: bool - :param target_nic_name: Target NIC name. - :type target_nic_name: str - """ - - _attribute_map = { - 'nic_id': {'key': 'nicId', 'type': 'str'}, - 'replica_nic_id': {'key': 'replicaNicId', 'type': 'str'}, - 'source_nic_arm_id': {'key': 'sourceNicArmId', 'type': 'str'}, - 'v_m_network_name': {'key': 'vMNetworkName', 'type': 'str'}, - 'recovery_vm_network_id': {'key': 'recoveryVMNetworkId', 'type': 'str'}, - 'ip_configs': {'key': 'ipConfigs', 'type': '[IPConfigDetails]'}, - 'selection_type': {'key': 'selectionType', 'type': 'str'}, - 'recovery_network_security_group_id': {'key': 'recoveryNetworkSecurityGroupId', 'type': 'str'}, - 'enable_accelerated_networking_on_recovery': {'key': 'enableAcceleratedNetworkingOnRecovery', 'type': 'bool'}, - 'tfo_vm_network_id': {'key': 'tfoVMNetworkId', 'type': 'str'}, - 'tfo_network_security_group_id': {'key': 'tfoNetworkSecurityGroupId', 'type': 'str'}, - 'enable_accelerated_networking_on_tfo': {'key': 'enableAcceleratedNetworkingOnTfo', 'type': 'bool'}, - 'recovery_nic_name': {'key': 'recoveryNicName', 'type': 'str'}, - 'recovery_nic_resource_group_name': {'key': 'recoveryNicResourceGroupName', 'type': 'str'}, - 'reuse_existing_nic': {'key': 'reuseExistingNic', 'type': 'bool'}, - 'tfo_recovery_nic_name': {'key': 'tfoRecoveryNicName', 'type': 'str'}, - 'tfo_recovery_nic_resource_group_name': {'key': 'tfoRecoveryNicResourceGroupName', 'type': 'str'}, - 'tfo_reuse_existing_nic': {'key': 'tfoReuseExistingNic', 'type': 'bool'}, - 'target_nic_name': {'key': 'targetNicName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMNicDetails, self).__init__(**kwargs) - self.nic_id = kwargs.get('nic_id', None) - self.replica_nic_id = kwargs.get('replica_nic_id', None) - self.source_nic_arm_id = kwargs.get('source_nic_arm_id', None) - self.v_m_network_name = kwargs.get('v_m_network_name', None) - self.recovery_vm_network_id = kwargs.get('recovery_vm_network_id', None) - self.ip_configs = kwargs.get('ip_configs', None) - self.selection_type = kwargs.get('selection_type', None) - self.recovery_network_security_group_id = kwargs.get('recovery_network_security_group_id', None) - self.enable_accelerated_networking_on_recovery = kwargs.get('enable_accelerated_networking_on_recovery', None) - self.tfo_vm_network_id = kwargs.get('tfo_vm_network_id', None) - self.tfo_network_security_group_id = kwargs.get('tfo_network_security_group_id', None) - self.enable_accelerated_networking_on_tfo = kwargs.get('enable_accelerated_networking_on_tfo', None) - self.recovery_nic_name = kwargs.get('recovery_nic_name', None) - self.recovery_nic_resource_group_name = kwargs.get('recovery_nic_resource_group_name', None) - self.reuse_existing_nic = kwargs.get('reuse_existing_nic', False) - self.tfo_recovery_nic_name = kwargs.get('tfo_recovery_nic_name', None) - self.tfo_recovery_nic_resource_group_name = kwargs.get('tfo_recovery_nic_resource_group_name', None) - self.tfo_reuse_existing_nic = kwargs.get('tfo_reuse_existing_nic', False) - self.target_nic_name = kwargs.get('target_nic_name', None) - - -class VMNicInputDetails(msrest.serialization.Model): - """Hyper V VM network input details. - - :param nic_id: The nic Id. - :type nic_id: str - :param ip_configs: The IP configurations to be used by NIC during test failover and failover. - :type ip_configs: list[~azure.mgmt.recoveryservicessiterecovery.models.IPConfigInputDetails] - :param selection_type: Selection type for failover. - :type selection_type: str - :param recovery_network_security_group_id: The id of the NSG associated with the NIC. - :type recovery_network_security_group_id: str - :param enable_accelerated_networking_on_recovery: Whether the NIC has accelerated networking - enabled. - :type enable_accelerated_networking_on_recovery: bool - :param tfo_network_security_group_id: The NSG to be used by NIC during test failover. - :type tfo_network_security_group_id: str - :param enable_accelerated_networking_on_tfo: Whether the test NIC has accelerated networking - enabled. - :type enable_accelerated_networking_on_tfo: bool - :param recovery_nic_name: The name of the NIC to be used when creating target NICs. - :type recovery_nic_name: str - :param recovery_nic_resource_group_name: The resource group of the NIC to be used when creating - target NICs. - :type recovery_nic_resource_group_name: str - :param reuse_existing_nic: A value indicating whether an existing NIC is allowed to be reused - during failover subject to availability. - :type reuse_existing_nic: bool - :param tfo_nic_name: The name of the NIC to be used when creating target NICs in TFO. - :type tfo_nic_name: str - :param tfo_nic_resource_group_name: The resource group of the NIC to be used when creating - target NICs in TFO. - :type tfo_nic_resource_group_name: str - :param tfo_reuse_existing_nic: A value indicating whether an existing NIC is allowed to be - reused during test failover subject to availability. - :type tfo_reuse_existing_nic: bool - :param target_nic_name: Target NIC name. - :type target_nic_name: str - """ - - _attribute_map = { - 'nic_id': {'key': 'nicId', 'type': 'str'}, - 'ip_configs': {'key': 'ipConfigs', 'type': '[IPConfigInputDetails]'}, - 'selection_type': {'key': 'selectionType', 'type': 'str'}, - 'recovery_network_security_group_id': {'key': 'recoveryNetworkSecurityGroupId', 'type': 'str'}, - 'enable_accelerated_networking_on_recovery': {'key': 'enableAcceleratedNetworkingOnRecovery', 'type': 'bool'}, - 'tfo_network_security_group_id': {'key': 'tfoNetworkSecurityGroupId', 'type': 'str'}, - 'enable_accelerated_networking_on_tfo': {'key': 'enableAcceleratedNetworkingOnTfo', 'type': 'bool'}, - 'recovery_nic_name': {'key': 'recoveryNicName', 'type': 'str'}, - 'recovery_nic_resource_group_name': {'key': 'recoveryNicResourceGroupName', 'type': 'str'}, - 'reuse_existing_nic': {'key': 'reuseExistingNic', 'type': 'bool'}, - 'tfo_nic_name': {'key': 'tfoNicName', 'type': 'str'}, - 'tfo_nic_resource_group_name': {'key': 'tfoNicResourceGroupName', 'type': 'str'}, - 'tfo_reuse_existing_nic': {'key': 'tfoReuseExistingNic', 'type': 'bool'}, - 'target_nic_name': {'key': 'targetNicName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMNicInputDetails, self).__init__(**kwargs) - self.nic_id = kwargs.get('nic_id', None) - self.ip_configs = kwargs.get('ip_configs', None) - self.selection_type = kwargs.get('selection_type', None) - self.recovery_network_security_group_id = kwargs.get('recovery_network_security_group_id', None) - self.enable_accelerated_networking_on_recovery = kwargs.get('enable_accelerated_networking_on_recovery', None) - self.tfo_network_security_group_id = kwargs.get('tfo_network_security_group_id', None) - self.enable_accelerated_networking_on_tfo = kwargs.get('enable_accelerated_networking_on_tfo', None) - self.recovery_nic_name = kwargs.get('recovery_nic_name', None) - self.recovery_nic_resource_group_name = kwargs.get('recovery_nic_resource_group_name', None) - self.reuse_existing_nic = kwargs.get('reuse_existing_nic', None) - self.tfo_nic_name = kwargs.get('tfo_nic_name', None) - self.tfo_nic_resource_group_name = kwargs.get('tfo_nic_resource_group_name', None) - self.tfo_reuse_existing_nic = kwargs.get('tfo_reuse_existing_nic', None) - self.target_nic_name = kwargs.get('target_nic_name', None) - - -class VmNicUpdatesTaskDetails(TaskTypeDetails): - """This class represents the vm NicUpdates task details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param vm_id: Virtual machine Id. - :type vm_id: str - :param nic_id: Nic Id. - :type nic_id: str - :param name: Name of the Nic. - :type name: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'vm_id': {'key': 'vmId', 'type': 'str'}, - 'nic_id': {'key': 'nicId', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VmNicUpdatesTaskDetails, self).__init__(**kwargs) - self.instance_type = 'VmNicUpdatesTaskDetails' # type: str - self.vm_id = kwargs.get('vm_id', None) - self.nic_id = kwargs.get('nic_id', None) - self.name = kwargs.get('name', None) - - -class VMwareCbtContainerCreationInput(ReplicationProviderSpecificContainerCreationInput): - """VMwareCbt container creation input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtContainerCreationInput, self).__init__(**kwargs) - self.instance_type = 'VMwareCbt' # type: str - - -class VMwareCbtContainerMappingInput(ReplicationProviderSpecificContainerMappingInput): - """VMwareCbt container mapping input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param key_vault_id: Required. The target key vault ARM Id. - :type key_vault_id: str - :param key_vault_uri: Required. The target key vault URL. - :type key_vault_uri: str - :param storage_account_id: Required. The storage account ARM Id. - :type storage_account_id: str - :param storage_account_sas_secret_name: Required. The secret name of the storage account. - :type storage_account_sas_secret_name: str - :param service_bus_connection_string_secret_name: Required. The secret name of the service bus - connection string. - :type service_bus_connection_string_secret_name: str - :param target_location: Required. The target location. - :type target_location: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'key_vault_id': {'required': True}, - 'key_vault_uri': {'required': True}, - 'storage_account_id': {'required': True}, - 'storage_account_sas_secret_name': {'required': True}, - 'service_bus_connection_string_secret_name': {'required': True}, - 'target_location': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, - 'storage_account_sas_secret_name': {'key': 'storageAccountSasSecretName', 'type': 'str'}, - 'service_bus_connection_string_secret_name': {'key': 'serviceBusConnectionStringSecretName', 'type': 'str'}, - 'target_location': {'key': 'targetLocation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtContainerMappingInput, self).__init__(**kwargs) - self.instance_type = 'VMwareCbt' # type: str - self.key_vault_id = kwargs['key_vault_id'] - self.key_vault_uri = kwargs['key_vault_uri'] - self.storage_account_id = kwargs['storage_account_id'] - self.storage_account_sas_secret_name = kwargs['storage_account_sas_secret_name'] - self.service_bus_connection_string_secret_name = kwargs['service_bus_connection_string_secret_name'] - self.target_location = kwargs['target_location'] - - -class VMwareCbtDiskInput(msrest.serialization.Model): - """VMwareCbt disk input. - - All required parameters must be populated in order to send to Azure. - - :param disk_id: Required. The disk Id. - :type disk_id: str - :param disk_type: The disk type. Possible values include: "Standard_LRS", "Premium_LRS", - "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :param is_os_disk: Required. A value indicating whether the disk is the OS disk. - :type is_os_disk: str - :param log_storage_account_id: Required. The log storage account ARM Id. - :type log_storage_account_id: str - :param log_storage_account_sas_secret_name: Required. The key vault secret name of the log - storage account. - :type log_storage_account_sas_secret_name: str - :param disk_encryption_set_id: The DiskEncryptionSet ARM Id. - :type disk_encryption_set_id: str - """ - - _validation = { - 'disk_id': {'required': True}, - 'is_os_disk': {'required': True}, - 'log_storage_account_id': {'required': True}, - 'log_storage_account_sas_secret_name': {'required': True}, - } - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'disk_type': {'key': 'diskType', 'type': 'str'}, - 'is_os_disk': {'key': 'isOSDisk', 'type': 'str'}, - 'log_storage_account_id': {'key': 'logStorageAccountId', 'type': 'str'}, - 'log_storage_account_sas_secret_name': {'key': 'logStorageAccountSasSecretName', 'type': 'str'}, - 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtDiskInput, self).__init__(**kwargs) - self.disk_id = kwargs['disk_id'] - self.disk_type = kwargs.get('disk_type', None) - self.is_os_disk = kwargs['is_os_disk'] - self.log_storage_account_id = kwargs['log_storage_account_id'] - self.log_storage_account_sas_secret_name = kwargs['log_storage_account_sas_secret_name'] - self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) - - -class VMwareCbtEnableMigrationInput(EnableMigrationProviderSpecificInput): - """VMwareCbt specific enable migration input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param vmware_machine_id: Required. The ARM Id of the VM discovered in VMware. - :type vmware_machine_id: str - :param disks_to_include: Required. The disks to include list. - :type disks_to_include: - list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtDiskInput] - :param license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", - "WindowsServer". - :type license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType - :param sql_server_license_type: The SQL Server license type. Possible values include: - "NotSpecified", "NoLicenseType", "PAYG", "AHUB". - :type sql_server_license_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType - :param data_mover_run_as_account_id: Required. The data mover run as account Id. - :type data_mover_run_as_account_id: str - :param snapshot_run_as_account_id: Required. The snapshot run as account Id. - :type snapshot_run_as_account_id: str - :param target_vm_name: The target VM name. - :type target_vm_name: str - :param target_vm_size: The target VM size. - :type target_vm_size: str - :param target_resource_group_id: Required. The target resource group ARM Id. - :type target_resource_group_id: str - :param target_network_id: Required. The target network ARM Id. - :type target_network_id: str - :param target_subnet_name: The target subnet name. - :type target_subnet_name: str - :param target_availability_set_id: The target availability set ARM Id. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group ARM Id. - :type target_proximity_placement_group_id: str - :param target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account - ARM Id. - :type target_boot_diagnostics_storage_account_id: str - :param perform_auto_resync: A value indicating whether auto resync is to be done. - :type perform_auto_resync: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param seed_disk_tags: The tags for the seed disks. - :type seed_disk_tags: dict[str, str] - :param target_disk_tags: The tags for the target disks. - :type target_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] - """ - - _validation = { - 'instance_type': {'required': True}, - 'vmware_machine_id': {'required': True}, - 'disks_to_include': {'required': True}, - 'data_mover_run_as_account_id': {'required': True}, - 'snapshot_run_as_account_id': {'required': True}, - 'target_resource_group_id': {'required': True}, - 'target_network_id': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'vmware_machine_id': {'key': 'vmwareMachineId', 'type': 'str'}, - 'disks_to_include': {'key': 'disksToInclude', 'type': '[VMwareCbtDiskInput]'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'sql_server_license_type': {'key': 'sqlServerLicenseType', 'type': 'str'}, - 'data_mover_run_as_account_id': {'key': 'dataMoverRunAsAccountId', 'type': 'str'}, - 'snapshot_run_as_account_id': {'key': 'snapshotRunAsAccountId', 'type': 'str'}, - 'target_vm_name': {'key': 'targetVmName', 'type': 'str'}, - 'target_vm_size': {'key': 'targetVmSize', 'type': 'str'}, - 'target_resource_group_id': {'key': 'targetResourceGroupId', 'type': 'str'}, - 'target_network_id': {'key': 'targetNetworkId', 'type': 'str'}, - 'target_subnet_name': {'key': 'targetSubnetName', 'type': 'str'}, - 'target_availability_set_id': {'key': 'targetAvailabilitySetId', 'type': 'str'}, - 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, - 'target_proximity_placement_group_id': {'key': 'targetProximityPlacementGroupId', 'type': 'str'}, - 'target_boot_diagnostics_storage_account_id': {'key': 'targetBootDiagnosticsStorageAccountId', 'type': 'str'}, - 'perform_auto_resync': {'key': 'performAutoResync', 'type': 'str'}, - 'target_vm_tags': {'key': 'targetVmTags', 'type': '{str}'}, - 'seed_disk_tags': {'key': 'seedDiskTags', 'type': '{str}'}, - 'target_disk_tags': {'key': 'targetDiskTags', 'type': '{str}'}, - 'target_nic_tags': {'key': 'targetNicTags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtEnableMigrationInput, self).__init__(**kwargs) - self.instance_type = 'VMwareCbt' # type: str - self.vmware_machine_id = kwargs['vmware_machine_id'] - self.disks_to_include = kwargs['disks_to_include'] - self.license_type = kwargs.get('license_type', None) - self.sql_server_license_type = kwargs.get('sql_server_license_type', None) - self.data_mover_run_as_account_id = kwargs['data_mover_run_as_account_id'] - self.snapshot_run_as_account_id = kwargs['snapshot_run_as_account_id'] - self.target_vm_name = kwargs.get('target_vm_name', None) - self.target_vm_size = kwargs.get('target_vm_size', None) - self.target_resource_group_id = kwargs['target_resource_group_id'] - self.target_network_id = kwargs['target_network_id'] - self.target_subnet_name = kwargs.get('target_subnet_name', None) - self.target_availability_set_id = kwargs.get('target_availability_set_id', None) - self.target_availability_zone = kwargs.get('target_availability_zone', None) - self.target_proximity_placement_group_id = kwargs.get('target_proximity_placement_group_id', None) - self.target_boot_diagnostics_storage_account_id = kwargs.get('target_boot_diagnostics_storage_account_id', None) - self.perform_auto_resync = kwargs.get('perform_auto_resync', None) - self.target_vm_tags = kwargs.get('target_vm_tags', None) - self.seed_disk_tags = kwargs.get('seed_disk_tags', None) - self.target_disk_tags = kwargs.get('target_disk_tags', None) - self.target_nic_tags = kwargs.get('target_nic_tags', None) - - -class VMwareCbtEventDetails(EventProviderSpecificDetails): - """Event details for VMwareCbt provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :ivar migration_item_name: The migration item name. - :vartype migration_item_name: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'migration_item_name': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'migration_item_name': {'key': 'migrationItemName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtEventDetails, self).__init__(**kwargs) - self.instance_type = 'VMwareCbt' # type: str - self.migration_item_name = None - - -class VMwareCbtMigrateInput(MigrateProviderSpecificInput): - """VMwareCbt specific migrate input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param perform_shutdown: Required. A value indicating whether VM is to be shutdown. - :type perform_shutdown: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'perform_shutdown': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'perform_shutdown': {'key': 'performShutdown', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtMigrateInput, self).__init__(**kwargs) - self.instance_type = 'VMwareCbt' # type: str - self.perform_shutdown = kwargs['perform_shutdown'] - - -class VMwareCbtMigrationDetails(MigrationProviderSpecificSettings): - """VMwareCbt provider specific settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the instance type.Constant filled by server. - :type instance_type: str - :ivar vmware_machine_id: The ARM Id of the VM discovered in VMware. - :vartype vmware_machine_id: str - :ivar os_type: The type of the OS on the VM. - :vartype os_type: str - :ivar firmware_type: The firmware type. - :vartype firmware_type: str - :ivar target_generation: The target generation. - :vartype target_generation: str - :param license_type: License Type of the VM to be used. - :type license_type: str - :param sql_server_license_type: The SQL Server license type. - :type sql_server_license_type: str - :ivar data_mover_run_as_account_id: The data mover run as account Id. - :vartype data_mover_run_as_account_id: str - :ivar snapshot_run_as_account_id: The snapshot run as account Id. - :vartype snapshot_run_as_account_id: str - :param target_vm_name: Target VM name. - :type target_vm_name: str - :param target_vm_size: The target VM size. - :type target_vm_size: str - :ivar target_location: The target location. - :vartype target_location: str - :param target_resource_group_id: The target resource group Id. - :type target_resource_group_id: str - :param target_availability_set_id: The target availability set Id. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account - ARM Id. - :type target_boot_diagnostics_storage_account_id: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param protected_disks: The list of protected disks. - :type protected_disks: - list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtProtectedDiskDetails] - :param target_network_id: The target network Id. - :type target_network_id: str - :param vm_nics: The network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtNicDetails] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] - :ivar migration_recovery_point_id: The recovery point Id to which the VM was migrated. - :vartype migration_recovery_point_id: str - :ivar last_recovery_point_received: The last recovery point received time. - :vartype last_recovery_point_received: ~datetime.datetime - :ivar last_recovery_point_id: The last recovery point Id. - :vartype last_recovery_point_id: str - :ivar initial_seeding_progress_percentage: The initial seeding progress percentage. - :vartype initial_seeding_progress_percentage: int - :ivar migration_progress_percentage: The migration progress percentage. - :vartype migration_progress_percentage: int - :ivar resync_progress_percentage: The resync progress percentage. - :vartype resync_progress_percentage: int - :ivar initial_seeding_retry_count: The initial seeding retry count. - :vartype initial_seeding_retry_count: long - :ivar resync_retry_count: The resync retry count. - :vartype resync_retry_count: long - :ivar resync_required: A value indicating whether resync is required. - :vartype resync_required: str - :ivar resync_state: The resync state. Possible values include: "None", - "PreparedForResynchronization", "StartedResynchronization". - :vartype resync_state: str or ~azure.mgmt.recoveryservicessiterecovery.models.ResyncState - :param perform_auto_resync: A value indicating whether auto resync is to be done. - :type perform_auto_resync: str - :param seed_disk_tags: The tags for the seed disks. - :type seed_disk_tags: dict[str, str] - :param target_disk_tags: The tags for the target disks. - :type target_disk_tags: dict[str, str] - """ - - _validation = { - 'instance_type': {'required': True}, - 'vmware_machine_id': {'readonly': True}, - 'os_type': {'readonly': True}, - 'firmware_type': {'readonly': True}, - 'target_generation': {'readonly': True}, - 'data_mover_run_as_account_id': {'readonly': True}, - 'snapshot_run_as_account_id': {'readonly': True}, - 'target_location': {'readonly': True}, - 'migration_recovery_point_id': {'readonly': True}, - 'last_recovery_point_received': {'readonly': True}, - 'last_recovery_point_id': {'readonly': True}, - 'initial_seeding_progress_percentage': {'readonly': True}, - 'migration_progress_percentage': {'readonly': True}, - 'resync_progress_percentage': {'readonly': True}, - 'initial_seeding_retry_count': {'readonly': True}, - 'resync_retry_count': {'readonly': True}, - 'resync_required': {'readonly': True}, - 'resync_state': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'vmware_machine_id': {'key': 'vmwareMachineId', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'firmware_type': {'key': 'firmwareType', 'type': 'str'}, - 'target_generation': {'key': 'targetGeneration', 'type': 'str'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'sql_server_license_type': {'key': 'sqlServerLicenseType', 'type': 'str'}, - 'data_mover_run_as_account_id': {'key': 'dataMoverRunAsAccountId', 'type': 'str'}, - 'snapshot_run_as_account_id': {'key': 'snapshotRunAsAccountId', 'type': 'str'}, - 'target_vm_name': {'key': 'targetVmName', 'type': 'str'}, - 'target_vm_size': {'key': 'targetVmSize', 'type': 'str'}, - 'target_location': {'key': 'targetLocation', 'type': 'str'}, - 'target_resource_group_id': {'key': 'targetResourceGroupId', 'type': 'str'}, - 'target_availability_set_id': {'key': 'targetAvailabilitySetId', 'type': 'str'}, - 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, - 'target_proximity_placement_group_id': {'key': 'targetProximityPlacementGroupId', 'type': 'str'}, - 'target_boot_diagnostics_storage_account_id': {'key': 'targetBootDiagnosticsStorageAccountId', 'type': 'str'}, - 'target_vm_tags': {'key': 'targetVmTags', 'type': '{str}'}, - 'protected_disks': {'key': 'protectedDisks', 'type': '[VMwareCbtProtectedDiskDetails]'}, - 'target_network_id': {'key': 'targetNetworkId', 'type': 'str'}, - 'vm_nics': {'key': 'vmNics', 'type': '[VMwareCbtNicDetails]'}, - 'target_nic_tags': {'key': 'targetNicTags', 'type': '{str}'}, - 'migration_recovery_point_id': {'key': 'migrationRecoveryPointId', 'type': 'str'}, - 'last_recovery_point_received': {'key': 'lastRecoveryPointReceived', 'type': 'iso-8601'}, - 'last_recovery_point_id': {'key': 'lastRecoveryPointId', 'type': 'str'}, - 'initial_seeding_progress_percentage': {'key': 'initialSeedingProgressPercentage', 'type': 'int'}, - 'migration_progress_percentage': {'key': 'migrationProgressPercentage', 'type': 'int'}, - 'resync_progress_percentage': {'key': 'resyncProgressPercentage', 'type': 'int'}, - 'initial_seeding_retry_count': {'key': 'initialSeedingRetryCount', 'type': 'long'}, - 'resync_retry_count': {'key': 'resyncRetryCount', 'type': 'long'}, - 'resync_required': {'key': 'resyncRequired', 'type': 'str'}, - 'resync_state': {'key': 'resyncState', 'type': 'str'}, - 'perform_auto_resync': {'key': 'performAutoResync', 'type': 'str'}, - 'seed_disk_tags': {'key': 'seedDiskTags', 'type': '{str}'}, - 'target_disk_tags': {'key': 'targetDiskTags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtMigrationDetails, self).__init__(**kwargs) - self.instance_type = 'VMwareCbt' # type: str - self.vmware_machine_id = None - self.os_type = None - self.firmware_type = None - self.target_generation = None - self.license_type = kwargs.get('license_type', None) - self.sql_server_license_type = kwargs.get('sql_server_license_type', None) - self.data_mover_run_as_account_id = None - self.snapshot_run_as_account_id = None - self.target_vm_name = kwargs.get('target_vm_name', None) - self.target_vm_size = kwargs.get('target_vm_size', None) - self.target_location = None - self.target_resource_group_id = kwargs.get('target_resource_group_id', None) - self.target_availability_set_id = kwargs.get('target_availability_set_id', None) - self.target_availability_zone = kwargs.get('target_availability_zone', None) - self.target_proximity_placement_group_id = kwargs.get('target_proximity_placement_group_id', None) - self.target_boot_diagnostics_storage_account_id = kwargs.get('target_boot_diagnostics_storage_account_id', None) - self.target_vm_tags = kwargs.get('target_vm_tags', None) - self.protected_disks = kwargs.get('protected_disks', None) - self.target_network_id = kwargs.get('target_network_id', None) - self.vm_nics = kwargs.get('vm_nics', None) - self.target_nic_tags = kwargs.get('target_nic_tags', None) - self.migration_recovery_point_id = None - self.last_recovery_point_received = None - self.last_recovery_point_id = None - self.initial_seeding_progress_percentage = None - self.migration_progress_percentage = None - self.resync_progress_percentage = None - self.initial_seeding_retry_count = None - self.resync_retry_count = None - self.resync_required = None - self.resync_state = None - self.perform_auto_resync = kwargs.get('perform_auto_resync', None) - self.seed_disk_tags = kwargs.get('seed_disk_tags', None) - self.target_disk_tags = kwargs.get('target_disk_tags', None) - - -class VMwareCbtNicDetails(msrest.serialization.Model): - """VMwareCbt NIC details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nic_id: The NIC Id. - :vartype nic_id: str - :param is_primary_nic: A value indicating whether this is the primary NIC. - :type is_primary_nic: str - :ivar source_ip_address: The source IP address. - :vartype source_ip_address: str - :ivar source_ip_address_type: The source IP address type. Possible values include: "Dynamic", - "Static". - :vartype source_ip_address_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.EthernetAddressType - :ivar source_network_id: Source network Id. - :vartype source_network_id: str - :param target_ip_address: The target IP address. - :type target_ip_address: str - :param target_ip_address_type: The target IP address type. Possible values include: "Dynamic", - "Static". - :type target_ip_address_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.EthernetAddressType - :param target_subnet_name: Target subnet name. - :type target_subnet_name: str - :param target_nic_name: Target NIC name. - :type target_nic_name: str - :param is_selected_for_migration: A value indicating whether this NIC is selected for - migration. - :type is_selected_for_migration: str - """ - - _validation = { - 'nic_id': {'readonly': True}, - 'source_ip_address': {'readonly': True}, - 'source_ip_address_type': {'readonly': True}, - 'source_network_id': {'readonly': True}, - } - - _attribute_map = { - 'nic_id': {'key': 'nicId', 'type': 'str'}, - 'is_primary_nic': {'key': 'isPrimaryNic', 'type': 'str'}, - 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, - 'source_ip_address_type': {'key': 'sourceIPAddressType', 'type': 'str'}, - 'source_network_id': {'key': 'sourceNetworkId', 'type': 'str'}, - 'target_ip_address': {'key': 'targetIPAddress', 'type': 'str'}, - 'target_ip_address_type': {'key': 'targetIPAddressType', 'type': 'str'}, - 'target_subnet_name': {'key': 'targetSubnetName', 'type': 'str'}, - 'target_nic_name': {'key': 'targetNicName', 'type': 'str'}, - 'is_selected_for_migration': {'key': 'isSelectedForMigration', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtNicDetails, self).__init__(**kwargs) - self.nic_id = None - self.is_primary_nic = kwargs.get('is_primary_nic', None) - self.source_ip_address = None - self.source_ip_address_type = None - self.source_network_id = None - self.target_ip_address = kwargs.get('target_ip_address', None) - self.target_ip_address_type = kwargs.get('target_ip_address_type', None) - self.target_subnet_name = kwargs.get('target_subnet_name', None) - self.target_nic_name = kwargs.get('target_nic_name', None) - self.is_selected_for_migration = kwargs.get('is_selected_for_migration', None) - - -class VMwareCbtNicInput(msrest.serialization.Model): - """VMwareCbt NIC input. - - All required parameters must be populated in order to send to Azure. - - :param nic_id: Required. The NIC Id. - :type nic_id: str - :param is_primary_nic: Required. A value indicating whether this is the primary NIC. - :type is_primary_nic: str - :param target_subnet_name: Target subnet name. - :type target_subnet_name: str - :param target_static_ip_address: The static IP address. - :type target_static_ip_address: str - :param is_selected_for_migration: A value indicating whether this NIC is selected for - migration. - :type is_selected_for_migration: str - :param target_nic_name: Target NIC name. - :type target_nic_name: str - """ - - _validation = { - 'nic_id': {'required': True}, - 'is_primary_nic': {'required': True}, - } - - _attribute_map = { - 'nic_id': {'key': 'nicId', 'type': 'str'}, - 'is_primary_nic': {'key': 'isPrimaryNic', 'type': 'str'}, - 'target_subnet_name': {'key': 'targetSubnetName', 'type': 'str'}, - 'target_static_ip_address': {'key': 'targetStaticIPAddress', 'type': 'str'}, - 'is_selected_for_migration': {'key': 'isSelectedForMigration', 'type': 'str'}, - 'target_nic_name': {'key': 'targetNicName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtNicInput, self).__init__(**kwargs) - self.nic_id = kwargs['nic_id'] - self.is_primary_nic = kwargs['is_primary_nic'] - self.target_subnet_name = kwargs.get('target_subnet_name', None) - self.target_static_ip_address = kwargs.get('target_static_ip_address', None) - self.is_selected_for_migration = kwargs.get('is_selected_for_migration', None) - self.target_nic_name = kwargs.get('target_nic_name', None) - - -class VMwareCbtPolicyCreationInput(PolicyProviderSpecificInput): - """VMware Cbt policy creation input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_history_in_minutes: The duration in minutes until which the recovery - points need to be stored. - :type recovery_point_history_in_minutes: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in - minutes). - :type crash_consistent_frequency_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). - :type app_consistent_frequency_in_minutes: int - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_history_in_minutes': {'key': 'recoveryPointHistoryInMinutes', 'type': 'int'}, - 'crash_consistent_frequency_in_minutes': {'key': 'crashConsistentFrequencyInMinutes', 'type': 'int'}, - 'app_consistent_frequency_in_minutes': {'key': 'appConsistentFrequencyInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtPolicyCreationInput, self).__init__(**kwargs) - self.instance_type = 'VMwareCbt' # type: str - self.recovery_point_history_in_minutes = kwargs.get('recovery_point_history_in_minutes', None) - self.crash_consistent_frequency_in_minutes = kwargs.get('crash_consistent_frequency_in_minutes', None) - self.app_consistent_frequency_in_minutes = kwargs.get('app_consistent_frequency_in_minutes', None) - - -class VmwareCbtPolicyDetails(PolicyProviderSpecificDetails): - """VMware Cbt specific policy details. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param recovery_point_history_in_minutes: The duration in minutes until which the recovery - points need to be stored. - :type recovery_point_history_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. - :type app_consistent_frequency_in_minutes: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in - minutes. - :type crash_consistent_frequency_in_minutes: int - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_history_in_minutes': {'key': 'recoveryPointHistoryInMinutes', 'type': 'int'}, - 'app_consistent_frequency_in_minutes': {'key': 'appConsistentFrequencyInMinutes', 'type': 'int'}, - 'crash_consistent_frequency_in_minutes': {'key': 'crashConsistentFrequencyInMinutes', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(VmwareCbtPolicyDetails, self).__init__(**kwargs) - self.instance_type = 'VMwareCbt' # type: str - self.recovery_point_history_in_minutes = kwargs.get('recovery_point_history_in_minutes', None) - self.app_consistent_frequency_in_minutes = kwargs.get('app_consistent_frequency_in_minutes', None) - self.crash_consistent_frequency_in_minutes = kwargs.get('crash_consistent_frequency_in_minutes', None) - - -class VMwareCbtProtectedDiskDetails(msrest.serialization.Model): - """VMwareCbt protected disk details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar disk_id: The disk id. - :vartype disk_id: str - :ivar disk_name: The disk name. - :vartype disk_name: str - :param disk_type: The disk type. Possible values include: "Standard_LRS", "Premium_LRS", - "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :ivar disk_path: The disk path. - :vartype disk_path: str - :ivar is_os_disk: A value indicating whether the disk is the OS disk. - :vartype is_os_disk: str - :ivar capacity_in_bytes: The disk capacity in bytes. - :vartype capacity_in_bytes: long - :ivar log_storage_account_id: The log storage account ARM Id. - :vartype log_storage_account_id: str - :ivar log_storage_account_sas_secret_name: The key vault secret name of the log storage - account. - :vartype log_storage_account_sas_secret_name: str - :ivar disk_encryption_set_id: The DiskEncryptionSet ARM Id. - :vartype disk_encryption_set_id: str - :ivar seed_managed_disk_id: The ARM Id of the seed managed disk. - :vartype seed_managed_disk_id: str - :ivar target_managed_disk_id: The ARM Id of the target managed disk. - :vartype target_managed_disk_id: str - :param target_disk_name: The name for the target managed disk. - :type target_disk_name: str - """ - - _validation = { - 'disk_id': {'readonly': True}, - 'disk_name': {'readonly': True}, - 'disk_path': {'readonly': True}, - 'is_os_disk': {'readonly': True}, - 'capacity_in_bytes': {'readonly': True}, - 'log_storage_account_id': {'readonly': True}, - 'log_storage_account_sas_secret_name': {'readonly': True}, - 'disk_encryption_set_id': {'readonly': True}, - 'seed_managed_disk_id': {'readonly': True}, - 'target_managed_disk_id': {'readonly': True}, - } - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'disk_name': {'key': 'diskName', 'type': 'str'}, - 'disk_type': {'key': 'diskType', 'type': 'str'}, - 'disk_path': {'key': 'diskPath', 'type': 'str'}, - 'is_os_disk': {'key': 'isOSDisk', 'type': 'str'}, - 'capacity_in_bytes': {'key': 'capacityInBytes', 'type': 'long'}, - 'log_storage_account_id': {'key': 'logStorageAccountId', 'type': 'str'}, - 'log_storage_account_sas_secret_name': {'key': 'logStorageAccountSasSecretName', 'type': 'str'}, - 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, - 'seed_managed_disk_id': {'key': 'seedManagedDiskId', 'type': 'str'}, - 'target_managed_disk_id': {'key': 'targetManagedDiskId', 'type': 'str'}, - 'target_disk_name': {'key': 'targetDiskName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtProtectedDiskDetails, self).__init__(**kwargs) - self.disk_id = None - self.disk_name = None - self.disk_type = kwargs.get('disk_type', None) - self.disk_path = None - self.is_os_disk = None - self.capacity_in_bytes = None - self.log_storage_account_id = None - self.log_storage_account_sas_secret_name = None - self.disk_encryption_set_id = None - self.seed_managed_disk_id = None - self.target_managed_disk_id = None - self.target_disk_name = kwargs.get('target_disk_name', None) - - -class VMwareCbtProtectionContainerMappingDetails(ProtectionContainerMappingProviderSpecificDetails): - """VMwareCbt provider specific container mapping details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :ivar key_vault_id: The target key vault ARM Id. - :vartype key_vault_id: str - :ivar key_vault_uri: The target key vault URI. - :vartype key_vault_uri: str - :ivar storage_account_id: The storage account ARM Id. - :vartype storage_account_id: str - :ivar storage_account_sas_secret_name: The secret name of the storage account. - :vartype storage_account_sas_secret_name: str - :ivar service_bus_connection_string_secret_name: The secret name of the service bus connection - string. - :vartype service_bus_connection_string_secret_name: str - :ivar target_location: The target location. - :vartype target_location: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'key_vault_id': {'readonly': True}, - 'key_vault_uri': {'readonly': True}, - 'storage_account_id': {'readonly': True}, - 'storage_account_sas_secret_name': {'readonly': True}, - 'service_bus_connection_string_secret_name': {'readonly': True}, - 'target_location': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, - 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, - 'storage_account_sas_secret_name': {'key': 'storageAccountSasSecretName', 'type': 'str'}, - 'service_bus_connection_string_secret_name': {'key': 'serviceBusConnectionStringSecretName', 'type': 'str'}, - 'target_location': {'key': 'targetLocation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtProtectionContainerMappingDetails, self).__init__(**kwargs) - self.instance_type = 'VMwareCbt' # type: str - self.key_vault_id = None - self.key_vault_uri = None - self.storage_account_id = None - self.storage_account_sas_secret_name = None - self.service_bus_connection_string_secret_name = None - self.target_location = None - - -class VMwareCbtResyncInput(ResyncProviderSpecificInput): - """VMwareCbt specific resync input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param skip_cbt_reset: Required. A value indicating whether CBT is to be reset. - :type skip_cbt_reset: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'skip_cbt_reset': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'skip_cbt_reset': {'key': 'skipCbtReset', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtResyncInput, self).__init__(**kwargs) - self.instance_type = 'VMwareCbt' # type: str - self.skip_cbt_reset = kwargs['skip_cbt_reset'] - - -class VMwareCbtTestMigrateInput(TestMigrateProviderSpecificInput): - """VMwareCbt specific test migrate input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_id: Required. The recovery point Id. - :type recovery_point_id: str - :param network_id: Required. The test network Id. - :type network_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'recovery_point_id': {'required': True}, - 'network_id': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, - 'network_id': {'key': 'networkId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtTestMigrateInput, self).__init__(**kwargs) - self.instance_type = 'VMwareCbt' # type: str - self.recovery_point_id = kwargs['recovery_point_id'] - self.network_id = kwargs['network_id'] - - -class VMwareCbtUpdateDiskInput(msrest.serialization.Model): - """VMwareCbt disk input for update. - - All required parameters must be populated in order to send to Azure. - - :param disk_id: Required. The disk Id. - :type disk_id: str - :param target_disk_name: The target disk name. - :type target_disk_name: str - """ - - _validation = { - 'disk_id': {'required': True}, - } - - _attribute_map = { - 'disk_id': {'key': 'diskId', 'type': 'str'}, - 'target_disk_name': {'key': 'targetDiskName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtUpdateDiskInput, self).__init__(**kwargs) - self.disk_id = kwargs['disk_id'] - self.target_disk_name = kwargs.get('target_disk_name', None) - - -class VMwareCbtUpdateMigrationItemInput(UpdateMigrationItemProviderSpecificInput): - """VMwareCbt specific update migration item input. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param target_vm_name: The target VM name. - :type target_vm_name: str - :param target_vm_size: The target VM size. - :type target_vm_size: str - :param target_resource_group_id: The target resource group ARM Id. - :type target_resource_group_id: str - :param target_availability_set_id: The target availability set ARM Id. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group ARM Id. - :type target_proximity_placement_group_id: str - :param target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account - ARM Id. - :type target_boot_diagnostics_storage_account_id: str - :param target_network_id: The target network ARM Id. - :type target_network_id: str - :param vm_nics: The list of NIC details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtNicInput] - :param vm_disks: The list of disk update properties. - :type vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtUpdateDiskInput] - :param license_type: The license type. Possible values include: "NotSpecified", - "NoLicenseType", "WindowsServer". - :type license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType - :param sql_server_license_type: The SQL Server license type. Possible values include: - "NotSpecified", "NoLicenseType", "PAYG", "AHUB". - :type sql_server_license_type: str or - ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType - :param perform_auto_resync: A value indicating whether auto resync is to be done. - :type perform_auto_resync: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param target_disk_tags: The tags for the target disks. - :type target_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'target_vm_name': {'key': 'targetVmName', 'type': 'str'}, - 'target_vm_size': {'key': 'targetVmSize', 'type': 'str'}, - 'target_resource_group_id': {'key': 'targetResourceGroupId', 'type': 'str'}, - 'target_availability_set_id': {'key': 'targetAvailabilitySetId', 'type': 'str'}, - 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, - 'target_proximity_placement_group_id': {'key': 'targetProximityPlacementGroupId', 'type': 'str'}, - 'target_boot_diagnostics_storage_account_id': {'key': 'targetBootDiagnosticsStorageAccountId', 'type': 'str'}, - 'target_network_id': {'key': 'targetNetworkId', 'type': 'str'}, - 'vm_nics': {'key': 'vmNics', 'type': '[VMwareCbtNicInput]'}, - 'vm_disks': {'key': 'vmDisks', 'type': '[VMwareCbtUpdateDiskInput]'}, - 'license_type': {'key': 'licenseType', 'type': 'str'}, - 'sql_server_license_type': {'key': 'sqlServerLicenseType', 'type': 'str'}, - 'perform_auto_resync': {'key': 'performAutoResync', 'type': 'str'}, - 'target_vm_tags': {'key': 'targetVmTags', 'type': '{str}'}, - 'target_disk_tags': {'key': 'targetDiskTags', 'type': '{str}'}, - 'target_nic_tags': {'key': 'targetNicTags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareCbtUpdateMigrationItemInput, self).__init__(**kwargs) - self.instance_type = 'VMwareCbt' # type: str - self.target_vm_name = kwargs.get('target_vm_name', None) - self.target_vm_size = kwargs.get('target_vm_size', None) - self.target_resource_group_id = kwargs.get('target_resource_group_id', None) - self.target_availability_set_id = kwargs.get('target_availability_set_id', None) - self.target_availability_zone = kwargs.get('target_availability_zone', None) - self.target_proximity_placement_group_id = kwargs.get('target_proximity_placement_group_id', None) - self.target_boot_diagnostics_storage_account_id = kwargs.get('target_boot_diagnostics_storage_account_id', None) - self.target_network_id = kwargs.get('target_network_id', None) - self.vm_nics = kwargs.get('vm_nics', None) - self.vm_disks = kwargs.get('vm_disks', None) - self.license_type = kwargs.get('license_type', None) - self.sql_server_license_type = kwargs.get('sql_server_license_type', None) - self.perform_auto_resync = kwargs.get('perform_auto_resync', None) - self.target_vm_tags = kwargs.get('target_vm_tags', None) - self.target_disk_tags = kwargs.get('target_disk_tags', None) - self.target_nic_tags = kwargs.get('target_nic_tags', None) - - -class VMwareDetails(FabricSpecificDetails): - """Store the fabric details specific to the VMware fabric. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param process_servers: The list of Process Servers associated with the fabric. - :type process_servers: list[~azure.mgmt.recoveryservicessiterecovery.models.ProcessServer] - :param master_target_servers: The list of Master Target servers associated with the fabric. - :type master_target_servers: - list[~azure.mgmt.recoveryservicessiterecovery.models.MasterTargetServer] - :param run_as_accounts: The list of run as accounts created on the server. - :type run_as_accounts: list[~azure.mgmt.recoveryservicessiterecovery.models.RunAsAccount] - :param replication_pair_count: The number of replication pairs configured in this CS. - :type replication_pair_count: str - :param process_server_count: The number of process servers. - :type process_server_count: str - :param agent_count: The number of source and target servers configured to talk to this CS. - :type agent_count: str - :param protected_servers: The number of protected servers. - :type protected_servers: str - :param system_load: The percentage of the system load. - :type system_load: str - :param system_load_status: The system load status. - :type system_load_status: str - :param cpu_load: The percentage of the CPU load. - :type cpu_load: str - :param cpu_load_status: The CPU load status. - :type cpu_load_status: str - :param total_memory_in_bytes: The total memory. - :type total_memory_in_bytes: long - :param available_memory_in_bytes: The available memory. - :type available_memory_in_bytes: long - :param memory_usage_status: The memory usage status. - :type memory_usage_status: str - :param total_space_in_bytes: The total space. - :type total_space_in_bytes: long - :param available_space_in_bytes: The available space. - :type available_space_in_bytes: long - :param space_usage_status: The space usage status. - :type space_usage_status: str - :param web_load: The web load. - :type web_load: str - :param web_load_status: The web load status. - :type web_load_status: str - :param database_server_load: The database server load. - :type database_server_load: str - :param database_server_load_status: The database server load status. - :type database_server_load_status: str - :param cs_service_status: The CS service status. - :type cs_service_status: str - :param ip_address: The IP address. - :type ip_address: str - :param agent_version: The agent Version. - :type agent_version: str - :param host_name: The host name. - :type host_name: str - :param last_heartbeat: The last heartbeat received from CS server. - :type last_heartbeat: ~datetime.datetime - :param version_status: Version status. - :type version_status: str - :param ssl_cert_expiry_date: CS SSL cert expiry date. - :type ssl_cert_expiry_date: ~datetime.datetime - :param ssl_cert_expiry_remaining_days: CS SSL cert expiry date. - :type ssl_cert_expiry_remaining_days: int - :param ps_template_version: PS template version. - :type ps_template_version: str - :param agent_expiry_date: Agent expiry date. - :type agent_expiry_date: ~datetime.datetime - :param agent_version_details: The agent version details. - :type agent_version_details: ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'process_servers': {'key': 'processServers', 'type': '[ProcessServer]'}, - 'master_target_servers': {'key': 'masterTargetServers', 'type': '[MasterTargetServer]'}, - 'run_as_accounts': {'key': 'runAsAccounts', 'type': '[RunAsAccount]'}, - 'replication_pair_count': {'key': 'replicationPairCount', 'type': 'str'}, - 'process_server_count': {'key': 'processServerCount', 'type': 'str'}, - 'agent_count': {'key': 'agentCount', 'type': 'str'}, - 'protected_servers': {'key': 'protectedServers', 'type': 'str'}, - 'system_load': {'key': 'systemLoad', 'type': 'str'}, - 'system_load_status': {'key': 'systemLoadStatus', 'type': 'str'}, - 'cpu_load': {'key': 'cpuLoad', 'type': 'str'}, - 'cpu_load_status': {'key': 'cpuLoadStatus', 'type': 'str'}, - 'total_memory_in_bytes': {'key': 'totalMemoryInBytes', 'type': 'long'}, - 'available_memory_in_bytes': {'key': 'availableMemoryInBytes', 'type': 'long'}, - 'memory_usage_status': {'key': 'memoryUsageStatus', 'type': 'str'}, - 'total_space_in_bytes': {'key': 'totalSpaceInBytes', 'type': 'long'}, - 'available_space_in_bytes': {'key': 'availableSpaceInBytes', 'type': 'long'}, - 'space_usage_status': {'key': 'spaceUsageStatus', 'type': 'str'}, - 'web_load': {'key': 'webLoad', 'type': 'str'}, - 'web_load_status': {'key': 'webLoadStatus', 'type': 'str'}, - 'database_server_load': {'key': 'databaseServerLoad', 'type': 'str'}, - 'database_server_load_status': {'key': 'databaseServerLoadStatus', 'type': 'str'}, - 'cs_service_status': {'key': 'csServiceStatus', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'agent_version': {'key': 'agentVersion', 'type': 'str'}, - 'host_name': {'key': 'hostName', 'type': 'str'}, - 'last_heartbeat': {'key': 'lastHeartbeat', 'type': 'iso-8601'}, - 'version_status': {'key': 'versionStatus', 'type': 'str'}, - 'ssl_cert_expiry_date': {'key': 'sslCertExpiryDate', 'type': 'iso-8601'}, - 'ssl_cert_expiry_remaining_days': {'key': 'sslCertExpiryRemainingDays', 'type': 'int'}, - 'ps_template_version': {'key': 'psTemplateVersion', 'type': 'str'}, - 'agent_expiry_date': {'key': 'agentExpiryDate', 'type': 'iso-8601'}, - 'agent_version_details': {'key': 'agentVersionDetails', 'type': 'VersionDetails'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareDetails, self).__init__(**kwargs) - self.instance_type = 'VMware' # type: str - self.process_servers = kwargs.get('process_servers', None) - self.master_target_servers = kwargs.get('master_target_servers', None) - self.run_as_accounts = kwargs.get('run_as_accounts', None) - self.replication_pair_count = kwargs.get('replication_pair_count', None) - self.process_server_count = kwargs.get('process_server_count', None) - self.agent_count = kwargs.get('agent_count', None) - self.protected_servers = kwargs.get('protected_servers', None) - self.system_load = kwargs.get('system_load', None) - self.system_load_status = kwargs.get('system_load_status', None) - self.cpu_load = kwargs.get('cpu_load', None) - self.cpu_load_status = kwargs.get('cpu_load_status', None) - self.total_memory_in_bytes = kwargs.get('total_memory_in_bytes', None) - self.available_memory_in_bytes = kwargs.get('available_memory_in_bytes', None) - self.memory_usage_status = kwargs.get('memory_usage_status', None) - self.total_space_in_bytes = kwargs.get('total_space_in_bytes', None) - self.available_space_in_bytes = kwargs.get('available_space_in_bytes', None) - self.space_usage_status = kwargs.get('space_usage_status', None) - self.web_load = kwargs.get('web_load', None) - self.web_load_status = kwargs.get('web_load_status', None) - self.database_server_load = kwargs.get('database_server_load', None) - self.database_server_load_status = kwargs.get('database_server_load_status', None) - self.cs_service_status = kwargs.get('cs_service_status', None) - self.ip_address = kwargs.get('ip_address', None) - self.agent_version = kwargs.get('agent_version', None) - self.host_name = kwargs.get('host_name', None) - self.last_heartbeat = kwargs.get('last_heartbeat', None) - self.version_status = kwargs.get('version_status', None) - self.ssl_cert_expiry_date = kwargs.get('ssl_cert_expiry_date', None) - self.ssl_cert_expiry_remaining_days = kwargs.get('ssl_cert_expiry_remaining_days', None) - self.ps_template_version = kwargs.get('ps_template_version', None) - self.agent_expiry_date = kwargs.get('agent_expiry_date', None) - self.agent_version_details = kwargs.get('agent_version_details', None) - - -class VMwareV2FabricCreationInput(FabricSpecificCreationInput): - """VMwareV2 fabric provider specific settings. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type.Constant filled by server. - :type instance_type: str - :param vmware_site_id: The ARM Id of the VMware site. - :type vmware_site_id: str - :param physical_site_id: The ARM Id of the physical site. - :type physical_site_id: str - :param migration_solution_id: Required. The ARM Id of the migration solution. - :type migration_solution_id: str - """ - - _validation = { - 'instance_type': {'required': True}, - 'migration_solution_id': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'vmware_site_id': {'key': 'vmwareSiteId', 'type': 'str'}, - 'physical_site_id': {'key': 'physicalSiteId', 'type': 'str'}, - 'migration_solution_id': {'key': 'migrationSolutionId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareV2FabricCreationInput, self).__init__(**kwargs) - self.instance_type = 'VMwareV2' # type: str - self.vmware_site_id = kwargs.get('vmware_site_id', None) - self.physical_site_id = kwargs.get('physical_site_id', None) - self.migration_solution_id = kwargs['migration_solution_id'] - - -class VMwareV2FabricSpecificDetails(FabricSpecificDetails): - """VMwareV2 fabric specific details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :ivar vmware_site_id: The ARM Id of the VMware site. - :vartype vmware_site_id: str - :ivar physical_site_id: The ARM Id of the physical site. - :vartype physical_site_id: str - :ivar migration_solution_id: The Migration solution ARM Id. - :vartype migration_solution_id: str - :ivar service_endpoint: The service endpoint. - :vartype service_endpoint: str - :ivar service_resource_id: The service resource Id. - :vartype service_resource_id: str - :ivar service_container_id: The service container Id. - :vartype service_container_id: str - :ivar process_servers: The list of process servers. - :vartype process_servers: - list[~azure.mgmt.recoveryservicessiterecovery.models.ProcessServerDetails] - """ - - _validation = { - 'instance_type': {'required': True}, - 'vmware_site_id': {'readonly': True}, - 'physical_site_id': {'readonly': True}, - 'migration_solution_id': {'readonly': True}, - 'service_endpoint': {'readonly': True}, - 'service_resource_id': {'readonly': True}, - 'service_container_id': {'readonly': True}, - 'process_servers': {'readonly': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'vmware_site_id': {'key': 'vmwareSiteId', 'type': 'str'}, - 'physical_site_id': {'key': 'physicalSiteId', 'type': 'str'}, - 'migration_solution_id': {'key': 'migrationSolutionId', 'type': 'str'}, - 'service_endpoint': {'key': 'serviceEndpoint', 'type': 'str'}, - 'service_resource_id': {'key': 'serviceResourceId', 'type': 'str'}, - 'service_container_id': {'key': 'serviceContainerId', 'type': 'str'}, - 'process_servers': {'key': 'processServers', 'type': '[ProcessServerDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareV2FabricSpecificDetails, self).__init__(**kwargs) - self.instance_type = 'VMwareV2' # type: str - self.vmware_site_id = None - self.physical_site_id = None - self.migration_solution_id = None - self.service_endpoint = None - self.service_resource_id = None - self.service_container_id = None - self.process_servers = None - - -class VMwareVirtualMachineDetails(ConfigurationSettings): - """VMware provider specific settings. - - All required parameters must be populated in order to send to Azure. - - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant - filled by server. - :type instance_type: str - :param agent_generated_id: The ID generated by the InMage agent after it gets installed on - guest. This is the ID to be used during InMage CreateProtection. - :type agent_generated_id: str - :param agent_installed: The value indicating if InMage scout agent is installed on guest. - :type agent_installed: str - :param os_type: The OsType installed on VM. - :type os_type: str - :param agent_version: The agent version. - :type agent_version: str - :param ip_address: The IP address. - :type ip_address: str - :param powered_on: The value indicating whether VM is powered on. - :type powered_on: str - :param v_center_infrastructure_id: The VCenter infrastructure Id. - :type v_center_infrastructure_id: str - :param discovery_type: A value indicating the discovery type of the machine. Value can be - vCenter or physical. - :type discovery_type: str - :param disk_details: The disk details. - :type disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageDiskDetails] - :param validation_errors: The validation errors. - :type validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - """ - - _validation = { - 'instance_type': {'required': True}, - } - - _attribute_map = { - 'instance_type': {'key': 'instanceType', 'type': 'str'}, - 'agent_generated_id': {'key': 'agentGeneratedId', 'type': 'str'}, - 'agent_installed': {'key': 'agentInstalled', 'type': 'str'}, - 'os_type': {'key': 'osType', 'type': 'str'}, - 'agent_version': {'key': 'agentVersion', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'powered_on': {'key': 'poweredOn', 'type': 'str'}, - 'v_center_infrastructure_id': {'key': 'vCenterInfrastructureId', 'type': 'str'}, - 'discovery_type': {'key': 'discoveryType', 'type': 'str'}, - 'disk_details': {'key': 'diskDetails', 'type': '[InMageDiskDetails]'}, - 'validation_errors': {'key': 'validationErrors', 'type': '[HealthError]'}, - } - - def __init__( - self, - **kwargs - ): - super(VMwareVirtualMachineDetails, self).__init__(**kwargs) - self.instance_type = 'VMwareVirtualMachine' # type: str - self.agent_generated_id = kwargs.get('agent_generated_id', None) - self.agent_installed = kwargs.get('agent_installed', None) - self.os_type = kwargs.get('os_type', None) - self.agent_version = kwargs.get('agent_version', None) - self.ip_address = kwargs.get('ip_address', None) - self.powered_on = kwargs.get('powered_on', None) - self.v_center_infrastructure_id = kwargs.get('v_center_infrastructure_id', None) - self.discovery_type = kwargs.get('discovery_type', None) - self.disk_details = kwargs.get('disk_details', None) - self.validation_errors = kwargs.get('validation_errors', None) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/_models_py3.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/_models_py3.py index 2c995b47ac33..5e49e209c141 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/_models_py3.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/_models_py3.py @@ -22,8 +22,8 @@ class AddDisksProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -42,6 +42,8 @@ def __init__( self, **kwargs ): + """ + """ super(AddDisksProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -51,12 +53,12 @@ class A2AAddDisksInput(AddDisksProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param vm_disks: The list of vm disk details. - :type vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] - :param vm_managed_disks: The list of vm managed disk details. - :type vm_managed_disks: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar vm_disks: The list of vm disk details. + :vartype vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] + :ivar vm_managed_disks: The list of vm managed disk details. + :vartype vm_managed_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmManagedDiskInputDetails] """ @@ -77,6 +79,14 @@ def __init__( vm_managed_disks: Optional[List["A2AVmManagedDiskInputDetails"]] = None, **kwargs ): + """ + :keyword vm_disks: The list of vm disk details. + :paramtype vm_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] + :keyword vm_managed_disks: The list of vm managed disk details. + :paramtype vm_managed_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmManagedDiskInputDetails] + """ super(A2AAddDisksInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.vm_disks = vm_disks @@ -91,8 +101,8 @@ class ApplyRecoveryPointProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -111,6 +121,8 @@ def __init__( self, **kwargs ): + """ + """ super(ApplyRecoveryPointProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -120,8 +132,8 @@ class A2AApplyRecoveryPointInput(ApplyRecoveryPointProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -136,6 +148,8 @@ def __init__( self, **kwargs ): + """ + """ super(A2AApplyRecoveryPointInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str @@ -148,8 +162,8 @@ class ReplicationProviderSpecificContainerCreationInput(msrest.serialization.Mod All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -168,6 +182,8 @@ def __init__( self, **kwargs ): + """ + """ super(ReplicationProviderSpecificContainerCreationInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -177,8 +193,8 @@ class A2AContainerCreationInput(ReplicationProviderSpecificContainerCreationInpu All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -193,6 +209,8 @@ def __init__( self, **kwargs ): + """ + """ super(A2AContainerCreationInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str @@ -205,8 +223,8 @@ class ReplicationProviderSpecificContainerMappingInput(msrest.serialization.Mode All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -225,6 +243,8 @@ def __init__( self, **kwargs ): + """ + """ super(ReplicationProviderSpecificContainerMappingInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -234,14 +254,18 @@ class A2AContainerMappingInput(ReplicationProviderSpecificContainerMappingInput) All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param agent_auto_update_status: A value indicating whether the auto update is enabled. - Possible values include: "Disabled", "Enabled". - :type agent_auto_update_status: str or + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar agent_auto_update_status: A value indicating whether the auto update is enabled. Possible + values include: "Disabled", "Enabled". + :vartype agent_auto_update_status: str or ~azure.mgmt.recoveryservicessiterecovery.models.AgentAutoUpdateStatus - :param automation_account_arm_id: The automation account arm id. - :type automation_account_arm_id: str + :ivar automation_account_arm_id: The automation account arm id. + :vartype automation_account_arm_id: str + :ivar automation_account_authentication_type: A value indicating the type authentication to use + for automation Account. Possible values include: "RunAsAccount", "SystemAssignedIdentity". + :vartype automation_account_authentication_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AutomationAccountAuthenticationType """ _validation = { @@ -252,6 +276,7 @@ class A2AContainerMappingInput(ReplicationProviderSpecificContainerMappingInput) 'instance_type': {'key': 'instanceType', 'type': 'str'}, 'agent_auto_update_status': {'key': 'agentAutoUpdateStatus', 'type': 'str'}, 'automation_account_arm_id': {'key': 'automationAccountArmId', 'type': 'str'}, + 'automation_account_authentication_type': {'key': 'automationAccountAuthenticationType', 'type': 'str'}, } def __init__( @@ -259,12 +284,26 @@ def __init__( *, agent_auto_update_status: Optional[Union[str, "AgentAutoUpdateStatus"]] = None, automation_account_arm_id: Optional[str] = None, - **kwargs - ): + automation_account_authentication_type: Optional[Union[str, "AutomationAccountAuthenticationType"]] = None, + **kwargs + ): + """ + :keyword agent_auto_update_status: A value indicating whether the auto update is enabled. + Possible values include: "Disabled", "Enabled". + :paramtype agent_auto_update_status: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AgentAutoUpdateStatus + :keyword automation_account_arm_id: The automation account arm id. + :paramtype automation_account_arm_id: str + :keyword automation_account_authentication_type: A value indicating the type authentication to + use for automation Account. Possible values include: "RunAsAccount", "SystemAssignedIdentity". + :paramtype automation_account_authentication_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AutomationAccountAuthenticationType + """ super(A2AContainerMappingInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.agent_auto_update_status = agent_auto_update_status self.automation_account_arm_id = automation_account_arm_id + self.automation_account_authentication_type = automation_account_authentication_type class CreateProtectionIntentProviderSpecificDetails(msrest.serialization.Model): @@ -275,8 +314,8 @@ class CreateProtectionIntentProviderSpecificDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -295,6 +334,8 @@ def __init__( self, **kwargs ): + """ + """ super(CreateProtectionIntentProviderSpecificDetails, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -304,60 +345,72 @@ class A2ACreateProtectionIntentInput(CreateProtectionIntentProviderSpecificDetai All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param fabric_object_id: Required. The fabric specific object Id of the virtual machine. - :type fabric_object_id: str - :param primary_location: Required. The primary location for the virtual machine. - :type primary_location: str - :param recovery_location: Required. The recovery location for the virtual machine. - :type recovery_location: str - :param recovery_subscription_id: Required. The recovery subscription Id of the virtual machine. - :type recovery_subscription_id: str - :param recovery_availability_type: Required. The recovery availability type of the virtual + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar fabric_object_id: Required. The fabric specific object Id of the virtual machine. + :vartype fabric_object_id: str + :ivar primary_location: Required. The primary location for the virtual machine. + :vartype primary_location: str + :ivar recovery_location: Required. The recovery location for the virtual machine. + :vartype recovery_location: str + :ivar recovery_subscription_id: Required. The recovery subscription Id of the virtual machine. + :vartype recovery_subscription_id: str + :ivar recovery_availability_type: Required. The recovery availability type of the virtual machine. Possible values include: "Single", "AvailabilitySet", "AvailabilityZone". - :type recovery_availability_type: str or + :vartype recovery_availability_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.A2ARecoveryAvailabilityType - :param protection_profile_custom_input: The protection profile custom inputs. - :type protection_profile_custom_input: + :ivar protection_profile_custom_input: The protection profile custom inputs. + :vartype protection_profile_custom_input: ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionProfileCustomDetails - :param recovery_resource_group_id: Required. The recovery resource group Id. Valid for V2 + :ivar recovery_resource_group_id: Required. The recovery resource group Id. Valid for V2 scenarios. - :type recovery_resource_group_id: str - :param primary_staging_storage_account_custom_input: The primary staging storage account input. - :type primary_staging_storage_account_custom_input: + :vartype recovery_resource_group_id: str + :ivar primary_staging_storage_account_custom_input: The primary staging storage account input. + :vartype primary_staging_storage_account_custom_input: ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails - :param recovery_availability_set_custom_input: The recovery availability set input. - :type recovery_availability_set_custom_input: + :ivar recovery_availability_set_custom_input: The recovery availability set input. + :vartype recovery_availability_set_custom_input: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryAvailabilitySetCustomDetails - :param recovery_virtual_network_custom_input: The recovery virtual network input. - :type recovery_virtual_network_custom_input: + :ivar recovery_virtual_network_custom_input: The recovery virtual network input. + :vartype recovery_virtual_network_custom_input: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryVirtualNetworkCustomDetails - :param recovery_proximity_placement_group_custom_input: The recovery proximity placement group + :ivar recovery_proximity_placement_group_custom_input: The recovery proximity placement group custom input. - :type recovery_proximity_placement_group_custom_input: + :vartype recovery_proximity_placement_group_custom_input: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryProximityPlacementGroupCustomDetails - :param auto_protection_of_data_disk: A value indicating whether the auto protection is enabled. + :ivar auto_protection_of_data_disk: A value indicating whether the auto protection is enabled. Possible values include: "Disabled", "Enabled". - :type auto_protection_of_data_disk: str or + :vartype auto_protection_of_data_disk: str or ~azure.mgmt.recoveryservicessiterecovery.models.AutoProtectionOfDataDisk - :param vm_disks: The list of vm disk inputs. - :type vm_disks: + :ivar vm_disks: The list of vm disk inputs. + :vartype vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectionIntentDiskInputDetails] - :param vm_managed_disks: The list of vm managed disk inputs. - :type vm_managed_disks: + :ivar vm_managed_disks: The list of vm managed disk inputs. + :vartype vm_managed_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectionIntentManagedDiskInputDetails] - :param multi_vm_group_name: The multi vm group name. - :type multi_vm_group_name: str - :param multi_vm_group_id: The multi vm group id. - :type multi_vm_group_id: str - :param recovery_boot_diag_storage_account: The boot diagnostic storage account. - :type recovery_boot_diag_storage_account: + :ivar multi_vm_group_name: The multi vm group name. + :vartype multi_vm_group_name: str + :ivar multi_vm_group_id: The multi vm group id. + :vartype multi_vm_group_id: str + :ivar recovery_boot_diag_storage_account: The boot diagnostic storage account. + :vartype recovery_boot_diag_storage_account: ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails - :param disk_encryption_info: The recovery disk encryption information (for two pass flows). - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo - :param recovery_availability_zone: The recovery availability zone. - :type recovery_availability_zone: str + :ivar disk_encryption_info: The recovery disk encryption information (for two pass flows). + :vartype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + :ivar recovery_availability_zone: The recovery availability zone. + :vartype recovery_availability_zone: str + :ivar agent_auto_update_status: A value indicating whether the auto update is enabled. Possible + values include: "Disabled", "Enabled". + :vartype agent_auto_update_status: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AgentAutoUpdateStatus + :ivar automation_account_authentication_type: A value indicating the authentication type for + automation account. The default value is "RunAsAccount". Possible values include: + "RunAsAccount", "SystemAssignedIdentity". + :vartype automation_account_authentication_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AutomationAccountAuthenticationType + :ivar automation_account_arm_id: The automation account arm id. + :vartype automation_account_arm_id: str """ _validation = { @@ -391,6 +444,9 @@ class A2ACreateProtectionIntentInput(CreateProtectionIntentProviderSpecificDetai 'recovery_boot_diag_storage_account': {'key': 'recoveryBootDiagStorageAccount', 'type': 'StorageAccountCustomDetails'}, 'disk_encryption_info': {'key': 'diskEncryptionInfo', 'type': 'DiskEncryptionInfo'}, 'recovery_availability_zone': {'key': 'recoveryAvailabilityZone', 'type': 'str'}, + 'agent_auto_update_status': {'key': 'agentAutoUpdateStatus', 'type': 'str'}, + 'automation_account_authentication_type': {'key': 'automationAccountAuthenticationType', 'type': 'str'}, + 'automation_account_arm_id': {'key': 'automationAccountArmId', 'type': 'str'}, } def __init__( @@ -415,8 +471,79 @@ def __init__( recovery_boot_diag_storage_account: Optional["StorageAccountCustomDetails"] = None, disk_encryption_info: Optional["DiskEncryptionInfo"] = None, recovery_availability_zone: Optional[str] = None, + agent_auto_update_status: Optional[Union[str, "AgentAutoUpdateStatus"]] = None, + automation_account_authentication_type: Optional[Union[str, "AutomationAccountAuthenticationType"]] = None, + automation_account_arm_id: Optional[str] = None, **kwargs ): + """ + :keyword fabric_object_id: Required. The fabric specific object Id of the virtual machine. + :paramtype fabric_object_id: str + :keyword primary_location: Required. The primary location for the virtual machine. + :paramtype primary_location: str + :keyword recovery_location: Required. The recovery location for the virtual machine. + :paramtype recovery_location: str + :keyword recovery_subscription_id: Required. The recovery subscription Id of the virtual + machine. + :paramtype recovery_subscription_id: str + :keyword recovery_availability_type: Required. The recovery availability type of the virtual + machine. Possible values include: "Single", "AvailabilitySet", "AvailabilityZone". + :paramtype recovery_availability_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.A2ARecoveryAvailabilityType + :keyword protection_profile_custom_input: The protection profile custom inputs. + :paramtype protection_profile_custom_input: + ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionProfileCustomDetails + :keyword recovery_resource_group_id: Required. The recovery resource group Id. Valid for V2 + scenarios. + :paramtype recovery_resource_group_id: str + :keyword primary_staging_storage_account_custom_input: The primary staging storage account + input. + :paramtype primary_staging_storage_account_custom_input: + ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails + :keyword recovery_availability_set_custom_input: The recovery availability set input. + :paramtype recovery_availability_set_custom_input: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryAvailabilitySetCustomDetails + :keyword recovery_virtual_network_custom_input: The recovery virtual network input. + :paramtype recovery_virtual_network_custom_input: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryVirtualNetworkCustomDetails + :keyword recovery_proximity_placement_group_custom_input: The recovery proximity placement + group custom input. + :paramtype recovery_proximity_placement_group_custom_input: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryProximityPlacementGroupCustomDetails + :keyword auto_protection_of_data_disk: A value indicating whether the auto protection is + enabled. Possible values include: "Disabled", "Enabled". + :paramtype auto_protection_of_data_disk: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AutoProtectionOfDataDisk + :keyword vm_disks: The list of vm disk inputs. + :paramtype vm_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectionIntentDiskInputDetails] + :keyword vm_managed_disks: The list of vm managed disk inputs. + :paramtype vm_managed_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectionIntentManagedDiskInputDetails] + :keyword multi_vm_group_name: The multi vm group name. + :paramtype multi_vm_group_name: str + :keyword multi_vm_group_id: The multi vm group id. + :paramtype multi_vm_group_id: str + :keyword recovery_boot_diag_storage_account: The boot diagnostic storage account. + :paramtype recovery_boot_diag_storage_account: + ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails + :keyword disk_encryption_info: The recovery disk encryption information (for two pass flows). + :paramtype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + :keyword recovery_availability_zone: The recovery availability zone. + :paramtype recovery_availability_zone: str + :keyword agent_auto_update_status: A value indicating whether the auto update is enabled. + Possible values include: "Disabled", "Enabled". + :paramtype agent_auto_update_status: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AgentAutoUpdateStatus + :keyword automation_account_authentication_type: A value indicating the authentication type for + automation account. The default value is "RunAsAccount". Possible values include: + "RunAsAccount", "SystemAssignedIdentity". + :paramtype automation_account_authentication_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AutomationAccountAuthenticationType + :keyword automation_account_arm_id: The automation account arm id. + :paramtype automation_account_arm_id: str + """ super(A2ACreateProtectionIntentInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.fabric_object_id = fabric_object_id @@ -438,6 +565,9 @@ def __init__( self.recovery_boot_diag_storage_account = recovery_boot_diag_storage_account self.disk_encryption_info = disk_encryption_info self.recovery_availability_zone = recovery_availability_zone + self.agent_auto_update_status = agent_auto_update_status + self.automation_account_authentication_type = automation_account_authentication_type + self.automation_account_arm_id = automation_account_arm_id class A2ACrossClusterMigrationApplyRecoveryPointInput(ApplyRecoveryPointProviderSpecificInput): @@ -445,8 +575,8 @@ class A2ACrossClusterMigrationApplyRecoveryPointInput(ApplyRecoveryPointProvider All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -461,6 +591,8 @@ def __init__( self, **kwargs ): + """ + """ super(A2ACrossClusterMigrationApplyRecoveryPointInput, self).__init__(**kwargs) self.instance_type = 'A2ACrossClusterMigration' # type: str @@ -470,8 +602,8 @@ class A2ACrossClusterMigrationContainerCreationInput(ReplicationProviderSpecific All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -486,6 +618,8 @@ def __init__( self, **kwargs ): + """ + """ super(A2ACrossClusterMigrationContainerCreationInput, self).__init__(**kwargs) self.instance_type = 'A2ACrossClusterMigration' # type: str @@ -498,8 +632,8 @@ class EnableProtectionProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -518,6 +652,8 @@ def __init__( self, **kwargs ): + """ + """ super(EnableProtectionProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -527,12 +663,12 @@ class A2ACrossClusterMigrationEnableProtectionInput(EnableProtectionProviderSpec All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param fabric_object_id: The fabric specific object Id of the virtual machine. - :type fabric_object_id: str - :param recovery_container_id: The recovery container Id. - :type recovery_container_id: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar fabric_object_id: The fabric specific object Id of the virtual machine. + :vartype fabric_object_id: str + :ivar recovery_container_id: The recovery container Id. + :vartype recovery_container_id: str """ _validation = { @@ -552,6 +688,12 @@ def __init__( recovery_container_id: Optional[str] = None, **kwargs ): + """ + :keyword fabric_object_id: The fabric specific object Id of the virtual machine. + :paramtype fabric_object_id: str + :keyword recovery_container_id: The recovery container Id. + :paramtype recovery_container_id: str + """ super(A2ACrossClusterMigrationEnableProtectionInput, self).__init__(**kwargs) self.instance_type = 'A2ACrossClusterMigration' # type: str self.fabric_object_id = fabric_object_id @@ -566,8 +708,8 @@ class PolicyProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -586,6 +728,8 @@ def __init__( self, **kwargs ): + """ + """ super(PolicyProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -595,8 +739,8 @@ class A2ACrossClusterMigrationPolicyCreationInput(PolicyProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -611,6 +755,8 @@ def __init__( self, **kwargs ): + """ + """ super(A2ACrossClusterMigrationPolicyCreationInput, self).__init__(**kwargs) self.instance_type = 'A2ACrossClusterMigration' # type: str @@ -623,8 +769,8 @@ class ReplicationProviderSpecificSettings(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -643,6 +789,8 @@ def __init__( self, **kwargs ): + """ + """ super(ReplicationProviderSpecificSettings, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -652,23 +800,23 @@ class A2ACrossClusterMigrationReplicationDetails(ReplicationProviderSpecificSett All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param fabric_object_id: The fabric specific object Id of the virtual machine. - :type fabric_object_id: str - :param primary_fabric_location: Primary fabric location. - :type primary_fabric_location: str - :param os_type: The type of operating system. - :type os_type: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param lifecycle_id: An id associated with the PE that survives actions like switch protection + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str + :ivar fabric_object_id: The fabric specific object Id of the virtual machine. + :vartype fabric_object_id: str + :ivar primary_fabric_location: Primary fabric location. + :vartype primary_fabric_location: str + :ivar os_type: The type of operating system. + :vartype os_type: str + :ivar vm_protection_state: The protection state for the vm. + :vartype vm_protection_state: str + :ivar vm_protection_state_description: The protection state description for the vm. + :vartype vm_protection_state_description: str + :ivar lifecycle_id: An id associated with the PE that survives actions like switch protection which change the backing PE/CPE objects internally.The lifecycle id gets carried forward to have a link/continuity in being able to have an Id that denotes the "same" protected item even though other internal Ids/ARM Id might be changing. - :type lifecycle_id: str + :vartype lifecycle_id: str """ _validation = { @@ -696,6 +844,23 @@ def __init__( lifecycle_id: Optional[str] = None, **kwargs ): + """ + :keyword fabric_object_id: The fabric specific object Id of the virtual machine. + :paramtype fabric_object_id: str + :keyword primary_fabric_location: Primary fabric location. + :paramtype primary_fabric_location: str + :keyword os_type: The type of operating system. + :paramtype os_type: str + :keyword vm_protection_state: The protection state for the vm. + :paramtype vm_protection_state: str + :keyword vm_protection_state_description: The protection state description for the vm. + :paramtype vm_protection_state_description: str + :keyword lifecycle_id: An id associated with the PE that survives actions like switch + protection which change the backing PE/CPE objects internally.The lifecycle id gets carried + forward to have a link/continuity in being able to have an Id that denotes the "same" protected + item even though other internal Ids/ARM Id might be changing. + :paramtype lifecycle_id: str + """ super(A2ACrossClusterMigrationReplicationDetails, self).__init__(**kwargs) self.instance_type = 'A2ACrossClusterMigration' # type: str self.fabric_object_id = fabric_object_id @@ -711,41 +876,47 @@ class A2AEnableProtectionInput(EnableProtectionProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param fabric_object_id: Required. The fabric specific object Id of the virtual machine. - :type fabric_object_id: str - :param recovery_container_id: The recovery container Id. - :type recovery_container_id: str - :param recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. - :type recovery_resource_group_id: str - :param recovery_cloud_service_id: The recovery cloud service Id. Valid for V1 scenarios. - :type recovery_cloud_service_id: str - :param recovery_availability_set_id: The recovery availability set Id. - :type recovery_availability_set_id: str - :param recovery_proximity_placement_group_id: The recovery proximity placement group Id. - :type recovery_proximity_placement_group_id: str - :param vm_disks: The list of vm disk details. - :type vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] - :param vm_managed_disks: The list of vm managed disk details. - :type vm_managed_disks: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar fabric_object_id: Required. The fabric specific object Id of the virtual machine. + :vartype fabric_object_id: str + :ivar recovery_container_id: The recovery container Id. + :vartype recovery_container_id: str + :ivar recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. + :vartype recovery_resource_group_id: str + :ivar recovery_cloud_service_id: The recovery cloud service Id. Valid for V1 scenarios. + :vartype recovery_cloud_service_id: str + :ivar recovery_availability_set_id: The recovery availability set Id. + :vartype recovery_availability_set_id: str + :ivar recovery_proximity_placement_group_id: The recovery proximity placement group Id. + :vartype recovery_proximity_placement_group_id: str + :ivar vm_disks: The list of vm disk details. + :vartype vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] + :ivar vm_managed_disks: The list of vm managed disk details. + :vartype vm_managed_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmManagedDiskInputDetails] - :param multi_vm_group_name: The multi vm group name. - :type multi_vm_group_name: str - :param multi_vm_group_id: The multi vm group id. - :type multi_vm_group_id: str - :param recovery_boot_diag_storage_account_id: The boot diagnostic storage account. - :type recovery_boot_diag_storage_account_id: str - :param disk_encryption_info: The recovery disk encryption information (for two pass flows). - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo - :param recovery_availability_zone: The recovery availability zone. - :type recovery_availability_zone: str - :param recovery_azure_network_id: The recovery Azure virtual network ARM id. - :type recovery_azure_network_id: str - :param recovery_subnet_name: The recovery subnet name. - :type recovery_subnet_name: str - :param recovery_virtual_machine_scale_set_id: The virtual machine scale set Id. - :type recovery_virtual_machine_scale_set_id: str + :ivar multi_vm_group_name: The multi vm group name. + :vartype multi_vm_group_name: str + :ivar multi_vm_group_id: The multi vm group id. + :vartype multi_vm_group_id: str + :ivar recovery_boot_diag_storage_account_id: The boot diagnostic storage account. + :vartype recovery_boot_diag_storage_account_id: str + :ivar disk_encryption_info: The recovery disk encryption information (for two pass flows). + :vartype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + :ivar recovery_availability_zone: The recovery availability zone. + :vartype recovery_availability_zone: str + :ivar recovery_extended_location: The recovery extended location. + :vartype recovery_extended_location: + ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocation + :ivar recovery_azure_network_id: The recovery Azure virtual network ARM id. + :vartype recovery_azure_network_id: str + :ivar recovery_subnet_name: The recovery subnet name. + :vartype recovery_subnet_name: str + :ivar recovery_virtual_machine_scale_set_id: The virtual machine scale set Id. + :vartype recovery_virtual_machine_scale_set_id: str + :ivar recovery_capacity_reservation_group_id: The recovery capacity reservation group Id. + :vartype recovery_capacity_reservation_group_id: str """ _validation = { @@ -768,9 +939,11 @@ class A2AEnableProtectionInput(EnableProtectionProviderSpecificInput): 'recovery_boot_diag_storage_account_id': {'key': 'recoveryBootDiagStorageAccountId', 'type': 'str'}, 'disk_encryption_info': {'key': 'diskEncryptionInfo', 'type': 'DiskEncryptionInfo'}, 'recovery_availability_zone': {'key': 'recoveryAvailabilityZone', 'type': 'str'}, + 'recovery_extended_location': {'key': 'recoveryExtendedLocation', 'type': 'ExtendedLocation'}, 'recovery_azure_network_id': {'key': 'recoveryAzureNetworkId', 'type': 'str'}, 'recovery_subnet_name': {'key': 'recoverySubnetName', 'type': 'str'}, 'recovery_virtual_machine_scale_set_id': {'key': 'recoveryVirtualMachineScaleSetId', 'type': 'str'}, + 'recovery_capacity_reservation_group_id': {'key': 'recoveryCapacityReservationGroupId', 'type': 'str'}, } def __init__( @@ -789,11 +962,55 @@ def __init__( recovery_boot_diag_storage_account_id: Optional[str] = None, disk_encryption_info: Optional["DiskEncryptionInfo"] = None, recovery_availability_zone: Optional[str] = None, + recovery_extended_location: Optional["ExtendedLocation"] = None, recovery_azure_network_id: Optional[str] = None, recovery_subnet_name: Optional[str] = None, recovery_virtual_machine_scale_set_id: Optional[str] = None, - **kwargs - ): + recovery_capacity_reservation_group_id: Optional[str] = None, + **kwargs + ): + """ + :keyword fabric_object_id: Required. The fabric specific object Id of the virtual machine. + :paramtype fabric_object_id: str + :keyword recovery_container_id: The recovery container Id. + :paramtype recovery_container_id: str + :keyword recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. + :paramtype recovery_resource_group_id: str + :keyword recovery_cloud_service_id: The recovery cloud service Id. Valid for V1 scenarios. + :paramtype recovery_cloud_service_id: str + :keyword recovery_availability_set_id: The recovery availability set Id. + :paramtype recovery_availability_set_id: str + :keyword recovery_proximity_placement_group_id: The recovery proximity placement group Id. + :paramtype recovery_proximity_placement_group_id: str + :keyword vm_disks: The list of vm disk details. + :paramtype vm_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] + :keyword vm_managed_disks: The list of vm managed disk details. + :paramtype vm_managed_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmManagedDiskInputDetails] + :keyword multi_vm_group_name: The multi vm group name. + :paramtype multi_vm_group_name: str + :keyword multi_vm_group_id: The multi vm group id. + :paramtype multi_vm_group_id: str + :keyword recovery_boot_diag_storage_account_id: The boot diagnostic storage account. + :paramtype recovery_boot_diag_storage_account_id: str + :keyword disk_encryption_info: The recovery disk encryption information (for two pass flows). + :paramtype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + :keyword recovery_availability_zone: The recovery availability zone. + :paramtype recovery_availability_zone: str + :keyword recovery_extended_location: The recovery extended location. + :paramtype recovery_extended_location: + ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocation + :keyword recovery_azure_network_id: The recovery Azure virtual network ARM id. + :paramtype recovery_azure_network_id: str + :keyword recovery_subnet_name: The recovery subnet name. + :paramtype recovery_subnet_name: str + :keyword recovery_virtual_machine_scale_set_id: The virtual machine scale set Id. + :paramtype recovery_virtual_machine_scale_set_id: str + :keyword recovery_capacity_reservation_group_id: The recovery capacity reservation group Id. + :paramtype recovery_capacity_reservation_group_id: str + """ super(A2AEnableProtectionInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.fabric_object_id = fabric_object_id @@ -809,9 +1026,11 @@ def __init__( self.recovery_boot_diag_storage_account_id = recovery_boot_diag_storage_account_id self.disk_encryption_info = disk_encryption_info self.recovery_availability_zone = recovery_availability_zone + self.recovery_extended_location = recovery_extended_location self.recovery_azure_network_id = recovery_azure_network_id self.recovery_subnet_name = recovery_subnet_name self.recovery_virtual_machine_scale_set_id = recovery_virtual_machine_scale_set_id + self.recovery_capacity_reservation_group_id = recovery_capacity_reservation_group_id class EventProviderSpecificDetails(msrest.serialization.Model): @@ -822,9 +1041,9 @@ class EventProviderSpecificDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str """ _validation = { @@ -843,6 +1062,8 @@ def __init__( self, **kwargs ): + """ + """ super(EventProviderSpecificDetails, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -852,21 +1073,21 @@ class A2AEventDetails(EventProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param protected_item_name: The protected item arm name. - :type protected_item_name: str - :param fabric_object_id: The azure vm arm id. - :type fabric_object_id: str - :param fabric_name: Fabric arm name. - :type fabric_name: str - :param fabric_location: The fabric location. - :type fabric_location: str - :param remote_fabric_name: Remote fabric arm name. - :type remote_fabric_name: str - :param remote_fabric_location: Remote fabric location. - :type remote_fabric_location: str + :vartype instance_type: str + :ivar protected_item_name: The protected item arm name. + :vartype protected_item_name: str + :ivar fabric_object_id: The azure vm arm id. + :vartype fabric_object_id: str + :ivar fabric_name: Fabric arm name. + :vartype fabric_name: str + :ivar fabric_location: The fabric location. + :vartype fabric_location: str + :ivar remote_fabric_name: Remote fabric arm name. + :vartype remote_fabric_name: str + :ivar remote_fabric_location: Remote fabric location. + :vartype remote_fabric_location: str """ _validation = { @@ -894,6 +1115,20 @@ def __init__( remote_fabric_location: Optional[str] = None, **kwargs ): + """ + :keyword protected_item_name: The protected item arm name. + :paramtype protected_item_name: str + :keyword fabric_object_id: The azure vm arm id. + :paramtype fabric_object_id: str + :keyword fabric_name: Fabric arm name. + :paramtype fabric_name: str + :keyword fabric_location: The fabric location. + :paramtype fabric_location: str + :keyword remote_fabric_name: Remote fabric arm name. + :paramtype remote_fabric_name: str + :keyword remote_fabric_location: Remote fabric location. + :paramtype remote_fabric_location: str + """ super(A2AEventDetails, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.protected_item_name = protected_item_name @@ -909,19 +1144,19 @@ class A2APolicyCreationInput(PolicyProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_history: The duration in minutes until which the recovery points need to + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_history: The duration in minutes until which the recovery points need to be stored. - :type recovery_point_history: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in + :vartype recovery_point_history: int + :ivar crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in minutes). - :type crash_consistent_frequency_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be + :vartype crash_consistent_frequency_in_minutes: int + :ivar app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). + :vartype app_consistent_frequency_in_minutes: int + :ivar multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: "Enable", "Disable". - :type multi_vm_sync_status: str or + :vartype multi_vm_sync_status: str or ~azure.mgmt.recoveryservicessiterecovery.models.SetMultiVmSyncStatus """ @@ -947,6 +1182,21 @@ def __init__( app_consistent_frequency_in_minutes: Optional[int] = None, **kwargs ): + """ + :keyword recovery_point_history: The duration in minutes until which the recovery points need + to be stored. + :paramtype recovery_point_history: int + :keyword crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in + minutes). + :paramtype crash_consistent_frequency_in_minutes: int + :keyword app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in + minutes). + :paramtype app_consistent_frequency_in_minutes: int + :keyword multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be + enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: "Enable", "Disable". + :paramtype multi_vm_sync_status: str or + ~azure.mgmt.recoveryservicessiterecovery.models.SetMultiVmSyncStatus + """ super(A2APolicyCreationInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.recovery_point_history = recovery_point_history @@ -963,9 +1213,9 @@ class PolicyProviderSpecificDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str """ _validation = { @@ -984,6 +1234,8 @@ def __init__( self, **kwargs ): + """ + """ super(PolicyProviderSpecificDetails, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -993,21 +1245,21 @@ class A2APolicyDetails(PolicyProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param recovery_point_threshold_in_minutes: The recovery point threshold in minutes. - :type recovery_point_threshold_in_minutes: int - :param recovery_point_history: The duration in minutes until which the recovery points need to + :vartype instance_type: str + :ivar recovery_point_threshold_in_minutes: The recovery point threshold in minutes. + :vartype recovery_point_threshold_in_minutes: int + :ivar recovery_point_history: The duration in minutes until which the recovery points need to be stored. - :type recovery_point_history: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. - :type multi_vm_sync_status: str - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in + :vartype recovery_point_history: int + :ivar app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. + :vartype app_consistent_frequency_in_minutes: int + :ivar multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. + :vartype multi_vm_sync_status: str + :ivar crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in minutes. - :type crash_consistent_frequency_in_minutes: int + :vartype crash_consistent_frequency_in_minutes: int """ _validation = { @@ -1033,6 +1285,20 @@ def __init__( crash_consistent_frequency_in_minutes: Optional[int] = None, **kwargs ): + """ + :keyword recovery_point_threshold_in_minutes: The recovery point threshold in minutes. + :paramtype recovery_point_threshold_in_minutes: int + :keyword recovery_point_history: The duration in minutes until which the recovery points need + to be stored. + :paramtype recovery_point_history: int + :keyword app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. + :paramtype app_consistent_frequency_in_minutes: int + :keyword multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. + :paramtype multi_vm_sync_status: str + :keyword crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in + minutes. + :paramtype crash_consistent_frequency_in_minutes: int + """ super(A2APolicyDetails, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.recovery_point_threshold_in_minutes = recovery_point_threshold_in_minutes @@ -1045,55 +1311,55 @@ def __init__( class A2AProtectedDiskDetails(msrest.serialization.Model): """A2A protected disk details. - :param disk_uri: The disk uri. - :type disk_uri: str - :param recovery_azure_storage_account_id: The recovery disk storage account. - :type recovery_azure_storage_account_id: str - :param primary_disk_azure_storage_account_id: The primary disk storage account. - :type primary_disk_azure_storage_account_id: str - :param recovery_disk_uri: Recovery disk uri. - :type recovery_disk_uri: str - :param disk_name: The disk name. - :type disk_name: str - :param disk_capacity_in_bytes: The disk capacity in bytes. - :type disk_capacity_in_bytes: long - :param primary_staging_azure_storage_account_id: The primary staging storage account. - :type primary_staging_azure_storage_account_id: str - :param disk_type: The type of disk. - :type disk_type: str - :param resync_required: A value indicating whether resync is required for this disk. - :type resync_required: bool - :param monitoring_percentage_completion: The percentage of the monitoring job. The type of the + :ivar disk_uri: The disk uri. + :vartype disk_uri: str + :ivar recovery_azure_storage_account_id: The recovery disk storage account. + :vartype recovery_azure_storage_account_id: str + :ivar primary_disk_azure_storage_account_id: The primary disk storage account. + :vartype primary_disk_azure_storage_account_id: str + :ivar recovery_disk_uri: Recovery disk uri. + :vartype recovery_disk_uri: str + :ivar disk_name: The disk name. + :vartype disk_name: str + :ivar disk_capacity_in_bytes: The disk capacity in bytes. + :vartype disk_capacity_in_bytes: long + :ivar primary_staging_azure_storage_account_id: The primary staging storage account. + :vartype primary_staging_azure_storage_account_id: str + :ivar disk_type: The type of disk. + :vartype disk_type: str + :ivar resync_required: A value indicating whether resync is required for this disk. + :vartype resync_required: bool + :ivar monitoring_percentage_completion: The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. - :type monitoring_percentage_completion: int - :param monitoring_job_type: The type of the monitoring job. The progress is contained in + :vartype monitoring_percentage_completion: int + :ivar monitoring_job_type: The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. - :type monitoring_job_type: str - :param data_pending_in_staging_storage_account_in_mb: The data pending for replication in MB at + :vartype monitoring_job_type: str + :ivar data_pending_in_staging_storage_account_in_mb: The data pending for replication in MB at staging account. - :type data_pending_in_staging_storage_account_in_mb: float - :param data_pending_at_source_agent_in_mb: The data pending at source virtual machine in MB. - :type data_pending_at_source_agent_in_mb: float - :param disk_state: The disk state. - :type disk_state: str - :param allowed_disk_level_operation: The disk level operations list. - :type allowed_disk_level_operation: list[str] - :param is_disk_encrypted: A value indicating whether vm has encrypted os disk or not. - :type is_disk_encrypted: bool - :param secret_identifier: The secret URL / identifier (BEK). - :type secret_identifier: str - :param dek_key_vault_arm_id: The KeyVault resource id for secret (BEK). - :type dek_key_vault_arm_id: str - :param is_disk_key_encrypted: A value indicating whether disk key got encrypted or not. - :type is_disk_key_encrypted: bool - :param key_identifier: The key URL / identifier (KEK). - :type key_identifier: str - :param kek_key_vault_arm_id: The KeyVault resource id for key (KEK). - :type kek_key_vault_arm_id: str - :param failover_disk_name: The failover name for the managed disk. - :type failover_disk_name: str - :param tfo_disk_name: The test failover name for the managed disk. - :type tfo_disk_name: str + :vartype data_pending_in_staging_storage_account_in_mb: float + :ivar data_pending_at_source_agent_in_mb: The data pending at source virtual machine in MB. + :vartype data_pending_at_source_agent_in_mb: float + :ivar disk_state: The disk state. + :vartype disk_state: str + :ivar allowed_disk_level_operation: The disk level operations list. + :vartype allowed_disk_level_operation: list[str] + :ivar is_disk_encrypted: A value indicating whether vm has encrypted os disk or not. + :vartype is_disk_encrypted: bool + :ivar secret_identifier: The secret URL / identifier (BEK). + :vartype secret_identifier: str + :ivar dek_key_vault_arm_id: The KeyVault resource id for secret (BEK). + :vartype dek_key_vault_arm_id: str + :ivar is_disk_key_encrypted: A value indicating whether disk key got encrypted or not. + :vartype is_disk_key_encrypted: bool + :ivar key_identifier: The key URL / identifier (KEK). + :vartype key_identifier: str + :ivar kek_key_vault_arm_id: The KeyVault resource id for key (KEK). + :vartype kek_key_vault_arm_id: str + :ivar failover_disk_name: The failover name for the managed disk. + :vartype failover_disk_name: str + :ivar tfo_disk_name: The test failover name for the managed disk. + :vartype tfo_disk_name: str """ _attribute_map = { @@ -1150,6 +1416,57 @@ def __init__( tfo_disk_name: Optional[str] = None, **kwargs ): + """ + :keyword disk_uri: The disk uri. + :paramtype disk_uri: str + :keyword recovery_azure_storage_account_id: The recovery disk storage account. + :paramtype recovery_azure_storage_account_id: str + :keyword primary_disk_azure_storage_account_id: The primary disk storage account. + :paramtype primary_disk_azure_storage_account_id: str + :keyword recovery_disk_uri: Recovery disk uri. + :paramtype recovery_disk_uri: str + :keyword disk_name: The disk name. + :paramtype disk_name: str + :keyword disk_capacity_in_bytes: The disk capacity in bytes. + :paramtype disk_capacity_in_bytes: long + :keyword primary_staging_azure_storage_account_id: The primary staging storage account. + :paramtype primary_staging_azure_storage_account_id: str + :keyword disk_type: The type of disk. + :paramtype disk_type: str + :keyword resync_required: A value indicating whether resync is required for this disk. + :paramtype resync_required: bool + :keyword monitoring_percentage_completion: The percentage of the monitoring job. The type of + the monitoring job is defined by MonitoringJobType property. + :paramtype monitoring_percentage_completion: int + :keyword monitoring_job_type: The type of the monitoring job. The progress is contained in + MonitoringPercentageCompletion property. + :paramtype monitoring_job_type: str + :keyword data_pending_in_staging_storage_account_in_mb: The data pending for replication in MB + at staging account. + :paramtype data_pending_in_staging_storage_account_in_mb: float + :keyword data_pending_at_source_agent_in_mb: The data pending at source virtual machine in MB. + :paramtype data_pending_at_source_agent_in_mb: float + :keyword disk_state: The disk state. + :paramtype disk_state: str + :keyword allowed_disk_level_operation: The disk level operations list. + :paramtype allowed_disk_level_operation: list[str] + :keyword is_disk_encrypted: A value indicating whether vm has encrypted os disk or not. + :paramtype is_disk_encrypted: bool + :keyword secret_identifier: The secret URL / identifier (BEK). + :paramtype secret_identifier: str + :keyword dek_key_vault_arm_id: The KeyVault resource id for secret (BEK). + :paramtype dek_key_vault_arm_id: str + :keyword is_disk_key_encrypted: A value indicating whether disk key got encrypted or not. + :paramtype is_disk_key_encrypted: bool + :keyword key_identifier: The key URL / identifier (KEK). + :paramtype key_identifier: str + :keyword kek_key_vault_arm_id: The KeyVault resource id for key (KEK). + :paramtype kek_key_vault_arm_id: str + :keyword failover_disk_name: The failover name for the managed disk. + :paramtype failover_disk_name: str + :keyword tfo_disk_name: The test failover name for the managed disk. + :paramtype tfo_disk_name: str + """ super(A2AProtectedDiskDetails, self).__init__(**kwargs) self.disk_uri = disk_uri self.recovery_azure_storage_account_id = recovery_azure_storage_account_id @@ -1179,67 +1496,67 @@ def __init__( class A2AProtectedManagedDiskDetails(msrest.serialization.Model): """A2A protected managed disk details. - :param disk_id: The managed disk Arm id. - :type disk_id: str - :param recovery_resource_group_id: The recovery disk resource group Arm Id. - :type recovery_resource_group_id: str - :param recovery_target_disk_id: Recovery target disk Arm Id. - :type recovery_target_disk_id: str - :param recovery_replica_disk_id: Recovery replica disk Arm Id. - :type recovery_replica_disk_id: str - :param recovery_orignal_target_disk_id: Recovery original target disk Arm Id. - :type recovery_orignal_target_disk_id: str - :param recovery_replica_disk_account_type: The replica disk type. Its an optional value and - will be same as source disk type if not user provided. - :type recovery_replica_disk_account_type: str - :param recovery_target_disk_account_type: The target disk type after failover. Its an optional + :ivar disk_id: The managed disk Arm id. + :vartype disk_id: str + :ivar recovery_resource_group_id: The recovery disk resource group Arm Id. + :vartype recovery_resource_group_id: str + :ivar recovery_target_disk_id: Recovery target disk Arm Id. + :vartype recovery_target_disk_id: str + :ivar recovery_replica_disk_id: Recovery replica disk Arm Id. + :vartype recovery_replica_disk_id: str + :ivar recovery_orignal_target_disk_id: Recovery original target disk Arm Id. + :vartype recovery_orignal_target_disk_id: str + :ivar recovery_replica_disk_account_type: The replica disk type. Its an optional value and will + be same as source disk type if not user provided. + :vartype recovery_replica_disk_account_type: str + :ivar recovery_target_disk_account_type: The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. - :type recovery_target_disk_account_type: str - :param recovery_disk_encryption_set_id: The recovery disk encryption set Id. - :type recovery_disk_encryption_set_id: str - :param primary_disk_encryption_set_id: The primary disk encryption set Id. - :type primary_disk_encryption_set_id: str - :param disk_name: The disk name. - :type disk_name: str - :param disk_capacity_in_bytes: The disk capacity in bytes. - :type disk_capacity_in_bytes: long - :param primary_staging_azure_storage_account_id: The primary staging storage account. - :type primary_staging_azure_storage_account_id: str - :param disk_type: The type of disk. - :type disk_type: str - :param resync_required: A value indicating whether resync is required for this disk. - :type resync_required: bool - :param monitoring_percentage_completion: The percentage of the monitoring job. The type of the + :vartype recovery_target_disk_account_type: str + :ivar recovery_disk_encryption_set_id: The recovery disk encryption set Id. + :vartype recovery_disk_encryption_set_id: str + :ivar primary_disk_encryption_set_id: The primary disk encryption set Id. + :vartype primary_disk_encryption_set_id: str + :ivar disk_name: The disk name. + :vartype disk_name: str + :ivar disk_capacity_in_bytes: The disk capacity in bytes. + :vartype disk_capacity_in_bytes: long + :ivar primary_staging_azure_storage_account_id: The primary staging storage account. + :vartype primary_staging_azure_storage_account_id: str + :ivar disk_type: The type of disk. + :vartype disk_type: str + :ivar resync_required: A value indicating whether resync is required for this disk. + :vartype resync_required: bool + :ivar monitoring_percentage_completion: The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. - :type monitoring_percentage_completion: int - :param monitoring_job_type: The type of the monitoring job. The progress is contained in + :vartype monitoring_percentage_completion: int + :ivar monitoring_job_type: The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. - :type monitoring_job_type: str - :param data_pending_in_staging_storage_account_in_mb: The data pending for replication in MB at + :vartype monitoring_job_type: str + :ivar data_pending_in_staging_storage_account_in_mb: The data pending for replication in MB at staging account. - :type data_pending_in_staging_storage_account_in_mb: float - :param data_pending_at_source_agent_in_mb: The data pending at source virtual machine in MB. - :type data_pending_at_source_agent_in_mb: float - :param disk_state: The disk state. - :type disk_state: str - :param allowed_disk_level_operation: The disk level operations list. - :type allowed_disk_level_operation: list[str] - :param is_disk_encrypted: A value indicating whether vm has encrypted os disk or not. - :type is_disk_encrypted: bool - :param secret_identifier: The secret URL / identifier (BEK). - :type secret_identifier: str - :param dek_key_vault_arm_id: The KeyVault resource id for secret (BEK). - :type dek_key_vault_arm_id: str - :param is_disk_key_encrypted: A value indicating whether disk key got encrypted or not. - :type is_disk_key_encrypted: bool - :param key_identifier: The key URL / identifier (KEK). - :type key_identifier: str - :param kek_key_vault_arm_id: The KeyVault resource id for key (KEK). - :type kek_key_vault_arm_id: str - :param failover_disk_name: The failover name for the managed disk. - :type failover_disk_name: str - :param tfo_disk_name: The test failover name for the managed disk. - :type tfo_disk_name: str + :vartype data_pending_in_staging_storage_account_in_mb: float + :ivar data_pending_at_source_agent_in_mb: The data pending at source virtual machine in MB. + :vartype data_pending_at_source_agent_in_mb: float + :ivar disk_state: The disk state. + :vartype disk_state: str + :ivar allowed_disk_level_operation: The disk level operations list. + :vartype allowed_disk_level_operation: list[str] + :ivar is_disk_encrypted: A value indicating whether vm has encrypted os disk or not. + :vartype is_disk_encrypted: bool + :ivar secret_identifier: The secret URL / identifier (BEK). + :vartype secret_identifier: str + :ivar dek_key_vault_arm_id: The KeyVault resource id for secret (BEK). + :vartype dek_key_vault_arm_id: str + :ivar is_disk_key_encrypted: A value indicating whether disk key got encrypted or not. + :vartype is_disk_key_encrypted: bool + :ivar key_identifier: The key URL / identifier (KEK). + :vartype key_identifier: str + :ivar kek_key_vault_arm_id: The KeyVault resource id for key (KEK). + :vartype kek_key_vault_arm_id: str + :ivar failover_disk_name: The failover name for the managed disk. + :vartype failover_disk_name: str + :ivar tfo_disk_name: The test failover name for the managed disk. + :vartype tfo_disk_name: str """ _attribute_map = { @@ -1306,6 +1623,69 @@ def __init__( tfo_disk_name: Optional[str] = None, **kwargs ): + """ + :keyword disk_id: The managed disk Arm id. + :paramtype disk_id: str + :keyword recovery_resource_group_id: The recovery disk resource group Arm Id. + :paramtype recovery_resource_group_id: str + :keyword recovery_target_disk_id: Recovery target disk Arm Id. + :paramtype recovery_target_disk_id: str + :keyword recovery_replica_disk_id: Recovery replica disk Arm Id. + :paramtype recovery_replica_disk_id: str + :keyword recovery_orignal_target_disk_id: Recovery original target disk Arm Id. + :paramtype recovery_orignal_target_disk_id: str + :keyword recovery_replica_disk_account_type: The replica disk type. Its an optional value and + will be same as source disk type if not user provided. + :paramtype recovery_replica_disk_account_type: str + :keyword recovery_target_disk_account_type: The target disk type after failover. Its an + optional value and will be same as source disk type if not user provided. + :paramtype recovery_target_disk_account_type: str + :keyword recovery_disk_encryption_set_id: The recovery disk encryption set Id. + :paramtype recovery_disk_encryption_set_id: str + :keyword primary_disk_encryption_set_id: The primary disk encryption set Id. + :paramtype primary_disk_encryption_set_id: str + :keyword disk_name: The disk name. + :paramtype disk_name: str + :keyword disk_capacity_in_bytes: The disk capacity in bytes. + :paramtype disk_capacity_in_bytes: long + :keyword primary_staging_azure_storage_account_id: The primary staging storage account. + :paramtype primary_staging_azure_storage_account_id: str + :keyword disk_type: The type of disk. + :paramtype disk_type: str + :keyword resync_required: A value indicating whether resync is required for this disk. + :paramtype resync_required: bool + :keyword monitoring_percentage_completion: The percentage of the monitoring job. The type of + the monitoring job is defined by MonitoringJobType property. + :paramtype monitoring_percentage_completion: int + :keyword monitoring_job_type: The type of the monitoring job. The progress is contained in + MonitoringPercentageCompletion property. + :paramtype monitoring_job_type: str + :keyword data_pending_in_staging_storage_account_in_mb: The data pending for replication in MB + at staging account. + :paramtype data_pending_in_staging_storage_account_in_mb: float + :keyword data_pending_at_source_agent_in_mb: The data pending at source virtual machine in MB. + :paramtype data_pending_at_source_agent_in_mb: float + :keyword disk_state: The disk state. + :paramtype disk_state: str + :keyword allowed_disk_level_operation: The disk level operations list. + :paramtype allowed_disk_level_operation: list[str] + :keyword is_disk_encrypted: A value indicating whether vm has encrypted os disk or not. + :paramtype is_disk_encrypted: bool + :keyword secret_identifier: The secret URL / identifier (BEK). + :paramtype secret_identifier: str + :keyword dek_key_vault_arm_id: The KeyVault resource id for secret (BEK). + :paramtype dek_key_vault_arm_id: str + :keyword is_disk_key_encrypted: A value indicating whether disk key got encrypted or not. + :paramtype is_disk_key_encrypted: bool + :keyword key_identifier: The key URL / identifier (KEK). + :paramtype key_identifier: str + :keyword kek_key_vault_arm_id: The KeyVault resource id for key (KEK). + :paramtype kek_key_vault_arm_id: str + :keyword failover_disk_name: The failover name for the managed disk. + :paramtype failover_disk_name: str + :keyword tfo_disk_name: The test failover name for the managed disk. + :paramtype tfo_disk_name: str + """ super(A2AProtectedManagedDiskDetails, self).__init__(**kwargs) self.disk_id = disk_id self.recovery_resource_group_id = recovery_resource_group_id @@ -1345,9 +1725,9 @@ class ProtectionContainerMappingProviderSpecificDetails(msrest.serialization.Mod All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str """ _validation = { @@ -1366,6 +1746,8 @@ def __init__( self, **kwargs ): + """ + """ super(ProtectionContainerMappingProviderSpecificDetails, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -1375,19 +1757,23 @@ class A2AProtectionContainerMappingDetails(ProtectionContainerMappingProviderSpe All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param agent_auto_update_status: A value indicating whether the auto update is enabled. - Possible values include: "Disabled", "Enabled". - :type agent_auto_update_status: str or + :vartype instance_type: str + :ivar agent_auto_update_status: A value indicating whether the auto update is enabled. Possible + values include: "Disabled", "Enabled". + :vartype agent_auto_update_status: str or ~azure.mgmt.recoveryservicessiterecovery.models.AgentAutoUpdateStatus - :param automation_account_arm_id: The automation account arm id. - :type automation_account_arm_id: str - :param schedule_name: The schedule arm name. - :type schedule_name: str - :param job_schedule_name: The job schedule arm name. - :type job_schedule_name: str + :ivar automation_account_arm_id: The automation account arm id. + :vartype automation_account_arm_id: str + :ivar automation_account_authentication_type: A value indicating the type authentication to use + for automation Account. Possible values include: "RunAsAccount", "SystemAssignedIdentity". + :vartype automation_account_authentication_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AutomationAccountAuthenticationType + :ivar schedule_name: The schedule arm name. + :vartype schedule_name: str + :ivar job_schedule_name: The job schedule arm name. + :vartype job_schedule_name: str """ _validation = { @@ -1398,6 +1784,7 @@ class A2AProtectionContainerMappingDetails(ProtectionContainerMappingProviderSpe 'instance_type': {'key': 'instanceType', 'type': 'str'}, 'agent_auto_update_status': {'key': 'agentAutoUpdateStatus', 'type': 'str'}, 'automation_account_arm_id': {'key': 'automationAccountArmId', 'type': 'str'}, + 'automation_account_authentication_type': {'key': 'automationAccountAuthenticationType', 'type': 'str'}, 'schedule_name': {'key': 'scheduleName', 'type': 'str'}, 'job_schedule_name': {'key': 'jobScheduleName', 'type': 'str'}, } @@ -1407,14 +1794,32 @@ def __init__( *, agent_auto_update_status: Optional[Union[str, "AgentAutoUpdateStatus"]] = None, automation_account_arm_id: Optional[str] = None, + automation_account_authentication_type: Optional[Union[str, "AutomationAccountAuthenticationType"]] = None, schedule_name: Optional[str] = None, job_schedule_name: Optional[str] = None, **kwargs ): + """ + :keyword agent_auto_update_status: A value indicating whether the auto update is enabled. + Possible values include: "Disabled", "Enabled". + :paramtype agent_auto_update_status: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AgentAutoUpdateStatus + :keyword automation_account_arm_id: The automation account arm id. + :paramtype automation_account_arm_id: str + :keyword automation_account_authentication_type: A value indicating the type authentication to + use for automation Account. Possible values include: "RunAsAccount", "SystemAssignedIdentity". + :paramtype automation_account_authentication_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AutomationAccountAuthenticationType + :keyword schedule_name: The schedule arm name. + :paramtype schedule_name: str + :keyword job_schedule_name: The job schedule arm name. + :paramtype job_schedule_name: str + """ super(A2AProtectionContainerMappingDetails, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.agent_auto_update_status = agent_auto_update_status self.automation_account_arm_id = automation_account_arm_id + self.automation_account_authentication_type = automation_account_authentication_type self.schedule_name = schedule_name self.job_schedule_name = job_schedule_name @@ -1424,13 +1829,13 @@ class A2AProtectionIntentDiskInputDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param disk_uri: Required. The disk Uri. - :type disk_uri: str - :param recovery_azure_storage_account_custom_input: The recovery VHD storage account input. - :type recovery_azure_storage_account_custom_input: + :ivar disk_uri: Required. The disk Uri. + :vartype disk_uri: str + :ivar recovery_azure_storage_account_custom_input: The recovery VHD storage account input. + :vartype recovery_azure_storage_account_custom_input: ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails - :param primary_staging_storage_account_custom_input: The primary staging storage account input. - :type primary_staging_storage_account_custom_input: + :ivar primary_staging_storage_account_custom_input: The primary staging storage account input. + :vartype primary_staging_storage_account_custom_input: ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails """ @@ -1452,6 +1857,17 @@ def __init__( primary_staging_storage_account_custom_input: Optional["StorageAccountCustomDetails"] = None, **kwargs ): + """ + :keyword disk_uri: Required. The disk Uri. + :paramtype disk_uri: str + :keyword recovery_azure_storage_account_custom_input: The recovery VHD storage account input. + :paramtype recovery_azure_storage_account_custom_input: + ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails + :keyword primary_staging_storage_account_custom_input: The primary staging storage account + input. + :paramtype primary_staging_storage_account_custom_input: + ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails + """ super(A2AProtectionIntentDiskInputDetails, self).__init__(**kwargs) self.disk_uri = disk_uri self.recovery_azure_storage_account_custom_input = recovery_azure_storage_account_custom_input @@ -1463,25 +1879,26 @@ class A2AProtectionIntentManagedDiskInputDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param disk_id: Required. The disk Id. - :type disk_id: str - :param primary_staging_storage_account_custom_input: The primary staging storage account input. - :type primary_staging_storage_account_custom_input: + :ivar disk_id: Required. The disk Id. + :vartype disk_id: str + :ivar primary_staging_storage_account_custom_input: The primary staging storage account input. + :vartype primary_staging_storage_account_custom_input: ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails - :param recovery_resource_group_custom_input: The recovery resource group input. - :type recovery_resource_group_custom_input: + :ivar recovery_resource_group_custom_input: The recovery resource group input. + :vartype recovery_resource_group_custom_input: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryResourceGroupCustomDetails - :param recovery_replica_disk_account_type: The replica disk type. Its an optional value and - will be same as source disk type if not user provided. - :type recovery_replica_disk_account_type: str - :param recovery_target_disk_account_type: The target disk type after failover. Its an optional + :ivar recovery_replica_disk_account_type: The replica disk type. Its an optional value and will + be same as source disk type if not user provided. + :vartype recovery_replica_disk_account_type: str + :ivar recovery_target_disk_account_type: The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. - :type recovery_target_disk_account_type: str - :param recovery_disk_encryption_set_id: The recovery disk encryption set Id. - :type recovery_disk_encryption_set_id: str - :param disk_encryption_info: The recovery disk encryption information (for one / single pass + :vartype recovery_target_disk_account_type: str + :ivar recovery_disk_encryption_set_id: The recovery disk encryption set Id. + :vartype recovery_disk_encryption_set_id: str + :ivar disk_encryption_info: The recovery disk encryption information (for one / single pass flows). - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + :vartype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo """ _validation = { @@ -1510,6 +1927,29 @@ def __init__( disk_encryption_info: Optional["DiskEncryptionInfo"] = None, **kwargs ): + """ + :keyword disk_id: Required. The disk Id. + :paramtype disk_id: str + :keyword primary_staging_storage_account_custom_input: The primary staging storage account + input. + :paramtype primary_staging_storage_account_custom_input: + ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails + :keyword recovery_resource_group_custom_input: The recovery resource group input. + :paramtype recovery_resource_group_custom_input: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryResourceGroupCustomDetails + :keyword recovery_replica_disk_account_type: The replica disk type. Its an optional value and + will be same as source disk type if not user provided. + :paramtype recovery_replica_disk_account_type: str + :keyword recovery_target_disk_account_type: The target disk type after failover. Its an + optional value and will be same as source disk type if not user provided. + :paramtype recovery_target_disk_account_type: str + :keyword recovery_disk_encryption_set_id: The recovery disk encryption set Id. + :paramtype recovery_disk_encryption_set_id: str + :keyword disk_encryption_info: The recovery disk encryption information (for one / single pass + flows). + :paramtype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + """ super(A2AProtectionIntentManagedDiskInputDetails, self).__init__(**kwargs) self.disk_id = disk_id self.primary_staging_storage_account_custom_input = primary_staging_storage_account_custom_input @@ -1528,8 +1968,8 @@ class ProviderSpecificRecoveryPointDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the provider type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the provider type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -1548,6 +1988,8 @@ def __init__( self, **kwargs ): + """ + """ super(ProviderSpecificRecoveryPointDetails, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -1557,14 +1999,14 @@ class A2ARecoveryPointDetails(ProviderSpecificRecoveryPointDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the provider type.Constant filled by server. - :type instance_type: str - :param recovery_point_sync_type: A value indicating whether the recovery point is multi VM + :ivar instance_type: Required. Gets the provider type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_sync_type: A value indicating whether the recovery point is multi VM consistent. Possible values include: "MultiVmSyncRecoveryPoint", "PerVmRecoveryPoint". - :type recovery_point_sync_type: str or + :vartype recovery_point_sync_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointSyncType - :param disks: List of disk ids representing a recovery point. - :type disks: list[str] + :ivar disks: List of disk ids representing a recovery point. + :vartype disks: list[str] """ _validation = { @@ -1584,6 +2026,14 @@ def __init__( disks: Optional[List[str]] = None, **kwargs ): + """ + :keyword recovery_point_sync_type: A value indicating whether the recovery point is multi VM + consistent. Possible values include: "MultiVmSyncRecoveryPoint", "PerVmRecoveryPoint". + :paramtype recovery_point_sync_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointSyncType + :keyword disks: List of disk ids representing a recovery point. + :paramtype disks: list[str] + """ super(A2ARecoveryPointDetails, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.recovery_point_sync_type = recovery_point_sync_type @@ -1598,8 +2048,8 @@ class RemoveDisksProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -1618,6 +2068,8 @@ def __init__( self, **kwargs ): + """ + """ super(RemoveDisksProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -1627,12 +2079,12 @@ class A2ARemoveDisksInput(RemoveDisksProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param vm_disks_uris: The list of vm disk vhd URIs. - :type vm_disks_uris: list[str] - :param vm_managed_disks_ids: The list of vm managed disk Ids. - :type vm_managed_disks_ids: list[str] + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar vm_disks_uris: The list of vm disk vhd URIs. + :vartype vm_disks_uris: list[str] + :ivar vm_managed_disks_ids: The list of vm managed disk Ids. + :vartype vm_managed_disks_ids: list[str] """ _validation = { @@ -1652,6 +2104,12 @@ def __init__( vm_managed_disks_ids: Optional[List[str]] = None, **kwargs ): + """ + :keyword vm_disks_uris: The list of vm disk vhd URIs. + :paramtype vm_disks_uris: list[str] + :keyword vm_managed_disks_ids: The list of vm managed disk Ids. + :paramtype vm_managed_disks_ids: list[str] + """ super(A2ARemoveDisksInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.vm_disks_uris = vm_disks_uris @@ -1665,123 +2123,137 @@ class A2AReplicationDetails(ReplicationProviderSpecificSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param fabric_object_id: The fabric specific object Id of the virtual machine. - :type fabric_object_id: str + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str + :ivar fabric_object_id: The fabric specific object Id of the virtual machine. + :vartype fabric_object_id: str :ivar initial_primary_zone: The initial primary availability zone. :vartype initial_primary_zone: str :ivar initial_primary_fabric_location: The initial primary fabric location. :vartype initial_primary_fabric_location: str :ivar initial_recovery_zone: The initial recovery availability zone. :vartype initial_recovery_zone: str + :ivar initial_primary_extended_location: The initial primary extended location. + :vartype initial_primary_extended_location: + ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocation + :ivar initial_recovery_extended_location: The initial recovery extended location. + :vartype initial_recovery_extended_location: + ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocation :ivar initial_recovery_fabric_location: The initial recovery fabric location. :vartype initial_recovery_fabric_location: str - :param multi_vm_group_id: The multi vm group Id. - :type multi_vm_group_id: str - :param multi_vm_group_name: The multi vm group name. - :type multi_vm_group_name: str - :param multi_vm_group_create_option: Whether Multi VM group is auto created or specified by + :ivar multi_vm_group_id: The multi vm group Id. + :vartype multi_vm_group_id: str + :ivar multi_vm_group_name: The multi vm group name. + :vartype multi_vm_group_name: str + :ivar multi_vm_group_create_option: Whether Multi VM group is auto created or specified by user. Possible values include: "AutoCreated", "UserSpecified". - :type multi_vm_group_create_option: str or + :vartype multi_vm_group_create_option: str or ~azure.mgmt.recoveryservicessiterecovery.models.MultiVmGroupCreateOption - :param management_id: The management Id. - :type management_id: str - :param protected_disks: The list of protected disks. - :type protected_disks: + :ivar management_id: The management Id. + :vartype management_id: str + :ivar protected_disks: The list of protected disks. + :vartype protected_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectedDiskDetails] - :param unprotected_disks: The list of unprotected disks. - :type unprotected_disks: + :ivar unprotected_disks: The list of unprotected disks. + :vartype unprotected_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AUnprotectedDiskDetails] - :param protected_managed_disks: The list of protected managed disks. - :type protected_managed_disks: + :ivar protected_managed_disks: The list of protected managed disks. + :vartype protected_managed_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectedManagedDiskDetails] - :param recovery_boot_diag_storage_account_id: The recovery boot diagnostic storage account Arm + :ivar recovery_boot_diag_storage_account_id: The recovery boot diagnostic storage account Arm Id. - :type recovery_boot_diag_storage_account_id: str - :param primary_fabric_location: Primary fabric location. - :type primary_fabric_location: str - :param recovery_fabric_location: The recovery fabric location. - :type recovery_fabric_location: str - :param os_type: The type of operating system. - :type os_type: str - :param recovery_azure_vm_size: The size of recovery virtual machine. - :type recovery_azure_vm_size: str - :param recovery_azure_vm_name: The name of recovery virtual machine. - :type recovery_azure_vm_name: str - :param recovery_azure_resource_group_id: The recovery resource group. - :type recovery_azure_resource_group_id: str - :param recovery_cloud_service: The recovery cloud service. - :type recovery_cloud_service: str - :param recovery_availability_set: The recovery availability set. - :type recovery_availability_set: str - :param selected_recovery_azure_network_id: The recovery virtual network. - :type selected_recovery_azure_network_id: str - :param selected_tfo_azure_network_id: The test failover virtual network. - :type selected_tfo_azure_network_id: str - :param vm_nics: The virtual machine nic details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] - :param vm_synced_config_details: The synced configuration details. - :type vm_synced_config_details: + :vartype recovery_boot_diag_storage_account_id: str + :ivar primary_fabric_location: Primary fabric location. + :vartype primary_fabric_location: str + :ivar recovery_fabric_location: The recovery fabric location. + :vartype recovery_fabric_location: str + :ivar os_type: The type of operating system. + :vartype os_type: str + :ivar recovery_azure_vm_size: The size of recovery virtual machine. + :vartype recovery_azure_vm_size: str + :ivar recovery_azure_vm_name: The name of recovery virtual machine. + :vartype recovery_azure_vm_name: str + :ivar recovery_azure_resource_group_id: The recovery resource group. + :vartype recovery_azure_resource_group_id: str + :ivar recovery_cloud_service: The recovery cloud service. + :vartype recovery_cloud_service: str + :ivar recovery_availability_set: The recovery availability set. + :vartype recovery_availability_set: str + :ivar selected_recovery_azure_network_id: The recovery virtual network. + :vartype selected_recovery_azure_network_id: str + :ivar selected_tfo_azure_network_id: The test failover virtual network. + :vartype selected_tfo_azure_network_id: str + :ivar vm_nics: The virtual machine nic details. + :vartype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] + :ivar vm_synced_config_details: The synced configuration details. + :vartype vm_synced_config_details: ~azure.mgmt.recoveryservicessiterecovery.models.AzureToAzureVmSyncedConfigDetails - :param monitoring_percentage_completion: The percentage of the monitoring job. The type of the + :ivar monitoring_percentage_completion: The percentage of the monitoring job. The type of the monitoring job is defined by MonitoringJobType property. - :type monitoring_percentage_completion: int - :param monitoring_job_type: The type of the monitoring job. The progress is contained in + :vartype monitoring_percentage_completion: int + :ivar monitoring_job_type: The type of the monitoring job. The progress is contained in MonitoringPercentageCompletion property. - :type monitoring_job_type: str - :param last_heartbeat: The last heartbeat received from the source server. - :type last_heartbeat: ~datetime.datetime - :param agent_version: The agent version. - :type agent_version: str - :param agent_expiry_date: Agent expiry date. - :type agent_expiry_date: ~datetime.datetime - :param is_replication_agent_update_required: A value indicating whether replication agent - update is required. - :type is_replication_agent_update_required: bool + :vartype monitoring_job_type: str + :ivar last_heartbeat: The last heartbeat received from the source server. + :vartype last_heartbeat: ~datetime.datetime + :ivar agent_version: The agent version. + :vartype agent_version: str + :ivar agent_expiry_date: Agent expiry date. + :vartype agent_expiry_date: ~datetime.datetime + :ivar is_replication_agent_update_required: A value indicating whether replication agent update + is required. + :vartype is_replication_agent_update_required: bool :ivar agent_certificate_expiry_date: Agent certificate expiry date. :vartype agent_certificate_expiry_date: ~datetime.datetime - :param is_replication_agent_certificate_update_required: A value indicating whether agent + :ivar is_replication_agent_certificate_update_required: A value indicating whether agent certificate update is required. - :type is_replication_agent_certificate_update_required: bool - :param recovery_fabric_object_id: The recovery fabric object Id. - :type recovery_fabric_object_id: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param lifecycle_id: An id associated with the PE that survives actions like switch protection + :vartype is_replication_agent_certificate_update_required: bool + :ivar recovery_fabric_object_id: The recovery fabric object Id. + :vartype recovery_fabric_object_id: str + :ivar vm_protection_state: The protection state for the vm. + :vartype vm_protection_state: str + :ivar vm_protection_state_description: The protection state description for the vm. + :vartype vm_protection_state_description: str + :ivar lifecycle_id: An id associated with the PE that survives actions like switch protection which change the backing PE/CPE objects internally.The lifecycle id gets carried forward to have a link/continuity in being able to have an Id that denotes the "same" protected item even though other internal Ids/ARM Id might be changing. - :type lifecycle_id: str - :param test_failover_recovery_fabric_object_id: The test failover fabric object Id. - :type test_failover_recovery_fabric_object_id: str - :param rpo_in_seconds: The last RPO value in seconds. - :type rpo_in_seconds: long - :param last_rpo_calculated_time: The time (in UTC) when the last RPO value was calculated by + :vartype lifecycle_id: str + :ivar test_failover_recovery_fabric_object_id: The test failover fabric object Id. + :vartype test_failover_recovery_fabric_object_id: str + :ivar rpo_in_seconds: The last RPO value in seconds. + :vartype rpo_in_seconds: long + :ivar last_rpo_calculated_time: The time (in UTC) when the last RPO value was calculated by Protection Service. - :type last_rpo_calculated_time: ~datetime.datetime - :param primary_availability_zone: The primary availability zone. - :type primary_availability_zone: str - :param recovery_availability_zone: The recovery availability zone. - :type recovery_availability_zone: str + :vartype last_rpo_calculated_time: ~datetime.datetime + :ivar primary_availability_zone: The primary availability zone. + :vartype primary_availability_zone: str + :ivar recovery_availability_zone: The recovery availability zone. + :vartype recovery_availability_zone: str + :ivar primary_extended_location: The primary Extended Location. + :vartype primary_extended_location: + ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocation + :ivar recovery_extended_location: The recovery Extended Location. + :vartype recovery_extended_location: + ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocation :ivar vm_encryption_type: The encryption type of the VM. Possible values include: "NotEncrypted", "OnePassEncrypted", "TwoPassEncrypted". :vartype vm_encryption_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.VmEncryptionType - :param tfo_azure_vm_name: The test failover vm name. - :type tfo_azure_vm_name: str + :ivar tfo_azure_vm_name: The test failover vm name. + :vartype tfo_azure_vm_name: str :ivar recovery_azure_generation: The recovery azure generation. :vartype recovery_azure_generation: str - :param recovery_proximity_placement_group_id: The recovery proximity placement group Id. - :type recovery_proximity_placement_group_id: str - :param auto_protection_of_data_disk: A value indicating whether the auto protection is enabled. + :ivar recovery_proximity_placement_group_id: The recovery proximity placement group Id. + :vartype recovery_proximity_placement_group_id: str + :ivar auto_protection_of_data_disk: A value indicating whether the auto protection is enabled. Possible values include: "Disabled", "Enabled". - :type auto_protection_of_data_disk: str or + :vartype auto_protection_of_data_disk: str or ~azure.mgmt.recoveryservicessiterecovery.models.AutoProtectionOfDataDisk - :param recovery_virtual_machine_scale_set_id: The recovery virtual machine scale set id. - :type recovery_virtual_machine_scale_set_id: str + :ivar recovery_virtual_machine_scale_set_id: The recovery virtual machine scale set id. + :vartype recovery_virtual_machine_scale_set_id: str + :ivar recovery_capacity_reservation_group_id: The recovery capacity reservation group Id. + :vartype recovery_capacity_reservation_group_id: str """ _validation = { @@ -1801,6 +2273,8 @@ class A2AReplicationDetails(ReplicationProviderSpecificSettings): 'initial_primary_zone': {'key': 'initialPrimaryZone', 'type': 'str'}, 'initial_primary_fabric_location': {'key': 'initialPrimaryFabricLocation', 'type': 'str'}, 'initial_recovery_zone': {'key': 'initialRecoveryZone', 'type': 'str'}, + 'initial_primary_extended_location': {'key': 'initialPrimaryExtendedLocation', 'type': 'ExtendedLocation'}, + 'initial_recovery_extended_location': {'key': 'initialRecoveryExtendedLocation', 'type': 'ExtendedLocation'}, 'initial_recovery_fabric_location': {'key': 'initialRecoveryFabricLocation', 'type': 'str'}, 'multi_vm_group_id': {'key': 'multiVmGroupId', 'type': 'str'}, 'multi_vm_group_name': {'key': 'multiVmGroupName', 'type': 'str'}, @@ -1839,18 +2313,23 @@ class A2AReplicationDetails(ReplicationProviderSpecificSettings): 'last_rpo_calculated_time': {'key': 'lastRpoCalculatedTime', 'type': 'iso-8601'}, 'primary_availability_zone': {'key': 'primaryAvailabilityZone', 'type': 'str'}, 'recovery_availability_zone': {'key': 'recoveryAvailabilityZone', 'type': 'str'}, + 'primary_extended_location': {'key': 'primaryExtendedLocation', 'type': 'ExtendedLocation'}, + 'recovery_extended_location': {'key': 'recoveryExtendedLocation', 'type': 'ExtendedLocation'}, 'vm_encryption_type': {'key': 'vmEncryptionType', 'type': 'str'}, 'tfo_azure_vm_name': {'key': 'tfoAzureVMName', 'type': 'str'}, 'recovery_azure_generation': {'key': 'recoveryAzureGeneration', 'type': 'str'}, 'recovery_proximity_placement_group_id': {'key': 'recoveryProximityPlacementGroupId', 'type': 'str'}, 'auto_protection_of_data_disk': {'key': 'autoProtectionOfDataDisk', 'type': 'str'}, 'recovery_virtual_machine_scale_set_id': {'key': 'recoveryVirtualMachineScaleSetId', 'type': 'str'}, + 'recovery_capacity_reservation_group_id': {'key': 'recoveryCapacityReservationGroupId', 'type': 'str'}, } def __init__( self, *, fabric_object_id: Optional[str] = None, + initial_primary_extended_location: Optional["ExtendedLocation"] = None, + initial_recovery_extended_location: Optional["ExtendedLocation"] = None, multi_vm_group_id: Optional[str] = None, multi_vm_group_name: Optional[str] = None, multi_vm_group_create_option: Optional[Union[str, "MultiVmGroupCreateOption"]] = None, @@ -1887,18 +2366,138 @@ def __init__( last_rpo_calculated_time: Optional[datetime.datetime] = None, primary_availability_zone: Optional[str] = None, recovery_availability_zone: Optional[str] = None, + primary_extended_location: Optional["ExtendedLocation"] = None, + recovery_extended_location: Optional["ExtendedLocation"] = None, tfo_azure_vm_name: Optional[str] = None, recovery_proximity_placement_group_id: Optional[str] = None, auto_protection_of_data_disk: Optional[Union[str, "AutoProtectionOfDataDisk"]] = None, recovery_virtual_machine_scale_set_id: Optional[str] = None, - **kwargs - ): + recovery_capacity_reservation_group_id: Optional[str] = None, + **kwargs + ): + """ + :keyword fabric_object_id: The fabric specific object Id of the virtual machine. + :paramtype fabric_object_id: str + :keyword initial_primary_extended_location: The initial primary extended location. + :paramtype initial_primary_extended_location: + ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocation + :keyword initial_recovery_extended_location: The initial recovery extended location. + :paramtype initial_recovery_extended_location: + ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocation + :keyword multi_vm_group_id: The multi vm group Id. + :paramtype multi_vm_group_id: str + :keyword multi_vm_group_name: The multi vm group name. + :paramtype multi_vm_group_name: str + :keyword multi_vm_group_create_option: Whether Multi VM group is auto created or specified by + user. Possible values include: "AutoCreated", "UserSpecified". + :paramtype multi_vm_group_create_option: str or + ~azure.mgmt.recoveryservicessiterecovery.models.MultiVmGroupCreateOption + :keyword management_id: The management Id. + :paramtype management_id: str + :keyword protected_disks: The list of protected disks. + :paramtype protected_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectedDiskDetails] + :keyword unprotected_disks: The list of unprotected disks. + :paramtype unprotected_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AUnprotectedDiskDetails] + :keyword protected_managed_disks: The list of protected managed disks. + :paramtype protected_managed_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectedManagedDiskDetails] + :keyword recovery_boot_diag_storage_account_id: The recovery boot diagnostic storage account + Arm Id. + :paramtype recovery_boot_diag_storage_account_id: str + :keyword primary_fabric_location: Primary fabric location. + :paramtype primary_fabric_location: str + :keyword recovery_fabric_location: The recovery fabric location. + :paramtype recovery_fabric_location: str + :keyword os_type: The type of operating system. + :paramtype os_type: str + :keyword recovery_azure_vm_size: The size of recovery virtual machine. + :paramtype recovery_azure_vm_size: str + :keyword recovery_azure_vm_name: The name of recovery virtual machine. + :paramtype recovery_azure_vm_name: str + :keyword recovery_azure_resource_group_id: The recovery resource group. + :paramtype recovery_azure_resource_group_id: str + :keyword recovery_cloud_service: The recovery cloud service. + :paramtype recovery_cloud_service: str + :keyword recovery_availability_set: The recovery availability set. + :paramtype recovery_availability_set: str + :keyword selected_recovery_azure_network_id: The recovery virtual network. + :paramtype selected_recovery_azure_network_id: str + :keyword selected_tfo_azure_network_id: The test failover virtual network. + :paramtype selected_tfo_azure_network_id: str + :keyword vm_nics: The virtual machine nic details. + :paramtype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] + :keyword vm_synced_config_details: The synced configuration details. + :paramtype vm_synced_config_details: + ~azure.mgmt.recoveryservicessiterecovery.models.AzureToAzureVmSyncedConfigDetails + :keyword monitoring_percentage_completion: The percentage of the monitoring job. The type of + the monitoring job is defined by MonitoringJobType property. + :paramtype monitoring_percentage_completion: int + :keyword monitoring_job_type: The type of the monitoring job. The progress is contained in + MonitoringPercentageCompletion property. + :paramtype monitoring_job_type: str + :keyword last_heartbeat: The last heartbeat received from the source server. + :paramtype last_heartbeat: ~datetime.datetime + :keyword agent_version: The agent version. + :paramtype agent_version: str + :keyword agent_expiry_date: Agent expiry date. + :paramtype agent_expiry_date: ~datetime.datetime + :keyword is_replication_agent_update_required: A value indicating whether replication agent + update is required. + :paramtype is_replication_agent_update_required: bool + :keyword is_replication_agent_certificate_update_required: A value indicating whether agent + certificate update is required. + :paramtype is_replication_agent_certificate_update_required: bool + :keyword recovery_fabric_object_id: The recovery fabric object Id. + :paramtype recovery_fabric_object_id: str + :keyword vm_protection_state: The protection state for the vm. + :paramtype vm_protection_state: str + :keyword vm_protection_state_description: The protection state description for the vm. + :paramtype vm_protection_state_description: str + :keyword lifecycle_id: An id associated with the PE that survives actions like switch + protection which change the backing PE/CPE objects internally.The lifecycle id gets carried + forward to have a link/continuity in being able to have an Id that denotes the "same" protected + item even though other internal Ids/ARM Id might be changing. + :paramtype lifecycle_id: str + :keyword test_failover_recovery_fabric_object_id: The test failover fabric object Id. + :paramtype test_failover_recovery_fabric_object_id: str + :keyword rpo_in_seconds: The last RPO value in seconds. + :paramtype rpo_in_seconds: long + :keyword last_rpo_calculated_time: The time (in UTC) when the last RPO value was calculated by + Protection Service. + :paramtype last_rpo_calculated_time: ~datetime.datetime + :keyword primary_availability_zone: The primary availability zone. + :paramtype primary_availability_zone: str + :keyword recovery_availability_zone: The recovery availability zone. + :paramtype recovery_availability_zone: str + :keyword primary_extended_location: The primary Extended Location. + :paramtype primary_extended_location: + ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocation + :keyword recovery_extended_location: The recovery Extended Location. + :paramtype recovery_extended_location: + ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocation + :keyword tfo_azure_vm_name: The test failover vm name. + :paramtype tfo_azure_vm_name: str + :keyword recovery_proximity_placement_group_id: The recovery proximity placement group Id. + :paramtype recovery_proximity_placement_group_id: str + :keyword auto_protection_of_data_disk: A value indicating whether the auto protection is + enabled. Possible values include: "Disabled", "Enabled". + :paramtype auto_protection_of_data_disk: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AutoProtectionOfDataDisk + :keyword recovery_virtual_machine_scale_set_id: The recovery virtual machine scale set id. + :paramtype recovery_virtual_machine_scale_set_id: str + :keyword recovery_capacity_reservation_group_id: The recovery capacity reservation group Id. + :paramtype recovery_capacity_reservation_group_id: str + """ super(A2AReplicationDetails, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.fabric_object_id = fabric_object_id self.initial_primary_zone = None self.initial_primary_fabric_location = None self.initial_recovery_zone = None + self.initial_primary_extended_location = initial_primary_extended_location + self.initial_recovery_extended_location = initial_recovery_extended_location self.initial_recovery_fabric_location = None self.multi_vm_group_id = multi_vm_group_id self.multi_vm_group_name = multi_vm_group_name @@ -1937,12 +2536,15 @@ def __init__( self.last_rpo_calculated_time = last_rpo_calculated_time self.primary_availability_zone = primary_availability_zone self.recovery_availability_zone = recovery_availability_zone + self.primary_extended_location = primary_extended_location + self.recovery_extended_location = recovery_extended_location self.vm_encryption_type = None self.tfo_azure_vm_name = tfo_azure_vm_name self.recovery_azure_generation = None self.recovery_proximity_placement_group_id = recovery_proximity_placement_group_id self.auto_protection_of_data_disk = auto_protection_of_data_disk self.recovery_virtual_machine_scale_set_id = recovery_virtual_machine_scale_set_id + self.recovery_capacity_reservation_group_id = recovery_capacity_reservation_group_id class ReplicationProtectionIntentProviderSpecificSettings(msrest.serialization.Model): @@ -1953,8 +2555,8 @@ class ReplicationProtectionIntentProviderSpecificSettings(msrest.serialization.M All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -1973,6 +2575,8 @@ def __init__( self, **kwargs ): + """ + """ super(ReplicationProtectionIntentProviderSpecificSettings, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -1982,58 +2586,69 @@ class A2AReplicationIntentDetails(ReplicationProtectionIntentProviderSpecificSet All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param fabric_object_id: The fabric specific object Id of the virtual machine. - :type fabric_object_id: str - :param primary_location: The primary location for the virtual machine. - :type primary_location: str - :param recovery_location: The recovery location for the virtual machine. - :type recovery_location: str - :param recovery_subscription_id: The recovery subscription Id of the virtual machine. - :type recovery_subscription_id: str - :param vm_disks: The list of vm disk details. - :type vm_disks: + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str + :ivar fabric_object_id: The fabric specific object Id of the virtual machine. + :vartype fabric_object_id: str + :ivar primary_location: The primary location for the virtual machine. + :vartype primary_location: str + :ivar recovery_location: The recovery location for the virtual machine. + :vartype recovery_location: str + :ivar recovery_subscription_id: The recovery subscription Id of the virtual machine. + :vartype recovery_subscription_id: str + :ivar vm_disks: The list of vm disk details. + :vartype vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectionIntentDiskInputDetails] - :param vm_managed_disks: The list of vm managed disk details. - :type vm_managed_disks: + :ivar vm_managed_disks: The list of vm managed disk details. + :vartype vm_managed_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectionIntentManagedDiskInputDetails] - :param recovery_resource_group_id: The recovery resource group id. - :type recovery_resource_group_id: str - :param protection_profile: The protection profile custom details. - :type protection_profile: + :ivar recovery_resource_group_id: The recovery resource group id. + :vartype recovery_resource_group_id: str + :ivar protection_profile: The protection profile custom details. + :vartype protection_profile: ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionProfileCustomDetails - :param primary_staging_storage_account: The primary staging storage account details. - :type primary_staging_storage_account: + :ivar primary_staging_storage_account: The primary staging storage account details. + :vartype primary_staging_storage_account: ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails - :param recovery_availability_set: The recovery availability set details. - :type recovery_availability_set: + :ivar recovery_availability_set: The recovery availability set details. + :vartype recovery_availability_set: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryAvailabilitySetCustomDetails - :param recovery_virtual_network: The recovery virtual network details. - :type recovery_virtual_network: + :ivar recovery_virtual_network: The recovery virtual network details. + :vartype recovery_virtual_network: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryVirtualNetworkCustomDetails - :param recovery_proximity_placement_group: The recovery proximity placement group custom + :ivar recovery_proximity_placement_group: The recovery proximity placement group custom details. - :type recovery_proximity_placement_group: + :vartype recovery_proximity_placement_group: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryProximityPlacementGroupCustomDetails - :param auto_protection_of_data_disk: A value indicating whether the auto protection is enabled. + :ivar auto_protection_of_data_disk: A value indicating whether the auto protection is enabled. Possible values include: "Disabled", "Enabled". - :type auto_protection_of_data_disk: str or + :vartype auto_protection_of_data_disk: str or ~azure.mgmt.recoveryservicessiterecovery.models.AutoProtectionOfDataDisk - :param multi_vm_group_name: The multi vm group name. - :type multi_vm_group_name: str - :param multi_vm_group_id: The multi vm group id. - :type multi_vm_group_id: str - :param recovery_boot_diag_storage_account: The boot diagnostic storage account. - :type recovery_boot_diag_storage_account: + :ivar multi_vm_group_name: The multi vm group name. + :vartype multi_vm_group_name: str + :ivar multi_vm_group_id: The multi vm group id. + :vartype multi_vm_group_id: str + :ivar recovery_boot_diag_storage_account: The boot diagnostic storage account. + :vartype recovery_boot_diag_storage_account: ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails - :param disk_encryption_info: The recovery disk encryption information (for two pass flows). - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo - :param recovery_availability_zone: The recovery availability zone. - :type recovery_availability_zone: str - :param recovery_availability_type: Required. The recovery availability type of the virtual + :ivar disk_encryption_info: The recovery disk encryption information (for two pass flows). + :vartype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + :ivar recovery_availability_zone: The recovery availability zone. + :vartype recovery_availability_zone: str + :ivar recovery_availability_type: Required. The recovery availability type of the virtual machine. - :type recovery_availability_type: str + :vartype recovery_availability_type: str + :ivar agent_auto_update_status: A value indicating whether the auto update is enabled. Possible + values include: "Disabled", "Enabled". + :vartype agent_auto_update_status: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AgentAutoUpdateStatus + :ivar automation_account_arm_id: The automation account arm id. + :vartype automation_account_arm_id: str + :ivar automation_account_authentication_type: A value indicating the type authentication to use + for automation Account. Possible values include: "RunAsAccount", "SystemAssignedIdentity". + :vartype automation_account_authentication_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AutomationAccountAuthenticationType """ _validation = { @@ -2062,6 +2677,9 @@ class A2AReplicationIntentDetails(ReplicationProtectionIntentProviderSpecificSet 'disk_encryption_info': {'key': 'diskEncryptionInfo', 'type': 'DiskEncryptionInfo'}, 'recovery_availability_zone': {'key': 'recoveryAvailabilityZone', 'type': 'str'}, 'recovery_availability_type': {'key': 'recoveryAvailabilityType', 'type': 'str'}, + 'agent_auto_update_status': {'key': 'agentAutoUpdateStatus', 'type': 'str'}, + 'automation_account_arm_id': {'key': 'automationAccountArmId', 'type': 'str'}, + 'automation_account_authentication_type': {'key': 'automationAccountAuthenticationType', 'type': 'str'}, } def __init__( @@ -2086,8 +2704,74 @@ def __init__( recovery_boot_diag_storage_account: Optional["StorageAccountCustomDetails"] = None, disk_encryption_info: Optional["DiskEncryptionInfo"] = None, recovery_availability_zone: Optional[str] = None, - **kwargs - ): + agent_auto_update_status: Optional[Union[str, "AgentAutoUpdateStatus"]] = None, + automation_account_arm_id: Optional[str] = None, + automation_account_authentication_type: Optional[Union[str, "AutomationAccountAuthenticationType"]] = None, + **kwargs + ): + """ + :keyword fabric_object_id: The fabric specific object Id of the virtual machine. + :paramtype fabric_object_id: str + :keyword primary_location: The primary location for the virtual machine. + :paramtype primary_location: str + :keyword recovery_location: The recovery location for the virtual machine. + :paramtype recovery_location: str + :keyword recovery_subscription_id: The recovery subscription Id of the virtual machine. + :paramtype recovery_subscription_id: str + :keyword vm_disks: The list of vm disk details. + :paramtype vm_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectionIntentDiskInputDetails] + :keyword vm_managed_disks: The list of vm managed disk details. + :paramtype vm_managed_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AProtectionIntentManagedDiskInputDetails] + :keyword recovery_resource_group_id: The recovery resource group id. + :paramtype recovery_resource_group_id: str + :keyword protection_profile: The protection profile custom details. + :paramtype protection_profile: + ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionProfileCustomDetails + :keyword primary_staging_storage_account: The primary staging storage account details. + :paramtype primary_staging_storage_account: + ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails + :keyword recovery_availability_set: The recovery availability set details. + :paramtype recovery_availability_set: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryAvailabilitySetCustomDetails + :keyword recovery_virtual_network: The recovery virtual network details. + :paramtype recovery_virtual_network: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryVirtualNetworkCustomDetails + :keyword recovery_proximity_placement_group: The recovery proximity placement group custom + details. + :paramtype recovery_proximity_placement_group: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryProximityPlacementGroupCustomDetails + :keyword auto_protection_of_data_disk: A value indicating whether the auto protection is + enabled. Possible values include: "Disabled", "Enabled". + :paramtype auto_protection_of_data_disk: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AutoProtectionOfDataDisk + :keyword multi_vm_group_name: The multi vm group name. + :paramtype multi_vm_group_name: str + :keyword multi_vm_group_id: The multi vm group id. + :paramtype multi_vm_group_id: str + :keyword recovery_boot_diag_storage_account: The boot diagnostic storage account. + :paramtype recovery_boot_diag_storage_account: + ~azure.mgmt.recoveryservicessiterecovery.models.StorageAccountCustomDetails + :keyword disk_encryption_info: The recovery disk encryption information (for two pass flows). + :paramtype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + :keyword recovery_availability_zone: The recovery availability zone. + :paramtype recovery_availability_zone: str + :keyword recovery_availability_type: Required. The recovery availability type of the virtual + machine. + :paramtype recovery_availability_type: str + :keyword agent_auto_update_status: A value indicating whether the auto update is enabled. + Possible values include: "Disabled", "Enabled". + :paramtype agent_auto_update_status: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AgentAutoUpdateStatus + :keyword automation_account_arm_id: The automation account arm id. + :paramtype automation_account_arm_id: str + :keyword automation_account_authentication_type: A value indicating the type authentication to + use for automation Account. Possible values include: "RunAsAccount", "SystemAssignedIdentity". + :paramtype automation_account_authentication_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AutomationAccountAuthenticationType + """ super(A2AReplicationIntentDetails, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.fabric_object_id = fabric_object_id @@ -2109,6 +2793,9 @@ def __init__( self.disk_encryption_info = disk_encryption_info self.recovery_availability_zone = recovery_availability_zone self.recovery_availability_type = recovery_availability_type + self.agent_auto_update_status = agent_auto_update_status + self.automation_account_arm_id = automation_account_arm_id + self.automation_account_authentication_type = automation_account_authentication_type class ReverseReplicationProviderSpecificInput(msrest.serialization.Model): @@ -2119,8 +2806,8 @@ class ReverseReplicationProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -2139,6 +2826,8 @@ def __init__( self, **kwargs ): + """ + """ super(ReverseReplicationProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -2148,20 +2837,20 @@ class A2AReprotectInput(ReverseReplicationProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_container_id: The recovery container Id. - :type recovery_container_id: str - :param vm_disks: The list of vm disk details. - :type vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] - :param recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. - :type recovery_resource_group_id: str - :param recovery_cloud_service_id: The recovery cloud service Id. Valid for V1 scenarios. - :type recovery_cloud_service_id: str - :param recovery_availability_set_id: The recovery availability set. - :type recovery_availability_set_id: str - :param policy_id: The Policy Id. - :type policy_id: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_container_id: The recovery container Id. + :vartype recovery_container_id: str + :ivar vm_disks: The list of vm disk details. + :vartype vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] + :ivar recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. + :vartype recovery_resource_group_id: str + :ivar recovery_cloud_service_id: The recovery cloud service Id. Valid for V1 scenarios. + :vartype recovery_cloud_service_id: str + :ivar recovery_availability_set_id: The recovery availability set. + :vartype recovery_availability_set_id: str + :ivar policy_id: The Policy Id. + :vartype policy_id: str """ _validation = { @@ -2189,6 +2878,21 @@ def __init__( policy_id: Optional[str] = None, **kwargs ): + """ + :keyword recovery_container_id: The recovery container Id. + :paramtype recovery_container_id: str + :keyword vm_disks: The list of vm disk details. + :paramtype vm_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] + :keyword recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. + :paramtype recovery_resource_group_id: str + :keyword recovery_cloud_service_id: The recovery cloud service Id. Valid for V1 scenarios. + :paramtype recovery_cloud_service_id: str + :keyword recovery_availability_set_id: The recovery availability set. + :paramtype recovery_availability_set_id: str + :keyword policy_id: The Policy Id. + :paramtype policy_id: str + """ super(A2AReprotectInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.recovery_container_id = recovery_container_id @@ -2207,8 +2911,8 @@ class SwitchProtectionProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -2227,6 +2931,8 @@ def __init__( self, **kwargs ): + """ + """ super(SwitchProtectionProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -2236,33 +2942,36 @@ class A2ASwitchProtectionInput(SwitchProtectionProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param recovery_container_id: The recovery container Id. - :type recovery_container_id: str - :param vm_disks: The list of vm disk details. - :type vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] - :param vm_managed_disks: The list of vm managed disk details. - :type vm_managed_disks: + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_container_id: The recovery container Id. + :vartype recovery_container_id: str + :ivar vm_disks: The list of vm disk details. + :vartype vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] + :ivar vm_managed_disks: The list of vm managed disk details. + :vartype vm_managed_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmManagedDiskInputDetails] - :param recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. - :type recovery_resource_group_id: str - :param recovery_cloud_service_id: The recovery cloud service Id. Valid for V1 scenarios. - :type recovery_cloud_service_id: str - :param recovery_availability_set_id: The recovery availability set. - :type recovery_availability_set_id: str - :param policy_id: The Policy Id. - :type policy_id: str - :param recovery_boot_diag_storage_account_id: The boot diagnostic storage account. - :type recovery_boot_diag_storage_account_id: str - :param recovery_availability_zone: The recovery availability zone. - :type recovery_availability_zone: str - :param recovery_proximity_placement_group_id: The recovery proximity placement group Id. - :type recovery_proximity_placement_group_id: str - :param recovery_virtual_machine_scale_set_id: The virtual machine scale set id. - :type recovery_virtual_machine_scale_set_id: str - :param disk_encryption_info: The recovery disk encryption information. - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + :ivar recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. + :vartype recovery_resource_group_id: str + :ivar recovery_cloud_service_id: The recovery cloud service Id. Valid for V1 scenarios. + :vartype recovery_cloud_service_id: str + :ivar recovery_availability_set_id: The recovery availability set. + :vartype recovery_availability_set_id: str + :ivar policy_id: The Policy Id. + :vartype policy_id: str + :ivar recovery_boot_diag_storage_account_id: The boot diagnostic storage account. + :vartype recovery_boot_diag_storage_account_id: str + :ivar recovery_availability_zone: The recovery availability zone. + :vartype recovery_availability_zone: str + :ivar recovery_proximity_placement_group_id: The recovery proximity placement group Id. + :vartype recovery_proximity_placement_group_id: str + :ivar recovery_virtual_machine_scale_set_id: The virtual machine scale set id. + :vartype recovery_virtual_machine_scale_set_id: str + :ivar recovery_capacity_reservation_group_id: The recovery capacity reservation group Id. + :vartype recovery_capacity_reservation_group_id: str + :ivar disk_encryption_info: The recovery disk encryption information. + :vartype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo """ _validation = { @@ -2282,6 +2991,7 @@ class A2ASwitchProtectionInput(SwitchProtectionProviderSpecificInput): 'recovery_availability_zone': {'key': 'recoveryAvailabilityZone', 'type': 'str'}, 'recovery_proximity_placement_group_id': {'key': 'recoveryProximityPlacementGroupId', 'type': 'str'}, 'recovery_virtual_machine_scale_set_id': {'key': 'recoveryVirtualMachineScaleSetId', 'type': 'str'}, + 'recovery_capacity_reservation_group_id': {'key': 'recoveryCapacityReservationGroupId', 'type': 'str'}, 'disk_encryption_info': {'key': 'diskEncryptionInfo', 'type': 'DiskEncryptionInfo'}, } @@ -2299,9 +3009,41 @@ def __init__( recovery_availability_zone: Optional[str] = None, recovery_proximity_placement_group_id: Optional[str] = None, recovery_virtual_machine_scale_set_id: Optional[str] = None, + recovery_capacity_reservation_group_id: Optional[str] = None, disk_encryption_info: Optional["DiskEncryptionInfo"] = None, **kwargs ): + """ + :keyword recovery_container_id: The recovery container Id. + :paramtype recovery_container_id: str + :keyword vm_disks: The list of vm disk details. + :paramtype vm_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmDiskInputDetails] + :keyword vm_managed_disks: The list of vm managed disk details. + :paramtype vm_managed_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmManagedDiskInputDetails] + :keyword recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. + :paramtype recovery_resource_group_id: str + :keyword recovery_cloud_service_id: The recovery cloud service Id. Valid for V1 scenarios. + :paramtype recovery_cloud_service_id: str + :keyword recovery_availability_set_id: The recovery availability set. + :paramtype recovery_availability_set_id: str + :keyword policy_id: The Policy Id. + :paramtype policy_id: str + :keyword recovery_boot_diag_storage_account_id: The boot diagnostic storage account. + :paramtype recovery_boot_diag_storage_account_id: str + :keyword recovery_availability_zone: The recovery availability zone. + :paramtype recovery_availability_zone: str + :keyword recovery_proximity_placement_group_id: The recovery proximity placement group Id. + :paramtype recovery_proximity_placement_group_id: str + :keyword recovery_virtual_machine_scale_set_id: The virtual machine scale set id. + :paramtype recovery_virtual_machine_scale_set_id: str + :keyword recovery_capacity_reservation_group_id: The recovery capacity reservation group Id. + :paramtype recovery_capacity_reservation_group_id: str + :keyword disk_encryption_info: The recovery disk encryption information. + :paramtype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + """ super(A2ASwitchProtectionInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.recovery_container_id = recovery_container_id @@ -2315,6 +3057,7 @@ def __init__( self.recovery_availability_zone = recovery_availability_zone self.recovery_proximity_placement_group_id = recovery_proximity_placement_group_id self.recovery_virtual_machine_scale_set_id = recovery_virtual_machine_scale_set_id + self.recovery_capacity_reservation_group_id = recovery_capacity_reservation_group_id self.disk_encryption_info = disk_encryption_info @@ -2326,8 +3069,8 @@ class TestFailoverProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -2346,6 +3089,8 @@ def __init__( self, **kwargs ): + """ + """ super(TestFailoverProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -2355,14 +3100,14 @@ class A2ATestFailoverInput(TestFailoverProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_id: The recovery point id to be passed to test failover to a particular + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_id: The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str - :param cloud_service_creation_option: A value indicating whether to use recovery cloud service + :vartype recovery_point_id: str + :ivar cloud_service_creation_option: A value indicating whether to use recovery cloud service for TFO or not. - :type cloud_service_creation_option: str + :vartype cloud_service_creation_option: str """ _validation = { @@ -2382,6 +3127,14 @@ def __init__( cloud_service_creation_option: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_id: The recovery point id to be passed to test failover to a particular + recovery point. In case of latest recovery point, null should be passed. + :paramtype recovery_point_id: str + :keyword cloud_service_creation_option: A value indicating whether to use recovery cloud + service for TFO or not. + :paramtype cloud_service_creation_option: str + """ super(A2ATestFailoverInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.recovery_point_id = recovery_point_id @@ -2396,8 +3149,8 @@ class UnplannedFailoverProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -2416,6 +3169,8 @@ def __init__( self, **kwargs ): + """ + """ super(UnplannedFailoverProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -2425,14 +3180,14 @@ class A2AUnplannedFailoverInput(UnplannedFailoverProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_id: The recovery point id to be passed to failover to a particular + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_id: The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str - :param cloud_service_creation_option: A value indicating whether to use recovery cloud service + :vartype recovery_point_id: str + :ivar cloud_service_creation_option: A value indicating whether to use recovery cloud service for failover or not. - :type cloud_service_creation_option: str + :vartype cloud_service_creation_option: str """ _validation = { @@ -2452,6 +3207,14 @@ def __init__( cloud_service_creation_option: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_id: The recovery point id to be passed to failover to a particular + recovery point. In case of latest recovery point, null should be passed. + :paramtype recovery_point_id: str + :keyword cloud_service_creation_option: A value indicating whether to use recovery cloud + service for failover or not. + :paramtype cloud_service_creation_option: str + """ super(A2AUnplannedFailoverInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.recovery_point_id = recovery_point_id @@ -2461,11 +3224,11 @@ def __init__( class A2AUnprotectedDiskDetails(msrest.serialization.Model): """A2A unprotected disk details. - :param disk_lun_id: The source lun Id for the data disk. - :type disk_lun_id: int - :param disk_auto_protection_status: A value indicating whether the disk auto protection is + :ivar disk_lun_id: The source lun Id for the data disk. + :vartype disk_lun_id: int + :ivar disk_auto_protection_status: A value indicating whether the disk auto protection is enabled. Possible values include: "Disabled", "Enabled". - :type disk_auto_protection_status: str or + :vartype disk_auto_protection_status: str or ~azure.mgmt.recoveryservicessiterecovery.models.AutoProtectionOfDataDisk """ @@ -2481,6 +3244,14 @@ def __init__( disk_auto_protection_status: Optional[Union[str, "AutoProtectionOfDataDisk"]] = None, **kwargs ): + """ + :keyword disk_lun_id: The source lun Id for the data disk. + :paramtype disk_lun_id: int + :keyword disk_auto_protection_status: A value indicating whether the disk auto protection is + enabled. Possible values include: "Disabled", "Enabled". + :paramtype disk_auto_protection_status: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AutoProtectionOfDataDisk + """ super(A2AUnprotectedDiskDetails, self).__init__(**kwargs) self.disk_lun_id = disk_lun_id self.disk_auto_protection_status = disk_auto_protection_status @@ -2494,8 +3265,8 @@ class ReplicationProviderSpecificUpdateContainerMappingInput(msrest.serializatio All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -2514,6 +3285,8 @@ def __init__( self, **kwargs ): + """ + """ super(ReplicationProviderSpecificUpdateContainerMappingInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -2523,14 +3296,18 @@ class A2AUpdateContainerMappingInput(ReplicationProviderSpecificUpdateContainerM All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param agent_auto_update_status: A value indicating whether the auto update is enabled. - Possible values include: "Disabled", "Enabled". - :type agent_auto_update_status: str or + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar agent_auto_update_status: A value indicating whether the auto update is enabled. Possible + values include: "Disabled", "Enabled". + :vartype agent_auto_update_status: str or ~azure.mgmt.recoveryservicessiterecovery.models.AgentAutoUpdateStatus - :param automation_account_arm_id: The automation account arm id. - :type automation_account_arm_id: str + :ivar automation_account_arm_id: The automation account arm id. + :vartype automation_account_arm_id: str + :ivar automation_account_authentication_type: A value indicating the type authentication to use + for automation Account. Possible values include: "RunAsAccount", "SystemAssignedIdentity". + :vartype automation_account_authentication_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AutomationAccountAuthenticationType """ _validation = { @@ -2541,6 +3318,7 @@ class A2AUpdateContainerMappingInput(ReplicationProviderSpecificUpdateContainerM 'instance_type': {'key': 'instanceType', 'type': 'str'}, 'agent_auto_update_status': {'key': 'agentAutoUpdateStatus', 'type': 'str'}, 'automation_account_arm_id': {'key': 'automationAccountArmId', 'type': 'str'}, + 'automation_account_authentication_type': {'key': 'automationAccountAuthenticationType', 'type': 'str'}, } def __init__( @@ -2548,12 +3326,26 @@ def __init__( *, agent_auto_update_status: Optional[Union[str, "AgentAutoUpdateStatus"]] = None, automation_account_arm_id: Optional[str] = None, - **kwargs - ): + automation_account_authentication_type: Optional[Union[str, "AutomationAccountAuthenticationType"]] = None, + **kwargs + ): + """ + :keyword agent_auto_update_status: A value indicating whether the auto update is enabled. + Possible values include: "Disabled", "Enabled". + :paramtype agent_auto_update_status: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AgentAutoUpdateStatus + :keyword automation_account_arm_id: The automation account arm id. + :paramtype automation_account_arm_id: str + :keyword automation_account_authentication_type: A value indicating the type authentication to + use for automation Account. Possible values include: "RunAsAccount", "SystemAssignedIdentity". + :paramtype automation_account_authentication_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AutomationAccountAuthenticationType + """ super(A2AUpdateContainerMappingInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.agent_auto_update_status = agent_auto_update_status self.automation_account_arm_id = automation_account_arm_id + self.automation_account_authentication_type = automation_account_authentication_type class UpdateReplicationProtectedItemProviderInput(msrest.serialization.Model): @@ -2564,8 +3356,8 @@ class UpdateReplicationProtectedItemProviderInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -2584,6 +3376,8 @@ def __init__( self, **kwargs ): + """ + """ super(UpdateReplicationProtectedItemProviderInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -2593,25 +3387,28 @@ class A2AUpdateReplicationProtectedItemInput(UpdateReplicationProtectedItemProvi All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_cloud_service_id: The target cloud service ARM Id (for V1). - :type recovery_cloud_service_id: str - :param recovery_resource_group_id: The target resource group ARM Id (for V2). - :type recovery_resource_group_id: str - :param managed_disk_update_details: Managed disk update details. - :type managed_disk_update_details: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_cloud_service_id: The target cloud service ARM Id (for V1). + :vartype recovery_cloud_service_id: str + :ivar recovery_resource_group_id: The target resource group ARM Id (for V2). + :vartype recovery_resource_group_id: str + :ivar managed_disk_update_details: Managed disk update details. + :vartype managed_disk_update_details: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmManagedDiskUpdateDetails] - :param recovery_boot_diag_storage_account_id: The boot diagnostic storage account. - :type recovery_boot_diag_storage_account_id: str - :param disk_encryption_info: The recovery os disk encryption information. - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo - :param tfo_azure_vm_name: The user given name for Test Failover VM. - :type tfo_azure_vm_name: str - :param recovery_proximity_placement_group_id: The recovery proximity placement group Id. - :type recovery_proximity_placement_group_id: str - :param recovery_virtual_machine_scale_set_id: The recovery virtual machine scale set Id. - :type recovery_virtual_machine_scale_set_id: str + :ivar recovery_boot_diag_storage_account_id: The boot diagnostic storage account. + :vartype recovery_boot_diag_storage_account_id: str + :ivar disk_encryption_info: The recovery os disk encryption information. + :vartype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + :ivar tfo_azure_vm_name: The user given name for Test Failover VM. + :vartype tfo_azure_vm_name: str + :ivar recovery_proximity_placement_group_id: The recovery proximity placement group Id. + :vartype recovery_proximity_placement_group_id: str + :ivar recovery_virtual_machine_scale_set_id: The recovery virtual machine scale set Id. + :vartype recovery_virtual_machine_scale_set_id: str + :ivar recovery_capacity_reservation_group_id: The recovery capacity reservation group Id. + :vartype recovery_capacity_reservation_group_id: str """ _validation = { @@ -2628,6 +3425,7 @@ class A2AUpdateReplicationProtectedItemInput(UpdateReplicationProtectedItemProvi 'tfo_azure_vm_name': {'key': 'tfoAzureVMName', 'type': 'str'}, 'recovery_proximity_placement_group_id': {'key': 'recoveryProximityPlacementGroupId', 'type': 'str'}, 'recovery_virtual_machine_scale_set_id': {'key': 'recoveryVirtualMachineScaleSetId', 'type': 'str'}, + 'recovery_capacity_reservation_group_id': {'key': 'recoveryCapacityReservationGroupId', 'type': 'str'}, } def __init__( @@ -2641,8 +3439,31 @@ def __init__( tfo_azure_vm_name: Optional[str] = None, recovery_proximity_placement_group_id: Optional[str] = None, recovery_virtual_machine_scale_set_id: Optional[str] = None, - **kwargs - ): + recovery_capacity_reservation_group_id: Optional[str] = None, + **kwargs + ): + """ + :keyword recovery_cloud_service_id: The target cloud service ARM Id (for V1). + :paramtype recovery_cloud_service_id: str + :keyword recovery_resource_group_id: The target resource group ARM Id (for V2). + :paramtype recovery_resource_group_id: str + :keyword managed_disk_update_details: Managed disk update details. + :paramtype managed_disk_update_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.A2AVmManagedDiskUpdateDetails] + :keyword recovery_boot_diag_storage_account_id: The boot diagnostic storage account. + :paramtype recovery_boot_diag_storage_account_id: str + :keyword disk_encryption_info: The recovery os disk encryption information. + :paramtype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + :keyword tfo_azure_vm_name: The user given name for Test Failover VM. + :paramtype tfo_azure_vm_name: str + :keyword recovery_proximity_placement_group_id: The recovery proximity placement group Id. + :paramtype recovery_proximity_placement_group_id: str + :keyword recovery_virtual_machine_scale_set_id: The recovery virtual machine scale set Id. + :paramtype recovery_virtual_machine_scale_set_id: str + :keyword recovery_capacity_reservation_group_id: The recovery capacity reservation group Id. + :paramtype recovery_capacity_reservation_group_id: str + """ super(A2AUpdateReplicationProtectedItemInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.recovery_cloud_service_id = recovery_cloud_service_id @@ -2653,6 +3474,7 @@ def __init__( self.tfo_azure_vm_name = tfo_azure_vm_name self.recovery_proximity_placement_group_id = recovery_proximity_placement_group_id self.recovery_virtual_machine_scale_set_id = recovery_virtual_machine_scale_set_id + self.recovery_capacity_reservation_group_id = recovery_capacity_reservation_group_id class A2AVmDiskInputDetails(msrest.serialization.Model): @@ -2660,13 +3482,13 @@ class A2AVmDiskInputDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param disk_uri: Required. The disk Uri. - :type disk_uri: str - :param recovery_azure_storage_account_id: Required. The recovery VHD storage account Id. - :type recovery_azure_storage_account_id: str - :param primary_staging_azure_storage_account_id: Required. The primary staging storage account + :ivar disk_uri: Required. The disk Uri. + :vartype disk_uri: str + :ivar recovery_azure_storage_account_id: Required. The recovery VHD storage account Id. + :vartype recovery_azure_storage_account_id: str + :ivar primary_staging_azure_storage_account_id: Required. The primary staging storage account Id. - :type primary_staging_azure_storage_account_id: str + :vartype primary_staging_azure_storage_account_id: str """ _validation = { @@ -2689,6 +3511,15 @@ def __init__( primary_staging_azure_storage_account_id: str, **kwargs ): + """ + :keyword disk_uri: Required. The disk Uri. + :paramtype disk_uri: str + :keyword recovery_azure_storage_account_id: Required. The recovery VHD storage account Id. + :paramtype recovery_azure_storage_account_id: str + :keyword primary_staging_azure_storage_account_id: Required. The primary staging storage + account Id. + :paramtype primary_staging_azure_storage_account_id: str + """ super(A2AVmDiskInputDetails, self).__init__(**kwargs) self.disk_uri = disk_uri self.recovery_azure_storage_account_id = recovery_azure_storage_account_id @@ -2700,24 +3531,25 @@ class A2AVmManagedDiskInputDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param disk_id: Required. The disk Id. - :type disk_id: str - :param primary_staging_azure_storage_account_id: Required. The primary staging storage account + :ivar disk_id: Required. The disk Id. + :vartype disk_id: str + :ivar primary_staging_azure_storage_account_id: Required. The primary staging storage account Arm Id. - :type primary_staging_azure_storage_account_id: str - :param recovery_resource_group_id: Required. The target resource group Arm Id. - :type recovery_resource_group_id: str - :param recovery_replica_disk_account_type: The replica disk type. Its an optional value and - will be same as source disk type if not user provided. - :type recovery_replica_disk_account_type: str - :param recovery_target_disk_account_type: The target disk type after failover. Its an optional + :vartype primary_staging_azure_storage_account_id: str + :ivar recovery_resource_group_id: Required. The target resource group Arm Id. + :vartype recovery_resource_group_id: str + :ivar recovery_replica_disk_account_type: The replica disk type. Its an optional value and will + be same as source disk type if not user provided. + :vartype recovery_replica_disk_account_type: str + :ivar recovery_target_disk_account_type: The target disk type after failover. Its an optional value and will be same as source disk type if not user provided. - :type recovery_target_disk_account_type: str - :param recovery_disk_encryption_set_id: The recovery disk encryption set Id. - :type recovery_disk_encryption_set_id: str - :param disk_encryption_info: The recovery disk encryption information (for one / single pass + :vartype recovery_target_disk_account_type: str + :ivar recovery_disk_encryption_set_id: The recovery disk encryption set Id. + :vartype recovery_disk_encryption_set_id: str + :ivar disk_encryption_info: The recovery disk encryption information (for one / single pass flows). - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + :vartype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo """ _validation = { @@ -2748,6 +3580,27 @@ def __init__( disk_encryption_info: Optional["DiskEncryptionInfo"] = None, **kwargs ): + """ + :keyword disk_id: Required. The disk Id. + :paramtype disk_id: str + :keyword primary_staging_azure_storage_account_id: Required. The primary staging storage + account Arm Id. + :paramtype primary_staging_azure_storage_account_id: str + :keyword recovery_resource_group_id: Required. The target resource group Arm Id. + :paramtype recovery_resource_group_id: str + :keyword recovery_replica_disk_account_type: The replica disk type. Its an optional value and + will be same as source disk type if not user provided. + :paramtype recovery_replica_disk_account_type: str + :keyword recovery_target_disk_account_type: The target disk type after failover. Its an + optional value and will be same as source disk type if not user provided. + :paramtype recovery_target_disk_account_type: str + :keyword recovery_disk_encryption_set_id: The recovery disk encryption set Id. + :paramtype recovery_disk_encryption_set_id: str + :keyword disk_encryption_info: The recovery disk encryption information (for one / single pass + flows). + :paramtype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + """ super(A2AVmManagedDiskInputDetails, self).__init__(**kwargs) self.disk_id = disk_id self.primary_staging_azure_storage_account_id = primary_staging_azure_storage_account_id @@ -2761,18 +3614,19 @@ def __init__( class A2AVmManagedDiskUpdateDetails(msrest.serialization.Model): """A2A Vm managed disk update details. - :param disk_id: The disk Id. - :type disk_id: str - :param recovery_target_disk_account_type: The target disk type before failover. - :type recovery_target_disk_account_type: str - :param recovery_replica_disk_account_type: The replica disk type before failover. - :type recovery_replica_disk_account_type: str - :param disk_encryption_info: The recovery os disk encryption information. - :type disk_encryption_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo - :param failover_disk_name: The target disk name for unplanned failover operation. - :type failover_disk_name: str - :param tfo_disk_name: The target disk name for test failover operation. - :type tfo_disk_name: str + :ivar disk_id: The disk Id. + :vartype disk_id: str + :ivar recovery_target_disk_account_type: The target disk type before failover. + :vartype recovery_target_disk_account_type: str + :ivar recovery_replica_disk_account_type: The replica disk type before failover. + :vartype recovery_replica_disk_account_type: str + :ivar disk_encryption_info: The recovery os disk encryption information. + :vartype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + :ivar failover_disk_name: The target disk name for unplanned failover operation. + :vartype failover_disk_name: str + :ivar tfo_disk_name: The target disk name for test failover operation. + :vartype tfo_disk_name: str """ _attribute_map = { @@ -2795,6 +3649,21 @@ def __init__( tfo_disk_name: Optional[str] = None, **kwargs ): + """ + :keyword disk_id: The disk Id. + :paramtype disk_id: str + :keyword recovery_target_disk_account_type: The target disk type before failover. + :paramtype recovery_target_disk_account_type: str + :keyword recovery_replica_disk_account_type: The replica disk type before failover. + :paramtype recovery_replica_disk_account_type: str + :keyword disk_encryption_info: The recovery os disk encryption information. + :paramtype disk_encryption_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionInfo + :keyword failover_disk_name: The target disk name for unplanned failover operation. + :paramtype failover_disk_name: str + :keyword tfo_disk_name: The target disk name for test failover operation. + :paramtype tfo_disk_name: str + """ super(A2AVmManagedDiskUpdateDetails, self).__init__(**kwargs) self.disk_id = disk_id self.recovery_target_disk_account_type = recovery_target_disk_account_type @@ -2807,10 +3676,10 @@ def __init__( class A2AZoneDetails(msrest.serialization.Model): """Zone details data. - :param source: Source zone info. - :type source: str - :param target: The target zone info. - :type target: str + :ivar source: Source zone info. + :vartype source: str + :ivar target: The target zone info. + :vartype target: str """ _attribute_map = { @@ -2825,6 +3694,12 @@ def __init__( target: Optional[str] = None, **kwargs ): + """ + :keyword source: Source zone info. + :paramtype source: str + :keyword target: The target zone info. + :paramtype target: str + """ super(A2AZoneDetails, self).__init__(**kwargs) self.source = source self.target = target @@ -2833,8 +3708,8 @@ def __init__( class AddDisksInput(msrest.serialization.Model): """Input for add disk(s) operation. - :param properties: Add disks input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.AddDisksInputProperties + :ivar properties: Add disks input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.AddDisksInputProperties """ _attribute_map = { @@ -2847,6 +3722,10 @@ def __init__( properties: Optional["AddDisksInputProperties"] = None, **kwargs ): + """ + :keyword properties: Add disks input properties. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.AddDisksInputProperties + """ super(AddDisksInput, self).__init__(**kwargs) self.properties = properties @@ -2856,10 +3735,10 @@ class AddDisksInputProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param provider_specific_details: Required. The ReplicationProviderInput. For - HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it - will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. - :type provider_specific_details: + :ivar provider_specific_details: Required. The ReplicationProviderInput. For HyperVReplicaAzure + provider, it will be AzureEnableProtectionInput object. For San provider, it will be + SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.AddDisksProviderSpecificInput """ @@ -2877,6 +3756,13 @@ def __init__( provider_specific_details: "AddDisksProviderSpecificInput", **kwargs ): + """ + :keyword provider_specific_details: Required. The ReplicationProviderInput. For + HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it + will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.AddDisksProviderSpecificInput + """ super(AddDisksInputProperties, self).__init__(**kwargs) self.provider_specific_details = provider_specific_details @@ -2886,8 +3772,8 @@ class AddRecoveryServicesProviderInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. The properties of an add provider request. - :type properties: + :ivar properties: Required. The properties of an add provider request. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInputProperties """ @@ -2905,6 +3791,11 @@ def __init__( properties: "AddRecoveryServicesProviderInputProperties", **kwargs ): + """ + :keyword properties: Required. The properties of an add provider request. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInputProperties + """ super(AddRecoveryServicesProviderInput, self).__init__(**kwargs) self.properties = properties @@ -2914,23 +3805,23 @@ class AddRecoveryServicesProviderInputProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param machine_name: Required. The name of the machine where the provider is getting added. - :type machine_name: str - :param machine_id: The Id of the machine where the provider is getting added. - :type machine_id: str - :param bios_id: The Bios Id of the machine. - :type bios_id: str - :param authentication_identity_input: Required. The identity provider input for DRA + :ivar machine_name: Required. The name of the machine where the provider is getting added. + :vartype machine_name: str + :ivar machine_id: The Id of the machine where the provider is getting added. + :vartype machine_id: str + :ivar bios_id: The Bios Id of the machine. + :vartype bios_id: str + :ivar authentication_identity_input: Required. The identity provider input for DRA authentication. - :type authentication_identity_input: + :vartype authentication_identity_input: ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderInput - :param resource_access_identity_input: Required. The identity provider input for resource + :ivar resource_access_identity_input: Required. The identity provider input for resource access. - :type resource_access_identity_input: + :vartype resource_access_identity_input: ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderInput - :param data_plane_authentication_identity_input: The identity provider input for data plane + :ivar data_plane_authentication_identity_input: The identity provider input for data plane authentication. - :type data_plane_authentication_identity_input: + :vartype data_plane_authentication_identity_input: ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderInput """ @@ -2960,6 +3851,26 @@ def __init__( data_plane_authentication_identity_input: Optional["IdentityProviderInput"] = None, **kwargs ): + """ + :keyword machine_name: Required. The name of the machine where the provider is getting added. + :paramtype machine_name: str + :keyword machine_id: The Id of the machine where the provider is getting added. + :paramtype machine_id: str + :keyword bios_id: The Bios Id of the machine. + :paramtype bios_id: str + :keyword authentication_identity_input: Required. The identity provider input for DRA + authentication. + :paramtype authentication_identity_input: + ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderInput + :keyword resource_access_identity_input: Required. The identity provider input for resource + access. + :paramtype resource_access_identity_input: + ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderInput + :keyword data_plane_authentication_identity_input: The identity provider input for data plane + authentication. + :paramtype data_plane_authentication_identity_input: + ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderInput + """ super(AddRecoveryServicesProviderInputProperties, self).__init__(**kwargs) self.machine_name = machine_name self.machine_id = machine_id @@ -2972,8 +3883,9 @@ def __init__( class AddVCenterRequest(msrest.serialization.Model): """Input required to add vCenter. - :param properties: The properties of an add vCenter request. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.AddVCenterRequestProperties + :ivar properties: The properties of an add vCenter request. + :vartype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.AddVCenterRequestProperties """ _attribute_map = { @@ -2986,6 +3898,11 @@ def __init__( properties: Optional["AddVCenterRequestProperties"] = None, **kwargs ): + """ + :keyword properties: The properties of an add vCenter request. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.AddVCenterRequestProperties + """ super(AddVCenterRequest, self).__init__(**kwargs) self.properties = properties @@ -2993,16 +3910,16 @@ def __init__( class AddVCenterRequestProperties(msrest.serialization.Model): """The properties of an add vCenter request. - :param friendly_name: The friendly name of the vCenter. - :type friendly_name: str - :param ip_address: The IP address of the vCenter to be discovered. - :type ip_address: str - :param process_server_id: The process server Id from where the discovery is orchestrated. - :type process_server_id: str - :param port: The port number for discovery. - :type port: str - :param run_as_account_id: The account Id which has privileges to discover the vCenter. - :type run_as_account_id: str + :ivar friendly_name: The friendly name of the vCenter. + :vartype friendly_name: str + :ivar ip_address: The IP address of the vCenter to be discovered. + :vartype ip_address: str + :ivar process_server_id: The process server Id from where the discovery is orchestrated. + :vartype process_server_id: str + :ivar port: The port number for discovery. + :vartype port: str + :ivar run_as_account_id: The account Id which has privileges to discover the vCenter. + :vartype run_as_account_id: str """ _attribute_map = { @@ -3023,6 +3940,18 @@ def __init__( run_as_account_id: Optional[str] = None, **kwargs ): + """ + :keyword friendly_name: The friendly name of the vCenter. + :paramtype friendly_name: str + :keyword ip_address: The IP address of the vCenter to be discovered. + :paramtype ip_address: str + :keyword process_server_id: The process server Id from where the discovery is orchestrated. + :paramtype process_server_id: str + :keyword port: The port number for discovery. + :paramtype port: str + :keyword run_as_account_id: The account Id which has privileges to discover the vCenter. + :paramtype run_as_account_id: str + """ super(AddVCenterRequestProperties, self).__init__(**kwargs) self.friendly_name = friendly_name self.ip_address = ip_address @@ -3068,6 +3997,8 @@ def __init__( self, **kwargs ): + """ + """ super(AgentDetails, self).__init__(**kwargs) self.agent_id = None self.machine_id = None @@ -3113,6 +4044,8 @@ def __init__( self, **kwargs ): + """ + """ super(AgentDiskDetails, self).__init__(**kwargs) self.disk_id = None self.disk_name = None @@ -3132,8 +4065,8 @@ class Resource(msrest.serialization.Model): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str + :ivar location: Resource Location. + :vartype location: str """ _validation = { @@ -3155,6 +4088,10 @@ def __init__( location: Optional[str] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + """ super(Resource, self).__init__(**kwargs) self.id = None self.name = None @@ -3173,10 +4110,10 @@ class Alert(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: Alert related data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.AlertProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: Alert related data. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.AlertProperties """ _validation = { @@ -3200,6 +4137,12 @@ def __init__( properties: Optional["AlertProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: Alert related data. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.AlertProperties + """ super(Alert, self).__init__(location=location, **kwargs) self.properties = properties @@ -3207,10 +4150,10 @@ def __init__( class AlertCollection(msrest.serialization.Model): """Collection of alerts. - :param value: The list of alerts. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.Alert] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The list of alerts. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.Alert] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -3225,6 +4168,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The list of alerts. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.Alert] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(AlertCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -3233,12 +4182,12 @@ def __init__( class AlertProperties(msrest.serialization.Model): """The properties of an alert. - :param send_to_owners: A value indicating whether to send email to subscription administrator. - :type send_to_owners: str - :param custom_email_addresses: The custom email address for sending emails. - :type custom_email_addresses: list[str] - :param locale: The locale for the email notification. - :type locale: str + :ivar send_to_owners: A value indicating whether to send email to subscription administrator. + :vartype send_to_owners: str + :ivar custom_email_addresses: The custom email address for sending emails. + :vartype custom_email_addresses: list[str] + :ivar locale: The locale for the email notification. + :vartype locale: str """ _attribute_map = { @@ -3255,19 +4204,120 @@ def __init__( locale: Optional[str] = None, **kwargs ): + """ + :keyword send_to_owners: A value indicating whether to send email to subscription + administrator. + :paramtype send_to_owners: str + :keyword custom_email_addresses: The custom email address for sending emails. + :paramtype custom_email_addresses: list[str] + :keyword locale: The locale for the email notification. + :paramtype locale: str + """ super(AlertProperties, self).__init__(**kwargs) self.send_to_owners = send_to_owners self.custom_email_addresses = custom_email_addresses self.locale = locale +class ApplianceCollection(msrest.serialization.Model): + """Collection of appliance details. + + :ivar value: The appliance details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationAppliance] + :ivar next_link: The value of next link. + :vartype next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReplicationAppliance]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ReplicationAppliance"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: The appliance details. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationAppliance] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ + super(ApplianceCollection, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApplianceQueryParameter(msrest.serialization.Model): + """Query parameter to get appliance. + + :ivar provider_type: The providerType to be used for fetching appliance details. + :vartype provider_type: str + """ + + _attribute_map = { + 'provider_type': {'key': 'providerType', 'type': 'str'}, + } + + def __init__( + self, + *, + provider_type: Optional[str] = None, + **kwargs + ): + """ + :keyword provider_type: The providerType to be used for fetching appliance details. + :paramtype provider_type: str + """ + super(ApplianceQueryParameter, self).__init__(**kwargs) + self.provider_type = provider_type + + +class ApplianceSpecificDetails(msrest.serialization.Model): + """Appliance specific details. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: InMageRcmApplianceSpecificDetails. + + All required parameters must be populated in order to send to Azure. + + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant + filled by server. + :vartype instance_type: str + """ + + _validation = { + 'instance_type': {'required': True}, + } + + _attribute_map = { + 'instance_type': {'key': 'instanceType', 'type': 'str'}, + } + + _subtype_map = { + 'instance_type': {'InMageRcm': 'InMageRcmApplianceSpecificDetails'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ApplianceSpecificDetails, self).__init__(**kwargs) + self.instance_type = None # type: Optional[str] + + class ApplyRecoveryPointInput(msrest.serialization.Model): """Input to apply recovery point. All required parameters must be populated in order to send to Azure. - :param properties: Required. The input properties to apply recovery point. - :type properties: + :ivar properties: Required. The input properties to apply recovery point. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.ApplyRecoveryPointInputProperties """ @@ -3285,6 +4335,11 @@ def __init__( properties: "ApplyRecoveryPointInputProperties", **kwargs ): + """ + :keyword properties: Required. The input properties to apply recovery point. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.ApplyRecoveryPointInputProperties + """ super(ApplyRecoveryPointInput, self).__init__(**kwargs) self.properties = properties @@ -3294,11 +4349,10 @@ class ApplyRecoveryPointInputProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param recovery_point_id: The recovery point Id. - :type recovery_point_id: str - :param provider_specific_details: Required. Provider specific input for applying recovery - point. - :type provider_specific_details: + :ivar recovery_point_id: The recovery point Id. + :vartype recovery_point_id: str + :ivar provider_specific_details: Required. Provider specific input for applying recovery point. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.ApplyRecoveryPointProviderSpecificInput """ @@ -3318,6 +4372,14 @@ def __init__( recovery_point_id: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_id: The recovery point Id. + :paramtype recovery_point_id: str + :keyword provider_specific_details: Required. Provider specific input for applying recovery + point. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.ApplyRecoveryPointProviderSpecificInput + """ super(ApplyRecoveryPointInputProperties, self).__init__(**kwargs) self.recovery_point_id = recovery_point_id self.provider_specific_details = provider_specific_details @@ -3331,12 +4393,12 @@ class JobDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for + :ivar instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for possible values).Constant filled by server. - :type instance_type: str - :param affected_object_details: The affected object properties like source server, source - cloud, target server, target cloud etc. based on the workflow object details. - :type affected_object_details: dict[str, str] + :vartype instance_type: str + :ivar affected_object_details: The affected object properties like source server, source cloud, + target server, target cloud etc. based on the workflow object details. + :vartype affected_object_details: dict[str, str] """ _validation = { @@ -3358,6 +4420,11 @@ def __init__( affected_object_details: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword affected_object_details: The affected object properties like source server, source + cloud, target server, target cloud etc. based on the workflow object details. + :paramtype affected_object_details: dict[str, str] + """ super(JobDetails, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] self.affected_object_details = affected_object_details @@ -3368,12 +4435,12 @@ class AsrJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for + :ivar instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for possible values).Constant filled by server. - :type instance_type: str - :param affected_object_details: The affected object properties like source server, source - cloud, target server, target cloud etc. based on the workflow object details. - :type affected_object_details: dict[str, str] + :vartype instance_type: str + :ivar affected_object_details: The affected object properties like source server, source cloud, + target server, target cloud etc. based on the workflow object details. + :vartype affected_object_details: dict[str, str] """ _validation = { @@ -3391,6 +4458,11 @@ def __init__( affected_object_details: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword affected_object_details: The affected object properties like source server, source + cloud, target server, target cloud etc. based on the workflow object details. + :paramtype affected_object_details: dict[str, str] + """ super(AsrJobDetails, self).__init__(affected_object_details=affected_object_details, **kwargs) self.instance_type = 'AsrJobDetails' # type: str @@ -3398,34 +4470,34 @@ def __init__( class ASRTask(msrest.serialization.Model): """Task of the Job. - :param task_id: The Id. - :type task_id: str - :param name: The unique Task name. - :type name: str - :param start_time: The start time. - :type start_time: ~datetime.datetime - :param end_time: The end time. - :type end_time: ~datetime.datetime - :param allowed_actions: The state/actions applicable on this task. - :type allowed_actions: list[str] - :param friendly_name: The name. - :type friendly_name: str - :param state: The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, + :ivar task_id: The Id. + :vartype task_id: str + :ivar name: The unique Task name. + :vartype name: str + :ivar start_time: The start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time. + :vartype end_time: ~datetime.datetime + :ivar allowed_actions: The state/actions applicable on this task. + :vartype allowed_actions: list[str] + :ivar friendly_name: The name. + :vartype friendly_name: str + :ivar state: The State. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. - :type state: str - :param state_description: The description of the task state. For example - For Succeeded state, + :vartype state: str + :ivar state_description: The description of the task state. For example - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. - :type state_description: str - :param task_type: The type of task. Details in CustomDetails property depend on this type. - :type task_type: str - :param custom_details: The custom task details based on the task type. - :type custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.TaskTypeDetails - :param group_task_custom_details: The custom task details based on the task type, if the task + :vartype state_description: str + :ivar task_type: The type of task. Details in CustomDetails property depend on this type. + :vartype task_type: str + :ivar custom_details: The custom task details based on the task type. + :vartype custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.TaskTypeDetails + :ivar group_task_custom_details: The custom task details based on the task type, if the task type is GroupTaskDetails or one of the types derived from it. - :type group_task_custom_details: + :vartype group_task_custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.GroupTaskDetails - :param errors: The task error details. - :type errors: list[~azure.mgmt.recoveryservicessiterecovery.models.JobErrorDetails] + :ivar errors: The task error details. + :vartype errors: list[~azure.mgmt.recoveryservicessiterecovery.models.JobErrorDetails] """ _attribute_map = { @@ -3460,6 +4532,36 @@ def __init__( errors: Optional[List["JobErrorDetails"]] = None, **kwargs ): + """ + :keyword task_id: The Id. + :paramtype task_id: str + :keyword name: The unique Task name. + :paramtype name: str + :keyword start_time: The start time. + :paramtype start_time: ~datetime.datetime + :keyword end_time: The end time. + :paramtype end_time: ~datetime.datetime + :keyword allowed_actions: The state/actions applicable on this task. + :paramtype allowed_actions: list[str] + :keyword friendly_name: The name. + :paramtype friendly_name: str + :keyword state: The State. It is one of these values - NotStarted, InProgress, Succeeded, + Failed, Cancelled, Suspended or Other. + :paramtype state: str + :keyword state_description: The description of the task state. For example - For Succeeded + state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + :paramtype state_description: str + :keyword task_type: The type of task. Details in CustomDetails property depend on this type. + :paramtype task_type: str + :keyword custom_details: The custom task details based on the task type. + :paramtype custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.TaskTypeDetails + :keyword group_task_custom_details: The custom task details based on the task type, if the task + type is GroupTaskDetails or one of the types derived from it. + :paramtype group_task_custom_details: + ~azure.mgmt.recoveryservicessiterecovery.models.GroupTaskDetails + :keyword errors: The task error details. + :paramtype errors: list[~azure.mgmt.recoveryservicessiterecovery.models.JobErrorDetails] + """ super(ASRTask, self).__init__(**kwargs) self.task_id = task_id self.name = name @@ -3483,8 +4585,8 @@ class TaskTypeDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The type of task details.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -3503,6 +4605,8 @@ def __init__( self, **kwargs ): + """ + """ super(TaskTypeDetails, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -3512,26 +4616,26 @@ class AutomationRunbookTaskDetails(TaskTypeDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param name: The recovery plan task name. - :type name: str - :param cloud_service_name: The cloud service of the automation runbook account. - :type cloud_service_name: str - :param subscription_id: The subscription Id of the automation runbook account. - :type subscription_id: str - :param account_name: The automation account name of the runbook. - :type account_name: str - :param runbook_id: The runbook Id. - :type runbook_id: str - :param runbook_name: The runbook name. - :type runbook_name: str - :param job_id: The job Id of the runbook execution. - :type job_id: str - :param job_output: The execution output of the runbook. - :type job_output: str - :param is_primary_side_script: A value indicating whether it is a primary side script or not. - :type is_primary_side_script: bool + :ivar instance_type: Required. The type of task details.Constant filled by server. + :vartype instance_type: str + :ivar name: The recovery plan task name. + :vartype name: str + :ivar cloud_service_name: The cloud service of the automation runbook account. + :vartype cloud_service_name: str + :ivar subscription_id: The subscription Id of the automation runbook account. + :vartype subscription_id: str + :ivar account_name: The automation account name of the runbook. + :vartype account_name: str + :ivar runbook_id: The runbook Id. + :vartype runbook_id: str + :ivar runbook_name: The runbook name. + :vartype runbook_name: str + :ivar job_id: The job Id of the runbook execution. + :vartype job_id: str + :ivar job_output: The execution output of the runbook. + :vartype job_output: str + :ivar is_primary_side_script: A value indicating whether it is a primary side script or not. + :vartype is_primary_side_script: bool """ _validation = { @@ -3565,6 +4669,26 @@ def __init__( is_primary_side_script: Optional[bool] = None, **kwargs ): + """ + :keyword name: The recovery plan task name. + :paramtype name: str + :keyword cloud_service_name: The cloud service of the automation runbook account. + :paramtype cloud_service_name: str + :keyword subscription_id: The subscription Id of the automation runbook account. + :paramtype subscription_id: str + :keyword account_name: The automation account name of the runbook. + :paramtype account_name: str + :keyword runbook_id: The runbook Id. + :paramtype runbook_id: str + :keyword runbook_name: The runbook name. + :paramtype runbook_name: str + :keyword job_id: The job Id of the runbook execution. + :paramtype job_id: str + :keyword job_output: The execution output of the runbook. + :paramtype job_output: str + :keyword is_primary_side_script: A value indicating whether it is a primary side script or not. + :paramtype is_primary_side_script: bool + """ super(AutomationRunbookTaskDetails, self).__init__(**kwargs) self.instance_type = 'AutomationRunbookTaskDetails' # type: str self.name = name @@ -3586,8 +4710,8 @@ class FabricSpecificCreationInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -3606,6 +4730,8 @@ def __init__( self, **kwargs ): + """ + """ super(FabricSpecificCreationInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -3615,10 +4741,10 @@ class AzureFabricCreationInput(FabricSpecificCreationInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type.Constant filled by server. - :type instance_type: str - :param location: The Location. - :type location: str + :ivar instance_type: Required. Gets the class type.Constant filled by server. + :vartype instance_type: str + :ivar location: The Location. + :vartype location: str """ _validation = { @@ -3636,6 +4762,10 @@ def __init__( location: Optional[str] = None, **kwargs ): + """ + :keyword location: The Location. + :paramtype location: str + """ super(AzureFabricCreationInput, self).__init__(**kwargs) self.instance_type = 'Azure' # type: str self.location = location @@ -3649,9 +4779,9 @@ class FabricSpecificDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str """ _validation = { @@ -3670,6 +4800,8 @@ def __init__( self, **kwargs ): + """ + """ super(FabricSpecificDetails, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -3679,15 +4811,15 @@ class AzureFabricSpecificDetails(FabricSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param location: The Location for the Azure fabric. - :type location: str - :param container_ids: The container Ids for the Azure fabric. - :type container_ids: list[str] - :param zones: The zones. - :type zones: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AZoneDetails] + :vartype instance_type: str + :ivar location: The Location for the Azure fabric. + :vartype location: str + :ivar container_ids: The container Ids for the Azure fabric. + :vartype container_ids: list[str] + :ivar zones: The zones. + :vartype zones: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AZoneDetails] """ _validation = { @@ -3709,6 +4841,14 @@ def __init__( zones: Optional[List["A2AZoneDetails"]] = None, **kwargs ): + """ + :keyword location: The Location for the Azure fabric. + :paramtype location: str + :keyword container_ids: The container Ids for the Azure fabric. + :paramtype container_ids: list[str] + :keyword zones: The zones. + :paramtype zones: list[~azure.mgmt.recoveryservicessiterecovery.models.A2AZoneDetails] + """ super(AzureFabricSpecificDetails, self).__init__(**kwargs) self.instance_type = 'Azure' # type: str self.location = location @@ -3724,8 +4864,8 @@ class FabricSpecificCreateNetworkMappingInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -3744,6 +4884,8 @@ def __init__( self, **kwargs ): + """ + """ super(FabricSpecificCreateNetworkMappingInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -3753,10 +4895,10 @@ class AzureToAzureCreateNetworkMappingInput(FabricSpecificCreateNetworkMappingIn All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str - :param primary_network_id: Required. The primary azure vnet Id. - :type primary_network_id: str + :ivar instance_type: Required. The instance type.Constant filled by server. + :vartype instance_type: str + :ivar primary_network_id: Required. The primary azure vnet Id. + :vartype primary_network_id: str """ _validation = { @@ -3775,6 +4917,10 @@ def __init__( primary_network_id: str, **kwargs ): + """ + :keyword primary_network_id: Required. The primary azure vnet Id. + :paramtype primary_network_id: str + """ super(AzureToAzureCreateNetworkMappingInput, self).__init__(**kwargs) self.instance_type = 'AzureToAzure' # type: str self.primary_network_id = primary_network_id @@ -3788,8 +4934,8 @@ class NetworkMappingFabricSpecificSettings(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -3808,6 +4954,8 @@ def __init__( self, **kwargs ): + """ + """ super(NetworkMappingFabricSpecificSettings, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -3817,12 +4965,12 @@ class AzureToAzureNetworkMappingSettings(NetworkMappingFabricSpecificSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param primary_fabric_location: The primary fabric location. - :type primary_fabric_location: str - :param recovery_fabric_location: The recovery fabric location. - :type recovery_fabric_location: str + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str + :ivar primary_fabric_location: The primary fabric location. + :vartype primary_fabric_location: str + :ivar recovery_fabric_location: The recovery fabric location. + :vartype recovery_fabric_location: str """ _validation = { @@ -3842,6 +4990,12 @@ def __init__( recovery_fabric_location: Optional[str] = None, **kwargs ): + """ + :keyword primary_fabric_location: The primary fabric location. + :paramtype primary_fabric_location: str + :keyword recovery_fabric_location: The recovery fabric location. + :paramtype recovery_fabric_location: str + """ super(AzureToAzureNetworkMappingSettings, self).__init__(**kwargs) self.instance_type = 'AzureToAzure' # type: str self.primary_fabric_location = primary_fabric_location @@ -3856,8 +5010,8 @@ class FabricSpecificUpdateNetworkMappingInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -3876,6 +5030,8 @@ def __init__( self, **kwargs ): + """ + """ super(FabricSpecificUpdateNetworkMappingInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -3885,10 +5041,10 @@ class AzureToAzureUpdateNetworkMappingInput(FabricSpecificUpdateNetworkMappingIn All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str - :param primary_network_id: The primary azure vnet Id. - :type primary_network_id: str + :ivar instance_type: Required. The instance type.Constant filled by server. + :vartype instance_type: str + :ivar primary_network_id: The primary azure vnet Id. + :vartype primary_network_id: str """ _validation = { @@ -3906,6 +5062,10 @@ def __init__( primary_network_id: Optional[str] = None, **kwargs ): + """ + :keyword primary_network_id: The primary azure vnet Id. + :paramtype primary_network_id: str + """ super(AzureToAzureUpdateNetworkMappingInput, self).__init__(**kwargs) self.instance_type = 'AzureToAzure' # type: str self.primary_network_id = primary_network_id @@ -3914,10 +5074,10 @@ def __init__( class AzureToAzureVmSyncedConfigDetails(msrest.serialization.Model): """Azure to Azure VM synced configuration details. - :param tags: A set of tags. The Azure VM tags. - :type tags: dict[str, str] - :param input_endpoints: The Azure VM input endpoints. - :type input_endpoints: list[~azure.mgmt.recoveryservicessiterecovery.models.InputEndpoint] + :ivar tags: A set of tags. The Azure VM tags. + :vartype tags: dict[str, str] + :ivar input_endpoints: The Azure VM input endpoints. + :vartype input_endpoints: list[~azure.mgmt.recoveryservicessiterecovery.models.InputEndpoint] """ _attribute_map = { @@ -3932,6 +5092,12 @@ def __init__( input_endpoints: Optional[List["InputEndpoint"]] = None, **kwargs ): + """ + :keyword tags: A set of tags. The Azure VM tags. + :paramtype tags: dict[str, str] + :keyword input_endpoints: The Azure VM input endpoints. + :paramtype input_endpoints: list[~azure.mgmt.recoveryservicessiterecovery.models.InputEndpoint] + """ super(AzureToAzureVmSyncedConfigDetails, self).__init__(**kwargs) self.tags = tags self.input_endpoints = input_endpoints @@ -3940,26 +5106,26 @@ def __init__( class AzureVmDiskDetails(msrest.serialization.Model): """Disk details for E2A provider. - :param vhd_type: VHD type. - :type vhd_type: str - :param vhd_id: The VHD id. - :type vhd_id: str - :param disk_id: The disk resource id. - :type disk_id: str - :param vhd_name: VHD name. - :type vhd_name: str - :param max_size_mb: Max side in MB. - :type max_size_mb: str - :param target_disk_location: Blob uri of the Azure disk. - :type target_disk_location: str - :param target_disk_name: The target Azure disk name. - :type target_disk_name: str - :param lun_id: Ordinal\LunId of the disk for the Azure VM. - :type lun_id: str - :param disk_encryption_set_id: The DiskEncryptionSet ARM ID. - :type disk_encryption_set_id: str - :param custom_target_disk_name: The custom target Azure disk name. - :type custom_target_disk_name: str + :ivar vhd_type: VHD type. + :vartype vhd_type: str + :ivar vhd_id: The VHD id. + :vartype vhd_id: str + :ivar disk_id: The disk resource id. + :vartype disk_id: str + :ivar vhd_name: VHD name. + :vartype vhd_name: str + :ivar max_size_mb: Max side in MB. + :vartype max_size_mb: str + :ivar target_disk_location: Blob uri of the Azure disk. + :vartype target_disk_location: str + :ivar target_disk_name: The target Azure disk name. + :vartype target_disk_name: str + :ivar lun_id: Ordinal\LunId of the disk for the Azure VM. + :vartype lun_id: str + :ivar disk_encryption_set_id: The DiskEncryptionSet ARM ID. + :vartype disk_encryption_set_id: str + :ivar custom_target_disk_name: The custom target Azure disk name. + :vartype custom_target_disk_name: str """ _attribute_map = { @@ -3990,6 +5156,28 @@ def __init__( custom_target_disk_name: Optional[str] = None, **kwargs ): + """ + :keyword vhd_type: VHD type. + :paramtype vhd_type: str + :keyword vhd_id: The VHD id. + :paramtype vhd_id: str + :keyword disk_id: The disk resource id. + :paramtype disk_id: str + :keyword vhd_name: VHD name. + :paramtype vhd_name: str + :keyword max_size_mb: Max side in MB. + :paramtype max_size_mb: str + :keyword target_disk_location: Blob uri of the Azure disk. + :paramtype target_disk_location: str + :keyword target_disk_name: The target Azure disk name. + :paramtype target_disk_name: str + :keyword lun_id: Ordinal\LunId of the disk for the Azure VM. + :paramtype lun_id: str + :keyword disk_encryption_set_id: The DiskEncryptionSet ARM ID. + :paramtype disk_encryption_set_id: str + :keyword custom_target_disk_name: The custom target Azure disk name. + :paramtype custom_target_disk_name: str + """ super(AzureVmDiskDetails, self).__init__(**kwargs) self.vhd_type = vhd_type self.vhd_id = vhd_id @@ -4006,10 +5194,10 @@ def __init__( class ComputeSizeErrorDetails(msrest.serialization.Model): """Represents the error used to indicate why the target compute size is not applicable. - :param message: The error message. - :type message: str - :param severity: The severity of the error. - :type severity: str + :ivar message: The error message. + :vartype message: str + :ivar severity: The severity of the error. + :vartype severity: str """ _attribute_map = { @@ -4024,6 +5212,12 @@ def __init__( severity: Optional[str] = None, **kwargs ): + """ + :keyword message: The error message. + :paramtype message: str + :keyword severity: The severity of the error. + :paramtype severity: str + """ super(ComputeSizeErrorDetails, self).__init__(**kwargs) self.message = message self.severity = severity @@ -4037,9 +5231,9 @@ class ConfigurationSettings(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str """ _validation = { @@ -4058,6 +5252,8 @@ def __init__( self, **kwargs ): + """ + """ super(ConfigurationSettings, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -4065,8 +5261,8 @@ def __init__( class ConfigureAlertRequest(msrest.serialization.Model): """Request to configure alerts for the system. - :param properties: The properties of a configure alert request. - :type properties: + :ivar properties: The properties of a configure alert request. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.ConfigureAlertRequestProperties """ @@ -4080,6 +5276,11 @@ def __init__( properties: Optional["ConfigureAlertRequestProperties"] = None, **kwargs ): + """ + :keyword properties: The properties of a configure alert request. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.ConfigureAlertRequestProperties + """ super(ConfigureAlertRequest, self).__init__(**kwargs) self.properties = properties @@ -4087,12 +5288,12 @@ def __init__( class ConfigureAlertRequestProperties(msrest.serialization.Model): """Properties of a configure alert request. - :param send_to_owners: A value indicating whether to send email to subscription administrator. - :type send_to_owners: str - :param custom_email_addresses: The custom email address for sending emails. - :type custom_email_addresses: list[str] - :param locale: The locale for the email notification. - :type locale: str + :ivar send_to_owners: A value indicating whether to send email to subscription administrator. + :vartype send_to_owners: str + :ivar custom_email_addresses: The custom email address for sending emails. + :vartype custom_email_addresses: list[str] + :ivar locale: The locale for the email notification. + :vartype locale: str """ _attribute_map = { @@ -4109,6 +5310,15 @@ def __init__( locale: Optional[str] = None, **kwargs ): + """ + :keyword send_to_owners: A value indicating whether to send email to subscription + administrator. + :paramtype send_to_owners: str + :keyword custom_email_addresses: The custom email address for sending emails. + :paramtype custom_email_addresses: list[str] + :keyword locale: The locale for the email notification. + :paramtype locale: str + """ super(ConfigureAlertRequestProperties, self).__init__(**kwargs) self.send_to_owners = send_to_owners self.custom_email_addresses = custom_email_addresses @@ -4120,10 +5330,11 @@ class ConsistencyCheckTaskDetails(TaskTypeDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param vm_details: The list of inconsistent Vm details. - :type vm_details: list[~azure.mgmt.recoveryservicessiterecovery.models.InconsistentVmDetails] + :ivar instance_type: Required. The type of task details.Constant filled by server. + :vartype instance_type: str + :ivar vm_details: The list of inconsistent Vm details. + :vartype vm_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.InconsistentVmDetails] """ _validation = { @@ -4141,6 +5352,11 @@ def __init__( vm_details: Optional[List["InconsistentVmDetails"]] = None, **kwargs ): + """ + :keyword vm_details: The list of inconsistent Vm details. + :paramtype vm_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.InconsistentVmDetails] + """ super(ConsistencyCheckTaskDetails, self).__init__(**kwargs) self.instance_type = 'ConsistencyCheckTaskDetails' # type: str self.vm_details = vm_details @@ -4151,8 +5367,8 @@ class CreateNetworkMappingInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. Input properties for creating network mapping. - :type properties: + :ivar properties: Required. Input properties for creating network mapping. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.CreateNetworkMappingInputProperties """ @@ -4170,6 +5386,11 @@ def __init__( properties: "CreateNetworkMappingInputProperties", **kwargs ): + """ + :keyword properties: Required. Input properties for creating network mapping. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.CreateNetworkMappingInputProperties + """ super(CreateNetworkMappingInput, self).__init__(**kwargs) self.properties = properties @@ -4179,12 +5400,12 @@ class CreateNetworkMappingInputProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param recovery_fabric_name: Recovery fabric Name. - :type recovery_fabric_name: str - :param recovery_network_id: Required. Recovery network Id. - :type recovery_network_id: str - :param fabric_specific_details: Fabric specific input properties. - :type fabric_specific_details: + :ivar recovery_fabric_name: Recovery fabric Name. + :vartype recovery_fabric_name: str + :ivar recovery_network_id: Required. Recovery network Id. + :vartype recovery_network_id: str + :ivar fabric_specific_details: Fabric specific input properties. + :vartype fabric_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.FabricSpecificCreateNetworkMappingInput """ @@ -4206,6 +5427,15 @@ def __init__( fabric_specific_details: Optional["FabricSpecificCreateNetworkMappingInput"] = None, **kwargs ): + """ + :keyword recovery_fabric_name: Recovery fabric Name. + :paramtype recovery_fabric_name: str + :keyword recovery_network_id: Required. Recovery network Id. + :paramtype recovery_network_id: str + :keyword fabric_specific_details: Fabric specific input properties. + :paramtype fabric_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.FabricSpecificCreateNetworkMappingInput + """ super(CreateNetworkMappingInputProperties, self).__init__(**kwargs) self.recovery_fabric_name = recovery_fabric_name self.recovery_network_id = recovery_network_id @@ -4215,8 +5445,9 @@ def __init__( class CreatePolicyInput(msrest.serialization.Model): """Protection Policy input. - :param properties: Policy creation properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.CreatePolicyInputProperties + :ivar properties: Policy creation properties. + :vartype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.CreatePolicyInputProperties """ _attribute_map = { @@ -4229,6 +5460,11 @@ def __init__( properties: Optional["CreatePolicyInputProperties"] = None, **kwargs ): + """ + :keyword properties: Policy creation properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.CreatePolicyInputProperties + """ super(CreatePolicyInput, self).__init__(**kwargs) self.properties = properties @@ -4236,8 +5472,8 @@ def __init__( class CreatePolicyInputProperties(msrest.serialization.Model): """Policy creation properties. - :param provider_specific_input: The ReplicationProviderSettings. - :type provider_specific_input: + :ivar provider_specific_input: The ReplicationProviderSettings. + :vartype provider_specific_input: ~azure.mgmt.recoveryservicessiterecovery.models.PolicyProviderSpecificInput """ @@ -4251,6 +5487,11 @@ def __init__( provider_specific_input: Optional["PolicyProviderSpecificInput"] = None, **kwargs ): + """ + :keyword provider_specific_input: The ReplicationProviderSettings. + :paramtype provider_specific_input: + ~azure.mgmt.recoveryservicessiterecovery.models.PolicyProviderSpecificInput + """ super(CreatePolicyInputProperties, self).__init__(**kwargs) self.provider_specific_input = provider_specific_input @@ -4258,8 +5499,8 @@ def __init__( class CreateProtectionContainerInput(msrest.serialization.Model): """Create protection container input. - :param properties: Create protection container input properties. - :type properties: + :ivar properties: Create protection container input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionContainerInputProperties """ @@ -4273,6 +5514,11 @@ def __init__( properties: Optional["CreateProtectionContainerInputProperties"] = None, **kwargs ): + """ + :keyword properties: Create protection container input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionContainerInputProperties + """ super(CreateProtectionContainerInput, self).__init__(**kwargs) self.properties = properties @@ -4280,8 +5526,8 @@ def __init__( class CreateProtectionContainerInputProperties(msrest.serialization.Model): """Create protection container input properties. - :param provider_specific_input: Provider specific inputs for container creation. - :type provider_specific_input: + :ivar provider_specific_input: Provider specific inputs for container creation. + :vartype provider_specific_input: list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerCreationInput] """ @@ -4295,6 +5541,11 @@ def __init__( provider_specific_input: Optional[List["ReplicationProviderSpecificContainerCreationInput"]] = None, **kwargs ): + """ + :keyword provider_specific_input: Provider specific inputs for container creation. + :paramtype provider_specific_input: + list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerCreationInput] + """ super(CreateProtectionContainerInputProperties, self).__init__(**kwargs) self.provider_specific_input = provider_specific_input @@ -4302,8 +5553,8 @@ def __init__( class CreateProtectionContainerMappingInput(msrest.serialization.Model): """Configure pairing input. - :param properties: Configure protection input properties. - :type properties: + :ivar properties: Configure protection input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInputProperties """ @@ -4317,6 +5568,11 @@ def __init__( properties: Optional["CreateProtectionContainerMappingInputProperties"] = None, **kwargs ): + """ + :keyword properties: Configure protection input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInputProperties + """ super(CreateProtectionContainerMappingInput, self).__init__(**kwargs) self.properties = properties @@ -4324,12 +5580,12 @@ def __init__( class CreateProtectionContainerMappingInputProperties(msrest.serialization.Model): """Configure pairing input properties. - :param target_protection_container_id: The target unique protection container name. - :type target_protection_container_id: str - :param policy_id: Applicable policy. - :type policy_id: str - :param provider_specific_input: Provider specific input for pairing. - :type provider_specific_input: + :ivar target_protection_container_id: The target unique protection container name. + :vartype target_protection_container_id: str + :ivar policy_id: Applicable policy. + :vartype policy_id: str + :ivar provider_specific_input: Provider specific input for pairing. + :vartype provider_specific_input: ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerMappingInput """ @@ -4347,6 +5603,15 @@ def __init__( provider_specific_input: Optional["ReplicationProviderSpecificContainerMappingInput"] = None, **kwargs ): + """ + :keyword target_protection_container_id: The target unique protection container name. + :paramtype target_protection_container_id: str + :keyword policy_id: Applicable policy. + :paramtype policy_id: str + :keyword provider_specific_input: Provider specific input for pairing. + :paramtype provider_specific_input: + ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderSpecificContainerMappingInput + """ super(CreateProtectionContainerMappingInputProperties, self).__init__(**kwargs) self.target_protection_container_id = target_protection_container_id self.policy_id = policy_id @@ -4356,8 +5621,8 @@ def __init__( class CreateProtectionIntentInput(msrest.serialization.Model): """Create protection intent input. - :param properties: Create protection intent input properties. - :type properties: + :ivar properties: Create protection intent input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionIntentProperties """ @@ -4371,6 +5636,11 @@ def __init__( properties: Optional["CreateProtectionIntentProperties"] = None, **kwargs ): + """ + :keyword properties: Create protection intent input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionIntentProperties + """ super(CreateProtectionIntentInput, self).__init__(**kwargs) self.properties = properties @@ -4378,9 +5648,9 @@ def __init__( class CreateProtectionIntentProperties(msrest.serialization.Model): """Create protection intent input properties. - :param provider_specific_details: The ReplicationProviderInput. For A2A provider, it will be + :ivar provider_specific_details: The ReplicationProviderInput. For A2A provider, it will be A2ACreateProtectionIntentInput object. - :type provider_specific_details: + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionIntentProviderSpecificDetails """ @@ -4394,6 +5664,12 @@ def __init__( provider_specific_details: Optional["CreateProtectionIntentProviderSpecificDetails"] = None, **kwargs ): + """ + :keyword provider_specific_details: The ReplicationProviderInput. For A2A provider, it will be + A2ACreateProtectionIntentInput object. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionIntentProviderSpecificDetails + """ super(CreateProtectionIntentProperties, self).__init__(**kwargs) self.provider_specific_details = provider_specific_details @@ -4403,8 +5679,8 @@ class CreateRecoveryPlanInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. Recovery plan creation properties. - :type properties: + :ivar properties: Required. Recovery plan creation properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.CreateRecoveryPlanInputProperties """ @@ -4422,6 +5698,11 @@ def __init__( properties: "CreateRecoveryPlanInputProperties", **kwargs ): + """ + :keyword properties: Required. Recovery plan creation properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.CreateRecoveryPlanInputProperties + """ super(CreateRecoveryPlanInput, self).__init__(**kwargs) self.properties = properties @@ -4431,18 +5712,18 @@ class CreateRecoveryPlanInputProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param primary_fabric_id: Required. The primary fabric Id. - :type primary_fabric_id: str - :param recovery_fabric_id: Required. The recovery fabric Id. - :type recovery_fabric_id: str - :param failover_deployment_model: The failover deployment model. Possible values include: + :ivar primary_fabric_id: Required. The primary fabric Id. + :vartype primary_fabric_id: str + :ivar recovery_fabric_id: Required. The recovery fabric Id. + :vartype recovery_fabric_id: str + :ivar failover_deployment_model: The failover deployment model. Possible values include: "NotApplicable", "Classic", "ResourceManager". - :type failover_deployment_model: str or + :vartype failover_deployment_model: str or ~azure.mgmt.recoveryservicessiterecovery.models.FailoverDeploymentModel - :param groups: Required. The recovery plan groups. - :type groups: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroup] - :param provider_specific_input: The provider specific input. - :type provider_specific_input: + :ivar groups: Required. The recovery plan groups. + :vartype groups: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroup] + :ivar provider_specific_input: The provider specific input. + :vartype provider_specific_input: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificInput] """ @@ -4470,6 +5751,21 @@ def __init__( provider_specific_input: Optional[List["RecoveryPlanProviderSpecificInput"]] = None, **kwargs ): + """ + :keyword primary_fabric_id: Required. The primary fabric Id. + :paramtype primary_fabric_id: str + :keyword recovery_fabric_id: Required. The recovery fabric Id. + :paramtype recovery_fabric_id: str + :keyword failover_deployment_model: The failover deployment model. Possible values include: + "NotApplicable", "Classic", "ResourceManager". + :paramtype failover_deployment_model: str or + ~azure.mgmt.recoveryservicessiterecovery.models.FailoverDeploymentModel + :keyword groups: Required. The recovery plan groups. + :paramtype groups: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroup] + :keyword provider_specific_input: The provider specific input. + :paramtype provider_specific_input: + list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificInput] + """ super(CreateRecoveryPlanInputProperties, self).__init__(**kwargs) self.primary_fabric_id = primary_fabric_id self.recovery_fabric_id = recovery_fabric_id @@ -4507,6 +5803,8 @@ def __init__( self, **kwargs ): + """ + """ super(CurrentJobDetails, self).__init__(**kwargs) self.job_name = None self.job_id = None @@ -4516,12 +5814,12 @@ def __init__( class CurrentScenarioDetails(msrest.serialization.Model): """Current scenario details of the protected entity. - :param scenario_name: Scenario name. - :type scenario_name: str - :param job_id: ARM Id of the job being executed. - :type job_id: str - :param start_time: Start time of the workflow. - :type start_time: ~datetime.datetime + :ivar scenario_name: Scenario name. + :vartype scenario_name: str + :ivar job_id: ARM Id of the job being executed. + :vartype job_id: str + :ivar start_time: Start time of the workflow. + :vartype start_time: ~datetime.datetime """ _attribute_map = { @@ -4538,6 +5836,14 @@ def __init__( start_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword scenario_name: Scenario name. + :paramtype scenario_name: str + :keyword job_id: ARM Id of the job being executed. + :paramtype job_id: str + :keyword start_time: Start time of the workflow. + :paramtype start_time: ~datetime.datetime + """ super(CurrentScenarioDetails, self).__init__(**kwargs) self.scenario_name = scenario_name self.job_id = job_id @@ -4547,16 +5853,16 @@ def __init__( class DataStore(msrest.serialization.Model): """The datastore details of the MT. - :param symbolic_name: The symbolic name of data store. - :type symbolic_name: str - :param uuid: The uuid of data store. - :type uuid: str - :param capacity: The capacity of data store in GBs. - :type capacity: str - :param free_space: The free space of data store in GBs. - :type free_space: str - :param type: The type of data store. - :type type: str + :ivar symbolic_name: The symbolic name of data store. + :vartype symbolic_name: str + :ivar uuid: The uuid of data store. + :vartype uuid: str + :ivar capacity: The capacity of data store in GBs. + :vartype capacity: str + :ivar free_space: The free space of data store in GBs. + :vartype free_space: str + :ivar type: The type of data store. + :vartype type: str """ _attribute_map = { @@ -4577,6 +5883,18 @@ def __init__( type: Optional[str] = None, **kwargs ): + """ + :keyword symbolic_name: The symbolic name of data store. + :paramtype symbolic_name: str + :keyword uuid: The uuid of data store. + :paramtype uuid: str + :keyword capacity: The capacity of data store in GBs. + :paramtype capacity: str + :keyword free_space: The free space of data store in GBs. + :paramtype free_space: str + :keyword type: The type of data store. + :paramtype type: str + """ super(DataStore, self).__init__(**kwargs) self.symbolic_name = symbolic_name self.uuid = uuid @@ -4590,8 +5908,8 @@ class DisableProtectionInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. Disable protection input properties. - :type properties: + :ivar properties: Required. Disable protection input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.DisableProtectionInputProperties """ @@ -4609,6 +5927,11 @@ def __init__( properties: "DisableProtectionInputProperties", **kwargs ): + """ + :keyword properties: Required. Disable protection input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.DisableProtectionInputProperties + """ super(DisableProtectionInput, self).__init__(**kwargs) self.properties = properties @@ -4616,12 +5939,12 @@ def __init__( class DisableProtectionInputProperties(msrest.serialization.Model): """Disable protection input properties. - :param disable_protection_reason: Disable protection reason. It can have values + :ivar disable_protection_reason: Disable protection reason. It can have values NotSpecified/MigrationComplete. Possible values include: "NotSpecified", "MigrationComplete". - :type disable_protection_reason: str or + :vartype disable_protection_reason: str or ~azure.mgmt.recoveryservicessiterecovery.models.DisableProtectionReason - :param replication_provider_input: Replication provider specific input. - :type replication_provider_input: + :ivar replication_provider_input: Replication provider specific input. + :vartype replication_provider_input: ~azure.mgmt.recoveryservicessiterecovery.models.DisableProtectionProviderSpecificInput """ @@ -4637,6 +5960,15 @@ def __init__( replication_provider_input: Optional["DisableProtectionProviderSpecificInput"] = None, **kwargs ): + """ + :keyword disable_protection_reason: Disable protection reason. It can have values + NotSpecified/MigrationComplete. Possible values include: "NotSpecified", "MigrationComplete". + :paramtype disable_protection_reason: str or + ~azure.mgmt.recoveryservicessiterecovery.models.DisableProtectionReason + :keyword replication_provider_input: Replication provider specific input. + :paramtype replication_provider_input: + ~azure.mgmt.recoveryservicessiterecovery.models.DisableProtectionProviderSpecificInput + """ super(DisableProtectionInputProperties, self).__init__(**kwargs) self.disable_protection_reason = disable_protection_reason self.replication_provider_input = replication_provider_input @@ -4650,8 +5982,8 @@ class DisableProtectionProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -4670,6 +6002,8 @@ def __init__( self, **kwargs ): + """ + """ super(DisableProtectionProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -4677,8 +6011,8 @@ def __init__( class DiscoverProtectableItemRequest(msrest.serialization.Model): """Request to add a physical machine as a protectable item in a container. - :param properties: The properties of a discover protectable item request. - :type properties: + :ivar properties: The properties of a discover protectable item request. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.DiscoverProtectableItemRequestProperties """ @@ -4692,6 +6026,11 @@ def __init__( properties: Optional["DiscoverProtectableItemRequestProperties"] = None, **kwargs ): + """ + :keyword properties: The properties of a discover protectable item request. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.DiscoverProtectableItemRequestProperties + """ super(DiscoverProtectableItemRequest, self).__init__(**kwargs) self.properties = properties @@ -4699,12 +6038,12 @@ def __init__( class DiscoverProtectableItemRequestProperties(msrest.serialization.Model): """Discover protectable item properties. - :param friendly_name: The friendly name of the physical machine. - :type friendly_name: str - :param ip_address: The IP address of the physical machine to be discovered. - :type ip_address: str - :param os_type: The OS type on the physical machine. - :type os_type: str + :ivar friendly_name: The friendly name of the physical machine. + :vartype friendly_name: str + :ivar ip_address: The IP address of the physical machine to be discovered. + :vartype ip_address: str + :ivar os_type: The OS type on the physical machine. + :vartype os_type: str """ _attribute_map = { @@ -4721,6 +6060,14 @@ def __init__( os_type: Optional[str] = None, **kwargs ): + """ + :keyword friendly_name: The friendly name of the physical machine. + :paramtype friendly_name: str + :keyword ip_address: The IP address of the physical machine to be discovered. + :paramtype ip_address: str + :keyword os_type: The OS type on the physical machine. + :paramtype os_type: str + """ super(DiscoverProtectableItemRequestProperties, self).__init__(**kwargs) self.friendly_name = friendly_name self.ip_address = ip_address @@ -4730,14 +6077,14 @@ def __init__( class DiskDetails(msrest.serialization.Model): """Onprem disk details data. - :param max_size_mb: The hard disk max size in MB. - :type max_size_mb: long - :param vhd_type: The type of the volume. - :type vhd_type: str - :param vhd_id: The VHD Id. - :type vhd_id: str - :param vhd_name: The VHD name. - :type vhd_name: str + :ivar max_size_mb: The hard disk max size in MB. + :vartype max_size_mb: long + :ivar vhd_type: The type of the volume. + :vartype vhd_type: str + :ivar vhd_id: The VHD Id. + :vartype vhd_id: str + :ivar vhd_name: The VHD name. + :vartype vhd_name: str """ _attribute_map = { @@ -4756,6 +6103,16 @@ def __init__( vhd_name: Optional[str] = None, **kwargs ): + """ + :keyword max_size_mb: The hard disk max size in MB. + :paramtype max_size_mb: long + :keyword vhd_type: The type of the volume. + :paramtype vhd_type: str + :keyword vhd_id: The VHD Id. + :paramtype vhd_id: str + :keyword vhd_name: The VHD name. + :paramtype vhd_name: str + """ super(DiskDetails, self).__init__(**kwargs) self.max_size_mb = max_size_mb self.vhd_type = vhd_type @@ -4766,11 +6123,11 @@ def __init__( class DiskEncryptionInfo(msrest.serialization.Model): """Recovery disk encryption info (BEK and KEK). - :param disk_encryption_key_info: The recovery KeyVault reference for secret. - :type disk_encryption_key_info: + :ivar disk_encryption_key_info: The recovery KeyVault reference for secret. + :vartype disk_encryption_key_info: ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionKeyInfo - :param key_encryption_key_info: The recovery KeyVault reference for key. - :type key_encryption_key_info: + :ivar key_encryption_key_info: The recovery KeyVault reference for key. + :vartype key_encryption_key_info: ~azure.mgmt.recoveryservicessiterecovery.models.KeyEncryptionKeyInfo """ @@ -4786,6 +6143,14 @@ def __init__( key_encryption_key_info: Optional["KeyEncryptionKeyInfo"] = None, **kwargs ): + """ + :keyword disk_encryption_key_info: The recovery KeyVault reference for secret. + :paramtype disk_encryption_key_info: + ~azure.mgmt.recoveryservicessiterecovery.models.DiskEncryptionKeyInfo + :keyword key_encryption_key_info: The recovery KeyVault reference for key. + :paramtype key_encryption_key_info: + ~azure.mgmt.recoveryservicessiterecovery.models.KeyEncryptionKeyInfo + """ super(DiskEncryptionInfo, self).__init__(**kwargs) self.disk_encryption_key_info = disk_encryption_key_info self.key_encryption_key_info = key_encryption_key_info @@ -4794,10 +6159,10 @@ def __init__( class DiskEncryptionKeyInfo(msrest.serialization.Model): """Disk Encryption Key Information (BitLocker Encryption Key (BEK) on Windows). - :param secret_identifier: The secret url / identifier. - :type secret_identifier: str - :param key_vault_resource_arm_id: The KeyVault resource ARM id for secret. - :type key_vault_resource_arm_id: str + :ivar secret_identifier: The secret url / identifier. + :vartype secret_identifier: str + :ivar key_vault_resource_arm_id: The KeyVault resource ARM id for secret. + :vartype key_vault_resource_arm_id: str """ _attribute_map = { @@ -4812,6 +6177,12 @@ def __init__( key_vault_resource_arm_id: Optional[str] = None, **kwargs ): + """ + :keyword secret_identifier: The secret url / identifier. + :paramtype secret_identifier: str + :keyword key_vault_resource_arm_id: The KeyVault resource ARM id for secret. + :paramtype key_vault_resource_arm_id: str + """ super(DiskEncryptionKeyInfo, self).__init__(**kwargs) self.secret_identifier = secret_identifier self.key_vault_resource_arm_id = key_vault_resource_arm_id @@ -4820,10 +6191,10 @@ def __init__( class DiskVolumeDetails(msrest.serialization.Model): """Volume details. - :param label: The volume label. - :type label: str - :param name: The volume name. - :type name: str + :ivar label: The volume label. + :vartype label: str + :ivar name: The volume name. + :vartype name: str """ _attribute_map = { @@ -4838,6 +6209,12 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword label: The volume label. + :paramtype label: str + :keyword name: The volume name. + :paramtype name: str + """ super(DiskVolumeDetails, self).__init__(**kwargs) self.label = label self.name = name @@ -4846,30 +6223,30 @@ def __init__( class Display(msrest.serialization.Model): """Contains the localized display information for this particular operation / action. These value will be used by several clients for (1) custom role definitions for RBAC; (2) complex query filters for the event service; and (3) audit history / records for management operations. - :param provider: The provider. The localized friendly form of the resource provider name - it - is expected to also include the publisher/company responsible. It should use Title Casing and + :ivar provider: The provider. The localized friendly form of the resource provider name - it is + expected to also include the publisher/company responsible. It should use Title Casing and begin with "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". - :type provider: str - :param resource: The resource. The localized friendly form of the resource related to this + :vartype provider: str + :ivar resource: The resource. The localized friendly form of the resource related to this action/operation - it should match the public documentation for the resource provider. It should use Title Casing. This value should be unique for a particular URL type (e.g. nested types should *not* reuse their parent's display.resource field). e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler Jobs". - :type resource: str - :param operation: The operation. The localized friendly name for the operation, as it should be + :vartype resource: str + :ivar operation: The operation. The localized friendly name for the operation, as it should be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing. Prescriptive guidance: Read Create or Update Delete 'ActionName'. - :type operation: str - :param description: The description. The localized friendly description for the operation, as - it should be shown to the user. It should be thorough, yet concise - it will be used in tool - tips and detailed views. Prescriptive guidance for namespaces: Read any 'display.provider' - resource Create or Update any 'display.provider' resource Delete any 'display.provider' - resource Perform any other action on any 'display.provider' resource Prescriptive guidance for - namespaces: Read any 'display.resource' Create or Update any 'display.resource' Delete any - 'display.resource' 'ActionName' any 'display.resources'. - :type description: str + :vartype operation: str + :ivar description: The description. The localized friendly description for the operation, as it + should be shown to the user. It should be thorough, yet concise - it will be used in tool tips + and detailed views. Prescriptive guidance for namespaces: Read any 'display.provider' resource + Create or Update any 'display.provider' resource Delete any 'display.provider' resource Perform + any other action on any 'display.provider' resource Prescriptive guidance for namespaces: Read + any 'display.resource' Create or Update any 'display.resource' Delete any 'display.resource' + 'ActionName' any 'display.resources'. + :vartype description: str """ _attribute_map = { @@ -4888,6 +6265,32 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword provider: The provider. The localized friendly form of the resource provider name - it + is expected to also include the publisher/company responsible. It should use Title Casing and + begin with "Microsoft" for 1st party services. e.g. "Microsoft Monitoring Insights" or + "Microsoft Compute.". + :paramtype provider: str + :keyword resource: The resource. The localized friendly form of the resource related to this + action/operation - it should match the public documentation for the resource provider. It + should use Title Casing. This value should be unique for a particular URL type (e.g. nested + types should *not* reuse their parent's display.resource field). e.g. "Virtual Machines" or + "Scheduler Job Collections", or "Virtual Machine VM Sizes" or "Scheduler Jobs". + :paramtype resource: str + :keyword operation: The operation. The localized friendly name for the operation, as it should + be shown to the user. It should be concise (to fit in drop downs) but clear (i.e. + self-documenting). It should use Title Casing. Prescriptive guidance: Read Create or Update + Delete 'ActionName'. + :paramtype operation: str + :keyword description: The description. The localized friendly description for the operation, as + it should be shown to the user. It should be thorough, yet concise - it will be used in tool + tips and detailed views. Prescriptive guidance for namespaces: Read any 'display.provider' + resource Create or Update any 'display.provider' resource Delete any 'display.provider' + resource Perform any other action on any 'display.provider' resource Prescriptive guidance for + namespaces: Read any 'display.resource' Create or Update any 'display.resource' Delete any + 'display.resource' 'ActionName' any 'display.resources'. + :paramtype description: str + """ super(Display, self).__init__(**kwargs) self.provider = provider self.resource = resource @@ -4950,6 +6353,8 @@ def __init__( self, **kwargs ): + """ + """ super(DraDetails, self).__init__(**kwargs) self.id = None self.name = None @@ -4967,8 +6372,8 @@ class EnableMigrationInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. Enable migration input properties. - :type properties: + :ivar properties: Required. Enable migration input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.EnableMigrationInputProperties """ @@ -4986,6 +6391,11 @@ def __init__( properties: "EnableMigrationInputProperties", **kwargs ): + """ + :keyword properties: Required. Enable migration input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.EnableMigrationInputProperties + """ super(EnableMigrationInput, self).__init__(**kwargs) self.properties = properties @@ -4995,10 +6405,10 @@ class EnableMigrationInputProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param policy_id: Required. The policy Id. - :type policy_id: str - :param provider_specific_details: Required. The provider specific details. - :type provider_specific_details: + :ivar policy_id: Required. The policy Id. + :vartype policy_id: str + :ivar provider_specific_details: Required. The provider specific details. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.EnableMigrationProviderSpecificInput """ @@ -5019,6 +6429,13 @@ def __init__( provider_specific_details: "EnableMigrationProviderSpecificInput", **kwargs ): + """ + :keyword policy_id: Required. The policy Id. + :paramtype policy_id: str + :keyword provider_specific_details: Required. The provider specific details. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.EnableMigrationProviderSpecificInput + """ super(EnableMigrationInputProperties, self).__init__(**kwargs) self.policy_id = policy_id self.provider_specific_details = provider_specific_details @@ -5032,8 +6449,8 @@ class EnableMigrationProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -5052,6 +6469,8 @@ def __init__( self, **kwargs ): + """ + """ super(EnableMigrationProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -5059,8 +6478,8 @@ def __init__( class EnableProtectionInput(msrest.serialization.Model): """Enable protection input. - :param properties: Enable protection input properties. - :type properties: + :ivar properties: Enable protection input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.EnableProtectionInputProperties """ @@ -5074,6 +6493,11 @@ def __init__( properties: Optional["EnableProtectionInputProperties"] = None, **kwargs ): + """ + :keyword properties: Enable protection input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.EnableProtectionInputProperties + """ super(EnableProtectionInput, self).__init__(**kwargs) self.properties = properties @@ -5081,14 +6505,14 @@ def __init__( class EnableProtectionInputProperties(msrest.serialization.Model): """Enable protection input properties. - :param policy_id: The Policy Id. - :type policy_id: str - :param protectable_item_id: The protectable item Id. - :type protectable_item_id: str - :param provider_specific_details: The ReplicationProviderInput. For HyperVReplicaAzure - provider, it will be AzureEnableProtectionInput object. For San provider, it will be + :ivar policy_id: The Policy Id. + :vartype policy_id: str + :ivar protectable_item_id: The protectable item Id. + :vartype protectable_item_id: str + :ivar provider_specific_details: The ReplicationProviderInput. For HyperVReplicaAzure provider, + it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. - :type provider_specific_details: + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.EnableProtectionProviderSpecificInput """ @@ -5106,6 +6530,17 @@ def __init__( provider_specific_details: Optional["EnableProtectionProviderSpecificInput"] = None, **kwargs ): + """ + :keyword policy_id: The Policy Id. + :paramtype policy_id: str + :keyword protectable_item_id: The protectable item Id. + :paramtype protectable_item_id: str + :keyword provider_specific_details: The ReplicationProviderInput. For HyperVReplicaAzure + provider, it will be AzureEnableProtectionInput object. For San provider, it will be + SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.EnableProtectionProviderSpecificInput + """ super(EnableProtectionInputProperties, self).__init__(**kwargs) self.policy_id = policy_id self.protectable_item_id = protectable_item_id @@ -5115,12 +6550,12 @@ def __init__( class EncryptionDetails(msrest.serialization.Model): """Encryption details for the fabric. - :param kek_state: The key encryption key state for the Vmm. - :type kek_state: str - :param kek_cert_thumbprint: The key encryption key certificate thumbprint. - :type kek_cert_thumbprint: str - :param kek_cert_expiry_date: The key encryption key certificate expiry date. - :type kek_cert_expiry_date: ~datetime.datetime + :ivar kek_state: The key encryption key state for the Vmm. + :vartype kek_state: str + :ivar kek_cert_thumbprint: The key encryption key certificate thumbprint. + :vartype kek_cert_thumbprint: str + :ivar kek_cert_expiry_date: The key encryption key certificate expiry date. + :vartype kek_cert_expiry_date: ~datetime.datetime """ _attribute_map = { @@ -5137,6 +6572,14 @@ def __init__( kek_cert_expiry_date: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword kek_state: The key encryption key state for the Vmm. + :paramtype kek_state: str + :keyword kek_cert_thumbprint: The key encryption key certificate thumbprint. + :paramtype kek_cert_thumbprint: str + :keyword kek_cert_expiry_date: The key encryption key certificate expiry date. + :paramtype kek_cert_expiry_date: ~datetime.datetime + """ super(EncryptionDetails, self).__init__(**kwargs) self.kek_state = kek_state self.kek_cert_thumbprint = kek_cert_thumbprint @@ -5154,10 +6597,10 @@ class Event(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: Event related data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.EventProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: Event related data. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.EventProperties """ _validation = { @@ -5181,6 +6624,12 @@ def __init__( properties: Optional["EventProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: Event related data. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.EventProperties + """ super(Event, self).__init__(location=location, **kwargs) self.properties = properties @@ -5188,10 +6637,10 @@ def __init__( class EventCollection(msrest.serialization.Model): """Collection of fabric details. - :param value: The list of events. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.Event] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The list of events. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.Event] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -5206,6 +6655,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The list of events. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.Event] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(EventCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -5214,33 +6669,33 @@ def __init__( class EventProperties(msrest.serialization.Model): """The properties of a monitoring event. - :param event_code: The Id of the monitoring event. - :type event_code: str - :param description: The event name. - :type description: str - :param event_type: The type of the event. for example: VM Health, Server Health, Job Failure + :ivar event_code: The Id of the monitoring event. + :vartype event_code: str + :ivar description: The event name. + :vartype description: str + :ivar event_type: The type of the event. for example: VM Health, Server Health, Job Failure etc. - :type event_type: str - :param affected_object_friendly_name: The friendly name of the source of the event on which it + :vartype event_type: str + :ivar affected_object_friendly_name: The friendly name of the source of the event on which it is raised (for example, VM, VMM etc). - :type affected_object_friendly_name: str - :param affected_object_correlation_id: The affected object correlationId for the event. - :type affected_object_correlation_id: str - :param severity: The severity of the event. - :type severity: str - :param time_of_occurrence: The time of occurrence of the event. - :type time_of_occurrence: ~datetime.datetime - :param fabric_id: The ARM ID of the fabric. - :type fabric_id: str - :param provider_specific_details: The provider specific settings. - :type provider_specific_details: + :vartype affected_object_friendly_name: str + :ivar affected_object_correlation_id: The affected object correlationId for the event. + :vartype affected_object_correlation_id: str + :ivar severity: The severity of the event. + :vartype severity: str + :ivar time_of_occurrence: The time of occurrence of the event. + :vartype time_of_occurrence: ~datetime.datetime + :ivar fabric_id: The ARM ID of the fabric. + :vartype fabric_id: str + :ivar provider_specific_details: The provider specific settings. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.EventProviderSpecificDetails - :param event_specific_details: The event specific settings. - :type event_specific_details: + :ivar event_specific_details: The event specific settings. + :vartype event_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.EventSpecificDetails - :param health_errors: The list of errors / warnings capturing details associated with the + :ivar health_errors: The list of errors / warnings capturing details associated with the issue(s). - :type health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :vartype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] """ _attribute_map = { @@ -5273,6 +6728,35 @@ def __init__( health_errors: Optional[List["HealthError"]] = None, **kwargs ): + """ + :keyword event_code: The Id of the monitoring event. + :paramtype event_code: str + :keyword description: The event name. + :paramtype description: str + :keyword event_type: The type of the event. for example: VM Health, Server Health, Job Failure + etc. + :paramtype event_type: str + :keyword affected_object_friendly_name: The friendly name of the source of the event on which + it is raised (for example, VM, VMM etc). + :paramtype affected_object_friendly_name: str + :keyword affected_object_correlation_id: The affected object correlationId for the event. + :paramtype affected_object_correlation_id: str + :keyword severity: The severity of the event. + :paramtype severity: str + :keyword time_of_occurrence: The time of occurrence of the event. + :paramtype time_of_occurrence: ~datetime.datetime + :keyword fabric_id: The ARM ID of the fabric. + :paramtype fabric_id: str + :keyword provider_specific_details: The provider specific settings. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.EventProviderSpecificDetails + :keyword event_specific_details: The event specific settings. + :paramtype event_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.EventSpecificDetails + :keyword health_errors: The list of errors / warnings capturing details associated with the + issue(s). + :paramtype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + """ super(EventProperties, self).__init__(**kwargs) self.event_code = event_code self.description = description @@ -5290,23 +6774,23 @@ def __init__( class EventQueryParameter(msrest.serialization.Model): """Implements the event query parameter. - :param event_code: The source id of the events to be queried. - :type event_code: str - :param severity: The severity of the events to be queried. - :type severity: str - :param event_type: The type of the events to be queried. - :type event_type: str - :param fabric_name: The affected object server id of the events to be queried. - :type fabric_name: str - :param affected_object_friendly_name: The affected object name of the events to be queried. - :type affected_object_friendly_name: str - :param affected_object_correlation_id: The affected object correlationId for the events to be + :ivar event_code: The source id of the events to be queried. + :vartype event_code: str + :ivar severity: The severity of the events to be queried. + :vartype severity: str + :ivar event_type: The type of the events to be queried. + :vartype event_type: str + :ivar fabric_name: The affected object server id of the events to be queried. + :vartype fabric_name: str + :ivar affected_object_friendly_name: The affected object name of the events to be queried. + :vartype affected_object_friendly_name: str + :ivar affected_object_correlation_id: The affected object correlationId for the events to be queried. - :type affected_object_correlation_id: str - :param start_time: The start time of the time range within which the events are to be queried. - :type start_time: ~datetime.datetime - :param end_time: The end time of the time range within which the events are to be queried. - :type end_time: ~datetime.datetime + :vartype affected_object_correlation_id: str + :ivar start_time: The start time of the time range within which the events are to be queried. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the time range within which the events are to be queried. + :vartype end_time: ~datetime.datetime """ _attribute_map = { @@ -5333,6 +6817,26 @@ def __init__( end_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword event_code: The source id of the events to be queried. + :paramtype event_code: str + :keyword severity: The severity of the events to be queried. + :paramtype severity: str + :keyword event_type: The type of the events to be queried. + :paramtype event_type: str + :keyword fabric_name: The affected object server id of the events to be queried. + :paramtype fabric_name: str + :keyword affected_object_friendly_name: The affected object name of the events to be queried. + :paramtype affected_object_friendly_name: str + :keyword affected_object_correlation_id: The affected object correlationId for the events to be + queried. + :paramtype affected_object_correlation_id: str + :keyword start_time: The start time of the time range within which the events are to be + queried. + :paramtype start_time: ~datetime.datetime + :keyword end_time: The end time of the time range within which the events are to be queried. + :paramtype end_time: ~datetime.datetime + """ super(EventQueryParameter, self).__init__(**kwargs) self.event_code = event_code self.severity = severity @@ -5352,9 +6856,9 @@ class EventSpecificDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str """ _validation = { @@ -5373,6 +6877,8 @@ def __init__( self, **kwargs ): + """ + """ super(EventSpecificDetails, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -5385,8 +6891,8 @@ class ProtectionProfileCustomDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str + :ivar resource_type: Required. The class type.Constant filled by server. + :vartype resource_type: str """ _validation = { @@ -5405,6 +6911,8 @@ def __init__( self, **kwargs ): + """ + """ super(ProtectionProfileCustomDetails, self).__init__(**kwargs) self.resource_type = None # type: Optional[str] @@ -5414,11 +6922,11 @@ class ExistingProtectionProfile(ProtectionProfileCustomDetails): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param protection_profile_id: Required. The protection profile Arm Id. Throw error, if resource + :ivar resource_type: Required. The class type.Constant filled by server. + :vartype resource_type: str + :ivar protection_profile_id: Required. The protection profile Arm Id. Throw error, if resource does not exists. - :type protection_profile_id: str + :vartype protection_profile_id: str """ _validation = { @@ -5437,6 +6945,11 @@ def __init__( protection_profile_id: str, **kwargs ): + """ + :keyword protection_profile_id: Required. The protection profile Arm Id. Throw error, if + resource does not exists. + :paramtype protection_profile_id: str + """ super(ExistingProtectionProfile, self).__init__(**kwargs) self.resource_type = 'Existing' # type: str self.protection_profile_id = protection_profile_id @@ -5450,8 +6963,8 @@ class RecoveryAvailabilitySetCustomDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str + :ivar resource_type: Required. The class type.Constant filled by server. + :vartype resource_type: str """ _validation = { @@ -5470,6 +6983,8 @@ def __init__( self, **kwargs ): + """ + """ super(RecoveryAvailabilitySetCustomDetails, self).__init__(**kwargs) self.resource_type = None # type: Optional[str] @@ -5479,11 +6994,11 @@ class ExistingRecoveryAvailabilitySet(RecoveryAvailabilitySetCustomDetails): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param recovery_availability_set_id: The recovery availability set Id. Will throw error, if + :ivar resource_type: Required. The class type.Constant filled by server. + :vartype resource_type: str + :ivar recovery_availability_set_id: The recovery availability set Id. Will throw error, if resource does not exist. - :type recovery_availability_set_id: str + :vartype recovery_availability_set_id: str """ _validation = { @@ -5501,6 +7016,11 @@ def __init__( recovery_availability_set_id: Optional[str] = None, **kwargs ): + """ + :keyword recovery_availability_set_id: The recovery availability set Id. Will throw error, if + resource does not exist. + :paramtype recovery_availability_set_id: str + """ super(ExistingRecoveryAvailabilitySet, self).__init__(**kwargs) self.resource_type = 'Existing' # type: str self.recovery_availability_set_id = recovery_availability_set_id @@ -5514,8 +7034,8 @@ class RecoveryProximityPlacementGroupCustomDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str + :ivar resource_type: Required. The class type.Constant filled by server. + :vartype resource_type: str """ _validation = { @@ -5534,6 +7054,8 @@ def __init__( self, **kwargs ): + """ + """ super(RecoveryProximityPlacementGroupCustomDetails, self).__init__(**kwargs) self.resource_type = None # type: Optional[str] @@ -5543,11 +7065,11 @@ class ExistingRecoveryProximityPlacementGroup(RecoveryProximityPlacementGroupCus All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param recovery_proximity_placement_group_id: The recovery proximity placement group Id. Will + :ivar resource_type: Required. The class type.Constant filled by server. + :vartype resource_type: str + :ivar recovery_proximity_placement_group_id: The recovery proximity placement group Id. Will throw error, if resource does not exist. - :type recovery_proximity_placement_group_id: str + :vartype recovery_proximity_placement_group_id: str """ _validation = { @@ -5565,6 +7087,11 @@ def __init__( recovery_proximity_placement_group_id: Optional[str] = None, **kwargs ): + """ + :keyword recovery_proximity_placement_group_id: The recovery proximity placement group Id. Will + throw error, if resource does not exist. + :paramtype recovery_proximity_placement_group_id: str + """ super(ExistingRecoveryProximityPlacementGroup, self).__init__(**kwargs) self.resource_type = 'Existing' # type: str self.recovery_proximity_placement_group_id = recovery_proximity_placement_group_id @@ -5578,8 +7105,8 @@ class RecoveryResourceGroupCustomDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str + :ivar resource_type: Required. The class type.Constant filled by server. + :vartype resource_type: str """ _validation = { @@ -5598,6 +7125,8 @@ def __init__( self, **kwargs ): + """ + """ super(RecoveryResourceGroupCustomDetails, self).__init__(**kwargs) self.resource_type = None # type: Optional[str] @@ -5607,10 +7136,10 @@ class ExistingRecoveryResourceGroup(RecoveryResourceGroupCustomDetails): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. - :type recovery_resource_group_id: str + :ivar resource_type: Required. The class type.Constant filled by server. + :vartype resource_type: str + :ivar recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. + :vartype recovery_resource_group_id: str """ _validation = { @@ -5628,6 +7157,10 @@ def __init__( recovery_resource_group_id: Optional[str] = None, **kwargs ): + """ + :keyword recovery_resource_group_id: The recovery resource group Id. Valid for V2 scenarios. + :paramtype recovery_resource_group_id: str + """ super(ExistingRecoveryResourceGroup, self).__init__(**kwargs) self.resource_type = 'Existing' # type: str self.recovery_resource_group_id = recovery_resource_group_id @@ -5641,8 +7174,8 @@ class RecoveryVirtualNetworkCustomDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str + :ivar resource_type: Required. The class type.Constant filled by server. + :vartype resource_type: str """ _validation = { @@ -5661,6 +7194,8 @@ def __init__( self, **kwargs ): + """ + """ super(RecoveryVirtualNetworkCustomDetails, self).__init__(**kwargs) self.resource_type = None # type: Optional[str] @@ -5670,13 +7205,13 @@ class ExistingRecoveryVirtualNetwork(RecoveryVirtualNetworkCustomDetails): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param recovery_virtual_network_id: Required. The recovery virtual network Id. Will throw - error, if resource does not exist. - :type recovery_virtual_network_id: str - :param recovery_subnet_name: The recovery subnet name. - :type recovery_subnet_name: str + :ivar resource_type: Required. The class type.Constant filled by server. + :vartype resource_type: str + :ivar recovery_virtual_network_id: Required. The recovery virtual network Id. Will throw error, + if resource does not exist. + :vartype recovery_virtual_network_id: str + :ivar recovery_subnet_name: The recovery subnet name. + :vartype recovery_subnet_name: str """ _validation = { @@ -5697,6 +7232,13 @@ def __init__( recovery_subnet_name: Optional[str] = None, **kwargs ): + """ + :keyword recovery_virtual_network_id: Required. The recovery virtual network Id. Will throw + error, if resource does not exist. + :paramtype recovery_virtual_network_id: str + :keyword recovery_subnet_name: The recovery subnet name. + :paramtype recovery_subnet_name: str + """ super(ExistingRecoveryVirtualNetwork, self).__init__(**kwargs) self.resource_type = 'Existing' # type: str self.recovery_virtual_network_id = recovery_virtual_network_id @@ -5711,8 +7253,8 @@ class StorageAccountCustomDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str + :ivar resource_type: Required. The class type.Constant filled by server. + :vartype resource_type: str """ _validation = { @@ -5731,6 +7273,8 @@ def __init__( self, **kwargs ): + """ + """ super(StorageAccountCustomDetails, self).__init__(**kwargs) self.resource_type = None # type: Optional[str] @@ -5740,11 +7284,11 @@ class ExistingStorageAccount(StorageAccountCustomDetails): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param azure_storage_account_id: Required. The storage account Arm Id. Throw error, if resource + :ivar resource_type: Required. The class type.Constant filled by server. + :vartype resource_type: str + :ivar azure_storage_account_id: Required. The storage account Arm Id. Throw error, if resource does not exists. - :type azure_storage_account_id: str + :vartype azure_storage_account_id: str """ _validation = { @@ -5763,6 +7307,11 @@ def __init__( azure_storage_account_id: str, **kwargs ): + """ + :keyword azure_storage_account_id: Required. The storage account Arm Id. Throw error, if + resource does not exists. + :paramtype azure_storage_account_id: str + """ super(ExistingStorageAccount, self).__init__(**kwargs) self.resource_type = 'Existing' # type: str self.azure_storage_account_id = azure_storage_account_id @@ -5773,16 +7322,16 @@ class ExportJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for + :ivar instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for possible values).Constant filled by server. - :type instance_type: str - :param affected_object_details: The affected object properties like source server, source - cloud, target server, target cloud etc. based on the workflow object details. - :type affected_object_details: dict[str, str] - :param blob_uri: BlobUri of the exported jobs. - :type blob_uri: str - :param sas_token: The sas token to access blob. - :type sas_token: str + :vartype instance_type: str + :ivar affected_object_details: The affected object properties like source server, source cloud, + target server, target cloud etc. based on the workflow object details. + :vartype affected_object_details: dict[str, str] + :ivar blob_uri: BlobUri of the exported jobs. + :vartype blob_uri: str + :ivar sas_token: The sas token to access blob. + :vartype sas_token: str """ _validation = { @@ -5804,12 +7353,60 @@ def __init__( sas_token: Optional[str] = None, **kwargs ): + """ + :keyword affected_object_details: The affected object properties like source server, source + cloud, target server, target cloud etc. based on the workflow object details. + :paramtype affected_object_details: dict[str, str] + :keyword blob_uri: BlobUri of the exported jobs. + :paramtype blob_uri: str + :keyword sas_token: The sas token to access blob. + :paramtype sas_token: str + """ super(ExportJobDetails, self).__init__(affected_object_details=affected_object_details, **kwargs) self.instance_type = 'ExportJobDetails' # type: str self.blob_uri = blob_uri self.sas_token = sas_token +class ExtendedLocation(msrest.serialization.Model): + """Extended location of the resource. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Required. The name of the extended location. + :vartype name: str + :ivar type: Required. The extended location type. Possible values include: "EdgeZone". + :vartype type: str or ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocationType + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "ExtendedLocationType"], + **kwargs + ): + """ + :keyword name: Required. The name of the extended location. + :paramtype name: str + :keyword type: Required. The extended location type. Possible values include: "EdgeZone". + :paramtype type: str or ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocationType + """ + super(ExtendedLocation, self).__init__(**kwargs) + self.name = name + self.type = type + + class Fabric(Resource): """Fabric definition. @@ -5821,10 +7418,10 @@ class Fabric(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: Fabric related data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.FabricProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: Fabric related data. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.FabricProperties """ _validation = { @@ -5848,6 +7445,12 @@ def __init__( properties: Optional["FabricProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: Fabric related data. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.FabricProperties + """ super(Fabric, self).__init__(location=location, **kwargs) self.properties = properties @@ -5855,10 +7458,10 @@ def __init__( class FabricCollection(msrest.serialization.Model): """Collection of fabric details. - :param value: The fabric details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The fabric details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -5873,6 +7476,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The fabric details. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(FabricCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -5881,8 +7490,9 @@ def __init__( class FabricCreationInput(msrest.serialization.Model): """Site details provided during the time of site creation. - :param properties: Fabric creation input. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.FabricCreationInputProperties + :ivar properties: Fabric creation input. + :vartype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.FabricCreationInputProperties """ _attribute_map = { @@ -5895,6 +7505,11 @@ def __init__( properties: Optional["FabricCreationInputProperties"] = None, **kwargs ): + """ + :keyword properties: Fabric creation input. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.FabricCreationInputProperties + """ super(FabricCreationInput, self).__init__(**kwargs) self.properties = properties @@ -5902,8 +7517,8 @@ def __init__( class FabricCreationInputProperties(msrest.serialization.Model): """Properties of site details provided during the time of site creation. - :param custom_details: Fabric provider specific creation input. - :type custom_details: + :ivar custom_details: Fabric provider specific creation input. + :vartype custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.FabricSpecificCreationInput """ @@ -5917,6 +7532,11 @@ def __init__( custom_details: Optional["FabricSpecificCreationInput"] = None, **kwargs ): + """ + :keyword custom_details: Fabric provider specific creation input. + :paramtype custom_details: + ~azure.mgmt.recoveryservicessiterecovery.models.FabricSpecificCreationInput + """ super(FabricCreationInputProperties, self).__init__(**kwargs) self.custom_details = custom_details @@ -5924,23 +7544,24 @@ def __init__( class FabricProperties(msrest.serialization.Model): """Fabric properties. - :param friendly_name: Friendly name of the fabric. - :type friendly_name: str - :param encryption_details: Encryption details for the fabric. - :type encryption_details: ~azure.mgmt.recoveryservicessiterecovery.models.EncryptionDetails - :param rollover_encryption_details: Rollover encryption details for the fabric. - :type rollover_encryption_details: + :ivar friendly_name: Friendly name of the fabric. + :vartype friendly_name: str + :ivar encryption_details: Encryption details for the fabric. + :vartype encryption_details: ~azure.mgmt.recoveryservicessiterecovery.models.EncryptionDetails + :ivar rollover_encryption_details: Rollover encryption details for the fabric. + :vartype rollover_encryption_details: ~azure.mgmt.recoveryservicessiterecovery.models.EncryptionDetails - :param internal_identifier: Dra Registration Id. - :type internal_identifier: str - :param bcdr_state: BCDR state of the fabric. - :type bcdr_state: str - :param custom_details: Fabric specific settings. - :type custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.FabricSpecificDetails - :param health_error_details: Fabric health error details. - :type health_error_details: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param health: Health of fabric. - :type health: str + :ivar internal_identifier: Dra Registration Id. + :vartype internal_identifier: str + :ivar bcdr_state: BCDR state of the fabric. + :vartype bcdr_state: str + :ivar custom_details: Fabric specific settings. + :vartype custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.FabricSpecificDetails + :ivar health_error_details: Fabric health error details. + :vartype health_error_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :ivar health: Health of fabric. + :vartype health: str """ _attribute_map = { @@ -5967,6 +7588,28 @@ def __init__( health: Optional[str] = None, **kwargs ): + """ + :keyword friendly_name: Friendly name of the fabric. + :paramtype friendly_name: str + :keyword encryption_details: Encryption details for the fabric. + :paramtype encryption_details: + ~azure.mgmt.recoveryservicessiterecovery.models.EncryptionDetails + :keyword rollover_encryption_details: Rollover encryption details for the fabric. + :paramtype rollover_encryption_details: + ~azure.mgmt.recoveryservicessiterecovery.models.EncryptionDetails + :keyword internal_identifier: Dra Registration Id. + :paramtype internal_identifier: str + :keyword bcdr_state: BCDR state of the fabric. + :paramtype bcdr_state: str + :keyword custom_details: Fabric specific settings. + :paramtype custom_details: + ~azure.mgmt.recoveryservicessiterecovery.models.FabricSpecificDetails + :keyword health_error_details: Fabric health error details. + :paramtype health_error_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :keyword health: Health of fabric. + :paramtype health: str + """ super(FabricProperties, self).__init__(**kwargs) self.friendly_name = friendly_name self.encryption_details = encryption_details @@ -5981,20 +7624,19 @@ def __init__( class FabricQueryParameter(msrest.serialization.Model): """Query parameter to get fabric. - :param zone_to_zone_mappings: A value indicating whether the zone to zone mappings are to be + :ivar zone_to_zone_mappings: A value indicating whether the zone to zone mappings are to be returned. - :type zone_to_zone_mappings: str - :param fetch_agent_details: A value indicating whether the agent details are to be fetched. - :type fetch_agent_details: str - :param bios_id: The BIOS Id to be used for fetching agent details. - :type bios_id: str - :param fqdn: The FQDN to be used for fetching agent details. - :type fqdn: str - :param discovery_type: The type of the discovered machine to be used for fetching agent - details. - :type discovery_type: str - :param os_type: The OS type to be used for fetching agent details. - :type os_type: str + :vartype zone_to_zone_mappings: str + :ivar fetch_agent_details: A value indicating whether the agent details are to be fetched. + :vartype fetch_agent_details: str + :ivar bios_id: The BIOS Id to be used for fetching agent details. + :vartype bios_id: str + :ivar fqdn: The FQDN to be used for fetching agent details. + :vartype fqdn: str + :ivar discovery_type: The type of the discovered machine to be used for fetching agent details. + :vartype discovery_type: str + :ivar os_type: The OS type to be used for fetching agent details. + :vartype os_type: str """ _attribute_map = { @@ -6017,6 +7659,22 @@ def __init__( os_type: Optional[str] = None, **kwargs ): + """ + :keyword zone_to_zone_mappings: A value indicating whether the zone to zone mappings are to be + returned. + :paramtype zone_to_zone_mappings: str + :keyword fetch_agent_details: A value indicating whether the agent details are to be fetched. + :paramtype fetch_agent_details: str + :keyword bios_id: The BIOS Id to be used for fetching agent details. + :paramtype bios_id: str + :keyword fqdn: The FQDN to be used for fetching agent details. + :paramtype fqdn: str + :keyword discovery_type: The type of the discovered machine to be used for fetching agent + details. + :paramtype discovery_type: str + :keyword os_type: The OS type to be used for fetching agent details. + :paramtype os_type: str + """ super(FabricQueryParameter, self).__init__(**kwargs) self.zone_to_zone_mappings = zone_to_zone_mappings self.fetch_agent_details = fetch_agent_details @@ -6034,10 +7692,10 @@ class JobTaskDetails(TaskTypeDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param job_task: The job entity. - :type job_task: ~azure.mgmt.recoveryservicessiterecovery.models.JobEntity + :ivar instance_type: Required. The type of task details.Constant filled by server. + :vartype instance_type: str + :ivar job_task: The job entity. + :vartype job_task: ~azure.mgmt.recoveryservicessiterecovery.models.JobEntity """ _validation = { @@ -6059,6 +7717,10 @@ def __init__( job_task: Optional["JobEntity"] = None, **kwargs ): + """ + :keyword job_task: The job entity. + :paramtype job_task: ~azure.mgmt.recoveryservicessiterecovery.models.JobEntity + """ super(JobTaskDetails, self).__init__(**kwargs) self.instance_type = 'JobTaskDetails' # type: str self.job_task = job_task @@ -6069,14 +7731,14 @@ class FabricReplicationGroupTaskDetails(JobTaskDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param job_task: The job entity. - :type job_task: ~azure.mgmt.recoveryservicessiterecovery.models.JobEntity - :param skipped_reason: The skipped reason. - :type skipped_reason: str - :param skipped_reason_string: The skipped reason string. - :type skipped_reason_string: str + :ivar instance_type: Required. The type of task details.Constant filled by server. + :vartype instance_type: str + :ivar job_task: The job entity. + :vartype job_task: ~azure.mgmt.recoveryservicessiterecovery.models.JobEntity + :ivar skipped_reason: The skipped reason. + :vartype skipped_reason: str + :ivar skipped_reason_string: The skipped reason string. + :vartype skipped_reason_string: str """ _validation = { @@ -6098,6 +7760,14 @@ def __init__( skipped_reason_string: Optional[str] = None, **kwargs ): + """ + :keyword job_task: The job entity. + :paramtype job_task: ~azure.mgmt.recoveryservicessiterecovery.models.JobEntity + :keyword skipped_reason: The skipped reason. + :paramtype skipped_reason: str + :keyword skipped_reason_string: The skipped reason string. + :paramtype skipped_reason_string: str + """ super(FabricReplicationGroupTaskDetails, self).__init__(job_task=job_task, **kwargs) self.instance_type = 'FabricReplicationGroupTaskDetails' # type: str self.skipped_reason = skipped_reason @@ -6109,14 +7779,14 @@ class FailoverJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for + :ivar instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for possible values).Constant filled by server. - :type instance_type: str - :param affected_object_details: The affected object properties like source server, source - cloud, target server, target cloud etc. based on the workflow object details. - :type affected_object_details: dict[str, str] - :param protected_item_details: The test VM details. - :type protected_item_details: + :vartype instance_type: str + :ivar affected_object_details: The affected object properties like source server, source cloud, + target server, target cloud etc. based on the workflow object details. + :vartype affected_object_details: dict[str, str] + :ivar protected_item_details: The test VM details. + :vartype protected_item_details: list[~azure.mgmt.recoveryservicessiterecovery.models.FailoverReplicationProtectedItemDetails] """ @@ -6137,6 +7807,14 @@ def __init__( protected_item_details: Optional[List["FailoverReplicationProtectedItemDetails"]] = None, **kwargs ): + """ + :keyword affected_object_details: The affected object properties like source server, source + cloud, target server, target cloud etc. based on the workflow object details. + :paramtype affected_object_details: dict[str, str] + :keyword protected_item_details: The test VM details. + :paramtype protected_item_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.FailoverReplicationProtectedItemDetails] + """ super(FailoverJobDetails, self).__init__(affected_object_details=affected_object_details, **kwargs) self.instance_type = 'FailoverJobDetails' # type: str self.protected_item_details = protected_item_details @@ -6145,8 +7823,8 @@ def __init__( class FailoverProcessServerRequest(msrest.serialization.Model): """Request to failover a process server. - :param properties: The properties of the PS Failover request. - :type properties: + :ivar properties: The properties of the PS Failover request. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.FailoverProcessServerRequestProperties """ @@ -6160,6 +7838,11 @@ def __init__( properties: Optional["FailoverProcessServerRequestProperties"] = None, **kwargs ): + """ + :keyword properties: The properties of the PS Failover request. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.FailoverProcessServerRequestProperties + """ super(FailoverProcessServerRequest, self).__init__(**kwargs) self.properties = properties @@ -6167,16 +7850,16 @@ def __init__( class FailoverProcessServerRequestProperties(msrest.serialization.Model): """The properties of the Failover Process Server request. - :param container_name: The container identifier. - :type container_name: str - :param source_process_server_id: The source process server. - :type source_process_server_id: str - :param target_process_server_id: The new process server. - :type target_process_server_id: str - :param vms_to_migrate: The VMS to migrate. - :type vms_to_migrate: list[str] - :param update_type: A value for failover type. It can be systemlevel/serverlevel. - :type update_type: str + :ivar container_name: The container identifier. + :vartype container_name: str + :ivar source_process_server_id: The source process server. + :vartype source_process_server_id: str + :ivar target_process_server_id: The new process server. + :vartype target_process_server_id: str + :ivar vms_to_migrate: The VMS to migrate. + :vartype vms_to_migrate: list[str] + :ivar update_type: A value for failover type. It can be systemlevel/serverlevel. + :vartype update_type: str """ _attribute_map = { @@ -6197,6 +7880,18 @@ def __init__( update_type: Optional[str] = None, **kwargs ): + """ + :keyword container_name: The container identifier. + :paramtype container_name: str + :keyword source_process_server_id: The source process server. + :paramtype source_process_server_id: str + :keyword target_process_server_id: The new process server. + :paramtype target_process_server_id: str + :keyword vms_to_migrate: The VMS to migrate. + :paramtype vms_to_migrate: list[str] + :keyword update_type: A value for failover type. It can be systemlevel/serverlevel. + :paramtype update_type: str + """ super(FailoverProcessServerRequestProperties, self).__init__(**kwargs) self.container_name = container_name self.source_process_server_id = source_process_server_id @@ -6208,26 +7903,26 @@ def __init__( class FailoverReplicationProtectedItemDetails(msrest.serialization.Model): """Failover details for a replication protected item. - :param name: The name. - :type name: str - :param friendly_name: The friendly name. - :type friendly_name: str - :param test_vm_name: The test Vm name. - :type test_vm_name: str - :param test_vm_friendly_name: The test Vm friendly name. - :type test_vm_friendly_name: str - :param network_connection_status: The network connection status. - :type network_connection_status: str - :param network_friendly_name: The network friendly name. - :type network_friendly_name: str - :param subnet: The network subnet. - :type subnet: str - :param recovery_point_id: The recovery point Id. - :type recovery_point_id: str - :param recovery_point_time: The recovery point time. - :type recovery_point_time: ~datetime.datetime - """ - + :ivar name: The name. + :vartype name: str + :ivar friendly_name: The friendly name. + :vartype friendly_name: str + :ivar test_vm_name: The test Vm name. + :vartype test_vm_name: str + :ivar test_vm_friendly_name: The test Vm friendly name. + :vartype test_vm_friendly_name: str + :ivar network_connection_status: The network connection status. + :vartype network_connection_status: str + :ivar network_friendly_name: The network friendly name. + :vartype network_friendly_name: str + :ivar subnet: The network subnet. + :vartype subnet: str + :ivar recovery_point_id: The recovery point Id. + :vartype recovery_point_id: str + :ivar recovery_point_time: The recovery point time. + :vartype recovery_point_time: ~datetime.datetime + """ + _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, @@ -6254,6 +7949,26 @@ def __init__( recovery_point_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword name: The name. + :paramtype name: str + :keyword friendly_name: The friendly name. + :paramtype friendly_name: str + :keyword test_vm_name: The test Vm name. + :paramtype test_vm_name: str + :keyword test_vm_friendly_name: The test Vm friendly name. + :paramtype test_vm_friendly_name: str + :keyword network_connection_status: The network connection status. + :paramtype network_connection_status: str + :keyword network_friendly_name: The network friendly name. + :paramtype network_friendly_name: str + :keyword subnet: The network subnet. + :paramtype subnet: str + :keyword recovery_point_id: The recovery point Id. + :paramtype recovery_point_id: str + :keyword recovery_point_time: The recovery point time. + :paramtype recovery_point_time: ~datetime.datetime + """ super(FailoverReplicationProtectedItemDetails, self).__init__(**kwargs) self.name = name self.friendly_name = friendly_name @@ -6274,10 +7989,10 @@ class GroupTaskDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param child_tasks: The child tasks. - :type child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] + :ivar instance_type: Required. The type of task details.Constant filled by server. + :vartype instance_type: str + :ivar child_tasks: The child tasks. + :vartype child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] """ _validation = { @@ -6299,6 +8014,10 @@ def __init__( child_tasks: Optional[List["ASRTask"]] = None, **kwargs ): + """ + :keyword child_tasks: The child tasks. + :paramtype child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] + """ super(GroupTaskDetails, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] self.child_tasks = child_tasks @@ -6307,42 +8026,42 @@ def __init__( class HealthError(msrest.serialization.Model): """Health Error. - :param inner_health_errors: The inner health errors. HealthError having a list of HealthError - as child errors is problematic. InnerHealthError is used because this will prevent an infinite + :ivar inner_health_errors: The inner health errors. HealthError having a list of HealthError as + child errors is problematic. InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. - :type inner_health_errors: + :vartype inner_health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.InnerHealthError] - :param error_source: Source of error. - :type error_source: str - :param error_type: Type of error. - :type error_type: str - :param error_level: Level of error. - :type error_level: str - :param error_category: Category of error. - :type error_category: str - :param error_code: Error code. - :type error_code: str - :param summary_message: Summary message of the entity. - :type summary_message: str - :param error_message: Error message. - :type error_message: str - :param possible_causes: Possible causes of error. - :type possible_causes: str - :param recommended_action: Recommended action to resolve error. - :type recommended_action: str - :param creation_time_utc: Error creation time (UTC). - :type creation_time_utc: ~datetime.datetime - :param recovery_provider_error_message: DRA error message. - :type recovery_provider_error_message: str - :param entity_id: ID of the entity. - :type entity_id: str - :param error_id: The health error unique id. - :type error_id: str - :param customer_resolvability: Value indicating whether the health error is customer - resolvable. Possible values include: "Allowed", "NotAllowed". - :type customer_resolvability: str or + :ivar error_source: Source of error. + :vartype error_source: str + :ivar error_type: Type of error. + :vartype error_type: str + :ivar error_level: Level of error. + :vartype error_level: str + :ivar error_category: Category of error. + :vartype error_category: str + :ivar error_code: Error code. + :vartype error_code: str + :ivar summary_message: Summary message of the entity. + :vartype summary_message: str + :ivar error_message: Error message. + :vartype error_message: str + :ivar possible_causes: Possible causes of error. + :vartype possible_causes: str + :ivar recommended_action: Recommended action to resolve error. + :vartype recommended_action: str + :ivar creation_time_utc: Error creation time (UTC). + :vartype creation_time_utc: ~datetime.datetime + :ivar recovery_provider_error_message: DRA error message. + :vartype recovery_provider_error_message: str + :ivar entity_id: ID of the entity. + :vartype entity_id: str + :ivar error_id: The health error unique id. + :vartype error_id: str + :ivar customer_resolvability: Value indicating whether the health error is customer resolvable. + Possible values include: "Allowed", "NotAllowed". + :vartype customer_resolvability: str or ~azure.mgmt.recoveryservicessiterecovery.models.HealthErrorCustomerResolvability """ @@ -6384,6 +8103,45 @@ def __init__( customer_resolvability: Optional[Union[str, "HealthErrorCustomerResolvability"]] = None, **kwargs ): + """ + :keyword inner_health_errors: The inner health errors. HealthError having a list of HealthError + as child errors is problematic. InnerHealthError is used because this will prevent an infinite + loop of structures when Hydra tries to auto-generate the contract. We are exposing the related + health errors as inner health errors and all API consumers can utilize this in the same fashion + as Exception -> InnerException. + :paramtype inner_health_errors: + list[~azure.mgmt.recoveryservicessiterecovery.models.InnerHealthError] + :keyword error_source: Source of error. + :paramtype error_source: str + :keyword error_type: Type of error. + :paramtype error_type: str + :keyword error_level: Level of error. + :paramtype error_level: str + :keyword error_category: Category of error. + :paramtype error_category: str + :keyword error_code: Error code. + :paramtype error_code: str + :keyword summary_message: Summary message of the entity. + :paramtype summary_message: str + :keyword error_message: Error message. + :paramtype error_message: str + :keyword possible_causes: Possible causes of error. + :paramtype possible_causes: str + :keyword recommended_action: Recommended action to resolve error. + :paramtype recommended_action: str + :keyword creation_time_utc: Error creation time (UTC). + :paramtype creation_time_utc: ~datetime.datetime + :keyword recovery_provider_error_message: DRA error message. + :paramtype recovery_provider_error_message: str + :keyword entity_id: ID of the entity. + :paramtype entity_id: str + :keyword error_id: The health error unique id. + :paramtype error_id: str + :keyword customer_resolvability: Value indicating whether the health error is customer + resolvable. Possible values include: "Allowed", "NotAllowed". + :paramtype customer_resolvability: str or + ~azure.mgmt.recoveryservicessiterecovery.models.HealthErrorCustomerResolvability + """ super(HealthError, self).__init__(**kwargs) self.inner_health_errors = inner_health_errors self.error_source = error_source @@ -6405,27 +8163,26 @@ def __init__( class HealthErrorSummary(msrest.serialization.Model): """class to define the summary of the health error details. - :param summary_code: The code of the health error. - :type summary_code: str - :param category: The category of the health error. Possible values include: "None", + :ivar summary_code: The code of the health error. + :vartype summary_code: str + :ivar category: The category of the health error. Possible values include: "None", "Replication", "TestFailover", "Configuration", "FabricInfrastructure", "VersionExpiry", "AgentAutoUpdateInfra", "AgentAutoUpdateArtifactDeleted", "AgentAutoUpdateRunAsAccount", "AgentAutoUpdateRunAsAccountExpiry", "AgentAutoUpdateRunAsAccountExpired". - :type category: str or ~azure.mgmt.recoveryservicessiterecovery.models.HealthErrorCategory - :param severity: Severity of error. Possible values include: "NONE", "Warning", "Error", - "Info". - :type severity: str or ~azure.mgmt.recoveryservicessiterecovery.models.Severity - :param summary_message: The summary message of the health error. - :type summary_message: str - :param affected_resource_type: The type of affected ARM resource. - :type affected_resource_type: str - :param affected_resource_subtype: The sub type of any subcomponent within the ARM resource that + :vartype category: str or ~azure.mgmt.recoveryservicessiterecovery.models.HealthErrorCategory + :ivar severity: Severity of error. Possible values include: "NONE", "Warning", "Error", "Info". + :vartype severity: str or ~azure.mgmt.recoveryservicessiterecovery.models.Severity + :ivar summary_message: The summary message of the health error. + :vartype summary_message: str + :ivar affected_resource_type: The type of affected ARM resource. + :vartype affected_resource_type: str + :ivar affected_resource_subtype: The sub type of any subcomponent within the ARM resource that this might be applicable. Value remains null if not applicable. - :type affected_resource_subtype: str - :param affected_resource_correlation_ids: The list of affected resource correlation Ids. This + :vartype affected_resource_subtype: str + :ivar affected_resource_correlation_ids: The list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. - :type affected_resource_correlation_ids: list[str] + :vartype affected_resource_correlation_ids: list[str] """ _attribute_map = { @@ -6450,6 +8207,29 @@ def __init__( affected_resource_correlation_ids: Optional[List[str]] = None, **kwargs ): + """ + :keyword summary_code: The code of the health error. + :paramtype summary_code: str + :keyword category: The category of the health error. Possible values include: "None", + "Replication", "TestFailover", "Configuration", "FabricInfrastructure", "VersionExpiry", + "AgentAutoUpdateInfra", "AgentAutoUpdateArtifactDeleted", "AgentAutoUpdateRunAsAccount", + "AgentAutoUpdateRunAsAccountExpiry", "AgentAutoUpdateRunAsAccountExpired". + :paramtype category: str or ~azure.mgmt.recoveryservicessiterecovery.models.HealthErrorCategory + :keyword severity: Severity of error. Possible values include: "NONE", "Warning", "Error", + "Info". + :paramtype severity: str or ~azure.mgmt.recoveryservicessiterecovery.models.Severity + :keyword summary_message: The summary message of the health error. + :paramtype summary_message: str + :keyword affected_resource_type: The type of affected ARM resource. + :paramtype affected_resource_type: str + :keyword affected_resource_subtype: The sub type of any subcomponent within the ARM resource + that this might be applicable. Value remains null if not applicable. + :paramtype affected_resource_subtype: str + :keyword affected_resource_correlation_ids: The list of affected resource correlation Ids. This + can be used to uniquely identify the count of items affected by a specific category and + severity as well as count of item affected by an specific issue. + :paramtype affected_resource_correlation_ids: list[str] + """ super(HealthErrorSummary, self).__init__(**kwargs) self.summary_code = summary_code self.category = category @@ -6489,6 +8269,8 @@ def __init__( self, **kwargs ): + """ + """ super(HyperVHostDetails, self).__init__(**kwargs) self.id = None self.name = None @@ -6500,17 +8282,17 @@ class HyperVReplica2012EventDetails(EventProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param container_name: The container friendly name. - :type container_name: str - :param fabric_name: The fabric friendly name. - :type fabric_name: str - :param remote_container_name: The remote container name. - :type remote_container_name: str - :param remote_fabric_name: The remote fabric name. - :type remote_fabric_name: str + :vartype instance_type: str + :ivar container_name: The container friendly name. + :vartype container_name: str + :ivar fabric_name: The fabric friendly name. + :vartype fabric_name: str + :ivar remote_container_name: The remote container name. + :vartype remote_container_name: str + :ivar remote_fabric_name: The remote fabric name. + :vartype remote_fabric_name: str """ _validation = { @@ -6534,6 +8316,16 @@ def __init__( remote_fabric_name: Optional[str] = None, **kwargs ): + """ + :keyword container_name: The container friendly name. + :paramtype container_name: str + :keyword fabric_name: The fabric friendly name. + :paramtype fabric_name: str + :keyword remote_container_name: The remote container name. + :paramtype remote_container_name: str + :keyword remote_fabric_name: The remote fabric name. + :paramtype remote_fabric_name: str + """ super(HyperVReplica2012EventDetails, self).__init__(**kwargs) self.instance_type = 'HyperVReplica2012' # type: str self.container_name = container_name @@ -6547,17 +8339,17 @@ class HyperVReplica2012R2EventDetails(EventProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param container_name: The container friendly name. - :type container_name: str - :param fabric_name: The fabric friendly name. - :type fabric_name: str - :param remote_container_name: The remote container name. - :type remote_container_name: str - :param remote_fabric_name: The remote fabric name. - :type remote_fabric_name: str + :vartype instance_type: str + :ivar container_name: The container friendly name. + :vartype container_name: str + :ivar fabric_name: The fabric friendly name. + :vartype fabric_name: str + :ivar remote_container_name: The remote container name. + :vartype remote_container_name: str + :ivar remote_fabric_name: The remote fabric name. + :vartype remote_fabric_name: str """ _validation = { @@ -6581,6 +8373,16 @@ def __init__( remote_fabric_name: Optional[str] = None, **kwargs ): + """ + :keyword container_name: The container friendly name. + :paramtype container_name: str + :keyword fabric_name: The fabric friendly name. + :paramtype fabric_name: str + :keyword remote_container_name: The remote container name. + :paramtype remote_container_name: str + :keyword remote_fabric_name: The remote fabric name. + :paramtype remote_fabric_name: str + """ super(HyperVReplica2012R2EventDetails, self).__init__(**kwargs) self.instance_type = 'HyperVReplica2012R2' # type: str self.container_name = container_name @@ -6594,12 +8396,12 @@ class HyperVReplicaAzureApplyRecoveryPointInput(ApplyRecoveryPointProviderSpecif All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param primary_kek_certificate_pfx: The primary kek certificate pfx. - :type primary_kek_certificate_pfx: str - :param secondary_kek_certificate_pfx: The secondary kek certificate pfx. - :type secondary_kek_certificate_pfx: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar primary_kek_certificate_pfx: The primary kek certificate pfx. + :vartype primary_kek_certificate_pfx: str + :ivar secondary_kek_certificate_pfx: The secondary kek certificate pfx. + :vartype secondary_kek_certificate_pfx: str """ _validation = { @@ -6619,6 +8421,12 @@ def __init__( secondary_kek_certificate_pfx: Optional[str] = None, **kwargs ): + """ + :keyword primary_kek_certificate_pfx: The primary kek certificate pfx. + :paramtype primary_kek_certificate_pfx: str + :keyword secondary_kek_certificate_pfx: The secondary kek certificate pfx. + :paramtype secondary_kek_certificate_pfx: str + """ super(HyperVReplicaAzureApplyRecoveryPointInput, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaAzure' # type: str self.primary_kek_certificate_pfx = primary_kek_certificate_pfx @@ -6628,15 +8436,15 @@ def __init__( class HyperVReplicaAzureDiskInputDetails(msrest.serialization.Model): """Disk input details. - :param disk_id: The DiskId. - :type disk_id: str - :param log_storage_account_id: The LogStorageAccountId. - :type log_storage_account_id: str - :param disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", + :ivar disk_id: The DiskId. + :vartype disk_id: str + :ivar log_storage_account_id: The LogStorageAccountId. + :vartype log_storage_account_id: str + :ivar disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :param disk_encryption_set_id: The DiskEncryptionSet ARM ID. - :type disk_encryption_set_id: str + :vartype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :ivar disk_encryption_set_id: The DiskEncryptionSet ARM ID. + :vartype disk_encryption_set_id: str """ _attribute_map = { @@ -6655,6 +8463,17 @@ def __init__( disk_encryption_set_id: Optional[str] = None, **kwargs ): + """ + :keyword disk_id: The DiskId. + :paramtype disk_id: str + :keyword log_storage_account_id: The LogStorageAccountId. + :paramtype log_storage_account_id: str + :keyword disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS". + :paramtype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :keyword disk_encryption_set_id: The DiskEncryptionSet ARM ID. + :paramtype disk_encryption_set_id: str + """ super(HyperVReplicaAzureDiskInputDetails, self).__init__(**kwargs) self.disk_id = disk_id self.log_storage_account_id = log_storage_account_id @@ -6667,75 +8486,75 @@ class HyperVReplicaAzureEnableProtectionInput(EnableProtectionProviderSpecificIn All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param hv_host_vm_id: The Hyper-V host VM Id. - :type hv_host_vm_id: str - :param vm_name: The VM Name. - :type vm_name: str - :param os_type: The OS type associated with VM. - :type os_type: str - :param vhd_id: The OS disk VHD id associated with VM. - :type vhd_id: str - :param target_storage_account_id: The storage account Id. - :type target_storage_account_id: str - :param target_azure_network_id: The selected target Azure network Id. - :type target_azure_network_id: str - :param target_azure_subnet_id: The selected target Azure subnet Id. - :type target_azure_subnet_id: str - :param enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar hv_host_vm_id: The Hyper-V host VM Id. + :vartype hv_host_vm_id: str + :ivar vm_name: The VM Name. + :vartype vm_name: str + :ivar os_type: The OS type associated with VM. + :vartype os_type: str + :ivar vhd_id: The OS disk VHD id associated with VM. + :vartype vhd_id: str + :ivar target_storage_account_id: The storage account Id. + :vartype target_storage_account_id: str + :ivar target_azure_network_id: The selected target Azure network Id. + :vartype target_azure_network_id: str + :ivar target_azure_subnet_id: The selected target Azure subnet Id. + :vartype target_azure_subnet_id: str + :ivar enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. - :type enable_rdp_on_target_option: str - :param target_azure_vm_name: The target azure VM Name. - :type target_azure_vm_name: str - :param log_storage_account_id: The storage account to be used for logging during replication. - :type log_storage_account_id: str - :param disks_to_include: The list of VHD Ids of disks to be protected. - :type disks_to_include: list[str] - :param target_azure_v1_resource_group_id: The Id of the target resource group (for classic + :vartype enable_rdp_on_target_option: str + :ivar target_azure_vm_name: The target azure VM Name. + :vartype target_azure_vm_name: str + :ivar log_storage_account_id: The storage account to be used for logging during replication. + :vartype log_storage_account_id: str + :ivar disks_to_include: The list of VHD Ids of disks to be protected. + :vartype disks_to_include: list[str] + :ivar target_azure_v1_resource_group_id: The Id of the target resource group (for classic deployment) in which the failover VM is to be created. - :type target_azure_v1_resource_group_id: str - :param target_azure_v2_resource_group_id: The Id of the target resource group (for resource + :vartype target_azure_v1_resource_group_id: str + :ivar target_azure_v2_resource_group_id: The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. - :type target_azure_v2_resource_group_id: str - :param use_managed_disks: A value indicating whether managed disks should be used during + :vartype target_azure_v2_resource_group_id: str + :ivar use_managed_disks: A value indicating whether managed disks should be used during failover. - :type use_managed_disks: str - :param target_availability_set_id: The target availability set ARM Id for resource manager + :vartype use_managed_disks: str + :ivar target_availability_set_id: The target availability set ARM Id for resource manager deployment. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", + :vartype target_availability_set_id: str + :ivar target_availability_zone: The target availability zone. + :vartype target_availability_zone: str + :ivar license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", "WindowsServer". - :type license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType - :param sql_server_license_type: The SQL Server license type. Possible values include: + :vartype license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType + :ivar sql_server_license_type: The SQL Server license type. Possible values include: "NotSpecified", "NoLicenseType", "PAYG", "AHUB". - :type sql_server_license_type: str or + :vartype sql_server_license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType - :param target_vm_size: The target VM size. - :type target_vm_size: str - :param target_proximity_placement_group_id: The proximity placement group ARM Id. - :type target_proximity_placement_group_id: str - :param use_managed_disks_for_replication: A value indicating whether managed disks should be + :ivar target_vm_size: The target VM size. + :vartype target_vm_size: str + :ivar target_proximity_placement_group_id: The proximity placement group ARM Id. + :vartype target_proximity_placement_group_id: str + :ivar use_managed_disks_for_replication: A value indicating whether managed disks should be used during replication. - :type use_managed_disks_for_replication: str - :param disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", + :vartype use_managed_disks_for_replication: str + :ivar disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :param disks_to_include_for_managed_disks: The disks to include list for managed disks. - :type disks_to_include_for_managed_disks: + :vartype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :ivar disks_to_include_for_managed_disks: The disks to include list for managed disks. + :vartype disks_to_include_for_managed_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.HyperVReplicaAzureDiskInputDetails] - :param disk_encryption_set_id: The DiskEncryptionSet ARM Id. - :type disk_encryption_set_id: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param seed_managed_disk_tags: The tags for the seed managed disks. - :type seed_managed_disk_tags: dict[str, str] - :param target_managed_disk_tags: The tags for the target managed disks. - :type target_managed_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] + :ivar disk_encryption_set_id: The DiskEncryptionSet ARM Id. + :vartype disk_encryption_set_id: str + :ivar target_vm_tags: The target VM tags. + :vartype target_vm_tags: dict[str, str] + :ivar seed_managed_disk_tags: The tags for the seed managed disks. + :vartype seed_managed_disk_tags: dict[str, str] + :ivar target_managed_disk_tags: The tags for the target managed disks. + :vartype target_managed_disk_tags: dict[str, str] + :ivar target_nic_tags: The tags for the target NICs. + :vartype target_nic_tags: dict[str, str] """ _validation = { @@ -6807,6 +8626,75 @@ def __init__( target_nic_tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword hv_host_vm_id: The Hyper-V host VM Id. + :paramtype hv_host_vm_id: str + :keyword vm_name: The VM Name. + :paramtype vm_name: str + :keyword os_type: The OS type associated with VM. + :paramtype os_type: str + :keyword vhd_id: The OS disk VHD id associated with VM. + :paramtype vhd_id: str + :keyword target_storage_account_id: The storage account Id. + :paramtype target_storage_account_id: str + :keyword target_azure_network_id: The selected target Azure network Id. + :paramtype target_azure_network_id: str + :keyword target_azure_subnet_id: The selected target Azure subnet Id. + :paramtype target_azure_subnet_id: str + :keyword enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after + failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + :paramtype enable_rdp_on_target_option: str + :keyword target_azure_vm_name: The target azure VM Name. + :paramtype target_azure_vm_name: str + :keyword log_storage_account_id: The storage account to be used for logging during replication. + :paramtype log_storage_account_id: str + :keyword disks_to_include: The list of VHD Ids of disks to be protected. + :paramtype disks_to_include: list[str] + :keyword target_azure_v1_resource_group_id: The Id of the target resource group (for classic + deployment) in which the failover VM is to be created. + :paramtype target_azure_v1_resource_group_id: str + :keyword target_azure_v2_resource_group_id: The Id of the target resource group (for resource + manager deployment) in which the failover VM is to be created. + :paramtype target_azure_v2_resource_group_id: str + :keyword use_managed_disks: A value indicating whether managed disks should be used during + failover. + :paramtype use_managed_disks: str + :keyword target_availability_set_id: The target availability set ARM Id for resource manager + deployment. + :paramtype target_availability_set_id: str + :keyword target_availability_zone: The target availability zone. + :paramtype target_availability_zone: str + :keyword license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", + "WindowsServer". + :paramtype license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType + :keyword sql_server_license_type: The SQL Server license type. Possible values include: + "NotSpecified", "NoLicenseType", "PAYG", "AHUB". + :paramtype sql_server_license_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType + :keyword target_vm_size: The target VM size. + :paramtype target_vm_size: str + :keyword target_proximity_placement_group_id: The proximity placement group ARM Id. + :paramtype target_proximity_placement_group_id: str + :keyword use_managed_disks_for_replication: A value indicating whether managed disks should be + used during replication. + :paramtype use_managed_disks_for_replication: str + :keyword disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS". + :paramtype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :keyword disks_to_include_for_managed_disks: The disks to include list for managed disks. + :paramtype disks_to_include_for_managed_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.HyperVReplicaAzureDiskInputDetails] + :keyword disk_encryption_set_id: The DiskEncryptionSet ARM Id. + :paramtype disk_encryption_set_id: str + :keyword target_vm_tags: The target VM tags. + :paramtype target_vm_tags: dict[str, str] + :keyword seed_managed_disk_tags: The tags for the seed managed disks. + :paramtype seed_managed_disk_tags: dict[str, str] + :keyword target_managed_disk_tags: The tags for the target managed disks. + :paramtype target_managed_disk_tags: dict[str, str] + :keyword target_nic_tags: The tags for the target NICs. + :paramtype target_nic_tags: dict[str, str] + """ super(HyperVReplicaAzureEnableProtectionInput, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaAzure' # type: str self.hv_host_vm_id = hv_host_vm_id @@ -6844,15 +8732,15 @@ class HyperVReplicaAzureEventDetails(EventProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param container_name: The container friendly name. - :type container_name: str - :param fabric_name: The fabric friendly name. - :type fabric_name: str - :param remote_container_name: The remote container name. - :type remote_container_name: str + :vartype instance_type: str + :ivar container_name: The container friendly name. + :vartype container_name: str + :ivar fabric_name: The fabric friendly name. + :vartype fabric_name: str + :ivar remote_container_name: The remote container name. + :vartype remote_container_name: str """ _validation = { @@ -6874,6 +8762,14 @@ def __init__( remote_container_name: Optional[str] = None, **kwargs ): + """ + :keyword container_name: The container friendly name. + :paramtype container_name: str + :keyword fabric_name: The fabric friendly name. + :paramtype fabric_name: str + :keyword remote_container_name: The remote container name. + :paramtype remote_container_name: str + """ super(HyperVReplicaAzureEventDetails, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaAzure' # type: str self.container_name = container_name @@ -6889,8 +8785,8 @@ class PlannedFailoverProviderSpecificFailoverInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -6909,6 +8805,8 @@ def __init__( self, **kwargs ): + """ + """ super(PlannedFailoverProviderSpecificFailoverInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -6918,14 +8816,14 @@ class HyperVReplicaAzureFailbackProviderInput(PlannedFailoverProviderSpecificFai All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param data_sync_option: Data sync option. - :type data_sync_option: str - :param recovery_vm_creation_option: ALR options to create alternate recovery. - :type recovery_vm_creation_option: str - :param provider_id_for_alternate_recovery: Provider Id for alternate location. - :type provider_id_for_alternate_recovery: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar data_sync_option: Data sync option. + :vartype data_sync_option: str + :ivar recovery_vm_creation_option: ALR options to create alternate recovery. + :vartype recovery_vm_creation_option: str + :ivar provider_id_for_alternate_recovery: Provider Id for alternate location. + :vartype provider_id_for_alternate_recovery: str """ _validation = { @@ -6947,6 +8845,14 @@ def __init__( provider_id_for_alternate_recovery: Optional[str] = None, **kwargs ): + """ + :keyword data_sync_option: Data sync option. + :paramtype data_sync_option: str + :keyword recovery_vm_creation_option: ALR options to create alternate recovery. + :paramtype recovery_vm_creation_option: str + :keyword provider_id_for_alternate_recovery: Provider Id for alternate location. + :paramtype provider_id_for_alternate_recovery: str + """ super(HyperVReplicaAzureFailbackProviderInput, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaAzureFailback' # type: str self.data_sync_option = data_sync_option @@ -6957,14 +8863,14 @@ def __init__( class HyperVReplicaAzureManagedDiskDetails(msrest.serialization.Model): """Hyper-V Managed disk details. - :param disk_id: The disk Id. - :type disk_id: str - :param seed_managed_disk_id: Seed managed disk Id. - :type seed_managed_disk_id: str - :param replica_disk_type: The replica disk type. - :type replica_disk_type: str - :param disk_encryption_set_id: The disk encryption set ARM Id. - :type disk_encryption_set_id: str + :ivar disk_id: The disk Id. + :vartype disk_id: str + :ivar seed_managed_disk_id: Seed managed disk Id. + :vartype seed_managed_disk_id: str + :ivar replica_disk_type: The replica disk type. + :vartype replica_disk_type: str + :ivar disk_encryption_set_id: The disk encryption set ARM Id. + :vartype disk_encryption_set_id: str """ _attribute_map = { @@ -6983,6 +8889,16 @@ def __init__( disk_encryption_set_id: Optional[str] = None, **kwargs ): + """ + :keyword disk_id: The disk Id. + :paramtype disk_id: str + :keyword seed_managed_disk_id: Seed managed disk Id. + :paramtype seed_managed_disk_id: str + :keyword replica_disk_type: The replica disk type. + :paramtype replica_disk_type: str + :keyword disk_encryption_set_id: The disk encryption set ARM Id. + :paramtype disk_encryption_set_id: str + """ super(HyperVReplicaAzureManagedDiskDetails, self).__init__(**kwargs) self.disk_id = disk_id self.seed_managed_disk_id = seed_managed_disk_id @@ -6995,15 +8911,15 @@ class HyperVReplicaAzurePlannedFailoverProviderInput(PlannedFailoverProviderSpec All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param primary_kek_certificate_pfx: Primary kek certificate pfx. - :type primary_kek_certificate_pfx: str - :param secondary_kek_certificate_pfx: Secondary kek certificate pfx. - :type secondary_kek_certificate_pfx: str - :param recovery_point_id: The recovery point id to be passed to failover to a particular + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar primary_kek_certificate_pfx: Primary kek certificate pfx. + :vartype primary_kek_certificate_pfx: str + :ivar secondary_kek_certificate_pfx: Secondary kek certificate pfx. + :vartype secondary_kek_certificate_pfx: str + :ivar recovery_point_id: The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str + :vartype recovery_point_id: str """ _validation = { @@ -7025,6 +8941,15 @@ def __init__( recovery_point_id: Optional[str] = None, **kwargs ): + """ + :keyword primary_kek_certificate_pfx: Primary kek certificate pfx. + :paramtype primary_kek_certificate_pfx: str + :keyword secondary_kek_certificate_pfx: Secondary kek certificate pfx. + :paramtype secondary_kek_certificate_pfx: str + :keyword recovery_point_id: The recovery point id to be passed to failover to a particular + recovery point. In case of latest recovery point, null should be passed. + :paramtype recovery_point_id: str + """ super(HyperVReplicaAzurePlannedFailoverProviderInput, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaAzure' # type: str self.primary_kek_certificate_pfx = primary_kek_certificate_pfx @@ -7037,25 +8962,25 @@ class HyperVReplicaAzurePolicyDetails(PolicyProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param recovery_point_history_duration_in_hours: The duration (in hours) to which point the + :vartype instance_type: str + :ivar recovery_point_history_duration_in_hours: The duration (in hours) to which point the recovery history needs to be maintained. - :type recovery_point_history_duration_in_hours: int - :param application_consistent_snapshot_frequency_in_hours: The interval (in hours) at which + :vartype recovery_point_history_duration_in_hours: int + :ivar application_consistent_snapshot_frequency_in_hours: The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. - :type application_consistent_snapshot_frequency_in_hours: int - :param replication_interval: The replication interval. - :type replication_interval: int - :param online_replication_start_time: The scheduled start time for the initial replication. If + :vartype application_consistent_snapshot_frequency_in_hours: int + :ivar replication_interval: The replication interval. + :vartype replication_interval: int + :ivar online_replication_start_time: The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. - :type online_replication_start_time: str - :param encryption: A value indicating whether encryption is enabled for virtual machines in - this cloud. - :type encryption: str - :param active_storage_account_id: The active storage account Id. - :type active_storage_account_id: str + :vartype online_replication_start_time: str + :ivar encryption: A value indicating whether encryption is enabled for virtual machines in this + cloud. + :vartype encryption: str + :ivar active_storage_account_id: The active storage account Id. + :vartype active_storage_account_id: str """ _validation = { @@ -7083,6 +9008,24 @@ def __init__( active_storage_account_id: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_history_duration_in_hours: The duration (in hours) to which point the + recovery history needs to be maintained. + :paramtype recovery_point_history_duration_in_hours: int + :keyword application_consistent_snapshot_frequency_in_hours: The interval (in hours) at which + Hyper-V Replica should create an application consistent snapshot within the VM. + :paramtype application_consistent_snapshot_frequency_in_hours: int + :keyword replication_interval: The replication interval. + :paramtype replication_interval: int + :keyword online_replication_start_time: The scheduled start time for the initial replication. + If this parameter is Null, the initial replication starts immediately. + :paramtype online_replication_start_time: str + :keyword encryption: A value indicating whether encryption is enabled for virtual machines in + this cloud. + :paramtype encryption: str + :keyword active_storage_account_id: The active storage account Id. + :paramtype active_storage_account_id: str + """ super(HyperVReplicaAzurePolicyDetails, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaAzure' # type: str self.recovery_point_history_duration_in_hours = recovery_point_history_duration_in_hours @@ -7098,22 +9041,22 @@ class HyperVReplicaAzurePolicyInput(PolicyProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_history_duration: The duration (in hours) to which point the recovery + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_history_duration: The duration (in hours) to which point the recovery history needs to be maintained. - :type recovery_point_history_duration: int - :param application_consistent_snapshot_frequency_in_hours: The interval (in hours) at which + :vartype recovery_point_history_duration: int + :ivar application_consistent_snapshot_frequency_in_hours: The interval (in hours) at which Hyper-V Replica should create an application consistent snapshot within the VM. - :type application_consistent_snapshot_frequency_in_hours: int - :param replication_interval: The replication interval. - :type replication_interval: int - :param online_replication_start_time: The scheduled start time for the initial replication. If + :vartype application_consistent_snapshot_frequency_in_hours: int + :ivar replication_interval: The replication interval. + :vartype replication_interval: int + :ivar online_replication_start_time: The scheduled start time for the initial replication. If this parameter is Null, the initial replication starts immediately. - :type online_replication_start_time: str - :param storage_accounts: The list of storage accounts to which the VMs in the primary cloud can + :vartype online_replication_start_time: str + :ivar storage_accounts: The list of storage accounts to which the VMs in the primary cloud can replicate to. - :type storage_accounts: list[str] + :vartype storage_accounts: list[str] """ _validation = { @@ -7139,6 +9082,22 @@ def __init__( storage_accounts: Optional[List[str]] = None, **kwargs ): + """ + :keyword recovery_point_history_duration: The duration (in hours) to which point the recovery + history needs to be maintained. + :paramtype recovery_point_history_duration: int + :keyword application_consistent_snapshot_frequency_in_hours: The interval (in hours) at which + Hyper-V Replica should create an application consistent snapshot within the VM. + :paramtype application_consistent_snapshot_frequency_in_hours: int + :keyword replication_interval: The replication interval. + :paramtype replication_interval: int + :keyword online_replication_start_time: The scheduled start time for the initial replication. + If this parameter is Null, the initial replication starts immediately. + :paramtype online_replication_start_time: str + :keyword storage_accounts: The list of storage accounts to which the VMs in the primary cloud + can replicate to. + :paramtype storage_accounts: list[str] + """ super(HyperVReplicaAzurePolicyInput, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaAzure' # type: str self.recovery_point_history_duration = recovery_point_history_duration @@ -7155,81 +9114,81 @@ class HyperVReplicaAzureReplicationDetails(ReplicationProviderSpecificSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param azure_vm_disk_details: Azure VM Disk details. - :type azure_vm_disk_details: + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str + :ivar azure_vm_disk_details: Azure VM Disk details. + :vartype azure_vm_disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.AzureVmDiskDetails] - :param recovery_azure_vm_name: Recovery Azure given name. - :type recovery_azure_vm_name: str - :param recovery_azure_vm_size: The Recovery Azure VM size. - :type recovery_azure_vm_size: str - :param recovery_azure_storage_account: The recovery Azure storage account. - :type recovery_azure_storage_account: str - :param recovery_azure_log_storage_account_id: The ARM id of the log storage account used for + :ivar recovery_azure_vm_name: Recovery Azure given name. + :vartype recovery_azure_vm_name: str + :ivar recovery_azure_vm_size: The Recovery Azure VM size. + :vartype recovery_azure_vm_size: str + :ivar recovery_azure_storage_account: The recovery Azure storage account. + :vartype recovery_azure_storage_account: str + :ivar recovery_azure_log_storage_account_id: The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. - :type recovery_azure_log_storage_account_id: str - :param last_replicated_time: The Last replication time. - :type last_replicated_time: ~datetime.datetime - :param rpo_in_seconds: Last RPO value. - :type rpo_in_seconds: long - :param last_rpo_calculated_time: The last RPO calculated time. - :type last_rpo_calculated_time: ~datetime.datetime - :param vm_id: The virtual machine Id. - :type vm_id: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param initial_replication_details: Initial replication details. - :type initial_replication_details: + :vartype recovery_azure_log_storage_account_id: str + :ivar last_replicated_time: The Last replication time. + :vartype last_replicated_time: ~datetime.datetime + :ivar rpo_in_seconds: Last RPO value. + :vartype rpo_in_seconds: long + :ivar last_rpo_calculated_time: The last RPO calculated time. + :vartype last_rpo_calculated_time: ~datetime.datetime + :ivar vm_id: The virtual machine Id. + :vartype vm_id: str + :ivar vm_protection_state: The protection state for the vm. + :vartype vm_protection_state: str + :ivar vm_protection_state_description: The protection state description for the vm. + :vartype vm_protection_state_description: str + :ivar initial_replication_details: Initial replication details. + :vartype initial_replication_details: ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails - :param vm_nics: The PE Network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] - :param selected_recovery_azure_network_id: The selected recovery azure network Id. - :type selected_recovery_azure_network_id: str - :param selected_source_nic_id: The selected source nic Id which will be used as the primary nic + :ivar vm_nics: The PE Network details. + :vartype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] + :ivar selected_recovery_azure_network_id: The selected recovery azure network Id. + :vartype selected_recovery_azure_network_id: str + :ivar selected_source_nic_id: The selected source nic Id which will be used as the primary nic during failover. - :type selected_source_nic_id: str - :param encryption: The encryption info. - :type encryption: str - :param o_s_details: The operating system info. - :type o_s_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDetails - :param source_vm_ram_size_in_mb: The RAM size of the VM on the primary side. - :type source_vm_ram_size_in_mb: int - :param source_vm_cpu_count: The CPU count of the VM on the primary side. - :type source_vm_cpu_count: int - :param enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after + :vartype selected_source_nic_id: str + :ivar encryption: The encryption info. + :vartype encryption: str + :ivar o_s_details: The operating system info. + :vartype o_s_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDetails + :ivar source_vm_ram_size_in_mb: The RAM size of the VM on the primary side. + :vartype source_vm_ram_size_in_mb: int + :ivar source_vm_cpu_count: The CPU count of the VM on the primary side. + :vartype source_vm_cpu_count: int + :ivar enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. - :type enable_rdp_on_target_option: str - :param recovery_azure_resource_group_id: The target resource group Id. - :type recovery_azure_resource_group_id: str - :param recovery_availability_set_id: The recovery availability set Id. - :type recovery_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param use_managed_disks: A value indicating whether managed disks should be used during + :vartype enable_rdp_on_target_option: str + :ivar recovery_azure_resource_group_id: The target resource group Id. + :vartype recovery_azure_resource_group_id: str + :ivar recovery_availability_set_id: The recovery availability set Id. + :vartype recovery_availability_set_id: str + :ivar target_availability_zone: The target availability zone. + :vartype target_availability_zone: str + :ivar target_proximity_placement_group_id: The target proximity placement group Id. + :vartype target_proximity_placement_group_id: str + :ivar use_managed_disks: A value indicating whether managed disks should be used during failover. - :type use_managed_disks: str - :param license_type: License Type of the VM to be used. - :type license_type: str - :param sql_server_license_type: The SQL Server license type. - :type sql_server_license_type: str + :vartype use_managed_disks: str + :ivar license_type: License Type of the VM to be used. + :vartype license_type: str + :ivar sql_server_license_type: The SQL Server license type. + :vartype sql_server_license_type: str :ivar last_recovery_point_received: The last recovery point received time. :vartype last_recovery_point_received: ~datetime.datetime - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param seed_managed_disk_tags: The tags for the seed managed disks. - :type seed_managed_disk_tags: dict[str, str] - :param target_managed_disk_tags: The tags for the target managed disks. - :type target_managed_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] - :param protected_managed_disks: The list of protected managed disks. - :type protected_managed_disks: + :ivar target_vm_tags: The target VM tags. + :vartype target_vm_tags: dict[str, str] + :ivar seed_managed_disk_tags: The tags for the seed managed disks. + :vartype seed_managed_disk_tags: dict[str, str] + :ivar target_managed_disk_tags: The tags for the target managed disks. + :vartype target_managed_disk_tags: dict[str, str] + :ivar target_nic_tags: The tags for the target NICs. + :vartype target_nic_tags: dict[str, str] + :ivar protected_managed_disks: The list of protected managed disks. + :vartype protected_managed_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.HyperVReplicaAzureManagedDiskDetails] """ @@ -7312,6 +9271,80 @@ def __init__( protected_managed_disks: Optional[List["HyperVReplicaAzureManagedDiskDetails"]] = None, **kwargs ): + """ + :keyword azure_vm_disk_details: Azure VM Disk details. + :paramtype azure_vm_disk_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.AzureVmDiskDetails] + :keyword recovery_azure_vm_name: Recovery Azure given name. + :paramtype recovery_azure_vm_name: str + :keyword recovery_azure_vm_size: The Recovery Azure VM size. + :paramtype recovery_azure_vm_size: str + :keyword recovery_azure_storage_account: The recovery Azure storage account. + :paramtype recovery_azure_storage_account: str + :keyword recovery_azure_log_storage_account_id: The ARM id of the log storage account used for + replication. This will be set to null if no log storage account was provided during enable + protection. + :paramtype recovery_azure_log_storage_account_id: str + :keyword last_replicated_time: The Last replication time. + :paramtype last_replicated_time: ~datetime.datetime + :keyword rpo_in_seconds: Last RPO value. + :paramtype rpo_in_seconds: long + :keyword last_rpo_calculated_time: The last RPO calculated time. + :paramtype last_rpo_calculated_time: ~datetime.datetime + :keyword vm_id: The virtual machine Id. + :paramtype vm_id: str + :keyword vm_protection_state: The protection state for the vm. + :paramtype vm_protection_state: str + :keyword vm_protection_state_description: The protection state description for the vm. + :paramtype vm_protection_state_description: str + :keyword initial_replication_details: Initial replication details. + :paramtype initial_replication_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails + :keyword vm_nics: The PE Network details. + :paramtype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] + :keyword selected_recovery_azure_network_id: The selected recovery azure network Id. + :paramtype selected_recovery_azure_network_id: str + :keyword selected_source_nic_id: The selected source nic Id which will be used as the primary + nic during failover. + :paramtype selected_source_nic_id: str + :keyword encryption: The encryption info. + :paramtype encryption: str + :keyword o_s_details: The operating system info. + :paramtype o_s_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDetails + :keyword source_vm_ram_size_in_mb: The RAM size of the VM on the primary side. + :paramtype source_vm_ram_size_in_mb: int + :keyword source_vm_cpu_count: The CPU count of the VM on the primary side. + :paramtype source_vm_cpu_count: int + :keyword enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after + failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + :paramtype enable_rdp_on_target_option: str + :keyword recovery_azure_resource_group_id: The target resource group Id. + :paramtype recovery_azure_resource_group_id: str + :keyword recovery_availability_set_id: The recovery availability set Id. + :paramtype recovery_availability_set_id: str + :keyword target_availability_zone: The target availability zone. + :paramtype target_availability_zone: str + :keyword target_proximity_placement_group_id: The target proximity placement group Id. + :paramtype target_proximity_placement_group_id: str + :keyword use_managed_disks: A value indicating whether managed disks should be used during + failover. + :paramtype use_managed_disks: str + :keyword license_type: License Type of the VM to be used. + :paramtype license_type: str + :keyword sql_server_license_type: The SQL Server license type. + :paramtype sql_server_license_type: str + :keyword target_vm_tags: The target VM tags. + :paramtype target_vm_tags: dict[str, str] + :keyword seed_managed_disk_tags: The tags for the seed managed disks. + :paramtype seed_managed_disk_tags: dict[str, str] + :keyword target_managed_disk_tags: The tags for the target managed disks. + :paramtype target_managed_disk_tags: dict[str, str] + :keyword target_nic_tags: The tags for the target NICs. + :paramtype target_nic_tags: dict[str, str] + :keyword protected_managed_disks: The list of protected managed disks. + :paramtype protected_managed_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.HyperVReplicaAzureManagedDiskDetails] + """ super(HyperVReplicaAzureReplicationDetails, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaAzure' # type: str self.azure_vm_disk_details = azure_vm_disk_details @@ -7354,20 +9387,20 @@ class HyperVReplicaAzureReprotectInput(ReverseReplicationProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param hv_host_vm_id: The Hyper-V host Vm Id. - :type hv_host_vm_id: str - :param vm_name: The Vm Name. - :type vm_name: str - :param os_type: The OS type associated with vm. - :type os_type: str - :param v_hd_id: The OS disk VHD id associated with vm. - :type v_hd_id: str - :param storage_account_id: The storage account name. - :type storage_account_id: str - :param log_storage_account_id: The storage account to be used for logging during replication. - :type log_storage_account_id: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar hv_host_vm_id: The Hyper-V host Vm Id. + :vartype hv_host_vm_id: str + :ivar vm_name: The Vm Name. + :vartype vm_name: str + :ivar os_type: The OS type associated with vm. + :vartype os_type: str + :ivar v_hd_id: The OS disk VHD id associated with vm. + :vartype v_hd_id: str + :ivar storage_account_id: The storage account name. + :vartype storage_account_id: str + :ivar log_storage_account_id: The storage account to be used for logging during replication. + :vartype log_storage_account_id: str """ _validation = { @@ -7395,6 +9428,20 @@ def __init__( log_storage_account_id: Optional[str] = None, **kwargs ): + """ + :keyword hv_host_vm_id: The Hyper-V host Vm Id. + :paramtype hv_host_vm_id: str + :keyword vm_name: The Vm Name. + :paramtype vm_name: str + :keyword os_type: The OS type associated with vm. + :paramtype os_type: str + :keyword v_hd_id: The OS disk VHD id associated with vm. + :paramtype v_hd_id: str + :keyword storage_account_id: The storage account name. + :paramtype storage_account_id: str + :keyword log_storage_account_id: The storage account to be used for logging during replication. + :paramtype log_storage_account_id: str + """ super(HyperVReplicaAzureReprotectInput, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaAzure' # type: str self.hv_host_vm_id = hv_host_vm_id @@ -7410,15 +9457,15 @@ class HyperVReplicaAzureTestFailoverInput(TestFailoverProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param primary_kek_certificate_pfx: Primary kek certificate pfx. - :type primary_kek_certificate_pfx: str - :param secondary_kek_certificate_pfx: Secondary kek certificate pfx. - :type secondary_kek_certificate_pfx: str - :param recovery_point_id: The recovery point id to be passed to test failover to a particular + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar primary_kek_certificate_pfx: Primary kek certificate pfx. + :vartype primary_kek_certificate_pfx: str + :ivar secondary_kek_certificate_pfx: Secondary kek certificate pfx. + :vartype secondary_kek_certificate_pfx: str + :ivar recovery_point_id: The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str + :vartype recovery_point_id: str """ _validation = { @@ -7440,6 +9487,15 @@ def __init__( recovery_point_id: Optional[str] = None, **kwargs ): + """ + :keyword primary_kek_certificate_pfx: Primary kek certificate pfx. + :paramtype primary_kek_certificate_pfx: str + :keyword secondary_kek_certificate_pfx: Secondary kek certificate pfx. + :paramtype secondary_kek_certificate_pfx: str + :keyword recovery_point_id: The recovery point id to be passed to test failover to a particular + recovery point. In case of latest recovery point, null should be passed. + :paramtype recovery_point_id: str + """ super(HyperVReplicaAzureTestFailoverInput, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaAzure' # type: str self.primary_kek_certificate_pfx = primary_kek_certificate_pfx @@ -7452,15 +9508,15 @@ class HyperVReplicaAzureUnplannedFailoverInput(UnplannedFailoverProviderSpecific All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param primary_kek_certificate_pfx: Primary kek certificate pfx. - :type primary_kek_certificate_pfx: str - :param secondary_kek_certificate_pfx: Secondary kek certificate pfx. - :type secondary_kek_certificate_pfx: str - :param recovery_point_id: The recovery point id to be passed to failover to a particular + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar primary_kek_certificate_pfx: Primary kek certificate pfx. + :vartype primary_kek_certificate_pfx: str + :ivar secondary_kek_certificate_pfx: Secondary kek certificate pfx. + :vartype secondary_kek_certificate_pfx: str + :ivar recovery_point_id: The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str + :vartype recovery_point_id: str """ _validation = { @@ -7482,6 +9538,15 @@ def __init__( recovery_point_id: Optional[str] = None, **kwargs ): + """ + :keyword primary_kek_certificate_pfx: Primary kek certificate pfx. + :paramtype primary_kek_certificate_pfx: str + :keyword secondary_kek_certificate_pfx: Secondary kek certificate pfx. + :paramtype secondary_kek_certificate_pfx: str + :keyword recovery_point_id: The recovery point id to be passed to failover to a particular + recovery point. In case of latest recovery point, null should be passed. + :paramtype recovery_point_id: str + """ super(HyperVReplicaAzureUnplannedFailoverInput, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaAzure' # type: str self.primary_kek_certificate_pfx = primary_kek_certificate_pfx @@ -7494,36 +9559,36 @@ class HyperVReplicaAzureUpdateReplicationProtectedItemInput(UpdateReplicationPro All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_azure_v1_resource_group_id: The recovery Azure resource group Id for classic + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_azure_v1_resource_group_id: The recovery Azure resource group Id for classic deployment. - :type recovery_azure_v1_resource_group_id: str - :param recovery_azure_v2_resource_group_id: The recovery Azure resource group Id for resource + :vartype recovery_azure_v1_resource_group_id: str + :ivar recovery_azure_v2_resource_group_id: The recovery Azure resource group Id for resource manager deployment. - :type recovery_azure_v2_resource_group_id: str - :param use_managed_disks: A value indicating whether managed disks should be used during + :vartype recovery_azure_v2_resource_group_id: str + :ivar use_managed_disks: A value indicating whether managed disks should be used during failover. - :type use_managed_disks: str - :param disk_id_to_disk_encryption_map: The dictionary of disk resource Id to disk encryption - set ARM Id. - :type disk_id_to_disk_encryption_map: dict[str, str] - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param target_managed_disk_tags: The tags for the target managed disks. - :type target_managed_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] - :param sql_server_license_type: The SQL Server license type. Possible values include: + :vartype use_managed_disks: str + :ivar disk_id_to_disk_encryption_map: The dictionary of disk resource Id to disk encryption set + ARM Id. + :vartype disk_id_to_disk_encryption_map: dict[str, str] + :ivar target_proximity_placement_group_id: The target proximity placement group Id. + :vartype target_proximity_placement_group_id: str + :ivar target_availability_zone: The target availability zone. + :vartype target_availability_zone: str + :ivar target_vm_tags: The target VM tags. + :vartype target_vm_tags: dict[str, str] + :ivar target_managed_disk_tags: The tags for the target managed disks. + :vartype target_managed_disk_tags: dict[str, str] + :ivar target_nic_tags: The tags for the target NICs. + :vartype target_nic_tags: dict[str, str] + :ivar sql_server_license_type: The SQL Server license type. Possible values include: "NotSpecified", "NoLicenseType", "PAYG", "AHUB". - :type sql_server_license_type: str or + :vartype sql_server_license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType - :param vm_disks: The list of disk update properties. - :type vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.UpdateDiskInput] + :ivar vm_disks: The list of disk update properties. + :vartype vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.UpdateDiskInput] """ _validation = { @@ -7561,6 +9626,36 @@ def __init__( vm_disks: Optional[List["UpdateDiskInput"]] = None, **kwargs ): + """ + :keyword recovery_azure_v1_resource_group_id: The recovery Azure resource group Id for classic + deployment. + :paramtype recovery_azure_v1_resource_group_id: str + :keyword recovery_azure_v2_resource_group_id: The recovery Azure resource group Id for resource + manager deployment. + :paramtype recovery_azure_v2_resource_group_id: str + :keyword use_managed_disks: A value indicating whether managed disks should be used during + failover. + :paramtype use_managed_disks: str + :keyword disk_id_to_disk_encryption_map: The dictionary of disk resource Id to disk encryption + set ARM Id. + :paramtype disk_id_to_disk_encryption_map: dict[str, str] + :keyword target_proximity_placement_group_id: The target proximity placement group Id. + :paramtype target_proximity_placement_group_id: str + :keyword target_availability_zone: The target availability zone. + :paramtype target_availability_zone: str + :keyword target_vm_tags: The target VM tags. + :paramtype target_vm_tags: dict[str, str] + :keyword target_managed_disk_tags: The tags for the target managed disks. + :paramtype target_managed_disk_tags: dict[str, str] + :keyword target_nic_tags: The tags for the target NICs. + :paramtype target_nic_tags: dict[str, str] + :keyword sql_server_license_type: The SQL Server license type. Possible values include: + "NotSpecified", "NoLicenseType", "PAYG", "AHUB". + :paramtype sql_server_license_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType + :keyword vm_disks: The list of disk update properties. + :paramtype vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.UpdateDiskInput] + """ super(HyperVReplicaAzureUpdateReplicationProtectedItemInput, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaAzure' # type: str self.recovery_azure_v1_resource_group_id = recovery_azure_v1_resource_group_id @@ -7581,17 +9676,17 @@ class HyperVReplicaBaseEventDetails(EventProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param container_name: The container friendly name. - :type container_name: str - :param fabric_name: The fabric friendly name. - :type fabric_name: str - :param remote_container_name: The remote container name. - :type remote_container_name: str - :param remote_fabric_name: The remote fabric name. - :type remote_fabric_name: str + :vartype instance_type: str + :ivar container_name: The container friendly name. + :vartype container_name: str + :ivar fabric_name: The fabric friendly name. + :vartype fabric_name: str + :ivar remote_container_name: The remote container name. + :vartype remote_container_name: str + :ivar remote_fabric_name: The remote fabric name. + :vartype remote_fabric_name: str """ _validation = { @@ -7615,6 +9710,16 @@ def __init__( remote_fabric_name: Optional[str] = None, **kwargs ): + """ + :keyword container_name: The container friendly name. + :paramtype container_name: str + :keyword fabric_name: The fabric friendly name. + :paramtype fabric_name: str + :keyword remote_container_name: The remote container name. + :paramtype remote_container_name: str + :keyword remote_fabric_name: The remote fabric name. + :paramtype remote_fabric_name: str + """ super(HyperVReplicaBaseEventDetails, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaBaseEventDetails' # type: str self.container_name = container_name @@ -7628,31 +9733,31 @@ class HyperVReplicaBasePolicyDetails(PolicyProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param recovery_points: A value indicating the number of recovery points. - :type recovery_points: int - :param application_consistent_snapshot_frequency_in_hours: A value indicating the application + :vartype instance_type: str + :ivar recovery_points: A value indicating the number of recovery points. + :vartype recovery_points: int + :ivar application_consistent_snapshot_frequency_in_hours: A value indicating the application consistent frequency. - :type application_consistent_snapshot_frequency_in_hours: int - :param compression: A value indicating whether compression has to be enabled. - :type compression: str - :param initial_replication_method: A value indicating whether IR is online. - :type initial_replication_method: str - :param online_replication_start_time: A value indicating the online IR start time. - :type online_replication_start_time: str - :param offline_replication_import_path: A value indicating the offline IR import path. - :type offline_replication_import_path: str - :param offline_replication_export_path: A value indicating the offline IR export path. - :type offline_replication_export_path: str - :param replication_port: A value indicating the recovery HTTPS port. - :type replication_port: int - :param allowed_authentication_type: A value indicating the authentication type. - :type allowed_authentication_type: int - :param replica_deletion_option: A value indicating whether the VM has to be auto deleted. + :vartype application_consistent_snapshot_frequency_in_hours: int + :ivar compression: A value indicating whether compression has to be enabled. + :vartype compression: str + :ivar initial_replication_method: A value indicating whether IR is online. + :vartype initial_replication_method: str + :ivar online_replication_start_time: A value indicating the online IR start time. + :vartype online_replication_start_time: str + :ivar offline_replication_import_path: A value indicating the offline IR import path. + :vartype offline_replication_import_path: str + :ivar offline_replication_export_path: A value indicating the offline IR export path. + :vartype offline_replication_export_path: str + :ivar replication_port: A value indicating the recovery HTTPS port. + :vartype replication_port: int + :ivar allowed_authentication_type: A value indicating the authentication type. + :vartype allowed_authentication_type: int + :ivar replica_deletion_option: A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud. - :type replica_deletion_option: str + :vartype replica_deletion_option: str """ _validation = { @@ -7688,6 +9793,30 @@ def __init__( replica_deletion_option: Optional[str] = None, **kwargs ): + """ + :keyword recovery_points: A value indicating the number of recovery points. + :paramtype recovery_points: int + :keyword application_consistent_snapshot_frequency_in_hours: A value indicating the application + consistent frequency. + :paramtype application_consistent_snapshot_frequency_in_hours: int + :keyword compression: A value indicating whether compression has to be enabled. + :paramtype compression: str + :keyword initial_replication_method: A value indicating whether IR is online. + :paramtype initial_replication_method: str + :keyword online_replication_start_time: A value indicating the online IR start time. + :paramtype online_replication_start_time: str + :keyword offline_replication_import_path: A value indicating the offline IR import path. + :paramtype offline_replication_import_path: str + :keyword offline_replication_export_path: A value indicating the offline IR export path. + :paramtype offline_replication_export_path: str + :keyword replication_port: A value indicating the recovery HTTPS port. + :paramtype replication_port: int + :keyword allowed_authentication_type: A value indicating the authentication type. + :paramtype allowed_authentication_type: int + :keyword replica_deletion_option: A value indicating whether the VM has to be auto deleted. + Supported Values: String.Empty, None, OnRecoveryCloud. + :paramtype replica_deletion_option: str + """ super(HyperVReplicaBasePolicyDetails, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaBasePolicyDetails' # type: str self.recovery_points = recovery_points @@ -7707,23 +9836,23 @@ class HyperVReplicaBaseReplicationDetails(ReplicationProviderSpecificSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param last_replicated_time: The Last replication time. - :type last_replicated_time: ~datetime.datetime - :param vm_nics: The PE Network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] - :param vm_id: The virtual machine Id. - :type vm_id: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param initial_replication_details: Initial replication details. - :type initial_replication_details: + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str + :ivar last_replicated_time: The Last replication time. + :vartype last_replicated_time: ~datetime.datetime + :ivar vm_nics: The PE Network details. + :vartype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] + :ivar vm_id: The virtual machine Id. + :vartype vm_id: str + :ivar vm_protection_state: The protection state for the vm. + :vartype vm_protection_state: str + :ivar vm_protection_state_description: The protection state description for the vm. + :vartype vm_protection_state_description: str + :ivar initial_replication_details: Initial replication details. + :vartype initial_replication_details: ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails - :param v_m_disk_details: VM disk details. - :type v_m_disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] + :ivar v_m_disk_details: VM disk details. + :vartype v_m_disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] """ _validation = { @@ -7753,6 +9882,23 @@ def __init__( v_m_disk_details: Optional[List["DiskDetails"]] = None, **kwargs ): + """ + :keyword last_replicated_time: The Last replication time. + :paramtype last_replicated_time: ~datetime.datetime + :keyword vm_nics: The PE Network details. + :paramtype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] + :keyword vm_id: The virtual machine Id. + :paramtype vm_id: str + :keyword vm_protection_state: The protection state for the vm. + :paramtype vm_protection_state: str + :keyword vm_protection_state_description: The protection state description for the vm. + :paramtype vm_protection_state_description: str + :keyword initial_replication_details: Initial replication details. + :paramtype initial_replication_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails + :keyword v_m_disk_details: VM disk details. + :paramtype v_m_disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] + """ super(HyperVReplicaBaseReplicationDetails, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaBaseReplicationDetails' # type: str self.last_replicated_time = last_replicated_time @@ -7769,33 +9915,33 @@ class HyperVReplicaBluePolicyDetails(PolicyProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param replication_frequency_in_seconds: A value indicating the replication interval. - :type replication_frequency_in_seconds: int - :param recovery_points: A value indicating the number of recovery points. - :type recovery_points: int - :param application_consistent_snapshot_frequency_in_hours: A value indicating the application + :vartype instance_type: str + :ivar replication_frequency_in_seconds: A value indicating the replication interval. + :vartype replication_frequency_in_seconds: int + :ivar recovery_points: A value indicating the number of recovery points. + :vartype recovery_points: int + :ivar application_consistent_snapshot_frequency_in_hours: A value indicating the application consistent frequency. - :type application_consistent_snapshot_frequency_in_hours: int - :param compression: A value indicating whether compression has to be enabled. - :type compression: str - :param initial_replication_method: A value indicating whether IR is online. - :type initial_replication_method: str - :param online_replication_start_time: A value indicating the online IR start time. - :type online_replication_start_time: str - :param offline_replication_import_path: A value indicating the offline IR import path. - :type offline_replication_import_path: str - :param offline_replication_export_path: A value indicating the offline IR export path. - :type offline_replication_export_path: str - :param replication_port: A value indicating the recovery HTTPS port. - :type replication_port: int - :param allowed_authentication_type: A value indicating the authentication type. - :type allowed_authentication_type: int - :param replica_deletion_option: A value indicating whether the VM has to be auto deleted. + :vartype application_consistent_snapshot_frequency_in_hours: int + :ivar compression: A value indicating whether compression has to be enabled. + :vartype compression: str + :ivar initial_replication_method: A value indicating whether IR is online. + :vartype initial_replication_method: str + :ivar online_replication_start_time: A value indicating the online IR start time. + :vartype online_replication_start_time: str + :ivar offline_replication_import_path: A value indicating the offline IR import path. + :vartype offline_replication_import_path: str + :ivar offline_replication_export_path: A value indicating the offline IR export path. + :vartype offline_replication_export_path: str + :ivar replication_port: A value indicating the recovery HTTPS port. + :vartype replication_port: int + :ivar allowed_authentication_type: A value indicating the authentication type. + :vartype allowed_authentication_type: int + :ivar replica_deletion_option: A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud. - :type replica_deletion_option: str + :vartype replica_deletion_option: str """ _validation = { @@ -7833,6 +9979,32 @@ def __init__( replica_deletion_option: Optional[str] = None, **kwargs ): + """ + :keyword replication_frequency_in_seconds: A value indicating the replication interval. + :paramtype replication_frequency_in_seconds: int + :keyword recovery_points: A value indicating the number of recovery points. + :paramtype recovery_points: int + :keyword application_consistent_snapshot_frequency_in_hours: A value indicating the application + consistent frequency. + :paramtype application_consistent_snapshot_frequency_in_hours: int + :keyword compression: A value indicating whether compression has to be enabled. + :paramtype compression: str + :keyword initial_replication_method: A value indicating whether IR is online. + :paramtype initial_replication_method: str + :keyword online_replication_start_time: A value indicating the online IR start time. + :paramtype online_replication_start_time: str + :keyword offline_replication_import_path: A value indicating the offline IR import path. + :paramtype offline_replication_import_path: str + :keyword offline_replication_export_path: A value indicating the offline IR export path. + :paramtype offline_replication_export_path: str + :keyword replication_port: A value indicating the recovery HTTPS port. + :paramtype replication_port: int + :keyword allowed_authentication_type: A value indicating the authentication type. + :paramtype allowed_authentication_type: int + :keyword replica_deletion_option: A value indicating whether the VM has to be auto deleted. + Supported Values: String.Empty, None, OnRecoveryCloud. + :paramtype replica_deletion_option: str + """ super(HyperVReplicaBluePolicyDetails, self).__init__(**kwargs) self.instance_type = 'HyperVReplica2012R2' # type: str self.replication_frequency_in_seconds = replication_frequency_in_seconds @@ -7856,29 +10028,29 @@ class HyperVReplicaPolicyInput(PolicyProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_points: A value indicating the number of recovery points. - :type recovery_points: int - :param application_consistent_snapshot_frequency_in_hours: A value indicating the application + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_points: A value indicating the number of recovery points. + :vartype recovery_points: int + :ivar application_consistent_snapshot_frequency_in_hours: A value indicating the application consistent frequency. - :type application_consistent_snapshot_frequency_in_hours: int - :param compression: A value indicating whether compression has to be enabled. - :type compression: str - :param initial_replication_method: A value indicating whether IR is online. - :type initial_replication_method: str - :param online_replication_start_time: A value indicating the online IR start time. - :type online_replication_start_time: str - :param offline_replication_import_path: A value indicating the offline IR import path. - :type offline_replication_import_path: str - :param offline_replication_export_path: A value indicating the offline IR export path. - :type offline_replication_export_path: str - :param replication_port: A value indicating the recovery HTTPS port. - :type replication_port: int - :param allowed_authentication_type: A value indicating the authentication type. - :type allowed_authentication_type: int - :param replica_deletion: A value indicating whether the VM has to be auto deleted. - :type replica_deletion: str + :vartype application_consistent_snapshot_frequency_in_hours: int + :ivar compression: A value indicating whether compression has to be enabled. + :vartype compression: str + :ivar initial_replication_method: A value indicating whether IR is online. + :vartype initial_replication_method: str + :ivar online_replication_start_time: A value indicating the online IR start time. + :vartype online_replication_start_time: str + :ivar offline_replication_import_path: A value indicating the offline IR import path. + :vartype offline_replication_import_path: str + :ivar offline_replication_export_path: A value indicating the offline IR export path. + :vartype offline_replication_export_path: str + :ivar replication_port: A value indicating the recovery HTTPS port. + :vartype replication_port: int + :ivar allowed_authentication_type: A value indicating the authentication type. + :vartype allowed_authentication_type: int + :ivar replica_deletion: A value indicating whether the VM has to be auto deleted. + :vartype replica_deletion: str """ _validation = { @@ -7918,6 +10090,29 @@ def __init__( replica_deletion: Optional[str] = None, **kwargs ): + """ + :keyword recovery_points: A value indicating the number of recovery points. + :paramtype recovery_points: int + :keyword application_consistent_snapshot_frequency_in_hours: A value indicating the application + consistent frequency. + :paramtype application_consistent_snapshot_frequency_in_hours: int + :keyword compression: A value indicating whether compression has to be enabled. + :paramtype compression: str + :keyword initial_replication_method: A value indicating whether IR is online. + :paramtype initial_replication_method: str + :keyword online_replication_start_time: A value indicating the online IR start time. + :paramtype online_replication_start_time: str + :keyword offline_replication_import_path: A value indicating the offline IR import path. + :paramtype offline_replication_import_path: str + :keyword offline_replication_export_path: A value indicating the offline IR export path. + :paramtype offline_replication_export_path: str + :keyword replication_port: A value indicating the recovery HTTPS port. + :paramtype replication_port: int + :keyword allowed_authentication_type: A value indicating the authentication type. + :paramtype allowed_authentication_type: int + :keyword replica_deletion: A value indicating whether the VM has to be auto deleted. + :paramtype replica_deletion: str + """ super(HyperVReplicaPolicyInput, self).__init__(**kwargs) self.instance_type = 'HyperVReplica2012' # type: str self.recovery_points = recovery_points @@ -7937,31 +10132,31 @@ class HyperVReplicaBluePolicyInput(HyperVReplicaPolicyInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_points: A value indicating the number of recovery points. - :type recovery_points: int - :param application_consistent_snapshot_frequency_in_hours: A value indicating the application + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_points: A value indicating the number of recovery points. + :vartype recovery_points: int + :ivar application_consistent_snapshot_frequency_in_hours: A value indicating the application consistent frequency. - :type application_consistent_snapshot_frequency_in_hours: int - :param compression: A value indicating whether compression has to be enabled. - :type compression: str - :param initial_replication_method: A value indicating whether IR is online. - :type initial_replication_method: str - :param online_replication_start_time: A value indicating the online IR start time. - :type online_replication_start_time: str - :param offline_replication_import_path: A value indicating the offline IR import path. - :type offline_replication_import_path: str - :param offline_replication_export_path: A value indicating the offline IR export path. - :type offline_replication_export_path: str - :param replication_port: A value indicating the recovery HTTPS port. - :type replication_port: int - :param allowed_authentication_type: A value indicating the authentication type. - :type allowed_authentication_type: int - :param replica_deletion: A value indicating whether the VM has to be auto deleted. - :type replica_deletion: str - :param replication_frequency_in_seconds: A value indicating the replication interval. - :type replication_frequency_in_seconds: int + :vartype application_consistent_snapshot_frequency_in_hours: int + :ivar compression: A value indicating whether compression has to be enabled. + :vartype compression: str + :ivar initial_replication_method: A value indicating whether IR is online. + :vartype initial_replication_method: str + :ivar online_replication_start_time: A value indicating the online IR start time. + :vartype online_replication_start_time: str + :ivar offline_replication_import_path: A value indicating the offline IR import path. + :vartype offline_replication_import_path: str + :ivar offline_replication_export_path: A value indicating the offline IR export path. + :vartype offline_replication_export_path: str + :ivar replication_port: A value indicating the recovery HTTPS port. + :vartype replication_port: int + :ivar allowed_authentication_type: A value indicating the authentication type. + :vartype allowed_authentication_type: int + :ivar replica_deletion: A value indicating whether the VM has to be auto deleted. + :vartype replica_deletion: str + :ivar replication_frequency_in_seconds: A value indicating the replication interval. + :vartype replication_frequency_in_seconds: int """ _validation = { @@ -7999,6 +10194,31 @@ def __init__( replication_frequency_in_seconds: Optional[int] = None, **kwargs ): + """ + :keyword recovery_points: A value indicating the number of recovery points. + :paramtype recovery_points: int + :keyword application_consistent_snapshot_frequency_in_hours: A value indicating the application + consistent frequency. + :paramtype application_consistent_snapshot_frequency_in_hours: int + :keyword compression: A value indicating whether compression has to be enabled. + :paramtype compression: str + :keyword initial_replication_method: A value indicating whether IR is online. + :paramtype initial_replication_method: str + :keyword online_replication_start_time: A value indicating the online IR start time. + :paramtype online_replication_start_time: str + :keyword offline_replication_import_path: A value indicating the offline IR import path. + :paramtype offline_replication_import_path: str + :keyword offline_replication_export_path: A value indicating the offline IR export path. + :paramtype offline_replication_export_path: str + :keyword replication_port: A value indicating the recovery HTTPS port. + :paramtype replication_port: int + :keyword allowed_authentication_type: A value indicating the authentication type. + :paramtype allowed_authentication_type: int + :keyword replica_deletion: A value indicating whether the VM has to be auto deleted. + :paramtype replica_deletion: str + :keyword replication_frequency_in_seconds: A value indicating the replication interval. + :paramtype replication_frequency_in_seconds: int + """ super(HyperVReplicaBluePolicyInput, self).__init__(recovery_points=recovery_points, application_consistent_snapshot_frequency_in_hours=application_consistent_snapshot_frequency_in_hours, compression=compression, initial_replication_method=initial_replication_method, online_replication_start_time=online_replication_start_time, offline_replication_import_path=offline_replication_import_path, offline_replication_export_path=offline_replication_export_path, replication_port=replication_port, allowed_authentication_type=allowed_authentication_type, replica_deletion=replica_deletion, **kwargs) self.instance_type = 'HyperVReplica2012R2' # type: str self.replication_frequency_in_seconds = replication_frequency_in_seconds @@ -8009,23 +10229,23 @@ class HyperVReplicaBlueReplicationDetails(ReplicationProviderSpecificSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param last_replicated_time: The Last replication time. - :type last_replicated_time: ~datetime.datetime - :param vm_nics: The PE Network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] - :param vm_id: The virtual machine Id. - :type vm_id: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param initial_replication_details: Initial replication details. - :type initial_replication_details: + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str + :ivar last_replicated_time: The Last replication time. + :vartype last_replicated_time: ~datetime.datetime + :ivar vm_nics: The PE Network details. + :vartype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] + :ivar vm_id: The virtual machine Id. + :vartype vm_id: str + :ivar vm_protection_state: The protection state for the vm. + :vartype vm_protection_state: str + :ivar vm_protection_state_description: The protection state description for the vm. + :vartype vm_protection_state_description: str + :ivar initial_replication_details: Initial replication details. + :vartype initial_replication_details: ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails - :param v_m_disk_details: VM disk details. - :type v_m_disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] + :ivar v_m_disk_details: VM disk details. + :vartype v_m_disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] """ _validation = { @@ -8055,6 +10275,23 @@ def __init__( v_m_disk_details: Optional[List["DiskDetails"]] = None, **kwargs ): + """ + :keyword last_replicated_time: The Last replication time. + :paramtype last_replicated_time: ~datetime.datetime + :keyword vm_nics: The PE Network details. + :paramtype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] + :keyword vm_id: The virtual machine Id. + :paramtype vm_id: str + :keyword vm_protection_state: The protection state for the vm. + :paramtype vm_protection_state: str + :keyword vm_protection_state_description: The protection state description for the vm. + :paramtype vm_protection_state_description: str + :keyword initial_replication_details: Initial replication details. + :paramtype initial_replication_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails + :keyword v_m_disk_details: VM disk details. + :paramtype v_m_disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] + """ super(HyperVReplicaBlueReplicationDetails, self).__init__(**kwargs) self.instance_type = 'HyperVReplica2012R2' # type: str self.last_replicated_time = last_replicated_time @@ -8071,31 +10308,31 @@ class HyperVReplicaPolicyDetails(PolicyProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param recovery_points: A value indicating the number of recovery points. - :type recovery_points: int - :param application_consistent_snapshot_frequency_in_hours: A value indicating the application + :vartype instance_type: str + :ivar recovery_points: A value indicating the number of recovery points. + :vartype recovery_points: int + :ivar application_consistent_snapshot_frequency_in_hours: A value indicating the application consistent frequency. - :type application_consistent_snapshot_frequency_in_hours: int - :param compression: A value indicating whether compression has to be enabled. - :type compression: str - :param initial_replication_method: A value indicating whether IR is online. - :type initial_replication_method: str - :param online_replication_start_time: A value indicating the online IR start time. - :type online_replication_start_time: str - :param offline_replication_import_path: A value indicating the offline IR import path. - :type offline_replication_import_path: str - :param offline_replication_export_path: A value indicating the offline IR export path. - :type offline_replication_export_path: str - :param replication_port: A value indicating the recovery HTTPS port. - :type replication_port: int - :param allowed_authentication_type: A value indicating the authentication type. - :type allowed_authentication_type: int - :param replica_deletion_option: A value indicating whether the VM has to be auto deleted. + :vartype application_consistent_snapshot_frequency_in_hours: int + :ivar compression: A value indicating whether compression has to be enabled. + :vartype compression: str + :ivar initial_replication_method: A value indicating whether IR is online. + :vartype initial_replication_method: str + :ivar online_replication_start_time: A value indicating the online IR start time. + :vartype online_replication_start_time: str + :ivar offline_replication_import_path: A value indicating the offline IR import path. + :vartype offline_replication_import_path: str + :ivar offline_replication_export_path: A value indicating the offline IR export path. + :vartype offline_replication_export_path: str + :ivar replication_port: A value indicating the recovery HTTPS port. + :vartype replication_port: int + :ivar allowed_authentication_type: A value indicating the authentication type. + :vartype allowed_authentication_type: int + :ivar replica_deletion_option: A value indicating whether the VM has to be auto deleted. Supported Values: String.Empty, None, OnRecoveryCloud. - :type replica_deletion_option: str + :vartype replica_deletion_option: str """ _validation = { @@ -8131,6 +10368,30 @@ def __init__( replica_deletion_option: Optional[str] = None, **kwargs ): + """ + :keyword recovery_points: A value indicating the number of recovery points. + :paramtype recovery_points: int + :keyword application_consistent_snapshot_frequency_in_hours: A value indicating the application + consistent frequency. + :paramtype application_consistent_snapshot_frequency_in_hours: int + :keyword compression: A value indicating whether compression has to be enabled. + :paramtype compression: str + :keyword initial_replication_method: A value indicating whether IR is online. + :paramtype initial_replication_method: str + :keyword online_replication_start_time: A value indicating the online IR start time. + :paramtype online_replication_start_time: str + :keyword offline_replication_import_path: A value indicating the offline IR import path. + :paramtype offline_replication_import_path: str + :keyword offline_replication_export_path: A value indicating the offline IR export path. + :paramtype offline_replication_export_path: str + :keyword replication_port: A value indicating the recovery HTTPS port. + :paramtype replication_port: int + :keyword allowed_authentication_type: A value indicating the authentication type. + :paramtype allowed_authentication_type: int + :keyword replica_deletion_option: A value indicating whether the VM has to be auto deleted. + Supported Values: String.Empty, None, OnRecoveryCloud. + :paramtype replica_deletion_option: str + """ super(HyperVReplicaPolicyDetails, self).__init__(**kwargs) self.instance_type = 'HyperVReplica2012' # type: str self.recovery_points = recovery_points @@ -8150,23 +10411,23 @@ class HyperVReplicaReplicationDetails(ReplicationProviderSpecificSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param last_replicated_time: The Last replication time. - :type last_replicated_time: ~datetime.datetime - :param vm_nics: The PE Network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] - :param vm_id: The virtual machine Id. - :type vm_id: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param initial_replication_details: Initial replication details. - :type initial_replication_details: + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str + :ivar last_replicated_time: The Last replication time. + :vartype last_replicated_time: ~datetime.datetime + :ivar vm_nics: The PE Network details. + :vartype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] + :ivar vm_id: The virtual machine Id. + :vartype vm_id: str + :ivar vm_protection_state: The protection state for the vm. + :vartype vm_protection_state: str + :ivar vm_protection_state_description: The protection state description for the vm. + :vartype vm_protection_state_description: str + :ivar initial_replication_details: Initial replication details. + :vartype initial_replication_details: ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails - :param v_m_disk_details: VM disk details. - :type v_m_disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] + :ivar v_m_disk_details: VM disk details. + :vartype v_m_disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] """ _validation = { @@ -8196,6 +10457,23 @@ def __init__( v_m_disk_details: Optional[List["DiskDetails"]] = None, **kwargs ): + """ + :keyword last_replicated_time: The Last replication time. + :paramtype last_replicated_time: ~datetime.datetime + :keyword vm_nics: The PE Network details. + :paramtype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] + :keyword vm_id: The virtual machine Id. + :paramtype vm_id: str + :keyword vm_protection_state: The protection state for the vm. + :paramtype vm_protection_state: str + :keyword vm_protection_state_description: The protection state description for the vm. + :paramtype vm_protection_state_description: str + :keyword initial_replication_details: Initial replication details. + :paramtype initial_replication_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails + :keyword v_m_disk_details: VM disk details. + :paramtype v_m_disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] + """ super(HyperVReplicaReplicationDetails, self).__init__(**kwargs) self.instance_type = 'HyperVReplica2012' # type: str self.last_replicated_time = last_replicated_time @@ -8212,11 +10490,11 @@ class HyperVSiteDetails(FabricSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param hyper_v_hosts: The list of Hyper-V hosts associated with the fabric. - :type hyper_v_hosts: list[~azure.mgmt.recoveryservicessiterecovery.models.HyperVHostDetails] + :vartype instance_type: str + :ivar hyper_v_hosts: The list of Hyper-V hosts associated with the fabric. + :vartype hyper_v_hosts: list[~azure.mgmt.recoveryservicessiterecovery.models.HyperVHostDetails] """ _validation = { @@ -8234,6 +10512,11 @@ def __init__( hyper_v_hosts: Optional[List["HyperVHostDetails"]] = None, **kwargs ): + """ + :keyword hyper_v_hosts: The list of Hyper-V hosts associated with the fabric. + :paramtype hyper_v_hosts: + list[~azure.mgmt.recoveryservicessiterecovery.models.HyperVHostDetails] + """ super(HyperVSiteDetails, self).__init__(**kwargs) self.instance_type = 'HyperVSite' # type: str self.hyper_v_hosts = hyper_v_hosts @@ -8247,30 +10530,33 @@ class HyperVVirtualMachineDetails(ConfigurationSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param source_item_id: The source id of the object. - :type source_item_id: str - :param generation: The id of the object in fabric. - :type generation: str - :param os_details: The Last replication time. - :type os_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDetails - :param disk_details: The Last successful failover time. - :type disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] - :param has_physical_disk: A value indicating whether the VM has a physical disk attached. - String value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", - "Present", "NotPresent". - :type has_physical_disk: str or ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus - :param has_fibre_channel_adapter: A value indicating whether the VM has a fibre channel adapter + :vartype instance_type: str + :ivar source_item_id: The source id of the object. + :vartype source_item_id: str + :ivar generation: The id of the object in fabric. + :vartype generation: str + :ivar os_details: The Last replication time. + :vartype os_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDetails + :ivar disk_details: The Last successful failover time. + :vartype disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] + :ivar has_physical_disk: A value indicating whether the VM has a physical disk attached. String + value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", "Present", + "NotPresent". + :vartype has_physical_disk: str or + ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus + :ivar has_fibre_channel_adapter: A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", "Present", "NotPresent". - :type has_fibre_channel_adapter: str or + :vartype has_fibre_channel_adapter: str or ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus - :param has_shared_vhd: A value indicating whether the VM has a shared VHD attached. String - value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", "Present", + :ivar has_shared_vhd: A value indicating whether the VM has a shared VHD attached. String value + of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", "Present", "NotPresent". - :type has_shared_vhd: str or ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus + :vartype has_shared_vhd: str or ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus + :ivar hyper_v_host_id: The Id of the hyper-v host in fabric. + :vartype hyper_v_host_id: str """ _validation = { @@ -8286,6 +10572,7 @@ class HyperVVirtualMachineDetails(ConfigurationSettings): 'has_physical_disk': {'key': 'hasPhysicalDisk', 'type': 'str'}, 'has_fibre_channel_adapter': {'key': 'hasFibreChannelAdapter', 'type': 'str'}, 'has_shared_vhd': {'key': 'hasSharedVhd', 'type': 'str'}, + 'hyper_v_host_id': {'key': 'hyperVHostId', 'type': 'str'}, } _subtype_map = { @@ -8302,8 +10589,36 @@ def __init__( has_physical_disk: Optional[Union[str, "PresenceStatus"]] = None, has_fibre_channel_adapter: Optional[Union[str, "PresenceStatus"]] = None, has_shared_vhd: Optional[Union[str, "PresenceStatus"]] = None, - **kwargs - ): + hyper_v_host_id: Optional[str] = None, + **kwargs + ): + """ + :keyword source_item_id: The source id of the object. + :paramtype source_item_id: str + :keyword generation: The id of the object in fabric. + :paramtype generation: str + :keyword os_details: The Last replication time. + :paramtype os_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDetails + :keyword disk_details: The Last successful failover time. + :paramtype disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] + :keyword has_physical_disk: A value indicating whether the VM has a physical disk attached. + String value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", + "Present", "NotPresent". + :paramtype has_physical_disk: str or + ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus + :keyword has_fibre_channel_adapter: A value indicating whether the VM has a fibre channel + adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: + "Unknown", "Present", "NotPresent". + :paramtype has_fibre_channel_adapter: str or + ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus + :keyword has_shared_vhd: A value indicating whether the VM has a shared VHD attached. String + value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", "Present", + "NotPresent". + :paramtype has_shared_vhd: str or + ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus + :keyword hyper_v_host_id: The Id of the hyper-v host in fabric. + :paramtype hyper_v_host_id: str + """ super(HyperVVirtualMachineDetails, self).__init__(**kwargs) self.instance_type = 'HyperVVirtualMachine' # type: str self.source_item_id = source_item_id @@ -8313,25 +10628,26 @@ def __init__( self.has_physical_disk = has_physical_disk self.has_fibre_channel_adapter = has_fibre_channel_adapter self.has_shared_vhd = has_shared_vhd + self.hyper_v_host_id = hyper_v_host_id class IdentityProviderDetails(msrest.serialization.Model): """Identity provider details. - :param tenant_id: The tenant Id for the service principal with which the on-premise + :ivar tenant_id: The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. - :type tenant_id: str - :param application_id: The application/client Id for the service principal with which the + :vartype tenant_id: str + :ivar application_id: The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. - :type application_id: str - :param object_id: The object Id of the service principal with which the on-premise + :vartype application_id: str + :ivar object_id: The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. - :type object_id: str - :param audience: The intended Audience of the service principal with which the on-premise + :vartype object_id: str + :ivar audience: The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. - :type audience: str - :param aad_authority: The base authority for Azure Active Directory authentication. - :type aad_authority: str + :vartype audience: str + :ivar aad_authority: The base authority for Azure Active Directory authentication. + :vartype aad_authority: str """ _attribute_map = { @@ -8352,6 +10668,22 @@ def __init__( aad_authority: Optional[str] = None, **kwargs ): + """ + :keyword tenant_id: The tenant Id for the service principal with which the on-premise + management/data plane components would communicate with our Azure services. + :paramtype tenant_id: str + :keyword application_id: The application/client Id for the service principal with which the + on-premise management/data plane components would communicate with our Azure services. + :paramtype application_id: str + :keyword object_id: The object Id of the service principal with which the on-premise + management/data plane components would communicate with our Azure services. + :paramtype object_id: str + :keyword audience: The intended Audience of the service principal with which the on-premise + management/data plane components would communicate with our Azure services. + :paramtype audience: str + :keyword aad_authority: The base authority for Azure Active Directory authentication. + :paramtype aad_authority: str + """ super(IdentityProviderDetails, self).__init__(**kwargs) self.tenant_id = tenant_id self.application_id = application_id @@ -8365,20 +10697,20 @@ class IdentityProviderInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param tenant_id: Required. The tenant Id for the service principal with which the on-premise + :ivar tenant_id: Required. The tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. - :type tenant_id: str - :param application_id: Required. The application/client Id for the service principal with which + :vartype tenant_id: str + :ivar application_id: Required. The application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. - :type application_id: str - :param object_id: Required. The object Id of the service principal with which the on-premise + :vartype application_id: str + :ivar object_id: Required. The object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. - :type object_id: str - :param audience: Required. The intended Audience of the service principal with which the + :vartype object_id: str + :ivar audience: Required. The intended Audience of the service principal with which the on-premise management/data plane components would communicate with our Azure services. - :type audience: str - :param aad_authority: Required. The base authority for Azure Active Directory authentication. - :type aad_authority: str + :vartype audience: str + :ivar aad_authority: Required. The base authority for Azure Active Directory authentication. + :vartype aad_authority: str """ _validation = { @@ -8407,6 +10739,23 @@ def __init__( aad_authority: str, **kwargs ): + """ + :keyword tenant_id: Required. The tenant Id for the service principal with which the on-premise + management/data plane components would communicate with our Azure services. + :paramtype tenant_id: str + :keyword application_id: Required. The application/client Id for the service principal with + which the on-premise management/data plane components would communicate with our Azure + services. + :paramtype application_id: str + :keyword object_id: Required. The object Id of the service principal with which the on-premise + management/data plane components would communicate with our Azure services. + :paramtype object_id: str + :keyword audience: Required. The intended Audience of the service principal with which the + on-premise management/data plane components would communicate with our Azure services. + :paramtype audience: str + :keyword aad_authority: Required. The base authority for Azure Active Directory authentication. + :paramtype aad_authority: str + """ super(IdentityProviderInput, self).__init__(**kwargs) self.tenant_id = tenant_id self.application_id = application_id @@ -8418,14 +10767,14 @@ def __init__( class InconsistentVmDetails(msrest.serialization.Model): """This class stores the monitoring details for consistency check of inconsistent Protected Entity. - :param vm_name: The Vm name. - :type vm_name: str - :param cloud_name: The Cloud name. - :type cloud_name: str - :param details: The list of details regarding state of the Protected Entity in SRS and On prem. - :type details: list[str] - :param error_ids: The list of error ids. - :type error_ids: list[str] + :ivar vm_name: The Vm name. + :vartype vm_name: str + :ivar cloud_name: The Cloud name. + :vartype cloud_name: str + :ivar details: The list of details regarding state of the Protected Entity in SRS and On prem. + :vartype details: list[str] + :ivar error_ids: The list of error ids. + :vartype error_ids: list[str] """ _attribute_map = { @@ -8444,6 +10793,17 @@ def __init__( error_ids: Optional[List[str]] = None, **kwargs ): + """ + :keyword vm_name: The Vm name. + :paramtype vm_name: str + :keyword cloud_name: The Cloud name. + :paramtype cloud_name: str + :keyword details: The list of details regarding state of the Protected Entity in SRS and On + prem. + :paramtype details: list[str] + :keyword error_ids: The list of error ids. + :paramtype error_ids: list[str] + """ super(InconsistentVmDetails, self).__init__(**kwargs) self.vm_name = vm_name self.cloud_name = cloud_name @@ -8454,10 +10814,10 @@ def __init__( class InitialReplicationDetails(msrest.serialization.Model): """Initial replication details. - :param initial_replication_type: Initial replication type. - :type initial_replication_type: str - :param initial_replication_progress_percentage: The initial replication progress percentage. - :type initial_replication_progress_percentage: str + :ivar initial_replication_type: Initial replication type. + :vartype initial_replication_type: str + :ivar initial_replication_progress_percentage: The initial replication progress percentage. + :vartype initial_replication_progress_percentage: str """ _attribute_map = { @@ -8472,6 +10832,12 @@ def __init__( initial_replication_progress_percentage: Optional[str] = None, **kwargs ): + """ + :keyword initial_replication_type: Initial replication type. + :paramtype initial_replication_type: str + :keyword initial_replication_progress_percentage: The initial replication progress percentage. + :paramtype initial_replication_progress_percentage: str + """ super(InitialReplicationDetails, self).__init__(**kwargs) self.initial_replication_type = initial_replication_type self.initial_replication_progress_percentage = initial_replication_progress_percentage @@ -8482,12 +10848,12 @@ class InlineWorkflowTaskDetails(GroupTaskDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param child_tasks: The child tasks. - :type child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] - :param workflow_ids: The list of child workflow ids. - :type workflow_ids: list[str] + :ivar instance_type: Required. The type of task details.Constant filled by server. + :vartype instance_type: str + :ivar child_tasks: The child tasks. + :vartype child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] + :ivar workflow_ids: The list of child workflow ids. + :vartype workflow_ids: list[str] """ _validation = { @@ -8507,6 +10873,12 @@ def __init__( workflow_ids: Optional[List[str]] = None, **kwargs ): + """ + :keyword child_tasks: The child tasks. + :paramtype child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] + :keyword workflow_ids: The list of child workflow ids. + :paramtype workflow_ids: list[str] + """ super(InlineWorkflowTaskDetails, self).__init__(child_tasks=child_tasks, **kwargs) self.instance_type = 'InlineWorkflowTaskDetails' # type: str self.workflow_ids = workflow_ids @@ -8515,15 +10887,15 @@ def __init__( class InMageAgentDetails(msrest.serialization.Model): """The details of the InMage agent. - :param agent_version: The agent version. - :type agent_version: str - :param agent_update_status: A value indicating whether installed agent needs to be updated. - :type agent_update_status: str - :param post_update_reboot_status: A value indicating whether reboot is required after update is + :ivar agent_version: The agent version. + :vartype agent_version: str + :ivar agent_update_status: A value indicating whether installed agent needs to be updated. + :vartype agent_update_status: str + :ivar post_update_reboot_status: A value indicating whether reboot is required after update is applied. - :type post_update_reboot_status: str - :param agent_expiry_date: Agent expiry date. - :type agent_expiry_date: ~datetime.datetime + :vartype post_update_reboot_status: str + :ivar agent_expiry_date: Agent expiry date. + :vartype agent_expiry_date: ~datetime.datetime """ _attribute_map = { @@ -8542,6 +10914,17 @@ def __init__( agent_expiry_date: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword agent_version: The agent version. + :paramtype agent_version: str + :keyword agent_update_status: A value indicating whether installed agent needs to be updated. + :paramtype agent_update_status: str + :keyword post_update_reboot_status: A value indicating whether reboot is required after update + is applied. + :paramtype post_update_reboot_status: str + :keyword agent_expiry_date: Agent expiry date. + :paramtype agent_expiry_date: ~datetime.datetime + """ super(InMageAgentDetails, self).__init__(**kwargs) self.agent_version = agent_version self.agent_update_status = agent_update_status @@ -8554,8 +10937,8 @@ class InMageAzureV2ApplyRecoveryPointInput(ApplyRecoveryPointProviderSpecificInp All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -8570,6 +10953,8 @@ def __init__( self, **kwargs ): + """ + """ super(InMageAzureV2ApplyRecoveryPointInput, self).__init__(**kwargs) self.instance_type = 'InMageAzureV2' # type: str @@ -8577,15 +10962,15 @@ def __init__( class InMageAzureV2DiskInputDetails(msrest.serialization.Model): """Disk input details. - :param disk_id: The DiskId. - :type disk_id: str - :param log_storage_account_id: The LogStorageAccountId. - :type log_storage_account_id: str - :param disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", + :ivar disk_id: The DiskId. + :vartype disk_id: str + :ivar log_storage_account_id: The LogStorageAccountId. + :vartype log_storage_account_id: str + :ivar disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :param disk_encryption_set_id: The DiskEncryptionSet ARM ID. - :type disk_encryption_set_id: str + :vartype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :ivar disk_encryption_set_id: The DiskEncryptionSet ARM ID. + :vartype disk_encryption_set_id: str """ _attribute_map = { @@ -8604,6 +10989,17 @@ def __init__( disk_encryption_set_id: Optional[str] = None, **kwargs ): + """ + :keyword disk_id: The DiskId. + :paramtype disk_id: str + :keyword log_storage_account_id: The LogStorageAccountId. + :paramtype log_storage_account_id: str + :keyword disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS". + :paramtype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :keyword disk_encryption_set_id: The DiskEncryptionSet ARM ID. + :paramtype disk_encryption_set_id: str + """ super(InMageAzureV2DiskInputDetails, self).__init__(**kwargs) self.disk_id = disk_id self.log_storage_account_id = log_storage_account_id @@ -8616,69 +11012,69 @@ class InMageAzureV2EnableProtectionInput(EnableProtectionProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param master_target_id: The Master target Id. - :type master_target_id: str - :param process_server_id: The Process Server Id. - :type process_server_id: str - :param storage_account_id: The storage account Id. - :type storage_account_id: str - :param run_as_account_id: The CS account Id. - :type run_as_account_id: str - :param multi_vm_group_id: The multi VM group Id. - :type multi_vm_group_id: str - :param multi_vm_group_name: The multi VM group name. - :type multi_vm_group_name: str - :param disks_to_include: The disks to include list. - :type disks_to_include: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar master_target_id: The Master target Id. + :vartype master_target_id: str + :ivar process_server_id: The Process Server Id. + :vartype process_server_id: str + :ivar storage_account_id: The storage account Id. + :vartype storage_account_id: str + :ivar run_as_account_id: The CS account Id. + :vartype run_as_account_id: str + :ivar multi_vm_group_id: The multi VM group Id. + :vartype multi_vm_group_id: str + :ivar multi_vm_group_name: The multi VM group name. + :vartype multi_vm_group_name: str + :ivar disks_to_include: The disks to include list. + :vartype disks_to_include: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageAzureV2DiskInputDetails] - :param target_azure_network_id: The selected target Azure network Id. - :type target_azure_network_id: str - :param target_azure_subnet_id: The selected target Azure subnet Id. - :type target_azure_subnet_id: str - :param enable_rdp_on_target_option: The selected option to enable RDP\SSH on target VM after + :ivar target_azure_network_id: The selected target Azure network Id. + :vartype target_azure_network_id: str + :ivar target_azure_subnet_id: The selected target Azure subnet Id. + :vartype target_azure_subnet_id: str + :ivar enable_rdp_on_target_option: The selected option to enable RDP\SSH on target VM after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. - :type enable_rdp_on_target_option: str - :param target_azure_vm_name: The target azure VM Name. - :type target_azure_vm_name: str - :param log_storage_account_id: The storage account to be used for logging during replication. - :type log_storage_account_id: str - :param target_azure_v1_resource_group_id: The Id of the target resource group (for classic + :vartype enable_rdp_on_target_option: str + :ivar target_azure_vm_name: The target azure VM Name. + :vartype target_azure_vm_name: str + :ivar log_storage_account_id: The storage account to be used for logging during replication. + :vartype log_storage_account_id: str + :ivar target_azure_v1_resource_group_id: The Id of the target resource group (for classic deployment) in which the failover VM is to be created. - :type target_azure_v1_resource_group_id: str - :param target_azure_v2_resource_group_id: The Id of the target resource group (for resource + :vartype target_azure_v1_resource_group_id: str + :ivar target_azure_v2_resource_group_id: The Id of the target resource group (for resource manager deployment) in which the failover VM is to be created. - :type target_azure_v2_resource_group_id: str - :param disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", + :vartype target_azure_v2_resource_group_id: str + :ivar disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :param target_availability_set_id: The target availability set ARM Id for resource manager + :vartype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :ivar target_availability_set_id: The target availability set ARM Id for resource manager deployment. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The proximity placement group ARM Id. - :type target_proximity_placement_group_id: str - :param license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", + :vartype target_availability_set_id: str + :ivar target_availability_zone: The target availability zone. + :vartype target_availability_zone: str + :ivar target_proximity_placement_group_id: The proximity placement group ARM Id. + :vartype target_proximity_placement_group_id: str + :ivar license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", "WindowsServer". - :type license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType - :param sql_server_license_type: The SQL Server license type. Possible values include: + :vartype license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType + :ivar sql_server_license_type: The SQL Server license type. Possible values include: "NotSpecified", "NoLicenseType", "PAYG", "AHUB". - :type sql_server_license_type: str or + :vartype sql_server_license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType - :param target_vm_size: The target VM size. - :type target_vm_size: str - :param disk_encryption_set_id: The DiskEncryptionSet ARM Id. - :type disk_encryption_set_id: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param seed_managed_disk_tags: The tags for the seed managed disks. - :type seed_managed_disk_tags: dict[str, str] - :param target_managed_disk_tags: The tags for the target managed disks. - :type target_managed_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] + :ivar target_vm_size: The target VM size. + :vartype target_vm_size: str + :ivar disk_encryption_set_id: The DiskEncryptionSet ARM Id. + :vartype disk_encryption_set_id: str + :ivar target_vm_tags: The target VM tags. + :vartype target_vm_tags: dict[str, str] + :ivar seed_managed_disk_tags: The tags for the seed managed disks. + :vartype seed_managed_disk_tags: dict[str, str] + :ivar target_managed_disk_tags: The tags for the target managed disks. + :vartype target_managed_disk_tags: dict[str, str] + :ivar target_nic_tags: The tags for the target NICs. + :vartype target_nic_tags: dict[str, str] """ _validation = { @@ -8746,6 +11142,69 @@ def __init__( target_nic_tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword master_target_id: The Master target Id. + :paramtype master_target_id: str + :keyword process_server_id: The Process Server Id. + :paramtype process_server_id: str + :keyword storage_account_id: The storage account Id. + :paramtype storage_account_id: str + :keyword run_as_account_id: The CS account Id. + :paramtype run_as_account_id: str + :keyword multi_vm_group_id: The multi VM group Id. + :paramtype multi_vm_group_id: str + :keyword multi_vm_group_name: The multi VM group name. + :paramtype multi_vm_group_name: str + :keyword disks_to_include: The disks to include list. + :paramtype disks_to_include: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageAzureV2DiskInputDetails] + :keyword target_azure_network_id: The selected target Azure network Id. + :paramtype target_azure_network_id: str + :keyword target_azure_subnet_id: The selected target Azure subnet Id. + :paramtype target_azure_subnet_id: str + :keyword enable_rdp_on_target_option: The selected option to enable RDP\SSH on target VM after + failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + :paramtype enable_rdp_on_target_option: str + :keyword target_azure_vm_name: The target azure VM Name. + :paramtype target_azure_vm_name: str + :keyword log_storage_account_id: The storage account to be used for logging during replication. + :paramtype log_storage_account_id: str + :keyword target_azure_v1_resource_group_id: The Id of the target resource group (for classic + deployment) in which the failover VM is to be created. + :paramtype target_azure_v1_resource_group_id: str + :keyword target_azure_v2_resource_group_id: The Id of the target resource group (for resource + manager deployment) in which the failover VM is to be created. + :paramtype target_azure_v2_resource_group_id: str + :keyword disk_type: The DiskType. Possible values include: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS". + :paramtype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :keyword target_availability_set_id: The target availability set ARM Id for resource manager + deployment. + :paramtype target_availability_set_id: str + :keyword target_availability_zone: The target availability zone. + :paramtype target_availability_zone: str + :keyword target_proximity_placement_group_id: The proximity placement group ARM Id. + :paramtype target_proximity_placement_group_id: str + :keyword license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", + "WindowsServer". + :paramtype license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType + :keyword sql_server_license_type: The SQL Server license type. Possible values include: + "NotSpecified", "NoLicenseType", "PAYG", "AHUB". + :paramtype sql_server_license_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType + :keyword target_vm_size: The target VM size. + :paramtype target_vm_size: str + :keyword disk_encryption_set_id: The DiskEncryptionSet ARM Id. + :paramtype disk_encryption_set_id: str + :keyword target_vm_tags: The target VM tags. + :paramtype target_vm_tags: dict[str, str] + :keyword seed_managed_disk_tags: The tags for the seed managed disks. + :paramtype seed_managed_disk_tags: dict[str, str] + :keyword target_managed_disk_tags: The tags for the target managed disks. + :paramtype target_managed_disk_tags: dict[str, str] + :keyword target_nic_tags: The tags for the target NICs. + :paramtype target_nic_tags: dict[str, str] + """ super(InMageAzureV2EnableProtectionInput, self).__init__(**kwargs) self.instance_type = 'InMageAzureV2' # type: str self.master_target_id = master_target_id @@ -8781,24 +11240,24 @@ class InMageAzureV2EventDetails(EventProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param event_type: InMage Event type. Takes one of the values of + :vartype instance_type: str + :ivar event_type: InMage Event type. Takes one of the values of InMageDataContract.InMageMonitoringEventType. - :type event_type: str - :param category: InMage Event Category. - :type category: str - :param component: InMage Event Component. - :type component: str - :param corrective_action: Corrective Action string for the event. - :type corrective_action: str - :param details: InMage Event Details. - :type details: str - :param summary: InMage Event Summary. - :type summary: str - :param site_name: VMware Site name. - :type site_name: str + :vartype event_type: str + :ivar category: InMage Event Category. + :vartype category: str + :ivar component: InMage Event Component. + :vartype component: str + :ivar corrective_action: Corrective Action string for the event. + :vartype corrective_action: str + :ivar details: InMage Event Details. + :vartype details: str + :ivar summary: InMage Event Summary. + :vartype summary: str + :ivar site_name: VMware Site name. + :vartype site_name: str """ _validation = { @@ -8828,6 +11287,23 @@ def __init__( site_name: Optional[str] = None, **kwargs ): + """ + :keyword event_type: InMage Event type. Takes one of the values of + InMageDataContract.InMageMonitoringEventType. + :paramtype event_type: str + :keyword category: InMage Event Category. + :paramtype category: str + :keyword component: InMage Event Component. + :paramtype component: str + :keyword corrective_action: Corrective Action string for the event. + :paramtype corrective_action: str + :keyword details: InMage Event Details. + :paramtype details: str + :keyword summary: InMage Event Summary. + :paramtype summary: str + :keyword site_name: VMware Site name. + :paramtype site_name: str + """ super(InMageAzureV2EventDetails, self).__init__(**kwargs) self.instance_type = 'InMageAzureV2' # type: str self.event_type = event_type @@ -8842,16 +11318,16 @@ def __init__( class InMageAzureV2ManagedDiskDetails(msrest.serialization.Model): """InMageAzureV2 Managed disk details. - :param disk_id: The disk id. - :type disk_id: str - :param seed_managed_disk_id: Seed managed disk Id. - :type seed_managed_disk_id: str - :param replica_disk_type: The replica disk type. - :type replica_disk_type: str - :param disk_encryption_set_id: The DiskEncryptionSet ARM ID. - :type disk_encryption_set_id: str - :param target_disk_name: The target disk name. - :type target_disk_name: str + :ivar disk_id: The disk id. + :vartype disk_id: str + :ivar seed_managed_disk_id: Seed managed disk Id. + :vartype seed_managed_disk_id: str + :ivar replica_disk_type: The replica disk type. + :vartype replica_disk_type: str + :ivar disk_encryption_set_id: The DiskEncryptionSet ARM ID. + :vartype disk_encryption_set_id: str + :ivar target_disk_name: The target disk name. + :vartype target_disk_name: str """ _attribute_map = { @@ -8872,6 +11348,18 @@ def __init__( target_disk_name: Optional[str] = None, **kwargs ): + """ + :keyword disk_id: The disk id. + :paramtype disk_id: str + :keyword seed_managed_disk_id: Seed managed disk Id. + :paramtype seed_managed_disk_id: str + :keyword replica_disk_type: The replica disk type. + :paramtype replica_disk_type: str + :keyword disk_encryption_set_id: The DiskEncryptionSet ARM ID. + :paramtype disk_encryption_set_id: str + :keyword target_disk_name: The target disk name. + :paramtype target_disk_name: str + """ super(InMageAzureV2ManagedDiskDetails, self).__init__(**kwargs) self.disk_id = disk_id self.seed_managed_disk_id = seed_managed_disk_id @@ -8885,21 +11373,21 @@ class InMageAzureV2PolicyDetails(PolicyProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in + :vartype instance_type: str + :ivar crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in minutes. - :type crash_consistent_frequency_in_minutes: int - :param recovery_point_threshold_in_minutes: The recovery point threshold in minutes. - :type recovery_point_threshold_in_minutes: int - :param recovery_point_history: The duration in minutes until which the recovery points need to + :vartype crash_consistent_frequency_in_minutes: int + :ivar recovery_point_threshold_in_minutes: The recovery point threshold in minutes. + :vartype recovery_point_threshold_in_minutes: int + :ivar recovery_point_history: The duration in minutes until which the recovery points need to be stored. - :type recovery_point_history: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. - :type multi_vm_sync_status: str + :vartype recovery_point_history: int + :ivar app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. + :vartype app_consistent_frequency_in_minutes: int + :ivar multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. + :vartype multi_vm_sync_status: str """ _validation = { @@ -8925,6 +11413,20 @@ def __init__( multi_vm_sync_status: Optional[str] = None, **kwargs ): + """ + :keyword crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in + minutes. + :paramtype crash_consistent_frequency_in_minutes: int + :keyword recovery_point_threshold_in_minutes: The recovery point threshold in minutes. + :paramtype recovery_point_threshold_in_minutes: int + :keyword recovery_point_history: The duration in minutes until which the recovery points need + to be stored. + :paramtype recovery_point_history: int + :keyword app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. + :paramtype app_consistent_frequency_in_minutes: int + :keyword multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. + :paramtype multi_vm_sync_status: str + """ super(InMageAzureV2PolicyDetails, self).__init__(**kwargs) self.instance_type = 'InMageAzureV2' # type: str self.crash_consistent_frequency_in_minutes = crash_consistent_frequency_in_minutes @@ -8939,21 +11441,21 @@ class InMageAzureV2PolicyInput(PolicyProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_threshold_in_minutes: The recovery point threshold in minutes. - :type recovery_point_threshold_in_minutes: int - :param recovery_point_history: The duration in minutes until which the recovery points need to + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_threshold_in_minutes: The recovery point threshold in minutes. + :vartype recovery_point_threshold_in_minutes: int + :ivar recovery_point_history: The duration in minutes until which the recovery points need to be stored. - :type recovery_point_history: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in + :vartype recovery_point_history: int + :ivar crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in minutes). - :type crash_consistent_frequency_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be + :vartype crash_consistent_frequency_in_minutes: int + :ivar app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). + :vartype app_consistent_frequency_in_minutes: int + :ivar multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: "Enable", "Disable". - :type multi_vm_sync_status: str or + :vartype multi_vm_sync_status: str or ~azure.mgmt.recoveryservicessiterecovery.models.SetMultiVmSyncStatus """ @@ -8981,6 +11483,23 @@ def __init__( app_consistent_frequency_in_minutes: Optional[int] = None, **kwargs ): + """ + :keyword recovery_point_threshold_in_minutes: The recovery point threshold in minutes. + :paramtype recovery_point_threshold_in_minutes: int + :keyword recovery_point_history: The duration in minutes until which the recovery points need + to be stored. + :paramtype recovery_point_history: int + :keyword crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in + minutes). + :paramtype crash_consistent_frequency_in_minutes: int + :keyword app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in + minutes). + :paramtype app_consistent_frequency_in_minutes: int + :keyword multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be + enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: "Enable", "Disable". + :paramtype multi_vm_sync_status: str or + ~azure.mgmt.recoveryservicessiterecovery.models.SetMultiVmSyncStatus + """ super(InMageAzureV2PolicyInput, self).__init__(**kwargs) self.instance_type = 'InMageAzureV2' # type: str self.recovery_point_threshold_in_minutes = recovery_point_threshold_in_minutes @@ -8993,50 +11512,52 @@ def __init__( class InMageAzureV2ProtectedDiskDetails(msrest.serialization.Model): """InMageAzureV2 protected disk details. - :param disk_id: The disk id. - :type disk_id: str - :param disk_name: The disk name. - :type disk_name: str - :param protection_stage: The protection stage. - :type protection_stage: str - :param health_error_code: The health error code for the disk. - :type health_error_code: str - :param rpo_in_seconds: The RPO in seconds. - :type rpo_in_seconds: long - :param resync_required: A value indicating whether resync is required for this disk. - :type resync_required: str - :param resync_progress_percentage: The resync progress percentage. - :type resync_progress_percentage: int - :param resync_duration_in_seconds: The resync duration in seconds. - :type resync_duration_in_seconds: long - :param disk_capacity_in_bytes: The disk capacity in bytes. - :type disk_capacity_in_bytes: long - :param file_system_capacity_in_bytes: The disk file system capacity in bytes. - :type file_system_capacity_in_bytes: long - :param source_data_in_mega_bytes: The source data transit in MB. - :type source_data_in_mega_bytes: float - :param ps_data_in_mega_bytes: The PS data transit in MB. - :type ps_data_in_mega_bytes: float - :param target_data_in_mega_bytes: The target data transit in MB. - :type target_data_in_mega_bytes: float - :param disk_resized: A value indicating whether disk is resized. - :type disk_resized: str - :param last_rpo_calculated_time: The last RPO calculated time. - :type last_rpo_calculated_time: ~datetime.datetime - :param resync_processed_bytes: The resync processed bytes. - :type resync_processed_bytes: long - :param resync_total_transferred_bytes: The resync total transferred bytes. - :type resync_total_transferred_bytes: long - :param resync_last15_minutes_transferred_bytes: The resync last 15 minutes transferred bytes. - :type resync_last15_minutes_transferred_bytes: long - :param resync_last_data_transfer_time_utc: The last data transfer time in UTC. - :type resync_last_data_transfer_time_utc: ~datetime.datetime - :param resync_start_time: The resync start time. - :type resync_start_time: ~datetime.datetime - :param progress_health: The Progress Health. - :type progress_health: str - :param progress_status: The Progress Status. - :type progress_status: str + :ivar disk_id: The disk id. + :vartype disk_id: str + :ivar disk_name: The disk name. + :vartype disk_name: str + :ivar protection_stage: The protection stage. + :vartype protection_stage: str + :ivar health_error_code: The health error code for the disk. + :vartype health_error_code: str + :ivar rpo_in_seconds: The RPO in seconds. + :vartype rpo_in_seconds: long + :ivar resync_required: A value indicating whether resync is required for this disk. + :vartype resync_required: str + :ivar resync_progress_percentage: The resync progress percentage. + :vartype resync_progress_percentage: int + :ivar resync_duration_in_seconds: The resync duration in seconds. + :vartype resync_duration_in_seconds: long + :ivar disk_capacity_in_bytes: The disk capacity in bytes. + :vartype disk_capacity_in_bytes: long + :ivar file_system_capacity_in_bytes: The disk file system capacity in bytes. + :vartype file_system_capacity_in_bytes: long + :ivar source_data_in_mega_bytes: The source data transit in MB. + :vartype source_data_in_mega_bytes: float + :ivar ps_data_in_mega_bytes: The PS data transit in MB. + :vartype ps_data_in_mega_bytes: float + :ivar target_data_in_mega_bytes: The target data transit in MB. + :vartype target_data_in_mega_bytes: float + :ivar disk_resized: A value indicating whether disk is resized. + :vartype disk_resized: str + :ivar last_rpo_calculated_time: The last RPO calculated time. + :vartype last_rpo_calculated_time: ~datetime.datetime + :ivar resync_processed_bytes: The resync processed bytes. + :vartype resync_processed_bytes: long + :ivar resync_total_transferred_bytes: The resync total transferred bytes. + :vartype resync_total_transferred_bytes: long + :ivar resync_last15_minutes_transferred_bytes: The resync last 15 minutes transferred bytes. + :vartype resync_last15_minutes_transferred_bytes: long + :ivar resync_last_data_transfer_time_utc: The last data transfer time in UTC. + :vartype resync_last_data_transfer_time_utc: ~datetime.datetime + :ivar resync_start_time: The resync start time. + :vartype resync_start_time: ~datetime.datetime + :ivar progress_health: The Progress Health. + :vartype progress_health: str + :ivar progress_status: The Progress Status. + :vartype progress_status: str + :ivar seconds_to_take_switch_provider: The seconds to take for switch provider. + :vartype seconds_to_take_switch_provider: long """ _attribute_map = { @@ -9062,6 +11583,7 @@ class InMageAzureV2ProtectedDiskDetails(msrest.serialization.Model): 'resync_start_time': {'key': 'resyncStartTime', 'type': 'iso-8601'}, 'progress_health': {'key': 'progressHealth', 'type': 'str'}, 'progress_status': {'key': 'progressStatus', 'type': 'str'}, + 'seconds_to_take_switch_provider': {'key': 'secondsToTakeSwitchProvider', 'type': 'long'}, } def __init__( @@ -9089,8 +11611,57 @@ def __init__( resync_start_time: Optional[datetime.datetime] = None, progress_health: Optional[str] = None, progress_status: Optional[str] = None, - **kwargs - ): + seconds_to_take_switch_provider: Optional[int] = None, + **kwargs + ): + """ + :keyword disk_id: The disk id. + :paramtype disk_id: str + :keyword disk_name: The disk name. + :paramtype disk_name: str + :keyword protection_stage: The protection stage. + :paramtype protection_stage: str + :keyword health_error_code: The health error code for the disk. + :paramtype health_error_code: str + :keyword rpo_in_seconds: The RPO in seconds. + :paramtype rpo_in_seconds: long + :keyword resync_required: A value indicating whether resync is required for this disk. + :paramtype resync_required: str + :keyword resync_progress_percentage: The resync progress percentage. + :paramtype resync_progress_percentage: int + :keyword resync_duration_in_seconds: The resync duration in seconds. + :paramtype resync_duration_in_seconds: long + :keyword disk_capacity_in_bytes: The disk capacity in bytes. + :paramtype disk_capacity_in_bytes: long + :keyword file_system_capacity_in_bytes: The disk file system capacity in bytes. + :paramtype file_system_capacity_in_bytes: long + :keyword source_data_in_mega_bytes: The source data transit in MB. + :paramtype source_data_in_mega_bytes: float + :keyword ps_data_in_mega_bytes: The PS data transit in MB. + :paramtype ps_data_in_mega_bytes: float + :keyword target_data_in_mega_bytes: The target data transit in MB. + :paramtype target_data_in_mega_bytes: float + :keyword disk_resized: A value indicating whether disk is resized. + :paramtype disk_resized: str + :keyword last_rpo_calculated_time: The last RPO calculated time. + :paramtype last_rpo_calculated_time: ~datetime.datetime + :keyword resync_processed_bytes: The resync processed bytes. + :paramtype resync_processed_bytes: long + :keyword resync_total_transferred_bytes: The resync total transferred bytes. + :paramtype resync_total_transferred_bytes: long + :keyword resync_last15_minutes_transferred_bytes: The resync last 15 minutes transferred bytes. + :paramtype resync_last15_minutes_transferred_bytes: long + :keyword resync_last_data_transfer_time_utc: The last data transfer time in UTC. + :paramtype resync_last_data_transfer_time_utc: ~datetime.datetime + :keyword resync_start_time: The resync start time. + :paramtype resync_start_time: ~datetime.datetime + :keyword progress_health: The Progress Health. + :paramtype progress_health: str + :keyword progress_status: The Progress Status. + :paramtype progress_status: str + :keyword seconds_to_take_switch_provider: The seconds to take for switch provider. + :paramtype seconds_to_take_switch_provider: long + """ super(InMageAzureV2ProtectedDiskDetails, self).__init__(**kwargs) self.disk_id = disk_id self.disk_name = disk_name @@ -9114,6 +11685,7 @@ def __init__( self.resync_start_time = resync_start_time self.progress_health = progress_health self.progress_status = progress_status + self.seconds_to_take_switch_provider = seconds_to_take_switch_provider class InMageAzureV2RecoveryPointDetails(ProviderSpecificRecoveryPointDetails): @@ -9121,11 +11693,11 @@ class InMageAzureV2RecoveryPointDetails(ProviderSpecificRecoveryPointDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the provider type.Constant filled by server. - :type instance_type: str - :param is_multi_vm_sync_point: A value indicating whether the recovery point is multi VM + :ivar instance_type: Required. Gets the provider type.Constant filled by server. + :vartype instance_type: str + :ivar is_multi_vm_sync_point: A value indicating whether the recovery point is multi VM consistent. - :type is_multi_vm_sync_point: str + :vartype is_multi_vm_sync_point: str """ _validation = { @@ -9143,6 +11715,11 @@ def __init__( is_multi_vm_sync_point: Optional[str] = None, **kwargs ): + """ + :keyword is_multi_vm_sync_point: A value indicating whether the recovery point is multi VM + consistent. + :paramtype is_multi_vm_sync_point: str + """ super(InMageAzureV2RecoveryPointDetails, self).__init__(**kwargs) self.instance_type = 'InMageAzureV2' # type: str self.is_multi_vm_sync_point = is_multi_vm_sync_point @@ -9155,153 +11732,158 @@ class InMageAzureV2ReplicationDetails(ReplicationProviderSpecificSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param infrastructure_vm_id: The infrastructure VM Id. - :type infrastructure_vm_id: str - :param v_center_infrastructure_id: The vCenter infrastructure Id. - :type v_center_infrastructure_id: str - :param protection_stage: The protection stage. - :type protection_stage: str - :param vm_id: The virtual machine Id. - :type vm_id: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param resync_progress_percentage: The resync progress percentage. - :type resync_progress_percentage: int - :param rpo_in_seconds: The RPO in seconds. - :type rpo_in_seconds: long - :param compressed_data_rate_in_mb: The compressed data change rate in MB. - :type compressed_data_rate_in_mb: float - :param uncompressed_data_rate_in_mb: The uncompressed data change rate in MB. - :type uncompressed_data_rate_in_mb: float - :param ip_address: The source IP address. - :type ip_address: str - :param agent_version: The agent version. - :type agent_version: str - :param agent_expiry_date: Agent expiry date. - :type agent_expiry_date: ~datetime.datetime - :param is_agent_update_required: A value indicating whether installed agent needs to be - updated. - :type is_agent_update_required: str - :param is_reboot_after_update_required: A value indicating whether the source server requires a + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str + :ivar infrastructure_vm_id: The infrastructure VM Id. + :vartype infrastructure_vm_id: str + :ivar v_center_infrastructure_id: The vCenter infrastructure Id. + :vartype v_center_infrastructure_id: str + :ivar protection_stage: The protection stage. + :vartype protection_stage: str + :ivar vm_id: The virtual machine Id. + :vartype vm_id: str + :ivar vm_protection_state: The protection state for the vm. + :vartype vm_protection_state: str + :ivar vm_protection_state_description: The protection state description for the vm. + :vartype vm_protection_state_description: str + :ivar resync_progress_percentage: The resync progress percentage. + :vartype resync_progress_percentage: int + :ivar rpo_in_seconds: The RPO in seconds. + :vartype rpo_in_seconds: long + :ivar compressed_data_rate_in_mb: The compressed data change rate in MB. + :vartype compressed_data_rate_in_mb: float + :ivar uncompressed_data_rate_in_mb: The uncompressed data change rate in MB. + :vartype uncompressed_data_rate_in_mb: float + :ivar ip_address: The source IP address. + :vartype ip_address: str + :ivar agent_version: The agent version. + :vartype agent_version: str + :ivar agent_expiry_date: Agent expiry date. + :vartype agent_expiry_date: ~datetime.datetime + :ivar is_agent_update_required: A value indicating whether installed agent needs to be updated. + :vartype is_agent_update_required: str + :ivar is_reboot_after_update_required: A value indicating whether the source server requires a restart after update. - :type is_reboot_after_update_required: str - :param last_heartbeat: The last heartbeat received from the source server. - :type last_heartbeat: ~datetime.datetime - :param process_server_id: The process server Id. - :type process_server_id: str - :param process_server_name: The process server name. - :type process_server_name: str - :param multi_vm_group_id: The multi vm group Id. - :type multi_vm_group_id: str - :param multi_vm_group_name: The multi vm group name. - :type multi_vm_group_name: str - :param multi_vm_sync_status: A value indicating whether multi vm sync is enabled or disabled. - :type multi_vm_sync_status: str - :param protected_disks: The list of protected disks. - :type protected_disks: + :vartype is_reboot_after_update_required: str + :ivar last_heartbeat: The last heartbeat received from the source server. + :vartype last_heartbeat: ~datetime.datetime + :ivar process_server_id: The process server Id. + :vartype process_server_id: str + :ivar process_server_name: The process server name. + :vartype process_server_name: str + :ivar multi_vm_group_id: The multi vm group Id. + :vartype multi_vm_group_id: str + :ivar multi_vm_group_name: The multi vm group name. + :vartype multi_vm_group_name: str + :ivar multi_vm_sync_status: A value indicating whether multi vm sync is enabled or disabled. + :vartype multi_vm_sync_status: str + :ivar protected_disks: The list of protected disks. + :vartype protected_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageAzureV2ProtectedDiskDetails] - :param disk_resized: A value indicating whether any disk is resized for this VM. - :type disk_resized: str - :param master_target_id: The master target Id. - :type master_target_id: str - :param source_vm_cpu_count: The CPU count of the VM on the primary side. - :type source_vm_cpu_count: int - :param source_vm_ram_size_in_mb: The RAM size of the VM on the primary side. - :type source_vm_ram_size_in_mb: int - :param os_type: The type of the OS on the VM. - :type os_type: str - :param vhd_name: The OS disk VHD name. - :type vhd_name: str - :param os_disk_id: The id of the disk containing the OS. - :type os_disk_id: str - :param azure_vm_disk_details: Azure VM Disk details. - :type azure_vm_disk_details: + :ivar disk_resized: A value indicating whether any disk is resized for this VM. + :vartype disk_resized: str + :ivar master_target_id: The master target Id. + :vartype master_target_id: str + :ivar source_vm_cpu_count: The CPU count of the VM on the primary side. + :vartype source_vm_cpu_count: int + :ivar source_vm_ram_size_in_mb: The RAM size of the VM on the primary side. + :vartype source_vm_ram_size_in_mb: int + :ivar os_type: The type of the OS on the VM. + :vartype os_type: str + :ivar vhd_name: The OS disk VHD name. + :vartype vhd_name: str + :ivar os_disk_id: The id of the disk containing the OS. + :vartype os_disk_id: str + :ivar azure_vm_disk_details: Azure VM Disk details. + :vartype azure_vm_disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.AzureVmDiskDetails] - :param recovery_azure_vm_name: Recovery Azure given name. - :type recovery_azure_vm_name: str - :param recovery_azure_vm_size: The Recovery Azure VM size. - :type recovery_azure_vm_size: str - :param recovery_azure_storage_account: The recovery Azure storage account. - :type recovery_azure_storage_account: str - :param recovery_azure_log_storage_account_id: The ARM id of the log storage account used for + :ivar recovery_azure_vm_name: Recovery Azure given name. + :vartype recovery_azure_vm_name: str + :ivar recovery_azure_vm_size: The Recovery Azure VM size. + :vartype recovery_azure_vm_size: str + :ivar recovery_azure_storage_account: The recovery Azure storage account. + :vartype recovery_azure_storage_account: str + :ivar recovery_azure_log_storage_account_id: The ARM id of the log storage account used for replication. This will be set to null if no log storage account was provided during enable protection. - :type recovery_azure_log_storage_account_id: str - :param vm_nics: The PE Network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] - :param selected_recovery_azure_network_id: The selected recovery azure network Id. - :type selected_recovery_azure_network_id: str - :param selected_tfo_azure_network_id: The test failover virtual network. - :type selected_tfo_azure_network_id: str - :param selected_source_nic_id: The selected source nic Id which will be used as the primary nic + :vartype recovery_azure_log_storage_account_id: str + :ivar vm_nics: The PE Network details. + :vartype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] + :ivar selected_recovery_azure_network_id: The selected recovery azure network Id. + :vartype selected_recovery_azure_network_id: str + :ivar selected_tfo_azure_network_id: The test failover virtual network. + :vartype selected_tfo_azure_network_id: str + :ivar selected_source_nic_id: The selected source nic Id which will be used as the primary nic during failover. - :type selected_source_nic_id: str - :param discovery_type: A value indicating the discovery type of the machine. Value can be + :vartype selected_source_nic_id: str + :ivar discovery_type: A value indicating the discovery type of the machine. Value can be vCenter or physical. - :type discovery_type: str - :param enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after + :vartype discovery_type: str + :ivar enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. - :type enable_rdp_on_target_option: str - :param datastores: The datastores of the on-premise machine. Value can be list of strings that + :vartype enable_rdp_on_target_option: str + :ivar datastores: The datastores of the on-premise machine. Value can be list of strings that contain datastore names. - :type datastores: list[str] - :param target_vm_id: The ARM Id of the target Azure VM. This value will be null until the VM is + :vartype datastores: list[str] + :ivar target_vm_id: The ARM Id of the target Azure VM. This value will be null until the VM is failed over. Only after failure it will be populated with the ARM Id of the Azure VM. - :type target_vm_id: str - :param recovery_azure_resource_group_id: The target resource group Id. - :type recovery_azure_resource_group_id: str - :param recovery_availability_set_id: The recovery availability set Id. - :type recovery_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param use_managed_disks: A value indicating whether managed disks should be used during + :vartype target_vm_id: str + :ivar recovery_azure_resource_group_id: The target resource group Id. + :vartype recovery_azure_resource_group_id: str + :ivar recovery_availability_set_id: The recovery availability set Id. + :vartype recovery_availability_set_id: str + :ivar target_availability_zone: The target availability zone. + :vartype target_availability_zone: str + :ivar target_proximity_placement_group_id: The target proximity placement group Id. + :vartype target_proximity_placement_group_id: str + :ivar use_managed_disks: A value indicating whether managed disks should be used during failover. - :type use_managed_disks: str - :param license_type: License Type of the VM to be used. - :type license_type: str - :param sql_server_license_type: The SQL Server license type. - :type sql_server_license_type: str - :param validation_errors: The validation errors of the on-premise machine Value can be list of + :vartype use_managed_disks: str + :ivar license_type: License Type of the VM to be used. + :vartype license_type: str + :ivar sql_server_license_type: The SQL Server license type. + :vartype sql_server_license_type: str + :ivar validation_errors: The validation errors of the on-premise machine Value can be list of validation errors. - :type validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param last_rpo_calculated_time: The last RPO calculated time. - :type last_rpo_calculated_time: ~datetime.datetime - :param last_update_received_time: The last update time received from on-prem components. - :type last_update_received_time: ~datetime.datetime - :param replica_id: The replica id of the protected item. - :type replica_id: str - :param os_version: The OS Version of the protected item. - :type os_version: str - :param protected_managed_disks: The list of protected managed disks. - :type protected_managed_disks: + :vartype validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :ivar last_rpo_calculated_time: The last RPO calculated time. + :vartype last_rpo_calculated_time: ~datetime.datetime + :ivar last_update_received_time: The last update time received from on-prem components. + :vartype last_update_received_time: ~datetime.datetime + :ivar replica_id: The replica id of the protected item. + :vartype replica_id: str + :ivar os_version: The OS Version of the protected item. + :vartype os_version: str + :ivar protected_managed_disks: The list of protected managed disks. + :vartype protected_managed_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageAzureV2ManagedDiskDetails] :ivar last_recovery_point_received: The last recovery point received time. :vartype last_recovery_point_received: ~datetime.datetime - :param firmware_type: The firmware type of this protected item. - :type firmware_type: str - :param azure_vm_generation: The target generation for this protected item. - :type azure_vm_generation: str - :param is_additional_stats_available: A value indicating whether additional IR stats are + :ivar firmware_type: The firmware type of this protected item. + :vartype firmware_type: str + :ivar azure_vm_generation: The target generation for this protected item. + :vartype azure_vm_generation: str + :ivar is_additional_stats_available: A value indicating whether additional IR stats are available or not. - :type is_additional_stats_available: bool - :param total_data_transferred: The total transferred data in bytes. - :type total_data_transferred: long - :param total_progress_health: The progress health. - :type total_progress_health: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param seed_managed_disk_tags: The tags for the seed managed disks. - :type seed_managed_disk_tags: dict[str, str] - :param target_managed_disk_tags: The tags for the target managed disks. - :type target_managed_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] + :vartype is_additional_stats_available: bool + :ivar total_data_transferred: The total transferred data in bytes. + :vartype total_data_transferred: long + :ivar total_progress_health: The progress health. + :vartype total_progress_health: str + :ivar target_vm_tags: The target VM tags. + :vartype target_vm_tags: dict[str, str] + :ivar seed_managed_disk_tags: The tags for the seed managed disks. + :vartype seed_managed_disk_tags: dict[str, str] + :ivar target_managed_disk_tags: The tags for the target managed disks. + :vartype target_managed_disk_tags: dict[str, str] + :ivar target_nic_tags: The tags for the target NICs. + :vartype target_nic_tags: dict[str, str] + :ivar switch_provider_blocking_error_details: The switch provider blocking error information. + :vartype switch_provider_blocking_error_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageAzureV2SwitchProviderBlockingErrorDetails] + :ivar switch_provider_details: The switch provider blocking error information. + :vartype switch_provider_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InMageAzureV2SwitchProviderDetails """ _validation = { @@ -9376,6 +11958,8 @@ class InMageAzureV2ReplicationDetails(ReplicationProviderSpecificSettings): 'seed_managed_disk_tags': {'key': 'seedManagedDiskTags', 'type': '{str}'}, 'target_managed_disk_tags': {'key': 'targetManagedDiskTags', 'type': '{str}'}, 'target_nic_tags': {'key': 'targetNicTags', 'type': '{str}'}, + 'switch_provider_blocking_error_details': {'key': 'switchProviderBlockingErrorDetails', 'type': '[InMageAzureV2SwitchProviderBlockingErrorDetails]'}, + 'switch_provider_details': {'key': 'switchProviderDetails', 'type': 'InMageAzureV2SwitchProviderDetails'}, } def __init__( @@ -9445,8 +12029,162 @@ def __init__( seed_managed_disk_tags: Optional[Dict[str, str]] = None, target_managed_disk_tags: Optional[Dict[str, str]] = None, target_nic_tags: Optional[Dict[str, str]] = None, - **kwargs - ): + switch_provider_blocking_error_details: Optional[List["InMageAzureV2SwitchProviderBlockingErrorDetails"]] = None, + switch_provider_details: Optional["InMageAzureV2SwitchProviderDetails"] = None, + **kwargs + ): + """ + :keyword infrastructure_vm_id: The infrastructure VM Id. + :paramtype infrastructure_vm_id: str + :keyword v_center_infrastructure_id: The vCenter infrastructure Id. + :paramtype v_center_infrastructure_id: str + :keyword protection_stage: The protection stage. + :paramtype protection_stage: str + :keyword vm_id: The virtual machine Id. + :paramtype vm_id: str + :keyword vm_protection_state: The protection state for the vm. + :paramtype vm_protection_state: str + :keyword vm_protection_state_description: The protection state description for the vm. + :paramtype vm_protection_state_description: str + :keyword resync_progress_percentage: The resync progress percentage. + :paramtype resync_progress_percentage: int + :keyword rpo_in_seconds: The RPO in seconds. + :paramtype rpo_in_seconds: long + :keyword compressed_data_rate_in_mb: The compressed data change rate in MB. + :paramtype compressed_data_rate_in_mb: float + :keyword uncompressed_data_rate_in_mb: The uncompressed data change rate in MB. + :paramtype uncompressed_data_rate_in_mb: float + :keyword ip_address: The source IP address. + :paramtype ip_address: str + :keyword agent_version: The agent version. + :paramtype agent_version: str + :keyword agent_expiry_date: Agent expiry date. + :paramtype agent_expiry_date: ~datetime.datetime + :keyword is_agent_update_required: A value indicating whether installed agent needs to be + updated. + :paramtype is_agent_update_required: str + :keyword is_reboot_after_update_required: A value indicating whether the source server requires + a restart after update. + :paramtype is_reboot_after_update_required: str + :keyword last_heartbeat: The last heartbeat received from the source server. + :paramtype last_heartbeat: ~datetime.datetime + :keyword process_server_id: The process server Id. + :paramtype process_server_id: str + :keyword process_server_name: The process server name. + :paramtype process_server_name: str + :keyword multi_vm_group_id: The multi vm group Id. + :paramtype multi_vm_group_id: str + :keyword multi_vm_group_name: The multi vm group name. + :paramtype multi_vm_group_name: str + :keyword multi_vm_sync_status: A value indicating whether multi vm sync is enabled or disabled. + :paramtype multi_vm_sync_status: str + :keyword protected_disks: The list of protected disks. + :paramtype protected_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageAzureV2ProtectedDiskDetails] + :keyword disk_resized: A value indicating whether any disk is resized for this VM. + :paramtype disk_resized: str + :keyword master_target_id: The master target Id. + :paramtype master_target_id: str + :keyword source_vm_cpu_count: The CPU count of the VM on the primary side. + :paramtype source_vm_cpu_count: int + :keyword source_vm_ram_size_in_mb: The RAM size of the VM on the primary side. + :paramtype source_vm_ram_size_in_mb: int + :keyword os_type: The type of the OS on the VM. + :paramtype os_type: str + :keyword vhd_name: The OS disk VHD name. + :paramtype vhd_name: str + :keyword os_disk_id: The id of the disk containing the OS. + :paramtype os_disk_id: str + :keyword azure_vm_disk_details: Azure VM Disk details. + :paramtype azure_vm_disk_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.AzureVmDiskDetails] + :keyword recovery_azure_vm_name: Recovery Azure given name. + :paramtype recovery_azure_vm_name: str + :keyword recovery_azure_vm_size: The Recovery Azure VM size. + :paramtype recovery_azure_vm_size: str + :keyword recovery_azure_storage_account: The recovery Azure storage account. + :paramtype recovery_azure_storage_account: str + :keyword recovery_azure_log_storage_account_id: The ARM id of the log storage account used for + replication. This will be set to null if no log storage account was provided during enable + protection. + :paramtype recovery_azure_log_storage_account_id: str + :keyword vm_nics: The PE Network details. + :paramtype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] + :keyword selected_recovery_azure_network_id: The selected recovery azure network Id. + :paramtype selected_recovery_azure_network_id: str + :keyword selected_tfo_azure_network_id: The test failover virtual network. + :paramtype selected_tfo_azure_network_id: str + :keyword selected_source_nic_id: The selected source nic Id which will be used as the primary + nic during failover. + :paramtype selected_source_nic_id: str + :keyword discovery_type: A value indicating the discovery type of the machine. Value can be + vCenter or physical. + :paramtype discovery_type: str + :keyword enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after + failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + :paramtype enable_rdp_on_target_option: str + :keyword datastores: The datastores of the on-premise machine. Value can be list of strings + that contain datastore names. + :paramtype datastores: list[str] + :keyword target_vm_id: The ARM Id of the target Azure VM. This value will be null until the VM + is failed over. Only after failure it will be populated with the ARM Id of the Azure VM. + :paramtype target_vm_id: str + :keyword recovery_azure_resource_group_id: The target resource group Id. + :paramtype recovery_azure_resource_group_id: str + :keyword recovery_availability_set_id: The recovery availability set Id. + :paramtype recovery_availability_set_id: str + :keyword target_availability_zone: The target availability zone. + :paramtype target_availability_zone: str + :keyword target_proximity_placement_group_id: The target proximity placement group Id. + :paramtype target_proximity_placement_group_id: str + :keyword use_managed_disks: A value indicating whether managed disks should be used during + failover. + :paramtype use_managed_disks: str + :keyword license_type: License Type of the VM to be used. + :paramtype license_type: str + :keyword sql_server_license_type: The SQL Server license type. + :paramtype sql_server_license_type: str + :keyword validation_errors: The validation errors of the on-premise machine Value can be list + of validation errors. + :paramtype validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :keyword last_rpo_calculated_time: The last RPO calculated time. + :paramtype last_rpo_calculated_time: ~datetime.datetime + :keyword last_update_received_time: The last update time received from on-prem components. + :paramtype last_update_received_time: ~datetime.datetime + :keyword replica_id: The replica id of the protected item. + :paramtype replica_id: str + :keyword os_version: The OS Version of the protected item. + :paramtype os_version: str + :keyword protected_managed_disks: The list of protected managed disks. + :paramtype protected_managed_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageAzureV2ManagedDiskDetails] + :keyword firmware_type: The firmware type of this protected item. + :paramtype firmware_type: str + :keyword azure_vm_generation: The target generation for this protected item. + :paramtype azure_vm_generation: str + :keyword is_additional_stats_available: A value indicating whether additional IR stats are + available or not. + :paramtype is_additional_stats_available: bool + :keyword total_data_transferred: The total transferred data in bytes. + :paramtype total_data_transferred: long + :keyword total_progress_health: The progress health. + :paramtype total_progress_health: str + :keyword target_vm_tags: The target VM tags. + :paramtype target_vm_tags: dict[str, str] + :keyword seed_managed_disk_tags: The tags for the seed managed disks. + :paramtype seed_managed_disk_tags: dict[str, str] + :keyword target_managed_disk_tags: The tags for the target managed disks. + :paramtype target_managed_disk_tags: dict[str, str] + :keyword target_nic_tags: The tags for the target NICs. + :paramtype target_nic_tags: dict[str, str] + :keyword switch_provider_blocking_error_details: The switch provider blocking error + information. + :paramtype switch_provider_blocking_error_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageAzureV2SwitchProviderBlockingErrorDetails] + :keyword switch_provider_details: The switch provider blocking error information. + :paramtype switch_provider_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InMageAzureV2SwitchProviderDetails + """ super(InMageAzureV2ReplicationDetails, self).__init__(**kwargs) self.instance_type = 'InMageAzureV2' # type: str self.infrastructure_vm_id = infrastructure_vm_id @@ -9514,6 +12252,8 @@ def __init__( self.seed_managed_disk_tags = seed_managed_disk_tags self.target_managed_disk_tags = target_managed_disk_tags self.target_nic_tags = target_nic_tags + self.switch_provider_blocking_error_details = switch_provider_blocking_error_details + self.switch_provider_details = switch_provider_details class InMageAzureV2ReprotectInput(ReverseReplicationProviderSpecificInput): @@ -9521,22 +12261,22 @@ class InMageAzureV2ReprotectInput(ReverseReplicationProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param master_target_id: The Master target Id. - :type master_target_id: str - :param process_server_id: The Process Server Id. - :type process_server_id: str - :param storage_account_id: The storage account id. - :type storage_account_id: str - :param run_as_account_id: The CS account Id. - :type run_as_account_id: str - :param policy_id: The Policy Id. - :type policy_id: str - :param log_storage_account_id: The storage account to be used for logging during replication. - :type log_storage_account_id: str - :param disks_to_include: The disks to include list. - :type disks_to_include: list[str] + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar master_target_id: The Master target Id. + :vartype master_target_id: str + :ivar process_server_id: The Process Server Id. + :vartype process_server_id: str + :ivar storage_account_id: The storage account id. + :vartype storage_account_id: str + :ivar run_as_account_id: The CS account Id. + :vartype run_as_account_id: str + :ivar policy_id: The Policy Id. + :vartype policy_id: str + :ivar log_storage_account_id: The storage account to be used for logging during replication. + :vartype log_storage_account_id: str + :ivar disks_to_include: The disks to include list. + :vartype disks_to_include: list[str] """ _validation = { @@ -9566,6 +12306,22 @@ def __init__( disks_to_include: Optional[List[str]] = None, **kwargs ): + """ + :keyword master_target_id: The Master target Id. + :paramtype master_target_id: str + :keyword process_server_id: The Process Server Id. + :paramtype process_server_id: str + :keyword storage_account_id: The storage account id. + :paramtype storage_account_id: str + :keyword run_as_account_id: The CS account Id. + :paramtype run_as_account_id: str + :keyword policy_id: The Policy Id. + :paramtype policy_id: str + :keyword log_storage_account_id: The storage account to be used for logging during replication. + :paramtype log_storage_account_id: str + :keyword disks_to_include: The disks to include list. + :paramtype disks_to_include: list[str] + """ super(InMageAzureV2ReprotectInput, self).__init__(**kwargs) self.instance_type = 'InMageAzureV2' # type: str self.master_target_id = master_target_id @@ -9577,16 +12333,196 @@ def __init__( self.disks_to_include = disks_to_include +class InMageAzureV2SwitchProviderBlockingErrorDetails(msrest.serialization.Model): + """InMageAzureV2 switch provider blocking error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: The error code. + :vartype error_code: str + :ivar error_message: The error message. + :vartype error_message: str + :ivar possible_causes: The possible causes. + :vartype possible_causes: str + :ivar recommended_action: The recommended action. + :vartype recommended_action: str + :ivar error_message_parameters: The error message parameters. + :vartype error_message_parameters: dict[str, str] + :ivar error_tags: The error tags. + :vartype error_tags: dict[str, str] + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'possible_causes': {'readonly': True}, + 'recommended_action': {'readonly': True}, + 'error_message_parameters': {'readonly': True}, + 'error_tags': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'possible_causes': {'key': 'possibleCauses', 'type': 'str'}, + 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, + 'error_message_parameters': {'key': 'errorMessageParameters', 'type': '{str}'}, + 'error_tags': {'key': 'errorTags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(InMageAzureV2SwitchProviderBlockingErrorDetails, self).__init__(**kwargs) + self.error_code = None + self.error_message = None + self.possible_causes = None + self.recommended_action = None + self.error_message_parameters = None + self.error_tags = None + + +class InMageAzureV2SwitchProviderDetails(msrest.serialization.Model): + """InMageAzureV2 switch provider details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar target_vault_id: The target vault Id. + :vartype target_vault_id: str + :ivar target_resource_id: The target resource Id. + :vartype target_resource_id: str + :ivar target_fabric_id: The target fabric Id. + :vartype target_fabric_id: str + :ivar target_appliance_id: The target appliance Id. + :vartype target_appliance_id: str + """ + + _validation = { + 'target_vault_id': {'readonly': True}, + 'target_resource_id': {'readonly': True}, + 'target_fabric_id': {'readonly': True}, + 'target_appliance_id': {'readonly': True}, + } + + _attribute_map = { + 'target_vault_id': {'key': 'targetVaultId', 'type': 'str'}, + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'target_fabric_id': {'key': 'targetFabricId', 'type': 'str'}, + 'target_appliance_id': {'key': 'targetApplianceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(InMageAzureV2SwitchProviderDetails, self).__init__(**kwargs) + self.target_vault_id = None + self.target_resource_id = None + self.target_fabric_id = None + self.target_appliance_id = None + + +class SwitchProviderSpecificInput(msrest.serialization.Model): + """Provider specific switch provider input. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: InMageAzureV2SwitchProviderInput. + + All required parameters must be populated in order to send to Azure. + + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + """ + + _validation = { + 'instance_type': {'required': True}, + } + + _attribute_map = { + 'instance_type': {'key': 'instanceType', 'type': 'str'}, + } + + _subtype_map = { + 'instance_type': {'InMageAzureV2': 'InMageAzureV2SwitchProviderInput'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SwitchProviderSpecificInput, self).__init__(**kwargs) + self.instance_type = None # type: Optional[str] + + +class InMageAzureV2SwitchProviderInput(SwitchProviderSpecificInput): + """Provider specific input for InMageAzureV2 switch provider. + + All required parameters must be populated in order to send to Azure. + + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar target_vault_id: Required. The target vault Id. + :vartype target_vault_id: str + :ivar target_fabric_id: Required. The target fabric Id. + :vartype target_fabric_id: str + :ivar target_appliance_id: Required. The target appliance Id. + :vartype target_appliance_id: str + """ + + _validation = { + 'instance_type': {'required': True}, + 'target_vault_id': {'required': True}, + 'target_fabric_id': {'required': True}, + 'target_appliance_id': {'required': True}, + } + + _attribute_map = { + 'instance_type': {'key': 'instanceType', 'type': 'str'}, + 'target_vault_id': {'key': 'targetVaultID', 'type': 'str'}, + 'target_fabric_id': {'key': 'targetFabricID', 'type': 'str'}, + 'target_appliance_id': {'key': 'targetApplianceID', 'type': 'str'}, + } + + def __init__( + self, + *, + target_vault_id: str, + target_fabric_id: str, + target_appliance_id: str, + **kwargs + ): + """ + :keyword target_vault_id: Required. The target vault Id. + :paramtype target_vault_id: str + :keyword target_fabric_id: Required. The target fabric Id. + :paramtype target_fabric_id: str + :keyword target_appliance_id: Required. The target appliance Id. + :paramtype target_appliance_id: str + """ + super(InMageAzureV2SwitchProviderInput, self).__init__(**kwargs) + self.instance_type = 'InMageAzureV2' # type: str + self.target_vault_id = target_vault_id + self.target_fabric_id = target_fabric_id + self.target_appliance_id = target_appliance_id + + class InMageAzureV2TestFailoverInput(TestFailoverProviderSpecificInput): """InMageAzureV2 provider specific input for test failover. All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_id: The recovery point id to be passed to test failover to a particular + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_id: The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str + :vartype recovery_point_id: str """ _validation = { @@ -9604,6 +12540,11 @@ def __init__( recovery_point_id: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_id: The recovery point id to be passed to test failover to a particular + recovery point. In case of latest recovery point, null should be passed. + :paramtype recovery_point_id: str + """ super(InMageAzureV2TestFailoverInput, self).__init__(**kwargs) self.instance_type = 'InMageAzureV2' # type: str self.recovery_point_id = recovery_point_id @@ -9614,11 +12555,11 @@ class InMageAzureV2UnplannedFailoverInput(UnplannedFailoverProviderSpecificInput All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_id: The recovery point id to be passed to failover to a particular + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_id: The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str + :vartype recovery_point_id: str """ _validation = { @@ -9636,6 +12577,11 @@ def __init__( recovery_point_id: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_id: The recovery point id to be passed to failover to a particular + recovery point. In case of latest recovery point, null should be passed. + :paramtype recovery_point_id: str + """ super(InMageAzureV2UnplannedFailoverInput, self).__init__(**kwargs) self.instance_type = 'InMageAzureV2' # type: str self.recovery_point_id = recovery_point_id @@ -9646,33 +12592,33 @@ class InMageAzureV2UpdateReplicationProtectedItemInput(UpdateReplicationProtecte All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_azure_v1_resource_group_id: The recovery Azure resource group Id for classic + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_azure_v1_resource_group_id: The recovery Azure resource group Id for classic deployment. - :type recovery_azure_v1_resource_group_id: str - :param recovery_azure_v2_resource_group_id: The recovery Azure resource group Id for resource + :vartype recovery_azure_v1_resource_group_id: str + :ivar recovery_azure_v2_resource_group_id: The recovery Azure resource group Id for resource manager deployment. - :type recovery_azure_v2_resource_group_id: str - :param use_managed_disks: A value indicating whether managed disks should be used during + :vartype recovery_azure_v2_resource_group_id: str + :ivar use_managed_disks: A value indicating whether managed disks should be used during failover. - :type use_managed_disks: str - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param target_managed_disk_tags: The tags for the target managed disks. - :type target_managed_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] - :param sql_server_license_type: The SQL Server license type. Possible values include: + :vartype use_managed_disks: str + :ivar target_proximity_placement_group_id: The target proximity placement group Id. + :vartype target_proximity_placement_group_id: str + :ivar target_availability_zone: The target availability zone. + :vartype target_availability_zone: str + :ivar target_vm_tags: The target VM tags. + :vartype target_vm_tags: dict[str, str] + :ivar target_managed_disk_tags: The tags for the target managed disks. + :vartype target_managed_disk_tags: dict[str, str] + :ivar target_nic_tags: The tags for the target NICs. + :vartype target_nic_tags: dict[str, str] + :ivar sql_server_license_type: The SQL Server license type. Possible values include: "NotSpecified", "NoLicenseType", "PAYG", "AHUB". - :type sql_server_license_type: str or + :vartype sql_server_license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType - :param vm_disks: The list of disk update properties. - :type vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.UpdateDiskInput] + :ivar vm_disks: The list of disk update properties. + :vartype vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.UpdateDiskInput] """ _validation = { @@ -9708,6 +12654,33 @@ def __init__( vm_disks: Optional[List["UpdateDiskInput"]] = None, **kwargs ): + """ + :keyword recovery_azure_v1_resource_group_id: The recovery Azure resource group Id for classic + deployment. + :paramtype recovery_azure_v1_resource_group_id: str + :keyword recovery_azure_v2_resource_group_id: The recovery Azure resource group Id for resource + manager deployment. + :paramtype recovery_azure_v2_resource_group_id: str + :keyword use_managed_disks: A value indicating whether managed disks should be used during + failover. + :paramtype use_managed_disks: str + :keyword target_proximity_placement_group_id: The target proximity placement group Id. + :paramtype target_proximity_placement_group_id: str + :keyword target_availability_zone: The target availability zone. + :paramtype target_availability_zone: str + :keyword target_vm_tags: The target VM tags. + :paramtype target_vm_tags: dict[str, str] + :keyword target_managed_disk_tags: The tags for the target managed disks. + :paramtype target_managed_disk_tags: dict[str, str] + :keyword target_nic_tags: The tags for the target NICs. + :paramtype target_nic_tags: dict[str, str] + :keyword sql_server_license_type: The SQL Server license type. Possible values include: + "NotSpecified", "NoLicenseType", "PAYG", "AHUB". + :paramtype sql_server_license_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType + :keyword vm_disks: The list of disk update properties. + :paramtype vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.UpdateDiskInput] + """ super(InMageAzureV2UpdateReplicationProtectedItemInput, self).__init__(**kwargs) self.instance_type = 'InMageAzureV2' # type: str self.recovery_azure_v1_resource_group_id = recovery_azure_v1_resource_group_id @@ -9727,18 +12700,18 @@ class InMageBasePolicyDetails(PolicyProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param recovery_point_threshold_in_minutes: The recovery point threshold in minutes. - :type recovery_point_threshold_in_minutes: int - :param recovery_point_history: The duration in minutes until which the recovery points need to + :vartype instance_type: str + :ivar recovery_point_threshold_in_minutes: The recovery point threshold in minutes. + :vartype recovery_point_threshold_in_minutes: int + :ivar recovery_point_history: The duration in minutes until which the recovery points need to be stored. - :type recovery_point_history: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. - :type multi_vm_sync_status: str + :vartype recovery_point_history: int + :ivar app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. + :vartype app_consistent_frequency_in_minutes: int + :ivar multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. + :vartype multi_vm_sync_status: str """ _validation = { @@ -9762,6 +12735,17 @@ def __init__( multi_vm_sync_status: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_threshold_in_minutes: The recovery point threshold in minutes. + :paramtype recovery_point_threshold_in_minutes: int + :keyword recovery_point_history: The duration in minutes until which the recovery points need + to be stored. + :paramtype recovery_point_history: int + :keyword app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. + :paramtype app_consistent_frequency_in_minutes: int + :keyword multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. + :paramtype multi_vm_sync_status: str + """ super(InMageBasePolicyDetails, self).__init__(**kwargs) self.instance_type = 'InMageBasePolicyDetails' # type: str self.recovery_point_threshold_in_minutes = recovery_point_threshold_in_minutes @@ -9775,11 +12759,11 @@ class InMageDisableProtectionProviderSpecificInput(DisableProtectionProviderSpec All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param replica_vm_deletion_status: A value indicating whether the replica VM should be - destroyed or retained. Values from Delete and Retain. - :type replica_vm_deletion_status: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar replica_vm_deletion_status: A value indicating whether the replica VM should be destroyed + or retained. Values from Delete and Retain. + :vartype replica_vm_deletion_status: str """ _validation = { @@ -9797,6 +12781,11 @@ def __init__( replica_vm_deletion_status: Optional[str] = None, **kwargs ): + """ + :keyword replica_vm_deletion_status: A value indicating whether the replica VM should be + destroyed or retained. Values from Delete and Retain. + :paramtype replica_vm_deletion_status: str + """ super(InMageDisableProtectionProviderSpecificInput, self).__init__(**kwargs) self.instance_type = 'InMage' # type: str self.replica_vm_deletion_status = replica_vm_deletion_status @@ -9805,18 +12794,18 @@ def __init__( class InMageDiskDetails(msrest.serialization.Model): """VMware/Physical specific Disk Details. - :param disk_id: The disk Id. - :type disk_id: str - :param disk_name: The disk name. - :type disk_name: str - :param disk_size_in_mb: The disk size in MB. - :type disk_size_in_mb: str - :param disk_type: Whether disk is system disk or data disk. - :type disk_type: str - :param disk_configuration: Whether disk is dynamic disk or basic disk. - :type disk_configuration: str - :param volume_list: Volumes of the disk. - :type volume_list: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskVolumeDetails] + :ivar disk_id: The disk Id. + :vartype disk_id: str + :ivar disk_name: The disk name. + :vartype disk_name: str + :ivar disk_size_in_mb: The disk size in MB. + :vartype disk_size_in_mb: str + :ivar disk_type: Whether disk is system disk or data disk. + :vartype disk_type: str + :ivar disk_configuration: Whether disk is dynamic disk or basic disk. + :vartype disk_configuration: str + :ivar volume_list: Volumes of the disk. + :vartype volume_list: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskVolumeDetails] """ _attribute_map = { @@ -9839,6 +12828,20 @@ def __init__( volume_list: Optional[List["DiskVolumeDetails"]] = None, **kwargs ): + """ + :keyword disk_id: The disk Id. + :paramtype disk_id: str + :keyword disk_name: The disk name. + :paramtype disk_name: str + :keyword disk_size_in_mb: The disk size in MB. + :paramtype disk_size_in_mb: str + :keyword disk_type: Whether disk is system disk or data disk. + :paramtype disk_type: str + :keyword disk_configuration: Whether disk is dynamic disk or basic disk. + :paramtype disk_configuration: str + :keyword volume_list: Volumes of the disk. + :paramtype volume_list: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskVolumeDetails] + """ super(InMageDiskDetails, self).__init__(**kwargs) self.disk_id = disk_id self.disk_name = disk_name @@ -9851,11 +12854,11 @@ def __init__( class InMageDiskExclusionInput(msrest.serialization.Model): """DiskExclusionInput when doing enable protection of virtual machine in InMage provider. - :param volume_options: The volume label based option for disk exclusion. - :type volume_options: + :ivar volume_options: The volume label based option for disk exclusion. + :vartype volume_options: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageVolumeExclusionOptions] - :param disk_signature_options: The guest disk signature based option for disk exclusion. - :type disk_signature_options: + :ivar disk_signature_options: The guest disk signature based option for disk exclusion. + :vartype disk_signature_options: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageDiskSignatureExclusionOptions] """ @@ -9871,6 +12874,14 @@ def __init__( disk_signature_options: Optional[List["InMageDiskSignatureExclusionOptions"]] = None, **kwargs ): + """ + :keyword volume_options: The volume label based option for disk exclusion. + :paramtype volume_options: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageVolumeExclusionOptions] + :keyword disk_signature_options: The guest disk signature based option for disk exclusion. + :paramtype disk_signature_options: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageDiskSignatureExclusionOptions] + """ super(InMageDiskExclusionInput, self).__init__(**kwargs) self.volume_options = volume_options self.disk_signature_options = disk_signature_options @@ -9879,8 +12890,8 @@ def __init__( class InMageDiskSignatureExclusionOptions(msrest.serialization.Model): """Guest disk signature based disk exclusion option when doing enable protection of virtual machine in InMage provider. - :param disk_signature: The guest signature of disk to be excluded from replication. - :type disk_signature: str + :ivar disk_signature: The guest signature of disk to be excluded from replication. + :vartype disk_signature: str """ _attribute_map = { @@ -9893,6 +12904,10 @@ def __init__( disk_signature: Optional[str] = None, **kwargs ): + """ + :keyword disk_signature: The guest signature of disk to be excluded from replication. + :paramtype disk_signature: str + """ super(InMageDiskSignatureExclusionOptions, self).__init__(**kwargs) self.disk_signature = disk_signature @@ -9902,29 +12917,29 @@ class InMageEnableProtectionInput(EnableProtectionProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param vm_friendly_name: The VM Name. - :type vm_friendly_name: str - :param master_target_id: Required. The Master Target Id. - :type master_target_id: str - :param process_server_id: Required. The Process Server Id. - :type process_server_id: str - :param retention_drive: Required. The retention drive to use on the MT. - :type retention_drive: str - :param run_as_account_id: The CS account Id. - :type run_as_account_id: str - :param multi_vm_group_id: Required. The multi VM group Id. - :type multi_vm_group_id: str - :param multi_vm_group_name: Required. The multi VM group name. - :type multi_vm_group_name: str - :param datastore_name: The target datastore name. - :type datastore_name: str - :param disk_exclusion_input: The enable disk exclusion input. - :type disk_exclusion_input: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar vm_friendly_name: The VM Name. + :vartype vm_friendly_name: str + :ivar master_target_id: Required. The Master Target Id. + :vartype master_target_id: str + :ivar process_server_id: Required. The Process Server Id. + :vartype process_server_id: str + :ivar retention_drive: Required. The retention drive to use on the MT. + :vartype retention_drive: str + :ivar run_as_account_id: The CS account Id. + :vartype run_as_account_id: str + :ivar multi_vm_group_id: Required. The multi VM group Id. + :vartype multi_vm_group_id: str + :ivar multi_vm_group_name: Required. The multi VM group name. + :vartype multi_vm_group_name: str + :ivar datastore_name: The target datastore name. + :vartype datastore_name: str + :ivar disk_exclusion_input: The enable disk exclusion input. + :vartype disk_exclusion_input: ~azure.mgmt.recoveryservicessiterecovery.models.InMageDiskExclusionInput - :param disks_to_include: The disks to include list. - :type disks_to_include: list[str] + :ivar disks_to_include: The disks to include list. + :vartype disks_to_include: list[str] """ _validation = { @@ -9965,6 +12980,29 @@ def __init__( disks_to_include: Optional[List[str]] = None, **kwargs ): + """ + :keyword vm_friendly_name: The VM Name. + :paramtype vm_friendly_name: str + :keyword master_target_id: Required. The Master Target Id. + :paramtype master_target_id: str + :keyword process_server_id: Required. The Process Server Id. + :paramtype process_server_id: str + :keyword retention_drive: Required. The retention drive to use on the MT. + :paramtype retention_drive: str + :keyword run_as_account_id: The CS account Id. + :paramtype run_as_account_id: str + :keyword multi_vm_group_id: Required. The multi VM group Id. + :paramtype multi_vm_group_id: str + :keyword multi_vm_group_name: Required. The multi VM group name. + :paramtype multi_vm_group_name: str + :keyword datastore_name: The target datastore name. + :paramtype datastore_name: str + :keyword disk_exclusion_input: The enable disk exclusion input. + :paramtype disk_exclusion_input: + ~azure.mgmt.recoveryservicessiterecovery.models.InMageDiskExclusionInput + :keyword disks_to_include: The disks to include list. + :paramtype disks_to_include: list[str] + """ super(InMageEnableProtectionInput, self).__init__(**kwargs) self.instance_type = 'InMage' # type: str self.vm_friendly_name = vm_friendly_name @@ -9979,23 +13017,75 @@ def __init__( self.disks_to_include = disks_to_include +class InMageFabricSwitchProviderBlockingErrorDetails(msrest.serialization.Model): + """InMageFabric switch provider blocking error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: The error code. + :vartype error_code: str + :ivar error_message: The error message. + :vartype error_message: str + :ivar possible_causes: The possible causes. + :vartype possible_causes: str + :ivar recommended_action: The recommended action. + :vartype recommended_action: str + :ivar error_message_parameters: The error message parameters. + :vartype error_message_parameters: dict[str, str] + :ivar error_tags: The error tags. + :vartype error_tags: dict[str, str] + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'possible_causes': {'readonly': True}, + 'recommended_action': {'readonly': True}, + 'error_message_parameters': {'readonly': True}, + 'error_tags': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'possible_causes': {'key': 'possibleCauses', 'type': 'str'}, + 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, + 'error_message_parameters': {'key': 'errorMessageParameters', 'type': '{str}'}, + 'error_tags': {'key': 'errorTags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(InMageFabricSwitchProviderBlockingErrorDetails, self).__init__(**kwargs) + self.error_code = None + self.error_message = None + self.possible_causes = None + self.recommended_action = None + self.error_message_parameters = None + self.error_tags = None + + class InMagePolicyDetails(PolicyProviderSpecificDetails): """InMage specific protection profile details. All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param recovery_point_threshold_in_minutes: The recovery point threshold in minutes. - :type recovery_point_threshold_in_minutes: int - :param recovery_point_history: The duration in minutes until which the recovery points need to + :vartype instance_type: str + :ivar recovery_point_threshold_in_minutes: The recovery point threshold in minutes. + :vartype recovery_point_threshold_in_minutes: int + :ivar recovery_point_history: The duration in minutes until which the recovery points need to be stored. - :type recovery_point_history: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. - :type multi_vm_sync_status: str + :vartype recovery_point_history: int + :ivar app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. + :vartype app_consistent_frequency_in_minutes: int + :ivar multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. + :vartype multi_vm_sync_status: str """ _validation = { @@ -10019,6 +13109,17 @@ def __init__( multi_vm_sync_status: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_threshold_in_minutes: The recovery point threshold in minutes. + :paramtype recovery_point_threshold_in_minutes: int + :keyword recovery_point_history: The duration in minutes until which the recovery points need + to be stored. + :paramtype recovery_point_history: int + :keyword app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. + :paramtype app_consistent_frequency_in_minutes: int + :keyword multi_vm_sync_status: A value indicating whether multi-VM sync has to be enabled. + :paramtype multi_vm_sync_status: str + """ super(InMagePolicyDetails, self).__init__(**kwargs) self.instance_type = 'InMage' # type: str self.recovery_point_threshold_in_minutes = recovery_point_threshold_in_minutes @@ -10032,18 +13133,18 @@ class InMagePolicyInput(PolicyProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_threshold_in_minutes: The recovery point threshold in minutes. - :type recovery_point_threshold_in_minutes: int - :param recovery_point_history: The duration in minutes until which the recovery points need to + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_threshold_in_minutes: The recovery point threshold in minutes. + :vartype recovery_point_threshold_in_minutes: int + :ivar recovery_point_history: The duration in minutes until which the recovery points need to be stored. - :type recovery_point_history: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be + :vartype recovery_point_history: int + :ivar app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). + :vartype app_consistent_frequency_in_minutes: int + :ivar multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: "Enable", "Disable". - :type multi_vm_sync_status: str or + :vartype multi_vm_sync_status: str or ~azure.mgmt.recoveryservicessiterecovery.models.SetMultiVmSyncStatus """ @@ -10069,6 +13170,20 @@ def __init__( app_consistent_frequency_in_minutes: Optional[int] = None, **kwargs ): + """ + :keyword recovery_point_threshold_in_minutes: The recovery point threshold in minutes. + :paramtype recovery_point_threshold_in_minutes: int + :keyword recovery_point_history: The duration in minutes until which the recovery points need + to be stored. + :paramtype recovery_point_history: int + :keyword app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in + minutes). + :paramtype app_consistent_frequency_in_minutes: int + :keyword multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be + enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: "Enable", "Disable". + :paramtype multi_vm_sync_status: str or + ~azure.mgmt.recoveryservicessiterecovery.models.SetMultiVmSyncStatus + """ super(InMagePolicyInput, self).__init__(**kwargs) self.instance_type = 'InMage' # type: str self.recovery_point_threshold_in_minutes = recovery_point_threshold_in_minutes @@ -10080,50 +13195,50 @@ def __init__( class InMageProtectedDiskDetails(msrest.serialization.Model): """InMage protected disk details. - :param disk_id: The disk id. - :type disk_id: str - :param disk_name: The disk name. - :type disk_name: str - :param protection_stage: The protection stage. - :type protection_stage: str - :param health_error_code: The health error code for the disk. - :type health_error_code: str - :param rpo_in_seconds: The RPO in seconds. - :type rpo_in_seconds: long - :param resync_required: A value indicating whether resync is required for this disk. - :type resync_required: str - :param resync_progress_percentage: The resync progress percentage. - :type resync_progress_percentage: int - :param resync_duration_in_seconds: The resync duration in seconds. - :type resync_duration_in_seconds: long - :param disk_capacity_in_bytes: The disk capacity in bytes. - :type disk_capacity_in_bytes: long - :param file_system_capacity_in_bytes: The file system capacity in bytes. - :type file_system_capacity_in_bytes: long - :param source_data_in_mb: The source data transit in MB. - :type source_data_in_mb: float - :param ps_data_in_mb: The PS data transit in MB. - :type ps_data_in_mb: float - :param target_data_in_mb: The target data transit in MB. - :type target_data_in_mb: float - :param disk_resized: A value indicating whether disk is resized. - :type disk_resized: str - :param last_rpo_calculated_time: The last RPO calculated time. - :type last_rpo_calculated_time: ~datetime.datetime - :param resync_processed_bytes: The resync processed bytes. - :type resync_processed_bytes: long - :param resync_total_transferred_bytes: The resync total transferred bytes. - :type resync_total_transferred_bytes: long - :param resync_last15_minutes_transferred_bytes: The resync last 15 minutes transferred bytes. - :type resync_last15_minutes_transferred_bytes: long - :param resync_last_data_transfer_time_utc: The last data transfer time in UTC. - :type resync_last_data_transfer_time_utc: ~datetime.datetime - :param resync_start_time: The resync start time. - :type resync_start_time: ~datetime.datetime - :param progress_health: The Progress Health. - :type progress_health: str - :param progress_status: The Progress Status. - :type progress_status: str + :ivar disk_id: The disk id. + :vartype disk_id: str + :ivar disk_name: The disk name. + :vartype disk_name: str + :ivar protection_stage: The protection stage. + :vartype protection_stage: str + :ivar health_error_code: The health error code for the disk. + :vartype health_error_code: str + :ivar rpo_in_seconds: The RPO in seconds. + :vartype rpo_in_seconds: long + :ivar resync_required: A value indicating whether resync is required for this disk. + :vartype resync_required: str + :ivar resync_progress_percentage: The resync progress percentage. + :vartype resync_progress_percentage: int + :ivar resync_duration_in_seconds: The resync duration in seconds. + :vartype resync_duration_in_seconds: long + :ivar disk_capacity_in_bytes: The disk capacity in bytes. + :vartype disk_capacity_in_bytes: long + :ivar file_system_capacity_in_bytes: The file system capacity in bytes. + :vartype file_system_capacity_in_bytes: long + :ivar source_data_in_mb: The source data transit in MB. + :vartype source_data_in_mb: float + :ivar ps_data_in_mb: The PS data transit in MB. + :vartype ps_data_in_mb: float + :ivar target_data_in_mb: The target data transit in MB. + :vartype target_data_in_mb: float + :ivar disk_resized: A value indicating whether disk is resized. + :vartype disk_resized: str + :ivar last_rpo_calculated_time: The last RPO calculated time. + :vartype last_rpo_calculated_time: ~datetime.datetime + :ivar resync_processed_bytes: The resync processed bytes. + :vartype resync_processed_bytes: long + :ivar resync_total_transferred_bytes: The resync total transferred bytes. + :vartype resync_total_transferred_bytes: long + :ivar resync_last15_minutes_transferred_bytes: The resync last 15 minutes transferred bytes. + :vartype resync_last15_minutes_transferred_bytes: long + :ivar resync_last_data_transfer_time_utc: The last data transfer time in UTC. + :vartype resync_last_data_transfer_time_utc: ~datetime.datetime + :ivar resync_start_time: The resync start time. + :vartype resync_start_time: ~datetime.datetime + :ivar progress_health: The Progress Health. + :vartype progress_health: str + :ivar progress_status: The Progress Status. + :vartype progress_status: str """ _attribute_map = { @@ -10178,6 +13293,52 @@ def __init__( progress_status: Optional[str] = None, **kwargs ): + """ + :keyword disk_id: The disk id. + :paramtype disk_id: str + :keyword disk_name: The disk name. + :paramtype disk_name: str + :keyword protection_stage: The protection stage. + :paramtype protection_stage: str + :keyword health_error_code: The health error code for the disk. + :paramtype health_error_code: str + :keyword rpo_in_seconds: The RPO in seconds. + :paramtype rpo_in_seconds: long + :keyword resync_required: A value indicating whether resync is required for this disk. + :paramtype resync_required: str + :keyword resync_progress_percentage: The resync progress percentage. + :paramtype resync_progress_percentage: int + :keyword resync_duration_in_seconds: The resync duration in seconds. + :paramtype resync_duration_in_seconds: long + :keyword disk_capacity_in_bytes: The disk capacity in bytes. + :paramtype disk_capacity_in_bytes: long + :keyword file_system_capacity_in_bytes: The file system capacity in bytes. + :paramtype file_system_capacity_in_bytes: long + :keyword source_data_in_mb: The source data transit in MB. + :paramtype source_data_in_mb: float + :keyword ps_data_in_mb: The PS data transit in MB. + :paramtype ps_data_in_mb: float + :keyword target_data_in_mb: The target data transit in MB. + :paramtype target_data_in_mb: float + :keyword disk_resized: A value indicating whether disk is resized. + :paramtype disk_resized: str + :keyword last_rpo_calculated_time: The last RPO calculated time. + :paramtype last_rpo_calculated_time: ~datetime.datetime + :keyword resync_processed_bytes: The resync processed bytes. + :paramtype resync_processed_bytes: long + :keyword resync_total_transferred_bytes: The resync total transferred bytes. + :paramtype resync_total_transferred_bytes: long + :keyword resync_last15_minutes_transferred_bytes: The resync last 15 minutes transferred bytes. + :paramtype resync_last15_minutes_transferred_bytes: long + :keyword resync_last_data_transfer_time_utc: The last data transfer time in UTC. + :paramtype resync_last_data_transfer_time_utc: ~datetime.datetime + :keyword resync_start_time: The resync start time. + :paramtype resync_start_time: ~datetime.datetime + :keyword progress_health: The Progress Health. + :paramtype progress_health: str + :keyword progress_status: The Progress Status. + :paramtype progress_status: str + """ super(InMageProtectedDiskDetails, self).__init__(**kwargs) self.disk_id = disk_id self.disk_name = disk_name @@ -10244,6 +13405,8 @@ def __init__( self, **kwargs ): + """ + """ super(InMageRcmAgentUpgradeBlockingErrorDetails, self).__init__(**kwargs) self.error_code = None self.error_message = None @@ -10253,15 +13416,130 @@ def __init__( self.error_tags = None +class InMageRcmApplianceDetails(msrest.serialization.Model): + """InMageRcm appliance details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The appliance Id. + :vartype id: str + :ivar name: The appliance name. + :vartype name: str + :ivar fabric_arm_id: The fabric ARM Id. + :vartype fabric_arm_id: str + :ivar process_server: The process server. + :vartype process_server: ~azure.mgmt.recoveryservicessiterecovery.models.ProcessServerDetails + :ivar rcm_proxy: The of RCM proxy. + :vartype rcm_proxy: ~azure.mgmt.recoveryservicessiterecovery.models.RcmProxyDetails + :ivar push_installer: The push installer. + :vartype push_installer: ~azure.mgmt.recoveryservicessiterecovery.models.PushInstallerDetails + :ivar replication_agent: The replication agent. + :vartype replication_agent: + ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationAgentDetails + :ivar reprotect_agent: The reprotect agent. + :vartype reprotect_agent: ~azure.mgmt.recoveryservicessiterecovery.models.ReprotectAgentDetails + :ivar mars_agent: The Mars agent. + :vartype mars_agent: ~azure.mgmt.recoveryservicessiterecovery.models.MarsAgentDetails + :ivar dra: The DRA. + :vartype dra: ~azure.mgmt.recoveryservicessiterecovery.models.DraDetails + :ivar switch_provider_blocking_error_details: The switch provider blocking error information. + :vartype switch_provider_blocking_error_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFabricSwitchProviderBlockingErrorDetails] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'fabric_arm_id': {'readonly': True}, + 'process_server': {'readonly': True}, + 'rcm_proxy': {'readonly': True}, + 'push_installer': {'readonly': True}, + 'replication_agent': {'readonly': True}, + 'reprotect_agent': {'readonly': True}, + 'mars_agent': {'readonly': True}, + 'dra': {'readonly': True}, + 'switch_provider_blocking_error_details': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'fabric_arm_id': {'key': 'fabricArmId', 'type': 'str'}, + 'process_server': {'key': 'processServer', 'type': 'ProcessServerDetails'}, + 'rcm_proxy': {'key': 'rcmProxy', 'type': 'RcmProxyDetails'}, + 'push_installer': {'key': 'pushInstaller', 'type': 'PushInstallerDetails'}, + 'replication_agent': {'key': 'replicationAgent', 'type': 'ReplicationAgentDetails'}, + 'reprotect_agent': {'key': 'reprotectAgent', 'type': 'ReprotectAgentDetails'}, + 'mars_agent': {'key': 'marsAgent', 'type': 'MarsAgentDetails'}, + 'dra': {'key': 'dra', 'type': 'DraDetails'}, + 'switch_provider_blocking_error_details': {'key': 'switchProviderBlockingErrorDetails', 'type': '[InMageRcmFabricSwitchProviderBlockingErrorDetails]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(InMageRcmApplianceDetails, self).__init__(**kwargs) + self.id = None + self.name = None + self.fabric_arm_id = None + self.process_server = None + self.rcm_proxy = None + self.push_installer = None + self.replication_agent = None + self.reprotect_agent = None + self.mars_agent = None + self.dra = None + self.switch_provider_blocking_error_details = None + + +class InMageRcmApplianceSpecificDetails(ApplianceSpecificDetails): + """InMageRcm appliance specific details. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant + filled by server. + :vartype instance_type: str + :ivar appliances: The list of appliances. + :vartype appliances: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmApplianceDetails] + """ + + _validation = { + 'instance_type': {'required': True}, + 'appliances': {'readonly': True}, + } + + _attribute_map = { + 'instance_type': {'key': 'instanceType', 'type': 'str'}, + 'appliances': {'key': 'appliances', 'type': '[InMageRcmApplianceDetails]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(InMageRcmApplianceSpecificDetails, self).__init__(**kwargs) + self.instance_type = 'InMageRcm' # type: str + self.appliances = None + + class InMageRcmApplyRecoveryPointInput(ApplyRecoveryPointProviderSpecificInput): """ApplyRecoveryPoint input specific to InMageRcm provider. All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_id: Required. The recovery point Id. - :type recovery_point_id: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_id: Required. The recovery point Id. + :vartype recovery_point_id: str """ _validation = { @@ -10280,6 +13558,10 @@ def __init__( recovery_point_id: str, **kwargs ): + """ + :keyword recovery_point_id: Required. The recovery point Id. + :paramtype recovery_point_id: str + """ super(InMageRcmApplyRecoveryPointInput, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.recovery_point_id = recovery_point_id @@ -10350,6 +13632,8 @@ def __init__( self, **kwargs ): + """ + """ super(InMageRcmDiscoveredProtectedVmDetails, self).__init__(**kwargs) self.v_center_id = None self.v_center_fqdn = None @@ -10370,15 +13654,15 @@ class InMageRcmDiskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param disk_id: Required. The disk Id. - :type disk_id: str - :param log_storage_account_id: Required. The log storage account ARM Id. - :type log_storage_account_id: str - :param disk_type: Required. The disk type. Possible values include: "Standard_LRS", + :ivar disk_id: Required. The disk Id. + :vartype disk_id: str + :ivar log_storage_account_id: Required. The log storage account ARM Id. + :vartype log_storage_account_id: str + :ivar disk_type: Required. The disk type. Possible values include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :param disk_encryption_set_id: The DiskEncryptionSet ARM Id. - :type disk_encryption_set_id: str + :vartype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :ivar disk_encryption_set_id: The DiskEncryptionSet ARM Id. + :vartype disk_encryption_set_id: str """ _validation = { @@ -10403,6 +13687,17 @@ def __init__( disk_encryption_set_id: Optional[str] = None, **kwargs ): + """ + :keyword disk_id: Required. The disk Id. + :paramtype disk_id: str + :keyword log_storage_account_id: Required. The log storage account ARM Id. + :paramtype log_storage_account_id: str + :keyword disk_type: Required. The disk type. Possible values include: "Standard_LRS", + "Premium_LRS", "StandardSSD_LRS". + :paramtype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :keyword disk_encryption_set_id: The DiskEncryptionSet ARM Id. + :paramtype disk_encryption_set_id: str + """ super(InMageRcmDiskInput, self).__init__(**kwargs) self.disk_id = disk_id self.log_storage_account_id = log_storage_account_id @@ -10415,13 +13710,13 @@ class InMageRcmDisksDefaultInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param log_storage_account_id: Required. The log storage account ARM Id. - :type log_storage_account_id: str - :param disk_type: Required. The disk type. Possible values include: "Standard_LRS", + :ivar log_storage_account_id: Required. The log storage account ARM Id. + :vartype log_storage_account_id: str + :ivar disk_type: Required. The disk type. Possible values include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :param disk_encryption_set_id: The DiskEncryptionSet ARM Id. - :type disk_encryption_set_id: str + :vartype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :ivar disk_encryption_set_id: The DiskEncryptionSet ARM Id. + :vartype disk_encryption_set_id: str """ _validation = { @@ -10443,6 +13738,15 @@ def __init__( disk_encryption_set_id: Optional[str] = None, **kwargs ): + """ + :keyword log_storage_account_id: Required. The log storage account ARM Id. + :paramtype log_storage_account_id: str + :keyword disk_type: Required. The disk type. Possible values include: "Standard_LRS", + "Premium_LRS", "StandardSSD_LRS". + :paramtype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :keyword disk_encryption_set_id: The DiskEncryptionSet ARM Id. + :paramtype disk_encryption_set_id: str + """ super(InMageRcmDisksDefaultInput, self).__init__(**kwargs) self.log_storage_account_id = log_storage_account_id self.disk_type = disk_type @@ -10454,47 +13758,48 @@ class InMageRcmEnableProtectionInput(EnableProtectionProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param fabric_discovery_machine_id: Required. The ARM Id of discovered machine. - :type fabric_discovery_machine_id: str - :param disks_to_include: The disks to include list. - :type disks_to_include: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar fabric_discovery_machine_id: Required. The ARM Id of discovered machine. + :vartype fabric_discovery_machine_id: str + :ivar disks_to_include: The disks to include list. + :vartype disks_to_include: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmDiskInput] - :param disks_default: The default disk input. - :type disks_default: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmDisksDefaultInput - :param target_resource_group_id: Required. The target resource group ARM Id. - :type target_resource_group_id: str - :param target_network_id: The selected target network ARM Id. - :type target_network_id: str - :param test_network_id: The selected test network ARM Id. - :type test_network_id: str - :param target_subnet_name: The selected target subnet name. - :type target_subnet_name: str - :param test_subnet_name: The selected test subnet name. - :type test_subnet_name: str - :param target_vm_name: The target VM name. - :type target_vm_name: str - :param target_vm_size: The target VM size. - :type target_vm_size: str - :param license_type: The license type. Possible values include: "NotSpecified", - "NoLicenseType", "WindowsServer". - :type license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType - :param target_availability_set_id: The target availability set ARM Id. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account + :ivar disks_default: The default disk input. + :vartype disks_default: + ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmDisksDefaultInput + :ivar target_resource_group_id: Required. The target resource group ARM Id. + :vartype target_resource_group_id: str + :ivar target_network_id: The selected target network ARM Id. + :vartype target_network_id: str + :ivar test_network_id: The selected test network ARM Id. + :vartype test_network_id: str + :ivar target_subnet_name: The selected target subnet name. + :vartype target_subnet_name: str + :ivar test_subnet_name: The selected test subnet name. + :vartype test_subnet_name: str + :ivar target_vm_name: The target VM name. + :vartype target_vm_name: str + :ivar target_vm_size: The target VM size. + :vartype target_vm_size: str + :ivar license_type: The license type. Possible values include: "NotSpecified", "NoLicenseType", + "WindowsServer". + :vartype license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType + :ivar target_availability_set_id: The target availability set ARM Id. + :vartype target_availability_set_id: str + :ivar target_availability_zone: The target availability zone. + :vartype target_availability_zone: str + :ivar target_proximity_placement_group_id: The target proximity placement group Id. + :vartype target_proximity_placement_group_id: str + :ivar target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account ARM Id. - :type target_boot_diagnostics_storage_account_id: str - :param run_as_account_id: The run-as account Id. - :type run_as_account_id: str - :param process_server_id: Required. The process server Id. - :type process_server_id: str - :param multi_vm_group_name: The multi VM group name. - :type multi_vm_group_name: str + :vartype target_boot_diagnostics_storage_account_id: str + :ivar run_as_account_id: The run-as account Id. + :vartype run_as_account_id: str + :ivar process_server_id: Required. The process server Id. + :vartype process_server_id: str + :ivar multi_vm_group_name: The multi VM group name. + :vartype multi_vm_group_name: str """ _validation = { @@ -10549,6 +13854,48 @@ def __init__( multi_vm_group_name: Optional[str] = None, **kwargs ): + """ + :keyword fabric_discovery_machine_id: Required. The ARM Id of discovered machine. + :paramtype fabric_discovery_machine_id: str + :keyword disks_to_include: The disks to include list. + :paramtype disks_to_include: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmDiskInput] + :keyword disks_default: The default disk input. + :paramtype disks_default: + ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmDisksDefaultInput + :keyword target_resource_group_id: Required. The target resource group ARM Id. + :paramtype target_resource_group_id: str + :keyword target_network_id: The selected target network ARM Id. + :paramtype target_network_id: str + :keyword test_network_id: The selected test network ARM Id. + :paramtype test_network_id: str + :keyword target_subnet_name: The selected target subnet name. + :paramtype target_subnet_name: str + :keyword test_subnet_name: The selected test subnet name. + :paramtype test_subnet_name: str + :keyword target_vm_name: The target VM name. + :paramtype target_vm_name: str + :keyword target_vm_size: The target VM size. + :paramtype target_vm_size: str + :keyword license_type: The license type. Possible values include: "NotSpecified", + "NoLicenseType", "WindowsServer". + :paramtype license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType + :keyword target_availability_set_id: The target availability set ARM Id. + :paramtype target_availability_set_id: str + :keyword target_availability_zone: The target availability zone. + :paramtype target_availability_zone: str + :keyword target_proximity_placement_group_id: The target proximity placement group Id. + :paramtype target_proximity_placement_group_id: str + :keyword target_boot_diagnostics_storage_account_id: The target boot diagnostics storage + account ARM Id. + :paramtype target_boot_diagnostics_storage_account_id: str + :keyword run_as_account_id: The run-as account Id. + :paramtype run_as_account_id: str + :keyword process_server_id: Required. The process server Id. + :paramtype process_server_id: str + :keyword multi_vm_group_name: The multi VM group name. + :paramtype multi_vm_group_name: str + """ super(InMageRcmEnableProtectionInput, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.fabric_discovery_machine_id = fabric_discovery_machine_id @@ -10578,9 +13925,9 @@ class InMageRcmEventDetails(EventProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str :ivar protected_item_name: The protected item name. :vartype protected_item_name: str :ivar vm_name: The protected item name. @@ -10627,6 +13974,8 @@ def __init__( self, **kwargs ): + """ + """ super(InMageRcmEventDetails, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.protected_item_name = None @@ -10644,15 +13993,15 @@ class InMageRcmFabricCreationInput(FabricSpecificCreationInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type.Constant filled by server. - :type instance_type: str - :param vmware_site_id: Required. The ARM Id of the VMware site. - :type vmware_site_id: str - :param physical_site_id: Required. The ARM Id of the physical site. - :type physical_site_id: str - :param source_agent_identity: Required. The identity provider input for source agent + :ivar instance_type: Required. Gets the class type.Constant filled by server. + :vartype instance_type: str + :ivar vmware_site_id: Required. The ARM Id of the VMware site. + :vartype vmware_site_id: str + :ivar physical_site_id: Required. The ARM Id of the physical site. + :vartype physical_site_id: str + :ivar source_agent_identity: Required. The identity provider input for source agent authentication. - :type source_agent_identity: + :vartype source_agent_identity: ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderInput """ @@ -10678,6 +14027,16 @@ def __init__( source_agent_identity: "IdentityProviderInput", **kwargs ): + """ + :keyword vmware_site_id: Required. The ARM Id of the VMware site. + :paramtype vmware_site_id: str + :keyword physical_site_id: Required. The ARM Id of the physical site. + :paramtype physical_site_id: str + :keyword source_agent_identity: Required. The identity provider input for source agent + authentication. + :paramtype source_agent_identity: + ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderInput + """ super(InMageRcmFabricCreationInput, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.vmware_site_id = vmware_site_id @@ -10692,9 +14051,9 @@ class InMageRcmFabricSpecificDetails(FabricSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str :ivar vmware_site_id: The ARM Id of the VMware site. :vartype vmware_site_id: str :ivar physical_site_id: The ARM Id of the physical site. @@ -10709,8 +14068,8 @@ class InMageRcmFabricSpecificDetails(FabricSpecificDetails): :vartype data_plane_uri: str :ivar control_plane_uri: The control plane Uri. :vartype control_plane_uri: str - :param source_agent_identity_details: The source agent identity details. - :type source_agent_identity_details: + :ivar source_agent_identity_details: The source agent identity details. + :vartype source_agent_identity_details: ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderDetails :ivar process_servers: The list of process servers. :vartype process_servers: @@ -10779,6 +14138,11 @@ def __init__( source_agent_identity_details: Optional["IdentityProviderDetails"] = None, **kwargs ): + """ + :keyword source_agent_identity_details: The source agent identity details. + :paramtype source_agent_identity_details: + ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderDetails + """ super(InMageRcmFabricSpecificDetails, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.vmware_site_id = None @@ -10799,6 +14163,58 @@ def __init__( self.agent_details = None +class InMageRcmFabricSwitchProviderBlockingErrorDetails(msrest.serialization.Model): + """InMageRcmFabric switch provider blocking error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: The error code. + :vartype error_code: str + :ivar error_message: The error message. + :vartype error_message: str + :ivar possible_causes: The possible causes. + :vartype possible_causes: str + :ivar recommended_action: The recommended action. + :vartype recommended_action: str + :ivar error_message_parameters: The error message parameters. + :vartype error_message_parameters: dict[str, str] + :ivar error_tags: The error tags. + :vartype error_tags: dict[str, str] + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_message': {'readonly': True}, + 'possible_causes': {'readonly': True}, + 'recommended_action': {'readonly': True}, + 'error_message_parameters': {'readonly': True}, + 'error_tags': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'possible_causes': {'key': 'possibleCauses', 'type': 'str'}, + 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, + 'error_message_parameters': {'key': 'errorMessageParameters', 'type': '{str}'}, + 'error_tags': {'key': 'errorTags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(InMageRcmFabricSwitchProviderBlockingErrorDetails, self).__init__(**kwargs) + self.error_code = None + self.error_message = None + self.possible_causes = None + self.recommended_action = None + self.error_message_parameters = None + self.error_tags = None + + class InMageRcmFailbackDiscoveredProtectedVmDetails(msrest.serialization.Model): """InMageRcmFailback discovered VM details. @@ -10864,6 +14280,8 @@ def __init__( self, **kwargs ): + """ + """ super(InMageRcmFailbackDiscoveredProtectedVmDetails, self).__init__(**kwargs) self.v_center_id = None self.v_center_fqdn = None @@ -10886,9 +14304,9 @@ class InMageRcmFailbackEventDetails(EventProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str :ivar protected_item_name: The protected item name. :vartype protected_item_name: str :ivar vm_name: The protected item name. @@ -10923,6 +14341,8 @@ def __init__( self, **kwargs ): + """ + """ super(InMageRcmFailbackEventDetails, self).__init__(**kwargs) self.instance_type = 'InMageRcmFailback' # type: str self.protected_item_name = None @@ -10987,6 +14407,8 @@ def __init__( self, **kwargs ): + """ + """ super(InMageRcmFailbackMobilityAgentDetails, self).__init__(**kwargs) self.version = None self.latest_version = None @@ -11032,6 +14454,8 @@ def __init__( self, **kwargs ): + """ + """ super(InMageRcmFailbackNicDetails, self).__init__(**kwargs) self.mac_address = None self.network_name = None @@ -11044,11 +14468,11 @@ class InMageRcmFailbackPlannedFailoverProviderInput(PlannedFailoverProviderSpeci All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: Required. The recovery point type. Possible values include: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_type: Required. The recovery point type. Possible values include: "ApplicationConsistent", "CrashConsistent". - :type recovery_point_type: str or + :vartype recovery_point_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackRecoveryPointType """ @@ -11068,6 +14492,12 @@ def __init__( recovery_point_type: Union[str, "InMageRcmFailbackRecoveryPointType"], **kwargs ): + """ + :keyword recovery_point_type: Required. The recovery point type. Possible values include: + "ApplicationConsistent", "CrashConsistent". + :paramtype recovery_point_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackRecoveryPointType + """ super(InMageRcmFailbackPlannedFailoverProviderInput, self).__init__(**kwargs) self.instance_type = 'InMageRcmFailback' # type: str self.recovery_point_type = recovery_point_type @@ -11078,13 +14508,13 @@ class InMageRcmFailbackPolicyCreationInput(PolicyProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in minutes). - :type crash_consistent_frequency_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). - :type app_consistent_frequency_in_minutes: int + :vartype crash_consistent_frequency_in_minutes: int + :ivar app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). + :vartype app_consistent_frequency_in_minutes: int """ _validation = { @@ -11104,6 +14534,14 @@ def __init__( app_consistent_frequency_in_minutes: Optional[int] = None, **kwargs ): + """ + :keyword crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in + minutes). + :paramtype crash_consistent_frequency_in_minutes: int + :keyword app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in + minutes). + :paramtype app_consistent_frequency_in_minutes: int + """ super(InMageRcmFailbackPolicyCreationInput, self).__init__(**kwargs) self.instance_type = 'InMageRcmFailback' # type: str self.crash_consistent_frequency_in_minutes = crash_consistent_frequency_in_minutes @@ -11115,14 +14553,14 @@ class InMageRcmFailbackPolicyDetails(PolicyProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. - :type app_consistent_frequency_in_minutes: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in + :vartype instance_type: str + :ivar app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. + :vartype app_consistent_frequency_in_minutes: int + :ivar crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in minutes. - :type crash_consistent_frequency_in_minutes: int + :vartype crash_consistent_frequency_in_minutes: int """ _validation = { @@ -11142,6 +14580,13 @@ def __init__( crash_consistent_frequency_in_minutes: Optional[int] = None, **kwargs ): + """ + :keyword app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. + :paramtype app_consistent_frequency_in_minutes: int + :keyword crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in + minutes. + :paramtype crash_consistent_frequency_in_minutes: int + """ super(InMageRcmFailbackPolicyDetails, self).__init__(**kwargs) self.instance_type = 'InMageRcmFailback' # type: str self.app_consistent_frequency_in_minutes = app_consistent_frequency_in_minutes @@ -11170,10 +14615,11 @@ class InMageRcmFailbackProtectedDiskDetails(msrest.serialization.Model): :ivar is_initial_replication_complete: A value indicating whether initial replication is complete or not. :vartype is_initial_replication_complete: str - :param ir_details: The initial replication details. - :type ir_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackSyncDetails - :param resync_details: The resync details. - :type resync_details: + :ivar ir_details: The initial replication details. + :vartype ir_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackSyncDetails + :ivar resync_details: The resync details. + :vartype resync_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackSyncDetails :ivar last_sync_time: The last sync time. :vartype last_sync_time: ~datetime.datetime @@ -11212,6 +14658,14 @@ def __init__( resync_details: Optional["InMageRcmFailbackSyncDetails"] = None, **kwargs ): + """ + :keyword ir_details: The initial replication details. + :paramtype ir_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackSyncDetails + :keyword resync_details: The resync details. + :paramtype resync_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackSyncDetails + """ super(InMageRcmFailbackProtectedDiskDetails, self).__init__(**kwargs) self.disk_id = None self.disk_name = None @@ -11233,8 +14687,8 @@ class InMageRcmFailbackReplicationDetails(ReplicationProviderSpecificSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str :ivar internal_identifier: The virtual machine internal identifier. :vartype internal_identifier: str :ivar azure_virtual_machine_id: The ARM Id of the azure VM. @@ -11284,14 +14738,14 @@ class InMageRcmFailbackReplicationDetails(ReplicationProviderSpecificSettings): :ivar resync_state: The resync state. Possible values include: "None", "PreparedForResynchronization", "StartedResynchronization". :vartype resync_state: str or ~azure.mgmt.recoveryservicessiterecovery.models.ResyncState - :param protected_disks: The list of protected disks. - :type protected_disks: + :ivar protected_disks: The list of protected disks. + :vartype protected_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackProtectedDiskDetails] - :param mobility_agent_details: The mobility agent information. - :type mobility_agent_details: + :ivar mobility_agent_details: The mobility agent information. + :vartype mobility_agent_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackMobilityAgentDetails - :param vm_nics: The network details. - :type vm_nics: + :ivar vm_nics: The network details. + :vartype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackNicDetails] :ivar last_planned_failover_start_time: The last planned failover start time. :vartype last_planned_failover_start_time: ~datetime.datetime @@ -11299,8 +14753,8 @@ class InMageRcmFailbackReplicationDetails(ReplicationProviderSpecificSettings): "Succeeded", "Failed", "Cancelled", "Unknown". :vartype last_planned_failover_status: str or ~azure.mgmt.recoveryservicessiterecovery.models.PlannedFailoverStatus - :param discovered_vm_details: The discovered VM information. - :type discovered_vm_details: + :ivar discovered_vm_details: The discovered VM information. + :vartype discovered_vm_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackDiscoveredProtectedVmDetails :ivar last_used_policy_id: The policy Id used by the forward replication. :vartype last_used_policy_id: str @@ -11382,6 +14836,20 @@ def __init__( discovered_vm_details: Optional["InMageRcmFailbackDiscoveredProtectedVmDetails"] = None, **kwargs ): + """ + :keyword protected_disks: The list of protected disks. + :paramtype protected_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackProtectedDiskDetails] + :keyword mobility_agent_details: The mobility agent information. + :paramtype mobility_agent_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackMobilityAgentDetails + :keyword vm_nics: The network details. + :paramtype vm_nics: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackNicDetails] + :keyword discovered_vm_details: The discovered VM information. + :paramtype discovered_vm_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackDiscoveredProtectedVmDetails + """ super(InMageRcmFailbackReplicationDetails, self).__init__(**kwargs) self.instance_type = 'InMageRcmFailback' # type: str self.internal_identifier = None @@ -11420,14 +14888,14 @@ class InMageRcmFailbackReprotectInput(ReverseReplicationProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param process_server_id: Required. The process server Id. - :type process_server_id: str - :param run_as_account_id: The run as account Id. - :type run_as_account_id: str - :param policy_id: Required. The Policy Id. - :type policy_id: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar process_server_id: Required. The process server Id. + :vartype process_server_id: str + :ivar run_as_account_id: The run as account Id. + :vartype run_as_account_id: str + :ivar policy_id: Required. The Policy Id. + :vartype policy_id: str """ _validation = { @@ -11451,6 +14919,14 @@ def __init__( run_as_account_id: Optional[str] = None, **kwargs ): + """ + :keyword process_server_id: Required. The process server Id. + :paramtype process_server_id: str + :keyword run_as_account_id: The run as account Id. + :paramtype run_as_account_id: str + :keyword policy_id: Required. The Policy Id. + :paramtype policy_id: str + """ super(InMageRcmFailbackReprotectInput, self).__init__(**kwargs) self.instance_type = 'InMageRcmFailback' # type: str self.process_server_id = process_server_id @@ -11512,6 +14988,8 @@ def __init__( self, **kwargs ): + """ + """ super(InMageRcmFailbackSyncDetails, self).__init__(**kwargs) self.progress_health = None self.transferred_bytes = None @@ -11564,6 +15042,8 @@ def __init__( self, **kwargs ): + """ + """ super(InMageRcmLastAgentUpgradeErrorDetails, self).__init__(**kwargs) self.error_code = None self.error_message = None @@ -11632,6 +15112,8 @@ def __init__( self, **kwargs ): + """ + """ super(InMageRcmMobilityAgentDetails, self).__init__(**kwargs) self.version = None self.latest_version = None @@ -11652,10 +15134,10 @@ class InMageRcmNicDetails(msrest.serialization.Model): :ivar nic_id: The NIC Id. :vartype nic_id: str - :param is_primary_nic: A value indicating whether this is the primary NIC. - :type is_primary_nic: str - :param is_selected_for_failover: A value indicating whether this NIC is selected for failover. - :type is_selected_for_failover: str + :ivar is_primary_nic: A value indicating whether this is the primary NIC. + :vartype is_primary_nic: str + :ivar is_selected_for_failover: A value indicating whether this NIC is selected for failover. + :vartype is_selected_for_failover: str :ivar source_ip_address: The source IP address. :vartype source_ip_address: str :ivar source_ip_address_type: The source IP address type. Possible values include: "Dynamic", @@ -11666,21 +15148,21 @@ class InMageRcmNicDetails(msrest.serialization.Model): :vartype source_network_id: str :ivar source_subnet_name: Source subnet name. :vartype source_subnet_name: str - :param target_ip_address: The target IP address. - :type target_ip_address: str - :param target_ip_address_type: The target IP address type. Possible values include: "Dynamic", + :ivar target_ip_address: The target IP address. + :vartype target_ip_address: str + :ivar target_ip_address_type: The target IP address type. Possible values include: "Dynamic", "Static". - :type target_ip_address_type: str or + :vartype target_ip_address_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.EthernetAddressType - :param target_subnet_name: Target subnet name. - :type target_subnet_name: str - :param test_subnet_name: Test subnet name. - :type test_subnet_name: str - :param test_ip_address: The test IP address. - :type test_ip_address: str - :param test_ip_address_type: The test IP address type. Possible values include: "Dynamic", + :ivar target_subnet_name: Target subnet name. + :vartype target_subnet_name: str + :ivar test_subnet_name: Test subnet name. + :vartype test_subnet_name: str + :ivar test_ip_address: The test IP address. + :vartype test_ip_address: str + :ivar test_ip_address_type: The test IP address type. Possible values include: "Dynamic", "Static". - :type test_ip_address_type: str or + :vartype test_ip_address_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.EthernetAddressType """ @@ -11721,6 +15203,29 @@ def __init__( test_ip_address_type: Optional[Union[str, "EthernetAddressType"]] = None, **kwargs ): + """ + :keyword is_primary_nic: A value indicating whether this is the primary NIC. + :paramtype is_primary_nic: str + :keyword is_selected_for_failover: A value indicating whether this NIC is selected for + failover. + :paramtype is_selected_for_failover: str + :keyword target_ip_address: The target IP address. + :paramtype target_ip_address: str + :keyword target_ip_address_type: The target IP address type. Possible values include: + "Dynamic", "Static". + :paramtype target_ip_address_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.EthernetAddressType + :keyword target_subnet_name: Target subnet name. + :paramtype target_subnet_name: str + :keyword test_subnet_name: Test subnet name. + :paramtype test_subnet_name: str + :keyword test_ip_address: The test IP address. + :paramtype test_ip_address: str + :keyword test_ip_address_type: The test IP address type. Possible values include: "Dynamic", + "Static". + :paramtype test_ip_address_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.EthernetAddressType + """ super(InMageRcmNicDetails, self).__init__(**kwargs) self.nic_id = None self.is_primary_nic = is_primary_nic @@ -11742,20 +15247,20 @@ class InMageRcmNicInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param nic_id: Required. The NIC Id. - :type nic_id: str - :param is_primary_nic: Required. A value indicating whether this is the primary NIC. - :type is_primary_nic: str - :param is_selected_for_failover: A value indicating whether this NIC is selected for failover. - :type is_selected_for_failover: str - :param target_subnet_name: Target subnet name. - :type target_subnet_name: str - :param target_static_ip_address: The target static IP address. - :type target_static_ip_address: str - :param test_subnet_name: The test subnet name. - :type test_subnet_name: str - :param test_static_ip_address: The test static IP address. - :type test_static_ip_address: str + :ivar nic_id: Required. The NIC Id. + :vartype nic_id: str + :ivar is_primary_nic: Required. A value indicating whether this is the primary NIC. + :vartype is_primary_nic: str + :ivar is_selected_for_failover: A value indicating whether this NIC is selected for failover. + :vartype is_selected_for_failover: str + :ivar target_subnet_name: Target subnet name. + :vartype target_subnet_name: str + :ivar target_static_ip_address: The target static IP address. + :vartype target_static_ip_address: str + :ivar test_subnet_name: The test subnet name. + :vartype test_subnet_name: str + :ivar test_static_ip_address: The test static IP address. + :vartype test_static_ip_address: str """ _validation = { @@ -11785,6 +15290,23 @@ def __init__( test_static_ip_address: Optional[str] = None, **kwargs ): + """ + :keyword nic_id: Required. The NIC Id. + :paramtype nic_id: str + :keyword is_primary_nic: Required. A value indicating whether this is the primary NIC. + :paramtype is_primary_nic: str + :keyword is_selected_for_failover: A value indicating whether this NIC is selected for + failover. + :paramtype is_selected_for_failover: str + :keyword target_subnet_name: Target subnet name. + :paramtype target_subnet_name: str + :keyword target_static_ip_address: The target static IP address. + :paramtype target_static_ip_address: str + :keyword test_subnet_name: The test subnet name. + :paramtype test_subnet_name: str + :keyword test_static_ip_address: The test static IP address. + :paramtype test_static_ip_address: str + """ super(InMageRcmNicInput, self).__init__(**kwargs) self.nic_id = nic_id self.is_primary_nic = is_primary_nic @@ -11800,18 +15322,18 @@ class InMageRcmPolicyCreationInput(PolicyProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_history_in_minutes: The duration in minutes until which the recovery + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_history_in_minutes: The duration in minutes until which the recovery points need to be stored. - :type recovery_point_history_in_minutes: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in + :vartype recovery_point_history_in_minutes: int + :ivar crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in minutes). - :type crash_consistent_frequency_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). - :type app_consistent_frequency_in_minutes: int - :param enable_multi_vm_sync: A value indicating whether multi-VM sync has to be enabled. - :type enable_multi_vm_sync: str + :vartype crash_consistent_frequency_in_minutes: int + :ivar app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). + :vartype app_consistent_frequency_in_minutes: int + :ivar enable_multi_vm_sync: A value indicating whether multi-VM sync has to be enabled. + :vartype enable_multi_vm_sync: str """ _validation = { @@ -11835,6 +15357,19 @@ def __init__( enable_multi_vm_sync: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_history_in_minutes: The duration in minutes until which the recovery + points need to be stored. + :paramtype recovery_point_history_in_minutes: int + :keyword crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in + minutes). + :paramtype crash_consistent_frequency_in_minutes: int + :keyword app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in + minutes). + :paramtype app_consistent_frequency_in_minutes: int + :keyword enable_multi_vm_sync: A value indicating whether multi-VM sync has to be enabled. + :paramtype enable_multi_vm_sync: str + """ super(InMageRcmPolicyCreationInput, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.recovery_point_history_in_minutes = recovery_point_history_in_minutes @@ -11848,19 +15383,19 @@ class InMageRcmPolicyDetails(PolicyProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param recovery_point_history_in_minutes: The duration in minutes until which the recovery + :vartype instance_type: str + :ivar recovery_point_history_in_minutes: The duration in minutes until which the recovery points need to be stored. - :type recovery_point_history_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. - :type app_consistent_frequency_in_minutes: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in + :vartype recovery_point_history_in_minutes: int + :ivar app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. + :vartype app_consistent_frequency_in_minutes: int + :ivar crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in minutes. - :type crash_consistent_frequency_in_minutes: int - :param enable_multi_vm_sync: A value indicating whether multi-VM sync has to be enabled. - :type enable_multi_vm_sync: str + :vartype crash_consistent_frequency_in_minutes: int + :ivar enable_multi_vm_sync: A value indicating whether multi-VM sync has to be enabled. + :vartype enable_multi_vm_sync: str """ _validation = { @@ -11884,6 +15419,18 @@ def __init__( enable_multi_vm_sync: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_history_in_minutes: The duration in minutes until which the recovery + points need to be stored. + :paramtype recovery_point_history_in_minutes: int + :keyword app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. + :paramtype app_consistent_frequency_in_minutes: int + :keyword crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in + minutes. + :paramtype crash_consistent_frequency_in_minutes: int + :keyword enable_multi_vm_sync: A value indicating whether multi-VM sync has to be enabled. + :paramtype enable_multi_vm_sync: str + """ super(InMageRcmPolicyDetails, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.recovery_point_history_in_minutes = recovery_point_history_in_minutes @@ -11913,9 +15460,9 @@ class InMageRcmProtectedDiskDetails(msrest.serialization.Model): :vartype seed_managed_disk_id: str :ivar target_managed_disk_id: The ARM Id of the target managed disk. :vartype target_managed_disk_id: str - :param disk_type: The disk type. Possible values include: "Standard_LRS", "Premium_LRS", + :ivar disk_type: The disk type. Possible values include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :vartype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType :ivar data_pending_in_log_data_store_in_mb: The data pending in log data store in MB. :vartype data_pending_in_log_data_store_in_mb: float :ivar data_pending_at_source_agent_in_mb: The data pending at source agent in MB. @@ -11923,10 +15470,10 @@ class InMageRcmProtectedDiskDetails(msrest.serialization.Model): :ivar is_initial_replication_complete: A value indicating whether initial replication is complete or not. :vartype is_initial_replication_complete: str - :param ir_details: The initial replication details. - :type ir_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmSyncDetails - :param resync_details: The resync details. - :type resync_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmSyncDetails + :ivar ir_details: The initial replication details. + :vartype ir_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmSyncDetails + :ivar resync_details: The resync details. + :vartype resync_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmSyncDetails """ _validation = { @@ -11968,6 +15515,15 @@ def __init__( resync_details: Optional["InMageRcmSyncDetails"] = None, **kwargs ): + """ + :keyword disk_type: The disk type. Possible values include: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS". + :paramtype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :keyword ir_details: The initial replication details. + :paramtype ir_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmSyncDetails + :keyword resync_details: The resync details. + :paramtype resync_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmSyncDetails + """ super(InMageRcmProtectedDiskDetails, self).__init__(**kwargs) self.disk_id = None self.disk_name = None @@ -11992,9 +15548,9 @@ class InMageRcmProtectionContainerMappingDetails(ProtectionContainerMappingProvi All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str :ivar enable_agent_auto_upgrade: A value indicating whether the flag for enable agent auto upgrade. :vartype enable_agent_auto_upgrade: str @@ -12014,6 +15570,8 @@ def __init__( self, **kwargs ): + """ + """ super(InMageRcmProtectionContainerMappingDetails, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.enable_agent_auto_upgrade = None @@ -12026,8 +15584,8 @@ class InMageRcmRecoveryPointDetails(ProviderSpecificRecoveryPointDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the provider type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the provider type.Constant filled by server. + :vartype instance_type: str :ivar is_multi_vm_sync_point: A value indicating whether the recovery point is multi VM consistent. :vartype is_multi_vm_sync_point: str @@ -12047,6 +15605,8 @@ def __init__( self, **kwargs ): + """ + """ super(InMageRcmRecoveryPointDetails, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.is_multi_vm_sync_point = None @@ -12059,8 +15619,8 @@ class InMageRcmReplicationDetails(ReplicationProviderSpecificSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str :ivar internal_identifier: The virtual machine internal identifier. :vartype internal_identifier: str :ivar fabric_discovery_machine_id: The ARM Id of the discovered VM. @@ -12087,29 +15647,29 @@ class InMageRcmReplicationDetails(ReplicationProviderSpecificSettings): :vartype primary_nic_ip_address: str :ivar target_generation: The target generation. :vartype target_generation: str - :param license_type: License Type of the VM to be used. - :type license_type: str - :param target_vm_name: Target VM name. - :type target_vm_name: str - :param target_vm_size: The target VM size. - :type target_vm_size: str - :param target_resource_group_id: The target resource group Id. - :type target_resource_group_id: str - :param target_location: The target location. - :type target_location: str - :param target_availability_set_id: The target availability set Id. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account + :ivar license_type: License Type of the VM to be used. + :vartype license_type: str + :ivar target_vm_name: Target VM name. + :vartype target_vm_name: str + :ivar target_vm_size: The target VM size. + :vartype target_vm_size: str + :ivar target_resource_group_id: The target resource group Id. + :vartype target_resource_group_id: str + :ivar target_location: The target location. + :vartype target_location: str + :ivar target_availability_set_id: The target availability set Id. + :vartype target_availability_set_id: str + :ivar target_availability_zone: The target availability zone. + :vartype target_availability_zone: str + :ivar target_proximity_placement_group_id: The target proximity placement group Id. + :vartype target_proximity_placement_group_id: str + :ivar target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account ARM Id. - :type target_boot_diagnostics_storage_account_id: str - :param target_network_id: The target network Id. - :type target_network_id: str - :param test_network_id: The test network Id. - :type test_network_id: str + :vartype target_boot_diagnostics_storage_account_id: str + :ivar target_network_id: The target network Id. + :vartype target_network_id: str + :ivar test_network_id: The test network Id. + :vartype test_network_id: str :ivar failover_recovery_point_id: The recovery point Id to which the VM was failed over. :vartype failover_recovery_point_id: str :ivar last_recovery_point_received: The last recovery point received time. @@ -12162,8 +15722,8 @@ class InMageRcmReplicationDetails(ReplicationProviderSpecificSettings): :ivar agent_upgrade_attempt_to_version: The agent version to which last agent upgrade was attempted. :vartype agent_upgrade_attempt_to_version: str - :param protected_disks: The list of protected disks. - :type protected_disks: + :ivar protected_disks: The list of protected disks. + :vartype protected_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmProtectedDiskDetails] :ivar is_last_upgrade_successful: A value indicating whether last agent upgrade was successful or not. @@ -12171,19 +15731,19 @@ class InMageRcmReplicationDetails(ReplicationProviderSpecificSettings): :ivar is_agent_registration_successful_after_failover: A value indicating whether agent registration was successful after failover. :vartype is_agent_registration_successful_after_failover: bool - :param mobility_agent_details: The mobility agent information. - :type mobility_agent_details: + :ivar mobility_agent_details: The mobility agent information. + :vartype mobility_agent_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmMobilityAgentDetails - :param last_agent_upgrade_error_details: The last agent upgrade error information. - :type last_agent_upgrade_error_details: + :ivar last_agent_upgrade_error_details: The last agent upgrade error information. + :vartype last_agent_upgrade_error_details: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmLastAgentUpgradeErrorDetails] - :param agent_upgrade_blocking_error_details: The agent upgrade blocking error information. - :type agent_upgrade_blocking_error_details: + :ivar agent_upgrade_blocking_error_details: The agent upgrade blocking error information. + :vartype agent_upgrade_blocking_error_details: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmAgentUpgradeBlockingErrorDetails] - :param vm_nics: The network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmNicDetails] - :param discovered_vm_details: The discovered VM details. - :type discovered_vm_details: + :ivar vm_nics: The network details. + :vartype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmNicDetails] + :ivar discovered_vm_details: The discovered VM details. + :vartype discovered_vm_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmDiscoveredProtectedVmDetails """ @@ -12302,6 +15862,48 @@ def __init__( discovered_vm_details: Optional["InMageRcmDiscoveredProtectedVmDetails"] = None, **kwargs ): + """ + :keyword license_type: License Type of the VM to be used. + :paramtype license_type: str + :keyword target_vm_name: Target VM name. + :paramtype target_vm_name: str + :keyword target_vm_size: The target VM size. + :paramtype target_vm_size: str + :keyword target_resource_group_id: The target resource group Id. + :paramtype target_resource_group_id: str + :keyword target_location: The target location. + :paramtype target_location: str + :keyword target_availability_set_id: The target availability set Id. + :paramtype target_availability_set_id: str + :keyword target_availability_zone: The target availability zone. + :paramtype target_availability_zone: str + :keyword target_proximity_placement_group_id: The target proximity placement group Id. + :paramtype target_proximity_placement_group_id: str + :keyword target_boot_diagnostics_storage_account_id: The target boot diagnostics storage + account ARM Id. + :paramtype target_boot_diagnostics_storage_account_id: str + :keyword target_network_id: The target network Id. + :paramtype target_network_id: str + :keyword test_network_id: The test network Id. + :paramtype test_network_id: str + :keyword protected_disks: The list of protected disks. + :paramtype protected_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmProtectedDiskDetails] + :keyword mobility_agent_details: The mobility agent information. + :paramtype mobility_agent_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmMobilityAgentDetails + :keyword last_agent_upgrade_error_details: The last agent upgrade error information. + :paramtype last_agent_upgrade_error_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmLastAgentUpgradeErrorDetails] + :keyword agent_upgrade_blocking_error_details: The agent upgrade blocking error information. + :paramtype agent_upgrade_blocking_error_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmAgentUpgradeBlockingErrorDetails] + :keyword vm_nics: The network details. + :paramtype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmNicDetails] + :keyword discovered_vm_details: The discovered VM details. + :paramtype discovered_vm_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmDiscoveredProtectedVmDetails + """ super(InMageRcmReplicationDetails, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.internal_identifier = None @@ -12362,16 +15964,16 @@ class InMageRcmReprotectInput(ReverseReplicationProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param reprotect_agent_id: Required. The reprotect agent Id. - :type reprotect_agent_id: str - :param datastore_name: Required. The target datastore name. - :type datastore_name: str - :param log_storage_account_id: Required. The log storage account ARM Id. - :type log_storage_account_id: str - :param policy_id: The Policy Id. - :type policy_id: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar reprotect_agent_id: Required. The reprotect agent Id. + :vartype reprotect_agent_id: str + :ivar datastore_name: Required. The target datastore name. + :vartype datastore_name: str + :ivar log_storage_account_id: Required. The log storage account ARM Id. + :vartype log_storage_account_id: str + :ivar policy_id: The Policy Id. + :vartype policy_id: str """ _validation = { @@ -12398,6 +16000,16 @@ def __init__( policy_id: Optional[str] = None, **kwargs ): + """ + :keyword reprotect_agent_id: Required. The reprotect agent Id. + :paramtype reprotect_agent_id: str + :keyword datastore_name: Required. The target datastore name. + :paramtype datastore_name: str + :keyword log_storage_account_id: Required. The log storage account ARM Id. + :paramtype log_storage_account_id: str + :keyword policy_id: The Policy Id. + :paramtype policy_id: str + """ super(InMageRcmReprotectInput, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.reprotect_agent_id = reprotect_agent_id @@ -12460,6 +16072,8 @@ def __init__( self, **kwargs ): + """ + """ super(InMageRcmSyncDetails, self).__init__(**kwargs) self.progress_health = None self.transferred_bytes = None @@ -12476,13 +16090,13 @@ class InMageRcmTestFailoverInput(TestFailoverProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param network_id: The test network Id. - :type network_id: str - :param recovery_point_id: The recovery point id to be passed to test failover to a particular + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar network_id: The test network Id. + :vartype network_id: str + :ivar recovery_point_id: The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str + :vartype recovery_point_id: str """ _validation = { @@ -12502,6 +16116,13 @@ def __init__( recovery_point_id: Optional[str] = None, **kwargs ): + """ + :keyword network_id: The test network Id. + :paramtype network_id: str + :keyword recovery_point_id: The recovery point id to be passed to test failover to a particular + recovery point. In case of latest recovery point, null should be passed. + :paramtype recovery_point_id: str + """ super(InMageRcmTestFailoverInput, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.network_id = network_id @@ -12513,13 +16134,13 @@ class InMageRcmUnplannedFailoverInput(UnplannedFailoverProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param perform_shutdown: Required. A value indicating whether VM is to be shutdown. - :type perform_shutdown: str - :param recovery_point_id: The recovery point id to be passed to failover to a particular + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar perform_shutdown: Required. A value indicating whether VM is to be shutdown. + :vartype perform_shutdown: str + :ivar recovery_point_id: The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str + :vartype recovery_point_id: str """ _validation = { @@ -12540,6 +16161,13 @@ def __init__( recovery_point_id: Optional[str] = None, **kwargs ): + """ + :keyword perform_shutdown: Required. A value indicating whether VM is to be shutdown. + :paramtype perform_shutdown: str + :keyword recovery_point_id: The recovery point id to be passed to failover to a particular + recovery point. In case of latest recovery point, null should be passed. + :paramtype recovery_point_id: str + """ super(InMageRcmUnplannedFailoverInput, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.perform_shutdown = perform_shutdown @@ -12554,8 +16182,8 @@ class UpdateApplianceForReplicationProtectedItemProviderSpecificInput(msrest.ser All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -12574,6 +16202,8 @@ def __init__( self, **kwargs ): + """ + """ super(UpdateApplianceForReplicationProtectedItemProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -12583,10 +16213,10 @@ class InMageRcmUpdateApplianceForReplicationProtectedItemInput(UpdateApplianceFo All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param run_as_account_id: The run as account Id. - :type run_as_account_id: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar run_as_account_id: The run as account Id. + :vartype run_as_account_id: str """ _validation = { @@ -12604,6 +16234,10 @@ def __init__( run_as_account_id: Optional[str] = None, **kwargs ): + """ + :keyword run_as_account_id: The run as account Id. + :paramtype run_as_account_id: str + """ super(InMageRcmUpdateApplianceForReplicationProtectedItemInput, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.run_as_account_id = run_as_account_id @@ -12614,11 +16248,11 @@ class InMageRcmUpdateContainerMappingInput(ReplicationProviderSpecificUpdateCont All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param enable_agent_auto_upgrade: Required. A value indicating whether agent auto upgrade has - to be enabled. - :type enable_agent_auto_upgrade: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar enable_agent_auto_upgrade: Required. A value indicating whether agent auto upgrade has to + be enabled. + :vartype enable_agent_auto_upgrade: str """ _validation = { @@ -12637,6 +16271,11 @@ def __init__( enable_agent_auto_upgrade: str, **kwargs ): + """ + :keyword enable_agent_auto_upgrade: Required. A value indicating whether agent auto upgrade has + to be enabled. + :paramtype enable_agent_auto_upgrade: str + """ super(InMageRcmUpdateContainerMappingInput, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.enable_agent_auto_upgrade = enable_agent_auto_upgrade @@ -12647,32 +16286,32 @@ class InMageRcmUpdateReplicationProtectedItemInput(UpdateReplicationProtectedIte All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param target_vm_name: The target VM name. - :type target_vm_name: str - :param target_vm_size: The target VM size. - :type target_vm_size: str - :param target_resource_group_id: The target resource group ARM Id. - :type target_resource_group_id: str - :param target_availability_set_id: The target availability set ARM Id. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar target_vm_name: The target VM name. + :vartype target_vm_name: str + :ivar target_vm_size: The target VM size. + :vartype target_vm_size: str + :ivar target_resource_group_id: The target resource group ARM Id. + :vartype target_resource_group_id: str + :ivar target_availability_set_id: The target availability set ARM Id. + :vartype target_availability_set_id: str + :ivar target_availability_zone: The target availability zone. + :vartype target_availability_zone: str + :ivar target_proximity_placement_group_id: The target proximity placement group Id. + :vartype target_proximity_placement_group_id: str + :ivar target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account ARM Id. - :type target_boot_diagnostics_storage_account_id: str - :param target_network_id: The target network ARM Id. - :type target_network_id: str - :param test_network_id: The test network ARM Id. - :type test_network_id: str - :param vm_nics: The list of NIC details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmNicInput] - :param license_type: The license type. Possible values include: "NotSpecified", - "NoLicenseType", "WindowsServer". - :type license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType + :vartype target_boot_diagnostics_storage_account_id: str + :ivar target_network_id: The target network ARM Id. + :vartype target_network_id: str + :ivar test_network_id: The test network ARM Id. + :vartype test_network_id: str + :ivar vm_nics: The list of NIC details. + :vartype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmNicInput] + :ivar license_type: The license type. Possible values include: "NotSpecified", "NoLicenseType", + "WindowsServer". + :vartype license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType """ _validation = { @@ -12710,6 +16349,32 @@ def __init__( license_type: Optional[Union[str, "LicenseType"]] = None, **kwargs ): + """ + :keyword target_vm_name: The target VM name. + :paramtype target_vm_name: str + :keyword target_vm_size: The target VM size. + :paramtype target_vm_size: str + :keyword target_resource_group_id: The target resource group ARM Id. + :paramtype target_resource_group_id: str + :keyword target_availability_set_id: The target availability set ARM Id. + :paramtype target_availability_set_id: str + :keyword target_availability_zone: The target availability zone. + :paramtype target_availability_zone: str + :keyword target_proximity_placement_group_id: The target proximity placement group Id. + :paramtype target_proximity_placement_group_id: str + :keyword target_boot_diagnostics_storage_account_id: The target boot diagnostics storage + account ARM Id. + :paramtype target_boot_diagnostics_storage_account_id: str + :keyword target_network_id: The target network ARM Id. + :paramtype target_network_id: str + :keyword test_network_id: The test network ARM Id. + :paramtype test_network_id: str + :keyword vm_nics: The list of NIC details. + :paramtype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmNicInput] + :keyword license_type: The license type. Possible values include: "NotSpecified", + "NoLicenseType", "WindowsServer". + :paramtype license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType + """ super(InMageRcmUpdateReplicationProtectedItemInput, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.target_vm_name = target_vm_name @@ -12730,97 +16395,98 @@ class InMageReplicationDetails(ReplicationProviderSpecificSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param active_site_type: The active location of the VM. If the VM is being protected from - Azure, this field will take values from { Azure, OnPrem }. If the VM is being protected between - two data-centers, this field will be OnPrem always. - :type active_site_type: str - :param source_vm_cpu_count: The CPU count of the VM on the primary side. - :type source_vm_cpu_count: int - :param source_vm_ram_size_in_mb: The RAM size of the VM on the primary side. - :type source_vm_ram_size_in_mb: int - :param os_details: The OS details. - :type os_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDiskDetails - :param protection_stage: The protection stage. - :type protection_stage: str - :param vm_id: The virtual machine Id. - :type vm_id: str - :param vm_protection_state: The protection state for the vm. - :type vm_protection_state: str - :param vm_protection_state_description: The protection state description for the vm. - :type vm_protection_state_description: str - :param resync_details: The resync details of the machine. - :type resync_details: ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails - :param retention_window_start: The retention window start time. - :type retention_window_start: ~datetime.datetime - :param retention_window_end: The retention window end time. - :type retention_window_end: ~datetime.datetime - :param compressed_data_rate_in_mb: The compressed data change rate in MB. - :type compressed_data_rate_in_mb: float - :param uncompressed_data_rate_in_mb: The uncompressed data change rate in MB. - :type uncompressed_data_rate_in_mb: float - :param rpo_in_seconds: The RPO in seconds. - :type rpo_in_seconds: long - :param protected_disks: The list of protected disks. - :type protected_disks: + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str + :ivar active_site_type: The active location of the VM. If the VM is being protected from Azure, + this field will take values from { Azure, OnPrem }. If the VM is being protected between two + data-centers, this field will be OnPrem always. + :vartype active_site_type: str + :ivar source_vm_cpu_count: The CPU count of the VM on the primary side. + :vartype source_vm_cpu_count: int + :ivar source_vm_ram_size_in_mb: The RAM size of the VM on the primary side. + :vartype source_vm_ram_size_in_mb: int + :ivar os_details: The OS details. + :vartype os_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDiskDetails + :ivar protection_stage: The protection stage. + :vartype protection_stage: str + :ivar vm_id: The virtual machine Id. + :vartype vm_id: str + :ivar vm_protection_state: The protection state for the vm. + :vartype vm_protection_state: str + :ivar vm_protection_state_description: The protection state description for the vm. + :vartype vm_protection_state_description: str + :ivar resync_details: The resync details of the machine. + :vartype resync_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails + :ivar retention_window_start: The retention window start time. + :vartype retention_window_start: ~datetime.datetime + :ivar retention_window_end: The retention window end time. + :vartype retention_window_end: ~datetime.datetime + :ivar compressed_data_rate_in_mb: The compressed data change rate in MB. + :vartype compressed_data_rate_in_mb: float + :ivar uncompressed_data_rate_in_mb: The uncompressed data change rate in MB. + :vartype uncompressed_data_rate_in_mb: float + :ivar rpo_in_seconds: The RPO in seconds. + :vartype rpo_in_seconds: long + :ivar protected_disks: The list of protected disks. + :vartype protected_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageProtectedDiskDetails] - :param ip_address: The source IP address. - :type ip_address: str - :param last_heartbeat: The last heartbeat received from the source server. - :type last_heartbeat: ~datetime.datetime - :param process_server_id: The process server Id. - :type process_server_id: str - :param master_target_id: The master target Id. - :type master_target_id: str - :param consistency_points: The collection of Consistency points. - :type consistency_points: dict[str, ~datetime.datetime] - :param disk_resized: A value indicating whether any disk is resized for this VM. - :type disk_resized: str - :param reboot_after_update_status: A value indicating whether the source server requires a + :ivar ip_address: The source IP address. + :vartype ip_address: str + :ivar last_heartbeat: The last heartbeat received from the source server. + :vartype last_heartbeat: ~datetime.datetime + :ivar process_server_id: The process server Id. + :vartype process_server_id: str + :ivar master_target_id: The master target Id. + :vartype master_target_id: str + :ivar consistency_points: The collection of Consistency points. + :vartype consistency_points: dict[str, ~datetime.datetime] + :ivar disk_resized: A value indicating whether any disk is resized for this VM. + :vartype disk_resized: str + :ivar reboot_after_update_status: A value indicating whether the source server requires a restart after update. - :type reboot_after_update_status: str - :param multi_vm_group_id: The multi vm group Id, if any. - :type multi_vm_group_id: str - :param multi_vm_group_name: The multi vm group name, if any. - :type multi_vm_group_name: str - :param multi_vm_sync_status: A value indicating whether the multi vm sync is enabled or + :vartype reboot_after_update_status: str + :ivar multi_vm_group_id: The multi vm group Id, if any. + :vartype multi_vm_group_id: str + :ivar multi_vm_group_name: The multi vm group name, if any. + :vartype multi_vm_group_name: str + :ivar multi_vm_sync_status: A value indicating whether the multi vm sync is enabled or disabled. - :type multi_vm_sync_status: str - :param agent_details: The agent details. - :type agent_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageAgentDetails - :param v_center_infrastructure_id: The vCenter infrastructure Id. - :type v_center_infrastructure_id: str - :param infrastructure_vm_id: The infrastructure VM Id. - :type infrastructure_vm_id: str - :param vm_nics: The PE Network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] - :param discovery_type: A value indicating the discovery type of the machine. - :type discovery_type: str - :param azure_storage_account_id: A value indicating the underlying Azure storage account. If - the VM is not running in Azure, this value shall be set to null. - :type azure_storage_account_id: str - :param datastores: The datastores of the on-premise machine Value can be list of strings that + :vartype multi_vm_sync_status: str + :ivar agent_details: The agent details. + :vartype agent_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageAgentDetails + :ivar v_center_infrastructure_id: The vCenter infrastructure Id. + :vartype v_center_infrastructure_id: str + :ivar infrastructure_vm_id: The infrastructure VM Id. + :vartype infrastructure_vm_id: str + :ivar vm_nics: The PE Network details. + :vartype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] + :ivar discovery_type: A value indicating the discovery type of the machine. + :vartype discovery_type: str + :ivar azure_storage_account_id: A value indicating the underlying Azure storage account. If the + VM is not running in Azure, this value shall be set to null. + :vartype azure_storage_account_id: str + :ivar datastores: The datastores of the on-premise machine Value can be list of strings that contain datastore names. - :type datastores: list[str] - :param validation_errors: The validation errors of the on-premise machine Value can be list of + :vartype datastores: list[str] + :ivar validation_errors: The validation errors of the on-premise machine Value can be list of validation errors. - :type validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param last_rpo_calculated_time: The last RPO calculated time. - :type last_rpo_calculated_time: ~datetime.datetime - :param last_update_received_time: The last update time received from on-prem components. - :type last_update_received_time: ~datetime.datetime - :param replica_id: The replica id of the protected item. - :type replica_id: str - :param os_version: The OS Version of the protected item. - :type os_version: str - :param is_additional_stats_available: A value indicating whether additional IR stats are + :vartype validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :ivar last_rpo_calculated_time: The last RPO calculated time. + :vartype last_rpo_calculated_time: ~datetime.datetime + :ivar last_update_received_time: The last update time received from on-prem components. + :vartype last_update_received_time: ~datetime.datetime + :ivar replica_id: The replica id of the protected item. + :vartype replica_id: str + :ivar os_version: The OS Version of the protected item. + :vartype os_version: str + :ivar is_additional_stats_available: A value indicating whether additional IR stats are available or not. - :type is_additional_stats_available: bool - :param total_data_transferred: The total transferred data in bytes. - :type total_data_transferred: long - :param total_progress_health: The progress health. - :type total_progress_health: str + :vartype is_additional_stats_available: bool + :ivar total_data_transferred: The total transferred data in bytes. + :vartype total_data_transferred: long + :ivar total_progress_health: The progress health. + :vartype total_progress_health: str """ _validation = { @@ -12916,6 +16582,98 @@ def __init__( total_progress_health: Optional[str] = None, **kwargs ): + """ + :keyword active_site_type: The active location of the VM. If the VM is being protected from + Azure, this field will take values from { Azure, OnPrem }. If the VM is being protected between + two data-centers, this field will be OnPrem always. + :paramtype active_site_type: str + :keyword source_vm_cpu_count: The CPU count of the VM on the primary side. + :paramtype source_vm_cpu_count: int + :keyword source_vm_ram_size_in_mb: The RAM size of the VM on the primary side. + :paramtype source_vm_ram_size_in_mb: int + :keyword os_details: The OS details. + :paramtype os_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDiskDetails + :keyword protection_stage: The protection stage. + :paramtype protection_stage: str + :keyword vm_id: The virtual machine Id. + :paramtype vm_id: str + :keyword vm_protection_state: The protection state for the vm. + :paramtype vm_protection_state: str + :keyword vm_protection_state_description: The protection state description for the vm. + :paramtype vm_protection_state_description: str + :keyword resync_details: The resync details of the machine. + :paramtype resync_details: + ~azure.mgmt.recoveryservicessiterecovery.models.InitialReplicationDetails + :keyword retention_window_start: The retention window start time. + :paramtype retention_window_start: ~datetime.datetime + :keyword retention_window_end: The retention window end time. + :paramtype retention_window_end: ~datetime.datetime + :keyword compressed_data_rate_in_mb: The compressed data change rate in MB. + :paramtype compressed_data_rate_in_mb: float + :keyword uncompressed_data_rate_in_mb: The uncompressed data change rate in MB. + :paramtype uncompressed_data_rate_in_mb: float + :keyword rpo_in_seconds: The RPO in seconds. + :paramtype rpo_in_seconds: long + :keyword protected_disks: The list of protected disks. + :paramtype protected_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageProtectedDiskDetails] + :keyword ip_address: The source IP address. + :paramtype ip_address: str + :keyword last_heartbeat: The last heartbeat received from the source server. + :paramtype last_heartbeat: ~datetime.datetime + :keyword process_server_id: The process server Id. + :paramtype process_server_id: str + :keyword master_target_id: The master target Id. + :paramtype master_target_id: str + :keyword consistency_points: The collection of Consistency points. + :paramtype consistency_points: dict[str, ~datetime.datetime] + :keyword disk_resized: A value indicating whether any disk is resized for this VM. + :paramtype disk_resized: str + :keyword reboot_after_update_status: A value indicating whether the source server requires a + restart after update. + :paramtype reboot_after_update_status: str + :keyword multi_vm_group_id: The multi vm group Id, if any. + :paramtype multi_vm_group_id: str + :keyword multi_vm_group_name: The multi vm group name, if any. + :paramtype multi_vm_group_name: str + :keyword multi_vm_sync_status: A value indicating whether the multi vm sync is enabled or + disabled. + :paramtype multi_vm_sync_status: str + :keyword agent_details: The agent details. + :paramtype agent_details: ~azure.mgmt.recoveryservicessiterecovery.models.InMageAgentDetails + :keyword v_center_infrastructure_id: The vCenter infrastructure Id. + :paramtype v_center_infrastructure_id: str + :keyword infrastructure_vm_id: The infrastructure VM Id. + :paramtype infrastructure_vm_id: str + :keyword vm_nics: The PE Network details. + :paramtype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicDetails] + :keyword discovery_type: A value indicating the discovery type of the machine. + :paramtype discovery_type: str + :keyword azure_storage_account_id: A value indicating the underlying Azure storage account. If + the VM is not running in Azure, this value shall be set to null. + :paramtype azure_storage_account_id: str + :keyword datastores: The datastores of the on-premise machine Value can be list of strings that + contain datastore names. + :paramtype datastores: list[str] + :keyword validation_errors: The validation errors of the on-premise machine Value can be list + of validation errors. + :paramtype validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :keyword last_rpo_calculated_time: The last RPO calculated time. + :paramtype last_rpo_calculated_time: ~datetime.datetime + :keyword last_update_received_time: The last update time received from on-prem components. + :paramtype last_update_received_time: ~datetime.datetime + :keyword replica_id: The replica id of the protected item. + :paramtype replica_id: str + :keyword os_version: The OS Version of the protected item. + :paramtype os_version: str + :keyword is_additional_stats_available: A value indicating whether additional IR stats are + available or not. + :paramtype is_additional_stats_available: bool + :keyword total_data_transferred: The total transferred data in bytes. + :paramtype total_data_transferred: long + :keyword total_progress_health: The progress health. + :paramtype total_progress_health: str + """ super(InMageReplicationDetails, self).__init__(**kwargs) self.instance_type = 'InMage' # type: str self.active_site_type = active_site_type @@ -12965,25 +16723,25 @@ class InMageReprotectInput(ReverseReplicationProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param master_target_id: Required. The Master Target Id. - :type master_target_id: str - :param process_server_id: Required. The Process Server Id. - :type process_server_id: str - :param retention_drive: Required. The retention drive to use on the MT. - :type retention_drive: str - :param run_as_account_id: The CS account Id. - :type run_as_account_id: str - :param datastore_name: The target datastore name. - :type datastore_name: str - :param disk_exclusion_input: The enable disk exclusion input. - :type disk_exclusion_input: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar master_target_id: Required. The Master Target Id. + :vartype master_target_id: str + :ivar process_server_id: Required. The Process Server Id. + :vartype process_server_id: str + :ivar retention_drive: Required. The retention drive to use on the MT. + :vartype retention_drive: str + :ivar run_as_account_id: The CS account Id. + :vartype run_as_account_id: str + :ivar datastore_name: The target datastore name. + :vartype datastore_name: str + :ivar disk_exclusion_input: The enable disk exclusion input. + :vartype disk_exclusion_input: ~azure.mgmt.recoveryservicessiterecovery.models.InMageDiskExclusionInput - :param profile_id: Required. The Policy Id. - :type profile_id: str - :param disks_to_include: The disks to include list. - :type disks_to_include: list[str] + :ivar profile_id: Required. The Policy Id. + :vartype profile_id: str + :ivar disks_to_include: The disks to include list. + :vartype disks_to_include: list[str] """ _validation = { @@ -13019,6 +16777,25 @@ def __init__( disks_to_include: Optional[List[str]] = None, **kwargs ): + """ + :keyword master_target_id: Required. The Master Target Id. + :paramtype master_target_id: str + :keyword process_server_id: Required. The Process Server Id. + :paramtype process_server_id: str + :keyword retention_drive: Required. The retention drive to use on the MT. + :paramtype retention_drive: str + :keyword run_as_account_id: The CS account Id. + :paramtype run_as_account_id: str + :keyword datastore_name: The target datastore name. + :paramtype datastore_name: str + :keyword disk_exclusion_input: The enable disk exclusion input. + :paramtype disk_exclusion_input: + ~azure.mgmt.recoveryservicessiterecovery.models.InMageDiskExclusionInput + :keyword profile_id: Required. The Policy Id. + :paramtype profile_id: str + :keyword disks_to_include: The disks to include list. + :paramtype disks_to_include: list[str] + """ super(InMageReprotectInput, self).__init__(**kwargs) self.instance_type = 'InMage' # type: str self.master_target_id = master_target_id @@ -13036,17 +16813,17 @@ class InMageTestFailoverInput(TestFailoverProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: The recovery point type. Values from LatestTime, LatestTag or + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_type: The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: "LatestTime", "LatestTag", "Custom". - :type recovery_point_type: str or + :vartype recovery_point_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointType - :param recovery_point_id: The recovery point id to be passed to test failover to a particular + :ivar recovery_point_id: The recovery point id to be passed to test failover to a particular recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str + :vartype recovery_point_id: str """ _validation = { @@ -13066,6 +16843,17 @@ def __init__( recovery_point_id: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_type: The recovery point type. Values from LatestTime, LatestTag or + Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In + the other two cases, recovery point id will be ignored. Possible values include: "LatestTime", + "LatestTag", "Custom". + :paramtype recovery_point_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointType + :keyword recovery_point_id: The recovery point id to be passed to test failover to a particular + recovery point. In case of latest recovery point, null should be passed. + :paramtype recovery_point_id: str + """ super(InMageTestFailoverInput, self).__init__(**kwargs) self.instance_type = 'InMage' # type: str self.recovery_point_type = recovery_point_type @@ -13077,17 +16865,17 @@ class InMageUnplannedFailoverInput(UnplannedFailoverProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: The recovery point type. Values from LatestTime, LatestTag or + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_type: The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. Possible values include: "LatestTime", "LatestTag", "Custom". - :type recovery_point_type: str or + :vartype recovery_point_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointType - :param recovery_point_id: The recovery point id to be passed to failover to a particular + :ivar recovery_point_id: The recovery point id to be passed to failover to a particular recovery point. In case of latest recovery point, null should be passed. - :type recovery_point_id: str + :vartype recovery_point_id: str """ _validation = { @@ -13107,6 +16895,17 @@ def __init__( recovery_point_id: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_type: The recovery point type. Values from LatestTime, LatestTag or + Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In + the other two cases, recovery point id will be ignored. Possible values include: "LatestTime", + "LatestTag", "Custom". + :paramtype recovery_point_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointType + :keyword recovery_point_id: The recovery point id to be passed to failover to a particular + recovery point. In case of latest recovery point, null should be passed. + :paramtype recovery_point_id: str + """ super(InMageUnplannedFailoverInput, self).__init__(**kwargs) self.instance_type = 'InMage' # type: str self.recovery_point_type = recovery_point_type @@ -13116,13 +16915,13 @@ def __init__( class InMageVolumeExclusionOptions(msrest.serialization.Model): """Guest disk signature based disk exclusion option when doing enable protection of virtual machine in InMage provider. - :param volume_label: The volume label. The disk having any volume with this label will be + :ivar volume_label: The volume label. The disk having any volume with this label will be excluded from replication. - :type volume_label: str - :param only_exclude_if_single_volume: The value indicating whether to exclude multi volume disk + :vartype volume_label: str + :ivar only_exclude_if_single_volume: The value indicating whether to exclude multi volume disk or not. If a disk has multiple volumes and one of the volume has label matching with VolumeLabel this disk will be excluded from replication if OnlyExcludeIfSingleVolume is false. - :type only_exclude_if_single_volume: str + :vartype only_exclude_if_single_volume: str """ _attribute_map = { @@ -13137,6 +16936,15 @@ def __init__( only_exclude_if_single_volume: Optional[str] = None, **kwargs ): + """ + :keyword volume_label: The volume label. The disk having any volume with this label will be + excluded from replication. + :paramtype volume_label: str + :keyword only_exclude_if_single_volume: The value indicating whether to exclude multi volume + disk or not. If a disk has multiple volumes and one of the volume has label matching with + VolumeLabel this disk will be excluded from replication if OnlyExcludeIfSingleVolume is false. + :paramtype only_exclude_if_single_volume: str + """ super(InMageVolumeExclusionOptions, self).__init__(**kwargs) self.volume_label = volume_label self.only_exclude_if_single_volume = only_exclude_if_single_volume @@ -13145,35 +16953,35 @@ def __init__( class InnerHealthError(msrest.serialization.Model): """Implements InnerHealthError class. HealthError object has a list of InnerHealthErrors as child errors. InnerHealthError is used because this will prevent an infinite loop of structures when Hydra tries to auto-generate the contract. We are exposing the related health errors as inner health errors and all API consumers can utilize this in the same fashion as Exception -> InnerException. - :param error_source: Source of error. - :type error_source: str - :param error_type: Type of error. - :type error_type: str - :param error_level: Level of error. - :type error_level: str - :param error_category: Category of error. - :type error_category: str - :param error_code: Error code. - :type error_code: str - :param summary_message: Summary message of the entity. - :type summary_message: str - :param error_message: Error message. - :type error_message: str - :param possible_causes: Possible causes of error. - :type possible_causes: str - :param recommended_action: Recommended action to resolve error. - :type recommended_action: str - :param creation_time_utc: Error creation time (UTC). - :type creation_time_utc: ~datetime.datetime - :param recovery_provider_error_message: DRA error message. - :type recovery_provider_error_message: str - :param entity_id: ID of the entity. - :type entity_id: str - :param error_id: The health error unique id. - :type error_id: str - :param customer_resolvability: Value indicating whether the health error is customer - resolvable. Possible values include: "Allowed", "NotAllowed". - :type customer_resolvability: str or + :ivar error_source: Source of error. + :vartype error_source: str + :ivar error_type: Type of error. + :vartype error_type: str + :ivar error_level: Level of error. + :vartype error_level: str + :ivar error_category: Category of error. + :vartype error_category: str + :ivar error_code: Error code. + :vartype error_code: str + :ivar summary_message: Summary message of the entity. + :vartype summary_message: str + :ivar error_message: Error message. + :vartype error_message: str + :ivar possible_causes: Possible causes of error. + :vartype possible_causes: str + :ivar recommended_action: Recommended action to resolve error. + :vartype recommended_action: str + :ivar creation_time_utc: Error creation time (UTC). + :vartype creation_time_utc: ~datetime.datetime + :ivar recovery_provider_error_message: DRA error message. + :vartype recovery_provider_error_message: str + :ivar entity_id: ID of the entity. + :vartype entity_id: str + :ivar error_id: The health error unique id. + :vartype error_id: str + :ivar customer_resolvability: Value indicating whether the health error is customer resolvable. + Possible values include: "Allowed", "NotAllowed". + :vartype customer_resolvability: str or ~azure.mgmt.recoveryservicessiterecovery.models.HealthErrorCustomerResolvability """ @@ -13213,6 +17021,38 @@ def __init__( customer_resolvability: Optional[Union[str, "HealthErrorCustomerResolvability"]] = None, **kwargs ): + """ + :keyword error_source: Source of error. + :paramtype error_source: str + :keyword error_type: Type of error. + :paramtype error_type: str + :keyword error_level: Level of error. + :paramtype error_level: str + :keyword error_category: Category of error. + :paramtype error_category: str + :keyword error_code: Error code. + :paramtype error_code: str + :keyword summary_message: Summary message of the entity. + :paramtype summary_message: str + :keyword error_message: Error message. + :paramtype error_message: str + :keyword possible_causes: Possible causes of error. + :paramtype possible_causes: str + :keyword recommended_action: Recommended action to resolve error. + :paramtype recommended_action: str + :keyword creation_time_utc: Error creation time (UTC). + :paramtype creation_time_utc: ~datetime.datetime + :keyword recovery_provider_error_message: DRA error message. + :paramtype recovery_provider_error_message: str + :keyword entity_id: ID of the entity. + :paramtype entity_id: str + :keyword error_id: The health error unique id. + :paramtype error_id: str + :keyword customer_resolvability: Value indicating whether the health error is customer + resolvable. Possible values include: "Allowed", "NotAllowed". + :paramtype customer_resolvability: str or + ~azure.mgmt.recoveryservicessiterecovery.models.HealthErrorCustomerResolvability + """ super(InnerHealthError, self).__init__(**kwargs) self.error_source = error_source self.error_type = error_type @@ -13233,14 +17073,14 @@ def __init__( class InputEndpoint(msrest.serialization.Model): """InputEndpoint. - :param endpoint_name: - :type endpoint_name: str - :param private_port: - :type private_port: int - :param public_port: - :type public_port: int - :param protocol: - :type protocol: str + :ivar endpoint_name: + :vartype endpoint_name: str + :ivar private_port: + :vartype private_port: int + :ivar public_port: + :vartype public_port: int + :ivar protocol: + :vartype protocol: str """ _attribute_map = { @@ -13259,6 +17099,16 @@ def __init__( protocol: Optional[str] = None, **kwargs ): + """ + :keyword endpoint_name: + :paramtype endpoint_name: str + :keyword private_port: + :paramtype private_port: int + :keyword public_port: + :paramtype public_port: int + :keyword protocol: + :paramtype protocol: str + """ super(InputEndpoint, self).__init__(**kwargs) self.endpoint_name = endpoint_name self.private_port = private_port @@ -13269,36 +17119,36 @@ def __init__( class IPConfigDetails(msrest.serialization.Model): """IPConfigDetails. - :param name: - :type name: str - :param is_primary: - :type is_primary: bool - :param subnet_name: - :type subnet_name: str - :param static_ip_address: - :type static_ip_address: str - :param ip_address_type: - :type ip_address_type: str - :param is_seleted_for_failover: - :type is_seleted_for_failover: bool - :param recovery_subnet_name: - :type recovery_subnet_name: str - :param recovery_static_ip_address: - :type recovery_static_ip_address: str - :param recovery_ip_address_type: - :type recovery_ip_address_type: str - :param recovery_public_ip_address_id: - :type recovery_public_ip_address_id: str - :param recovery_lb_backend_address_pool_ids: - :type recovery_lb_backend_address_pool_ids: list[str] - :param tfo_subnet_name: - :type tfo_subnet_name: str - :param tfo_static_ip_address: - :type tfo_static_ip_address: str - :param tfo_public_ip_address_id: - :type tfo_public_ip_address_id: str - :param tfo_lb_backend_address_pool_ids: - :type tfo_lb_backend_address_pool_ids: list[str] + :ivar name: + :vartype name: str + :ivar is_primary: + :vartype is_primary: bool + :ivar subnet_name: + :vartype subnet_name: str + :ivar static_ip_address: + :vartype static_ip_address: str + :ivar ip_address_type: + :vartype ip_address_type: str + :ivar is_seleted_for_failover: + :vartype is_seleted_for_failover: bool + :ivar recovery_subnet_name: + :vartype recovery_subnet_name: str + :ivar recovery_static_ip_address: + :vartype recovery_static_ip_address: str + :ivar recovery_ip_address_type: + :vartype recovery_ip_address_type: str + :ivar recovery_public_ip_address_id: + :vartype recovery_public_ip_address_id: str + :ivar recovery_lb_backend_address_pool_ids: + :vartype recovery_lb_backend_address_pool_ids: list[str] + :ivar tfo_subnet_name: + :vartype tfo_subnet_name: str + :ivar tfo_static_ip_address: + :vartype tfo_static_ip_address: str + :ivar tfo_public_ip_address_id: + :vartype tfo_public_ip_address_id: str + :ivar tfo_lb_backend_address_pool_ids: + :vartype tfo_lb_backend_address_pool_ids: list[str] """ _attribute_map = { @@ -13339,6 +17189,38 @@ def __init__( tfo_lb_backend_address_pool_ids: Optional[List[str]] = None, **kwargs ): + """ + :keyword name: + :paramtype name: str + :keyword is_primary: + :paramtype is_primary: bool + :keyword subnet_name: + :paramtype subnet_name: str + :keyword static_ip_address: + :paramtype static_ip_address: str + :keyword ip_address_type: + :paramtype ip_address_type: str + :keyword is_seleted_for_failover: + :paramtype is_seleted_for_failover: bool + :keyword recovery_subnet_name: + :paramtype recovery_subnet_name: str + :keyword recovery_static_ip_address: + :paramtype recovery_static_ip_address: str + :keyword recovery_ip_address_type: + :paramtype recovery_ip_address_type: str + :keyword recovery_public_ip_address_id: + :paramtype recovery_public_ip_address_id: str + :keyword recovery_lb_backend_address_pool_ids: + :paramtype recovery_lb_backend_address_pool_ids: list[str] + :keyword tfo_subnet_name: + :paramtype tfo_subnet_name: str + :keyword tfo_static_ip_address: + :paramtype tfo_static_ip_address: str + :keyword tfo_public_ip_address_id: + :paramtype tfo_public_ip_address_id: str + :keyword tfo_lb_backend_address_pool_ids: + :paramtype tfo_lb_backend_address_pool_ids: list[str] + """ super(IPConfigDetails, self).__init__(**kwargs) self.name = name self.is_primary = is_primary @@ -13360,28 +17242,28 @@ def __init__( class IPConfigInputDetails(msrest.serialization.Model): """IPConfigInputDetails. - :param ip_config_name: - :type ip_config_name: str - :param is_primary: - :type is_primary: bool - :param is_seleted_for_failover: - :type is_seleted_for_failover: bool - :param recovery_subnet_name: - :type recovery_subnet_name: str - :param recovery_static_ip_address: - :type recovery_static_ip_address: str - :param recovery_public_ip_address_id: - :type recovery_public_ip_address_id: str - :param recovery_lb_backend_address_pool_ids: - :type recovery_lb_backend_address_pool_ids: list[str] - :param tfo_subnet_name: - :type tfo_subnet_name: str - :param tfo_static_ip_address: - :type tfo_static_ip_address: str - :param tfo_public_ip_address_id: - :type tfo_public_ip_address_id: str - :param tfo_lb_backend_address_pool_ids: - :type tfo_lb_backend_address_pool_ids: list[str] + :ivar ip_config_name: + :vartype ip_config_name: str + :ivar is_primary: + :vartype is_primary: bool + :ivar is_seleted_for_failover: + :vartype is_seleted_for_failover: bool + :ivar recovery_subnet_name: + :vartype recovery_subnet_name: str + :ivar recovery_static_ip_address: + :vartype recovery_static_ip_address: str + :ivar recovery_public_ip_address_id: + :vartype recovery_public_ip_address_id: str + :ivar recovery_lb_backend_address_pool_ids: + :vartype recovery_lb_backend_address_pool_ids: list[str] + :ivar tfo_subnet_name: + :vartype tfo_subnet_name: str + :ivar tfo_static_ip_address: + :vartype tfo_static_ip_address: str + :ivar tfo_public_ip_address_id: + :vartype tfo_public_ip_address_id: str + :ivar tfo_lb_backend_address_pool_ids: + :vartype tfo_lb_backend_address_pool_ids: list[str] """ _attribute_map = { @@ -13414,6 +17296,30 @@ def __init__( tfo_lb_backend_address_pool_ids: Optional[List[str]] = None, **kwargs ): + """ + :keyword ip_config_name: + :paramtype ip_config_name: str + :keyword is_primary: + :paramtype is_primary: bool + :keyword is_seleted_for_failover: + :paramtype is_seleted_for_failover: bool + :keyword recovery_subnet_name: + :paramtype recovery_subnet_name: str + :keyword recovery_static_ip_address: + :paramtype recovery_static_ip_address: str + :keyword recovery_public_ip_address_id: + :paramtype recovery_public_ip_address_id: str + :keyword recovery_lb_backend_address_pool_ids: + :paramtype recovery_lb_backend_address_pool_ids: list[str] + :keyword tfo_subnet_name: + :paramtype tfo_subnet_name: str + :keyword tfo_static_ip_address: + :paramtype tfo_static_ip_address: str + :keyword tfo_public_ip_address_id: + :paramtype tfo_public_ip_address_id: str + :keyword tfo_lb_backend_address_pool_ids: + :paramtype tfo_lb_backend_address_pool_ids: list[str] + """ super(IPConfigInputDetails, self).__init__(**kwargs) self.ip_config_name = ip_config_name self.is_primary = is_primary @@ -13439,10 +17345,10 @@ class Job(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.JobProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The custom data. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.JobProperties """ _validation = { @@ -13466,6 +17372,12 @@ def __init__( properties: Optional["JobProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The custom data. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.JobProperties + """ super(Job, self).__init__(location=location, **kwargs) self.properties = properties @@ -13473,10 +17385,10 @@ def __init__( class JobCollection(msrest.serialization.Model): """Collection of jobs. - :param value: The list of jobs. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.Job] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The list of jobs. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.Job] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -13491,6 +17403,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The list of jobs. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.Job] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(JobCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -13499,18 +17417,18 @@ def __init__( class JobEntity(msrest.serialization.Model): """This class contains the minimal job details required to navigate to the desired drill down. - :param job_id: The job id. - :type job_id: str - :param job_friendly_name: The job display name. - :type job_friendly_name: str - :param target_object_id: The object id. - :type target_object_id: str - :param target_object_name: The object name. - :type target_object_name: str - :param target_instance_type: The workflow affected object type. - :type target_instance_type: str - :param job_scenario_name: The job name. Enum type ScenarioName. - :type job_scenario_name: str + :ivar job_id: The job id. + :vartype job_id: str + :ivar job_friendly_name: The job display name. + :vartype job_friendly_name: str + :ivar target_object_id: The object id. + :vartype target_object_id: str + :ivar target_object_name: The object name. + :vartype target_object_name: str + :ivar target_instance_type: The workflow affected object type. + :vartype target_instance_type: str + :ivar job_scenario_name: The job name. Enum type ScenarioName. + :vartype job_scenario_name: str """ _attribute_map = { @@ -13533,6 +17451,20 @@ def __init__( job_scenario_name: Optional[str] = None, **kwargs ): + """ + :keyword job_id: The job id. + :paramtype job_id: str + :keyword job_friendly_name: The job display name. + :paramtype job_friendly_name: str + :keyword target_object_id: The object id. + :paramtype target_object_id: str + :keyword target_object_name: The object name. + :paramtype target_object_name: str + :keyword target_instance_type: The workflow affected object type. + :paramtype target_instance_type: str + :keyword job_scenario_name: The job name. Enum type ScenarioName. + :paramtype job_scenario_name: str + """ super(JobEntity, self).__init__(**kwargs) self.job_id = job_id self.job_friendly_name = job_friendly_name @@ -13545,16 +17477,16 @@ def __init__( class JobErrorDetails(msrest.serialization.Model): """This class contains the error details per object. - :param service_error_details: The Service error details. - :type service_error_details: ~azure.mgmt.recoveryservicessiterecovery.models.ServiceError - :param provider_error_details: The Provider error details. - :type provider_error_details: ~azure.mgmt.recoveryservicessiterecovery.models.ProviderError - :param error_level: Error level of error. - :type error_level: str - :param creation_time: The creation time of job error. - :type creation_time: ~datetime.datetime - :param task_id: The Id of the task. - :type task_id: str + :ivar service_error_details: The Service error details. + :vartype service_error_details: ~azure.mgmt.recoveryservicessiterecovery.models.ServiceError + :ivar provider_error_details: The Provider error details. + :vartype provider_error_details: ~azure.mgmt.recoveryservicessiterecovery.models.ProviderError + :ivar error_level: Error level of error. + :vartype error_level: str + :ivar creation_time: The creation time of job error. + :vartype creation_time: ~datetime.datetime + :ivar task_id: The Id of the task. + :vartype task_id: str """ _attribute_map = { @@ -13575,6 +17507,19 @@ def __init__( task_id: Optional[str] = None, **kwargs ): + """ + :keyword service_error_details: The Service error details. + :paramtype service_error_details: ~azure.mgmt.recoveryservicessiterecovery.models.ServiceError + :keyword provider_error_details: The Provider error details. + :paramtype provider_error_details: + ~azure.mgmt.recoveryservicessiterecovery.models.ProviderError + :keyword error_level: Error level of error. + :paramtype error_level: str + :keyword creation_time: The creation time of job error. + :paramtype creation_time: ~datetime.datetime + :keyword task_id: The Id of the task. + :paramtype task_id: str + """ super(JobErrorDetails, self).__init__(**kwargs) self.service_error_details = service_error_details self.provider_error_details = provider_error_details @@ -13586,37 +17531,37 @@ def __init__( class JobProperties(msrest.serialization.Model): """Job custom data details. - :param activity_id: The activity id. - :type activity_id: str - :param scenario_name: The ScenarioName. - :type scenario_name: str - :param friendly_name: The DisplayName. - :type friendly_name: str - :param state: The status of the Job. It is one of these values - NotStarted, InProgress, + :ivar activity_id: The activity id. + :vartype activity_id: str + :ivar scenario_name: The ScenarioName. + :vartype scenario_name: str + :ivar friendly_name: The DisplayName. + :vartype friendly_name: str + :ivar state: The status of the Job. It is one of these values - NotStarted, InProgress, Succeeded, Failed, Cancelled, Suspended or Other. - :type state: str - :param state_description: The description of the state of the Job. For e.g. - For Succeeded + :vartype state: str + :ivar state_description: The description of the state of the Job. For e.g. - For Succeeded state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. - :type state_description: str - :param tasks: The tasks. - :type tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] - :param errors: The errors. - :type errors: list[~azure.mgmt.recoveryservicessiterecovery.models.JobErrorDetails] - :param start_time: The start time. - :type start_time: ~datetime.datetime - :param end_time: The end time. - :type end_time: ~datetime.datetime - :param allowed_actions: The Allowed action the job. - :type allowed_actions: list[str] - :param target_object_id: The affected Object Id. - :type target_object_id: str - :param target_object_name: The name of the affected object. - :type target_object_name: str - :param target_instance_type: The type of the affected object which is of + :vartype state_description: str + :ivar tasks: The tasks. + :vartype tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] + :ivar errors: The errors. + :vartype errors: list[~azure.mgmt.recoveryservicessiterecovery.models.JobErrorDetails] + :ivar start_time: The start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time. + :vartype end_time: ~datetime.datetime + :ivar allowed_actions: The Allowed action the job. + :vartype allowed_actions: list[str] + :ivar target_object_id: The affected Object Id. + :vartype target_object_id: str + :ivar target_object_name: The name of the affected object. + :vartype target_object_name: str + :ivar target_instance_type: The type of the affected object which is of Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class. - :type target_instance_type: str - :param custom_details: The custom job details like test failover job details. - :type custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.JobDetails + :vartype target_instance_type: str + :ivar custom_details: The custom job details like test failover job details. + :vartype custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.JobDetails """ _attribute_map = { @@ -13655,6 +17600,39 @@ def __init__( custom_details: Optional["JobDetails"] = None, **kwargs ): + """ + :keyword activity_id: The activity id. + :paramtype activity_id: str + :keyword scenario_name: The ScenarioName. + :paramtype scenario_name: str + :keyword friendly_name: The DisplayName. + :paramtype friendly_name: str + :keyword state: The status of the Job. It is one of these values - NotStarted, InProgress, + Succeeded, Failed, Cancelled, Suspended or Other. + :paramtype state: str + :keyword state_description: The description of the state of the Job. For e.g. - For Succeeded + state, description can be Completed, PartiallySucceeded, CompletedWithInformation or Skipped. + :paramtype state_description: str + :keyword tasks: The tasks. + :paramtype tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] + :keyword errors: The errors. + :paramtype errors: list[~azure.mgmt.recoveryservicessiterecovery.models.JobErrorDetails] + :keyword start_time: The start time. + :paramtype start_time: ~datetime.datetime + :keyword end_time: The end time. + :paramtype end_time: ~datetime.datetime + :keyword allowed_actions: The Allowed action the job. + :paramtype allowed_actions: list[str] + :keyword target_object_id: The affected Object Id. + :paramtype target_object_id: str + :keyword target_object_name: The name of the affected object. + :paramtype target_object_name: str + :keyword target_instance_type: The type of the affected object which is of + Microsoft.Azure.SiteRecovery.V2015_11_10.AffectedObjectType class. + :paramtype target_instance_type: str + :keyword custom_details: The custom job details like test failover job details. + :paramtype custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.JobDetails + """ super(JobProperties, self).__init__(**kwargs) self.activity_id = activity_id self.scenario_name = scenario_name @@ -13675,24 +17653,24 @@ def __init__( class JobQueryParameter(msrest.serialization.Model): """Query parameter to enumerate jobs. - :param start_time: Date time to get jobs from. - :type start_time: str - :param end_time: Date time to get jobs upto. - :type end_time: str - :param fabric_id: The Id of the fabric to search jobs under. - :type fabric_id: str - :param affected_object_types: The type of objects. - :type affected_object_types: str - :param job_status: The states of the job to be filtered can be in. - :type job_status: str - :param job_output_type: The output type of the jobs. Possible values include: "Json", "Xml", + :ivar start_time: Date time to get jobs from. + :vartype start_time: str + :ivar end_time: Date time to get jobs upto. + :vartype end_time: str + :ivar fabric_id: The Id of the fabric to search jobs under. + :vartype fabric_id: str + :ivar affected_object_types: The type of objects. + :vartype affected_object_types: str + :ivar job_status: The states of the job to be filtered can be in. + :vartype job_status: str + :ivar job_output_type: The output type of the jobs. Possible values include: "Json", "Xml", "Excel". - :type job_output_type: str or + :vartype job_output_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.ExportJobOutputSerializationType - :param job_name: The job Name. - :type job_name: str - :param timezone_offset: The timezone offset for the location of the request (in minutes). - :type timezone_offset: float + :ivar job_name: The job Name. + :vartype job_name: str + :ivar timezone_offset: The timezone offset for the location of the request (in minutes). + :vartype timezone_offset: float """ _attribute_map = { @@ -13719,6 +17697,26 @@ def __init__( timezone_offset: Optional[float] = None, **kwargs ): + """ + :keyword start_time: Date time to get jobs from. + :paramtype start_time: str + :keyword end_time: Date time to get jobs upto. + :paramtype end_time: str + :keyword fabric_id: The Id of the fabric to search jobs under. + :paramtype fabric_id: str + :keyword affected_object_types: The type of objects. + :paramtype affected_object_types: str + :keyword job_status: The states of the job to be filtered can be in. + :paramtype job_status: str + :keyword job_output_type: The output type of the jobs. Possible values include: "Json", "Xml", + "Excel". + :paramtype job_output_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.ExportJobOutputSerializationType + :keyword job_name: The job Name. + :paramtype job_name: str + :keyword timezone_offset: The timezone offset for the location of the request (in minutes). + :paramtype timezone_offset: float + """ super(JobQueryParameter, self).__init__(**kwargs) self.start_time = start_time self.end_time = end_time @@ -13735,17 +17733,17 @@ class JobStatusEventDetails(EventSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param job_id: Job arm id for the event. - :type job_id: str - :param job_friendly_name: JobName for the Event. - :type job_friendly_name: str - :param job_status: JobStatus for the Event. - :type job_status: str - :param affected_object_type: AffectedObjectType for the event. - :type affected_object_type: str + :vartype instance_type: str + :ivar job_id: Job arm id for the event. + :vartype job_id: str + :ivar job_friendly_name: JobName for the Event. + :vartype job_friendly_name: str + :ivar job_status: JobStatus for the Event. + :vartype job_status: str + :ivar affected_object_type: AffectedObjectType for the event. + :vartype affected_object_type: str """ _validation = { @@ -13769,6 +17767,16 @@ def __init__( affected_object_type: Optional[str] = None, **kwargs ): + """ + :keyword job_id: Job arm id for the event. + :paramtype job_id: str + :keyword job_friendly_name: JobName for the Event. + :paramtype job_friendly_name: str + :keyword job_status: JobStatus for the Event. + :paramtype job_status: str + :keyword affected_object_type: AffectedObjectType for the event. + :paramtype affected_object_type: str + """ super(JobStatusEventDetails, self).__init__(**kwargs) self.instance_type = 'JobStatus' # type: str self.job_id = job_id @@ -13780,10 +17788,10 @@ def __init__( class KeyEncryptionKeyInfo(msrest.serialization.Model): """Key Encryption Key (KEK) information. - :param key_identifier: The key URL / identifier. - :type key_identifier: str - :param key_vault_resource_arm_id: The KeyVault resource ARM Id for key. - :type key_vault_resource_arm_id: str + :ivar key_identifier: The key URL / identifier. + :vartype key_identifier: str + :ivar key_vault_resource_arm_id: The KeyVault resource ARM Id for key. + :vartype key_vault_resource_arm_id: str """ _attribute_map = { @@ -13798,6 +17806,12 @@ def __init__( key_vault_resource_arm_id: Optional[str] = None, **kwargs ): + """ + :keyword key_identifier: The key URL / identifier. + :paramtype key_identifier: str + :keyword key_vault_resource_arm_id: The KeyVault resource ARM Id for key. + :paramtype key_vault_resource_arm_id: str + """ super(KeyEncryptionKeyInfo, self).__init__(**kwargs) self.key_identifier = key_identifier self.key_vault_resource_arm_id = key_vault_resource_arm_id @@ -13814,10 +17828,10 @@ class LogicalNetwork(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The Logical Network Properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.LogicalNetworkProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The Logical Network Properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.LogicalNetworkProperties """ _validation = { @@ -13841,6 +17855,12 @@ def __init__( properties: Optional["LogicalNetworkProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The Logical Network Properties. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.LogicalNetworkProperties + """ super(LogicalNetwork, self).__init__(location=location, **kwargs) self.properties = properties @@ -13848,10 +17868,10 @@ def __init__( class LogicalNetworkCollection(msrest.serialization.Model): """List of logical networks. - :param value: The Logical Networks list details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.LogicalNetwork] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The Logical Networks list details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.LogicalNetwork] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -13866,6 +17886,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The Logical Networks list details. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.LogicalNetwork] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(LogicalNetworkCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -13874,17 +17900,17 @@ def __init__( class LogicalNetworkProperties(msrest.serialization.Model): """Logical Network Properties. - :param friendly_name: The Friendly Name. - :type friendly_name: str - :param network_virtualization_status: A value indicating whether Network Virtualization is + :ivar friendly_name: The Friendly Name. + :vartype friendly_name: str + :ivar network_virtualization_status: A value indicating whether Network Virtualization is enabled for the logical network. - :type network_virtualization_status: str - :param logical_network_usage: A value indicating whether logical network is used as private - test network by test failover. - :type logical_network_usage: str - :param logical_network_definitions_status: A value indicating whether logical network + :vartype network_virtualization_status: str + :ivar logical_network_usage: A value indicating whether logical network is used as private test + network by test failover. + :vartype logical_network_usage: str + :ivar logical_network_definitions_status: A value indicating whether logical network definitions are isolated. - :type logical_network_definitions_status: str + :vartype logical_network_definitions_status: str """ _attribute_map = { @@ -13903,6 +17929,19 @@ def __init__( logical_network_definitions_status: Optional[str] = None, **kwargs ): + """ + :keyword friendly_name: The Friendly Name. + :paramtype friendly_name: str + :keyword network_virtualization_status: A value indicating whether Network Virtualization is + enabled for the logical network. + :paramtype network_virtualization_status: str + :keyword logical_network_usage: A value indicating whether logical network is used as private + test network by test failover. + :paramtype logical_network_usage: str + :keyword logical_network_definitions_status: A value indicating whether logical network + definitions are isolated. + :paramtype logical_network_definitions_status: str + """ super(LogicalNetworkProperties, self).__init__(**kwargs) self.friendly_name = friendly_name self.network_virtualization_status = network_virtualization_status @@ -13915,14 +17954,14 @@ class ManualActionTaskDetails(TaskTypeDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param name: The name. - :type name: str - :param instructions: The instructions. - :type instructions: str - :param observation: The observation. - :type observation: str + :ivar instance_type: Required. The type of task details.Constant filled by server. + :vartype instance_type: str + :ivar name: The name. + :vartype name: str + :ivar instructions: The instructions. + :vartype instructions: str + :ivar observation: The observation. + :vartype observation: str """ _validation = { @@ -13944,6 +17983,14 @@ def __init__( observation: Optional[str] = None, **kwargs ): + """ + :keyword name: The name. + :paramtype name: str + :keyword instructions: The instructions. + :paramtype instructions: str + :keyword observation: The observation. + :paramtype observation: str + """ super(ManualActionTaskDetails, self).__init__(**kwargs) self.instance_type = 'ManualActionTaskDetails' # type: str self.name = name @@ -14005,6 +18052,8 @@ def __init__( self, **kwargs ): + """ + """ super(MarsAgentDetails, self).__init__(**kwargs) self.id = None self.name = None @@ -14020,42 +18069,43 @@ def __init__( class MasterTargetServer(msrest.serialization.Model): """Details of a Master Target Server. - :param id: The server Id. - :type id: str - :param ip_address: The IP address of the server. - :type ip_address: str - :param name: The server name. - :type name: str - :param os_type: The OS type of the server. - :type os_type: str - :param agent_version: The version of the scout component on the server. - :type agent_version: str - :param last_heartbeat: The last heartbeat received from the server. - :type last_heartbeat: ~datetime.datetime - :param version_status: Version status. - :type version_status: str - :param retention_volumes: The retention volumes of Master target Server. - :type retention_volumes: list[~azure.mgmt.recoveryservicessiterecovery.models.RetentionVolume] - :param data_stores: The list of data stores in the fabric. - :type data_stores: list[~azure.mgmt.recoveryservicessiterecovery.models.DataStore] - :param validation_errors: Validation errors. - :type validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param health_errors: Health errors. - :type health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param disk_count: Disk count of the master target. - :type disk_count: int - :param os_version: OS Version of the master target. - :type os_version: str - :param agent_expiry_date: Agent expiry date. - :type agent_expiry_date: ~datetime.datetime - :param mars_agent_version: MARS agent version. - :type mars_agent_version: str - :param mars_agent_expiry_date: MARS agent expiry date. - :type mars_agent_expiry_date: ~datetime.datetime - :param agent_version_details: Agent version details. - :type agent_version_details: ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails - :param mars_agent_version_details: Mars agent version details. - :type mars_agent_version_details: + :ivar id: The server Id. + :vartype id: str + :ivar ip_address: The IP address of the server. + :vartype ip_address: str + :ivar name: The server name. + :vartype name: str + :ivar os_type: The OS type of the server. + :vartype os_type: str + :ivar agent_version: The version of the scout component on the server. + :vartype agent_version: str + :ivar last_heartbeat: The last heartbeat received from the server. + :vartype last_heartbeat: ~datetime.datetime + :ivar version_status: Version status. + :vartype version_status: str + :ivar retention_volumes: The retention volumes of Master target Server. + :vartype retention_volumes: + list[~azure.mgmt.recoveryservicessiterecovery.models.RetentionVolume] + :ivar data_stores: The list of data stores in the fabric. + :vartype data_stores: list[~azure.mgmt.recoveryservicessiterecovery.models.DataStore] + :ivar validation_errors: Validation errors. + :vartype validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :ivar health_errors: Health errors. + :vartype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :ivar disk_count: Disk count of the master target. + :vartype disk_count: int + :ivar os_version: OS Version of the master target. + :vartype os_version: str + :ivar agent_expiry_date: Agent expiry date. + :vartype agent_expiry_date: ~datetime.datetime + :ivar mars_agent_version: MARS agent version. + :vartype mars_agent_version: str + :ivar mars_agent_expiry_date: MARS agent expiry date. + :vartype mars_agent_expiry_date: ~datetime.datetime + :ivar agent_version_details: Agent version details. + :vartype agent_version_details: ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails + :ivar mars_agent_version_details: Mars agent version details. + :vartype mars_agent_version_details: ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails """ @@ -14103,6 +18153,47 @@ def __init__( mars_agent_version_details: Optional["VersionDetails"] = None, **kwargs ): + """ + :keyword id: The server Id. + :paramtype id: str + :keyword ip_address: The IP address of the server. + :paramtype ip_address: str + :keyword name: The server name. + :paramtype name: str + :keyword os_type: The OS type of the server. + :paramtype os_type: str + :keyword agent_version: The version of the scout component on the server. + :paramtype agent_version: str + :keyword last_heartbeat: The last heartbeat received from the server. + :paramtype last_heartbeat: ~datetime.datetime + :keyword version_status: Version status. + :paramtype version_status: str + :keyword retention_volumes: The retention volumes of Master target Server. + :paramtype retention_volumes: + list[~azure.mgmt.recoveryservicessiterecovery.models.RetentionVolume] + :keyword data_stores: The list of data stores in the fabric. + :paramtype data_stores: list[~azure.mgmt.recoveryservicessiterecovery.models.DataStore] + :keyword validation_errors: Validation errors. + :paramtype validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :keyword health_errors: Health errors. + :paramtype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :keyword disk_count: Disk count of the master target. + :paramtype disk_count: int + :keyword os_version: OS Version of the master target. + :paramtype os_version: str + :keyword agent_expiry_date: Agent expiry date. + :paramtype agent_expiry_date: ~datetime.datetime + :keyword mars_agent_version: MARS agent version. + :paramtype mars_agent_version: str + :keyword mars_agent_expiry_date: MARS agent expiry date. + :paramtype mars_agent_expiry_date: ~datetime.datetime + :keyword agent_version_details: Agent version details. + :paramtype agent_version_details: + ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails + :keyword mars_agent_version_details: Mars agent version details. + :paramtype mars_agent_version_details: + ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails + """ super(MasterTargetServer, self).__init__(**kwargs) self.id = id self.ip_address = ip_address @@ -14129,8 +18220,8 @@ class MigrateInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. Migrate input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.MigrateInputProperties + :ivar properties: Required. Migrate input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.MigrateInputProperties """ _validation = { @@ -14147,6 +18238,10 @@ def __init__( properties: "MigrateInputProperties", **kwargs ): + """ + :keyword properties: Required. Migrate input properties. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.MigrateInputProperties + """ super(MigrateInput, self).__init__(**kwargs) self.properties = properties @@ -14156,8 +18251,8 @@ class MigrateInputProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param provider_specific_details: Required. The provider specific details. - :type provider_specific_details: + :ivar provider_specific_details: Required. The provider specific details. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.MigrateProviderSpecificInput """ @@ -14175,6 +18270,11 @@ def __init__( provider_specific_details: "MigrateProviderSpecificInput", **kwargs ): + """ + :keyword provider_specific_details: Required. The provider specific details. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.MigrateProviderSpecificInput + """ super(MigrateInputProperties, self).__init__(**kwargs) self.provider_specific_details = provider_specific_details @@ -14187,8 +18287,8 @@ class MigrateProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -14207,6 +18307,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrateProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -14222,10 +18324,10 @@ class MigrationItem(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The migration item properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.MigrationItemProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The migration item properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.MigrationItemProperties """ _validation = { @@ -14249,6 +18351,12 @@ def __init__( properties: Optional["MigrationItemProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The migration item properties. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.MigrationItemProperties + """ super(MigrationItem, self).__init__(location=location, **kwargs) self.properties = properties @@ -14256,10 +18364,10 @@ def __init__( class MigrationItemCollection(msrest.serialization.Model): """Migration item collection. - :param value: The list of migration items. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The list of migration items. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -14274,6 +18382,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The list of migration items. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(MigrationItemCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -14321,8 +18435,8 @@ class MigrationItemProperties(msrest.serialization.Model): :vartype current_job: ~azure.mgmt.recoveryservicessiterecovery.models.CurrentJobDetails :ivar event_correlation_id: The correlation Id for events associated with this migration item. :vartype event_correlation_id: str - :param provider_specific_details: The migration provider custom settings. - :type provider_specific_details: + :ivar provider_specific_details: The migration provider custom settings. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.MigrationProviderSpecificSettings """ @@ -14367,6 +18481,11 @@ def __init__( provider_specific_details: Optional["MigrationProviderSpecificSettings"] = None, **kwargs ): + """ + :keyword provider_specific_details: The migration provider custom settings. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.MigrationProviderSpecificSettings + """ super(MigrationItemProperties, self).__init__(**kwargs) self.machine_name = None self.policy_id = None @@ -14388,12 +18507,12 @@ def __init__( class MigrationItemsQueryParameter(msrest.serialization.Model): """Query parameter to enumerate migration items. - :param source_fabric_name: The source fabric name filter. - :type source_fabric_name: str - :param source_container_name: The source container name filter. - :type source_container_name: str - :param instance_type: The replication provider type. - :type instance_type: str + :ivar source_fabric_name: The source fabric name filter. + :vartype source_fabric_name: str + :ivar source_container_name: The source container name filter. + :vartype source_container_name: str + :ivar instance_type: The replication provider type. + :vartype instance_type: str """ _attribute_map = { @@ -14410,6 +18529,14 @@ def __init__( instance_type: Optional[str] = None, **kwargs ): + """ + :keyword source_fabric_name: The source fabric name filter. + :paramtype source_fabric_name: str + :keyword source_container_name: The source container name filter. + :paramtype source_container_name: str + :keyword instance_type: The replication provider type. + :paramtype instance_type: str + """ super(MigrationItemsQueryParameter, self).__init__(**kwargs) self.source_fabric_name = source_fabric_name self.source_container_name = source_container_name @@ -14424,8 +18551,8 @@ class MigrationProviderSpecificSettings(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -14444,6 +18571,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrationProviderSpecificSettings, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -14459,10 +18588,10 @@ class MigrationRecoveryPoint(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: Recovery point properties. - :type properties: + :ivar location: Resource Location. + :vartype location: str + :ivar properties: Recovery point properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.MigrationRecoveryPointProperties """ @@ -14487,6 +18616,13 @@ def __init__( properties: Optional["MigrationRecoveryPointProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: Recovery point properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.MigrationRecoveryPointProperties + """ super(MigrationRecoveryPoint, self).__init__(location=location, **kwargs) self.properties = properties @@ -14494,10 +18630,10 @@ def __init__( class MigrationRecoveryPointCollection(msrest.serialization.Model): """Collection of migration recovery points. - :param value: The migration recovery point details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.MigrationRecoveryPoint] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The migration recovery point details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.MigrationRecoveryPoint] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -14512,6 +18648,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The migration recovery point details. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.MigrationRecoveryPoint] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(MigrationRecoveryPointCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -14544,6 +18686,8 @@ def __init__( self, **kwargs ): + """ + """ super(MigrationRecoveryPointProperties, self).__init__(**kwargs) self.recovery_point_time = None self.recovery_point_type = None @@ -14552,12 +18696,12 @@ def __init__( class MobilityServiceUpdate(msrest.serialization.Model): """The Mobility Service update details. - :param version: The version of the latest update. - :type version: str - :param reboot_status: The reboot status of the update - whether it is required or not. - :type reboot_status: str - :param os_type: The OS type. - :type os_type: str + :ivar version: The version of the latest update. + :vartype version: str + :ivar reboot_status: The reboot status of the update - whether it is required or not. + :vartype reboot_status: str + :ivar os_type: The OS type. + :vartype os_type: str """ _attribute_map = { @@ -14574,6 +18718,14 @@ def __init__( os_type: Optional[str] = None, **kwargs ): + """ + :keyword version: The version of the latest update. + :paramtype version: str + :keyword reboot_status: The reboot status of the update - whether it is required or not. + :paramtype reboot_status: str + :keyword os_type: The OS type. + :paramtype os_type: str + """ super(MobilityServiceUpdate, self).__init__(**kwargs) self.version = version self.reboot_status = reboot_status @@ -14591,10 +18743,10 @@ class Network(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The Network Properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.NetworkProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The Network Properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.NetworkProperties """ _validation = { @@ -14618,6 +18770,12 @@ def __init__( properties: Optional["NetworkProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The Network Properties. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.NetworkProperties + """ super(Network, self).__init__(location=location, **kwargs) self.properties = properties @@ -14625,10 +18783,10 @@ def __init__( class NetworkCollection(msrest.serialization.Model): """List of networks. - :param value: The Networks list details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.Network] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The Networks list details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.Network] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -14643,6 +18801,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The Networks list details. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.Network] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(NetworkCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -14659,10 +18823,10 @@ class NetworkMapping(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The Network Mapping Properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The Network Mapping Properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingProperties """ _validation = { @@ -14686,6 +18850,12 @@ def __init__( properties: Optional["NetworkMappingProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The Network Mapping Properties. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingProperties + """ super(NetworkMapping, self).__init__(location=location, **kwargs) self.properties = properties @@ -14693,10 +18863,10 @@ def __init__( class NetworkMappingCollection(msrest.serialization.Model): """List of network mappings. As with NetworkMapping, it should be possible to reuse a prev version of this class. It doesn't seem likely this class could be anything more than a slightly bespoke collection of NetworkMapping. Hence it makes sense to override Load with Base.NetworkMapping instead of existing CurrentVersion.NetworkMapping. - :param value: The Network Mappings list. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMapping] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The Network Mappings list. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMapping] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -14711,6 +18881,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The Network Mappings list. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMapping] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(NetworkMappingCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -14719,24 +18895,24 @@ def __init__( class NetworkMappingProperties(msrest.serialization.Model): """Network Mapping Properties. - :param state: The pairing state for network mapping. - :type state: str - :param primary_network_friendly_name: The primary network friendly name. - :type primary_network_friendly_name: str - :param primary_network_id: The primary network id for network mapping. - :type primary_network_id: str - :param primary_fabric_friendly_name: The primary fabric friendly name. - :type primary_fabric_friendly_name: str - :param recovery_network_friendly_name: The recovery network friendly name. - :type recovery_network_friendly_name: str - :param recovery_network_id: The recovery network id for network mapping. - :type recovery_network_id: str - :param recovery_fabric_arm_id: The recovery fabric ARM id. - :type recovery_fabric_arm_id: str - :param recovery_fabric_friendly_name: The recovery fabric friendly name. - :type recovery_fabric_friendly_name: str - :param fabric_specific_settings: The fabric specific settings. - :type fabric_specific_settings: + :ivar state: The pairing state for network mapping. + :vartype state: str + :ivar primary_network_friendly_name: The primary network friendly name. + :vartype primary_network_friendly_name: str + :ivar primary_network_id: The primary network id for network mapping. + :vartype primary_network_id: str + :ivar primary_fabric_friendly_name: The primary fabric friendly name. + :vartype primary_fabric_friendly_name: str + :ivar recovery_network_friendly_name: The recovery network friendly name. + :vartype recovery_network_friendly_name: str + :ivar recovery_network_id: The recovery network id for network mapping. + :vartype recovery_network_id: str + :ivar recovery_fabric_arm_id: The recovery fabric ARM id. + :vartype recovery_fabric_arm_id: str + :ivar recovery_fabric_friendly_name: The recovery fabric friendly name. + :vartype recovery_fabric_friendly_name: str + :ivar fabric_specific_settings: The fabric specific settings. + :vartype fabric_specific_settings: ~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingFabricSpecificSettings """ @@ -14766,6 +18942,27 @@ def __init__( fabric_specific_settings: Optional["NetworkMappingFabricSpecificSettings"] = None, **kwargs ): + """ + :keyword state: The pairing state for network mapping. + :paramtype state: str + :keyword primary_network_friendly_name: The primary network friendly name. + :paramtype primary_network_friendly_name: str + :keyword primary_network_id: The primary network id for network mapping. + :paramtype primary_network_id: str + :keyword primary_fabric_friendly_name: The primary fabric friendly name. + :paramtype primary_fabric_friendly_name: str + :keyword recovery_network_friendly_name: The recovery network friendly name. + :paramtype recovery_network_friendly_name: str + :keyword recovery_network_id: The recovery network id for network mapping. + :paramtype recovery_network_id: str + :keyword recovery_fabric_arm_id: The recovery fabric ARM id. + :paramtype recovery_fabric_arm_id: str + :keyword recovery_fabric_friendly_name: The recovery fabric friendly name. + :paramtype recovery_fabric_friendly_name: str + :keyword fabric_specific_settings: The fabric specific settings. + :paramtype fabric_specific_settings: + ~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingFabricSpecificSettings + """ super(NetworkMappingProperties, self).__init__(**kwargs) self.state = state self.primary_network_friendly_name = primary_network_friendly_name @@ -14781,14 +18978,14 @@ def __init__( class NetworkProperties(msrest.serialization.Model): """Network Properties. - :param fabric_type: The Fabric Type. - :type fabric_type: str - :param subnets: The List of subnets. - :type subnets: list[~azure.mgmt.recoveryservicessiterecovery.models.Subnet] - :param friendly_name: The Friendly Name. - :type friendly_name: str - :param network_type: The Network Type. - :type network_type: str + :ivar fabric_type: The Fabric Type. + :vartype fabric_type: str + :ivar subnets: The List of subnets. + :vartype subnets: list[~azure.mgmt.recoveryservicessiterecovery.models.Subnet] + :ivar friendly_name: The Friendly Name. + :vartype friendly_name: str + :ivar network_type: The Network Type. + :vartype network_type: str """ _attribute_map = { @@ -14807,6 +19004,16 @@ def __init__( network_type: Optional[str] = None, **kwargs ): + """ + :keyword fabric_type: The Fabric Type. + :paramtype fabric_type: str + :keyword subnets: The List of subnets. + :paramtype subnets: list[~azure.mgmt.recoveryservicessiterecovery.models.Subnet] + :keyword friendly_name: The Friendly Name. + :paramtype friendly_name: str + :keyword network_type: The Network Type. + :paramtype network_type: str + """ super(NetworkProperties, self).__init__(**kwargs) self.fabric_type = fabric_type self.subnets = subnets @@ -14819,21 +19026,21 @@ class NewProtectionProfile(ProtectionProfileCustomDetails): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param policy_name: Required. The protection profile input. - :type policy_name: str - :param recovery_point_history: The duration in minutes until which the recovery points need to + :ivar resource_type: Required. The class type.Constant filled by server. + :vartype resource_type: str + :ivar policy_name: Required. The protection profile input. + :vartype policy_name: str + :ivar recovery_point_history: The duration in minutes until which the recovery points need to be stored. - :type recovery_point_history: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in + :vartype recovery_point_history: int + :ivar crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in minutes). - :type crash_consistent_frequency_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). - :type app_consistent_frequency_in_minutes: int - :param multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be + :vartype crash_consistent_frequency_in_minutes: int + :ivar app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). + :vartype app_consistent_frequency_in_minutes: int + :ivar multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: "Enable", "Disable". - :type multi_vm_sync_status: str or + :vartype multi_vm_sync_status: str or ~azure.mgmt.recoveryservicessiterecovery.models.SetMultiVmSyncStatus """ @@ -14862,6 +19069,23 @@ def __init__( app_consistent_frequency_in_minutes: Optional[int] = None, **kwargs ): + """ + :keyword policy_name: Required. The protection profile input. + :paramtype policy_name: str + :keyword recovery_point_history: The duration in minutes until which the recovery points need + to be stored. + :paramtype recovery_point_history: int + :keyword crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in + minutes). + :paramtype crash_consistent_frequency_in_minutes: int + :keyword app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in + minutes). + :paramtype app_consistent_frequency_in_minutes: int + :keyword multi_vm_sync_status: Required. A value indicating whether multi-VM sync has to be + enabled. Value should be 'Enabled' or 'Disabled'. Possible values include: "Enable", "Disable". + :paramtype multi_vm_sync_status: str or + ~azure.mgmt.recoveryservicessiterecovery.models.SetMultiVmSyncStatus + """ super(NewProtectionProfile, self).__init__(**kwargs) self.resource_type = 'New' # type: str self.policy_name = policy_name @@ -14876,14 +19100,14 @@ class NewRecoveryVirtualNetwork(RecoveryVirtualNetworkCustomDetails): All required parameters must be populated in order to send to Azure. - :param resource_type: Required. The class type.Constant filled by server. - :type resource_type: str - :param recovery_virtual_network_resource_group_name: The name of the resource group to be used + :ivar resource_type: Required. The class type.Constant filled by server. + :vartype resource_type: str + :ivar recovery_virtual_network_resource_group_name: The name of the resource group to be used to create the recovery virtual network. If absent, target network would be created in the same resource group as target VM. - :type recovery_virtual_network_resource_group_name: str - :param recovery_virtual_network_name: The recovery virtual network name. - :type recovery_virtual_network_name: str + :vartype recovery_virtual_network_resource_group_name: str + :ivar recovery_virtual_network_name: The recovery virtual network name. + :vartype recovery_virtual_network_name: str """ _validation = { @@ -14903,6 +19127,14 @@ def __init__( recovery_virtual_network_name: Optional[str] = None, **kwargs ): + """ + :keyword recovery_virtual_network_resource_group_name: The name of the resource group to be + used to create the recovery virtual network. If absent, target network would be created in the + same resource group as target VM. + :paramtype recovery_virtual_network_resource_group_name: str + :keyword recovery_virtual_network_name: The recovery virtual network name. + :paramtype recovery_virtual_network_name: str + """ super(NewRecoveryVirtualNetwork, self).__init__(**kwargs) self.resource_type = 'New' # type: str self.recovery_virtual_network_resource_group_name = recovery_virtual_network_resource_group_name @@ -14912,7 +19144,7 @@ def __init__( class OperationsDiscovery(msrest.serialization.Model): """Operations discovery class. - :param name: Name of the API. The name of the operation being performed on this particular + :ivar name: Name of the API. The name of the operation being performed on this particular object. It should match the action name that appears in RBAC / the event service. Examples of operations include: * Microsoft.Compute/virtualMachine/capture/action * Microsoft.Compute/virtualMachine/restart/action * Microsoft.Compute/virtualMachine/write * @@ -14925,14 +19157,14 @@ class OperationsDiscovery(msrest.serialization.Model): include the "{Resource Provider Namespace}/register/action" operation in their response. This API is used to register for their service, and should include details about the operation (e.g. a localized name for the resource provider + any special considerations like PII release). - :type name: str - :param display: Object type. - :type display: ~azure.mgmt.recoveryservicessiterecovery.models.Display - :param origin: Origin. The intended executor of the operation; governs the display of the + :vartype name: str + :ivar display: Object type. + :vartype display: ~azure.mgmt.recoveryservicessiterecovery.models.Display + :ivar origin: Origin. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is "user,system". - :type origin: str - :param properties: Properties. Reserved for future use. - :type properties: any + :vartype origin: str + :ivar properties: Properties. Reserved for future use. + :vartype properties: any """ _attribute_map = { @@ -14951,6 +19183,29 @@ def __init__( properties: Optional[Any] = None, **kwargs ): + """ + :keyword name: Name of the API. The name of the operation being performed on this particular + object. It should match the action name that appears in RBAC / the event service. Examples of + operations include: * Microsoft.Compute/virtualMachine/capture/action * + Microsoft.Compute/virtualMachine/restart/action * Microsoft.Compute/virtualMachine/write * + Microsoft.Compute/virtualMachine/read * Microsoft.Compute/virtualMachine/delete Each action + should include, in order: (1) Resource Provider Namespace (2) Type hierarchy for which the + action applies (e.g. server/databases for a SQL Azure database) (3) Read, Write, Action or + Delete indicating which type applies. If it is a PUT/PATCH on a collection or named value, + Write should be used. If it is a GET, Read should be used. If it is a DELETE, Delete should be + used. If it is a POST, Action should be used. As a note: all resource providers would need to + include the "{Resource Provider Namespace}/register/action" operation in their response. This + API is used to register for their service, and should include details about the operation (e.g. + a localized name for the resource provider + any special considerations like PII release). + :paramtype name: str + :keyword display: Object type. + :paramtype display: ~azure.mgmt.recoveryservicessiterecovery.models.Display + :keyword origin: Origin. The intended executor of the operation; governs the display of the + operation in the RBAC UX and the audit logs UX. Default value is "user,system". + :paramtype origin: str + :keyword properties: Properties. Reserved for future use. + :paramtype properties: any + """ super(OperationsDiscovery, self).__init__(**kwargs) self.name = name self.display = display @@ -14961,10 +19216,10 @@ def __init__( class OperationsDiscoveryCollection(msrest.serialization.Model): """Collection of ClientDiscovery details. - :param value: The ClientDiscovery details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.OperationsDiscovery] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The ClientDiscovery details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.OperationsDiscovery] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -14979,6 +19234,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The ClientDiscovery details. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.OperationsDiscovery] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(OperationsDiscoveryCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -14987,18 +19248,18 @@ def __init__( class OSDetails(msrest.serialization.Model): """Disk Details. - :param os_type: VM Disk details. - :type os_type: str - :param product_type: Product type. - :type product_type: str - :param os_edition: The OSEdition. - :type os_edition: str - :param o_s_version: The OS Version. - :type o_s_version: str - :param o_s_major_version: The OS Major Version. - :type o_s_major_version: str - :param o_s_minor_version: The OS Minor Version. - :type o_s_minor_version: str + :ivar os_type: VM Disk details. + :vartype os_type: str + :ivar product_type: Product type. + :vartype product_type: str + :ivar os_edition: The OSEdition. + :vartype os_edition: str + :ivar o_s_version: The OS Version. + :vartype o_s_version: str + :ivar o_s_major_version: The OS Major Version. + :vartype o_s_major_version: str + :ivar o_s_minor_version: The OS Minor Version. + :vartype o_s_minor_version: str """ _attribute_map = { @@ -15021,6 +19282,20 @@ def __init__( o_s_minor_version: Optional[str] = None, **kwargs ): + """ + :keyword os_type: VM Disk details. + :paramtype os_type: str + :keyword product_type: Product type. + :paramtype product_type: str + :keyword os_edition: The OSEdition. + :paramtype os_edition: str + :keyword o_s_version: The OS Version. + :paramtype o_s_version: str + :keyword o_s_major_version: The OS Major Version. + :paramtype o_s_major_version: str + :keyword o_s_minor_version: The OS Minor Version. + :paramtype o_s_minor_version: str + """ super(OSDetails, self).__init__(**kwargs) self.os_type = os_type self.product_type = product_type @@ -15033,12 +19308,12 @@ def __init__( class OSDiskDetails(msrest.serialization.Model): """Details of the OS Disk. - :param os_vhd_id: The id of the disk containing the OS. - :type os_vhd_id: str - :param os_type: The type of the OS on the VM. - :type os_type: str - :param vhd_name: The OS disk VHD name. - :type vhd_name: str + :ivar os_vhd_id: The id of the disk containing the OS. + :vartype os_vhd_id: str + :ivar os_type: The type of the OS on the VM. + :vartype os_type: str + :ivar vhd_name: The OS disk VHD name. + :vartype vhd_name: str """ _attribute_map = { @@ -15055,6 +19330,14 @@ def __init__( vhd_name: Optional[str] = None, **kwargs ): + """ + :keyword os_vhd_id: The id of the disk containing the OS. + :paramtype os_vhd_id: str + :keyword os_type: The type of the OS on the VM. + :paramtype os_type: str + :keyword vhd_name: The OS disk VHD name. + :paramtype vhd_name: str + """ super(OSDiskDetails, self).__init__(**kwargs) self.os_vhd_id = os_vhd_id self.os_type = os_type @@ -15064,10 +19347,10 @@ def __init__( class OSVersionWrapper(msrest.serialization.Model): """Wrapper model for OSVersion to include version and service pack info. - :param version: The version. - :type version: str - :param service_pack: The service pack. - :type service_pack: str + :ivar version: The version. + :vartype version: str + :ivar service_pack: The service pack. + :vartype service_pack: str """ _attribute_map = { @@ -15082,6 +19365,12 @@ def __init__( service_pack: Optional[str] = None, **kwargs ): + """ + :keyword version: The version. + :paramtype version: str + :keyword service_pack: The service pack. + :paramtype service_pack: str + """ super(OSVersionWrapper, self).__init__(**kwargs) self.version = version self.service_pack = service_pack @@ -15090,8 +19379,8 @@ def __init__( class PlannedFailoverInput(msrest.serialization.Model): """Input definition for planned failover. - :param properties: Planned failover input properties. - :type properties: + :ivar properties: Planned failover input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.PlannedFailoverInputProperties """ @@ -15105,6 +19394,11 @@ def __init__( properties: Optional["PlannedFailoverInputProperties"] = None, **kwargs ): + """ + :keyword properties: Planned failover input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.PlannedFailoverInputProperties + """ super(PlannedFailoverInput, self).__init__(**kwargs) self.properties = properties @@ -15112,10 +19406,10 @@ def __init__( class PlannedFailoverInputProperties(msrest.serialization.Model): """Input definition for planned failover input properties. - :param failover_direction: Failover direction. - :type failover_direction: str - :param provider_specific_details: Provider specific settings. - :type provider_specific_details: + :ivar failover_direction: Failover direction. + :vartype failover_direction: str + :ivar provider_specific_details: Provider specific settings. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.PlannedFailoverProviderSpecificFailoverInput """ @@ -15131,6 +19425,13 @@ def __init__( provider_specific_details: Optional["PlannedFailoverProviderSpecificFailoverInput"] = None, **kwargs ): + """ + :keyword failover_direction: Failover direction. + :paramtype failover_direction: str + :keyword provider_specific_details: Provider specific settings. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.PlannedFailoverProviderSpecificFailoverInput + """ super(PlannedFailoverInputProperties, self).__init__(**kwargs) self.failover_direction = failover_direction self.provider_specific_details = provider_specific_details @@ -15147,10 +19448,10 @@ class Policy(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.PolicyProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The custom data. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.PolicyProperties """ _validation = { @@ -15174,6 +19475,12 @@ def __init__( properties: Optional["PolicyProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The custom data. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.PolicyProperties + """ super(Policy, self).__init__(location=location, **kwargs) self.properties = properties @@ -15181,10 +19488,10 @@ def __init__( class PolicyCollection(msrest.serialization.Model): """Protection Profile Collection details. - :param value: The policy details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.Policy] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The policy details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.Policy] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -15199,6 +19506,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The policy details. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.Policy] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(PolicyCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -15207,10 +19520,10 @@ def __init__( class PolicyProperties(msrest.serialization.Model): """Protection profile custom data details. - :param friendly_name: The FriendlyName. - :type friendly_name: str - :param provider_specific_details: The ReplicationChannelSetting. - :type provider_specific_details: + :ivar friendly_name: The FriendlyName. + :vartype friendly_name: str + :ivar provider_specific_details: The ReplicationChannelSetting. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.PolicyProviderSpecificDetails """ @@ -15226,6 +19539,13 @@ def __init__( provider_specific_details: Optional["PolicyProviderSpecificDetails"] = None, **kwargs ): + """ + :keyword friendly_name: The FriendlyName. + :paramtype friendly_name: str + :keyword provider_specific_details: The ReplicationChannelSetting. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.PolicyProviderSpecificDetails + """ super(PolicyProperties, self).__init__(**kwargs) self.friendly_name = friendly_name self.provider_specific_details = provider_specific_details @@ -15236,65 +19556,65 @@ class ProcessServer(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param friendly_name: The Process Server's friendly name. - :type friendly_name: str - :param id: The Process Server Id. - :type id: str - :param ip_address: The IP address of the server. - :type ip_address: str - :param os_type: The OS type of the server. - :type os_type: str - :param agent_version: The version of the scout component on the server. - :type agent_version: str - :param last_heartbeat: The last heartbeat received from the server. - :type last_heartbeat: ~datetime.datetime - :param version_status: Version status. - :type version_status: str - :param mobility_service_updates: The list of the mobility service updates available on the + :ivar friendly_name: The Process Server's friendly name. + :vartype friendly_name: str + :ivar id: The Process Server Id. + :vartype id: str + :ivar ip_address: The IP address of the server. + :vartype ip_address: str + :ivar os_type: The OS type of the server. + :vartype os_type: str + :ivar agent_version: The version of the scout component on the server. + :vartype agent_version: str + :ivar last_heartbeat: The last heartbeat received from the server. + :vartype last_heartbeat: ~datetime.datetime + :ivar version_status: Version status. + :vartype version_status: str + :ivar mobility_service_updates: The list of the mobility service updates available on the Process Server. - :type mobility_service_updates: + :vartype mobility_service_updates: list[~azure.mgmt.recoveryservicessiterecovery.models.MobilityServiceUpdate] - :param host_id: The agent generated Id. - :type host_id: str - :param machine_count: The servers configured with this PS. - :type machine_count: str - :param replication_pair_count: The number of replication pairs configured in this PS. - :type replication_pair_count: str - :param system_load: The percentage of the system load. - :type system_load: str - :param system_load_status: The system load status. - :type system_load_status: str - :param cpu_load: The percentage of the CPU load. - :type cpu_load: str - :param cpu_load_status: The CPU load status. - :type cpu_load_status: str - :param total_memory_in_bytes: The total memory. - :type total_memory_in_bytes: long - :param available_memory_in_bytes: The available memory. - :type available_memory_in_bytes: long - :param memory_usage_status: The memory usage status. - :type memory_usage_status: str - :param total_space_in_bytes: The total space. - :type total_space_in_bytes: long - :param available_space_in_bytes: The available space. - :type available_space_in_bytes: long - :param space_usage_status: The space usage status. - :type space_usage_status: str - :param ps_service_status: The PS service status. - :type ps_service_status: str - :param ssl_cert_expiry_date: The PS SSL cert expiry date. - :type ssl_cert_expiry_date: ~datetime.datetime - :param ssl_cert_expiry_remaining_days: CS SSL cert expiry date. - :type ssl_cert_expiry_remaining_days: int - :param os_version: OS Version of the process server. Note: This will get populated if user has + :ivar host_id: The agent generated Id. + :vartype host_id: str + :ivar machine_count: The servers configured with this PS. + :vartype machine_count: str + :ivar replication_pair_count: The number of replication pairs configured in this PS. + :vartype replication_pair_count: str + :ivar system_load: The percentage of the system load. + :vartype system_load: str + :ivar system_load_status: The system load status. + :vartype system_load_status: str + :ivar cpu_load: The percentage of the CPU load. + :vartype cpu_load: str + :ivar cpu_load_status: The CPU load status. + :vartype cpu_load_status: str + :ivar total_memory_in_bytes: The total memory. + :vartype total_memory_in_bytes: long + :ivar available_memory_in_bytes: The available memory. + :vartype available_memory_in_bytes: long + :ivar memory_usage_status: The memory usage status. + :vartype memory_usage_status: str + :ivar total_space_in_bytes: The total space. + :vartype total_space_in_bytes: long + :ivar available_space_in_bytes: The available space. + :vartype available_space_in_bytes: long + :ivar space_usage_status: The space usage status. + :vartype space_usage_status: str + :ivar ps_service_status: The PS service status. + :vartype ps_service_status: str + :ivar ssl_cert_expiry_date: The PS SSL cert expiry date. + :vartype ssl_cert_expiry_date: ~datetime.datetime + :ivar ssl_cert_expiry_remaining_days: CS SSL cert expiry date. + :vartype ssl_cert_expiry_remaining_days: int + :ivar os_version: OS Version of the process server. Note: This will get populated if user has CS version greater than 9.12.0.0. - :type os_version: str - :param health_errors: Health errors. - :type health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param agent_expiry_date: Agent expiry date. - :type agent_expiry_date: ~datetime.datetime - :param agent_version_details: The agent version details. - :type agent_version_details: ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails + :vartype os_version: str + :ivar health_errors: Health errors. + :vartype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :ivar agent_expiry_date: Agent expiry date. + :vartype agent_expiry_date: ~datetime.datetime + :ivar agent_version_details: The agent version details. + :vartype agent_version_details: ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails :ivar health: The health of Process Server. Possible values include: "None", "Normal", "Warning", "Critical". :vartype health: str or ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionHealth @@ -15397,6 +19717,68 @@ def __init__( agent_version_details: Optional["VersionDetails"] = None, **kwargs ): + """ + :keyword friendly_name: The Process Server's friendly name. + :paramtype friendly_name: str + :keyword id: The Process Server Id. + :paramtype id: str + :keyword ip_address: The IP address of the server. + :paramtype ip_address: str + :keyword os_type: The OS type of the server. + :paramtype os_type: str + :keyword agent_version: The version of the scout component on the server. + :paramtype agent_version: str + :keyword last_heartbeat: The last heartbeat received from the server. + :paramtype last_heartbeat: ~datetime.datetime + :keyword version_status: Version status. + :paramtype version_status: str + :keyword mobility_service_updates: The list of the mobility service updates available on the + Process Server. + :paramtype mobility_service_updates: + list[~azure.mgmt.recoveryservicessiterecovery.models.MobilityServiceUpdate] + :keyword host_id: The agent generated Id. + :paramtype host_id: str + :keyword machine_count: The servers configured with this PS. + :paramtype machine_count: str + :keyword replication_pair_count: The number of replication pairs configured in this PS. + :paramtype replication_pair_count: str + :keyword system_load: The percentage of the system load. + :paramtype system_load: str + :keyword system_load_status: The system load status. + :paramtype system_load_status: str + :keyword cpu_load: The percentage of the CPU load. + :paramtype cpu_load: str + :keyword cpu_load_status: The CPU load status. + :paramtype cpu_load_status: str + :keyword total_memory_in_bytes: The total memory. + :paramtype total_memory_in_bytes: long + :keyword available_memory_in_bytes: The available memory. + :paramtype available_memory_in_bytes: long + :keyword memory_usage_status: The memory usage status. + :paramtype memory_usage_status: str + :keyword total_space_in_bytes: The total space. + :paramtype total_space_in_bytes: long + :keyword available_space_in_bytes: The available space. + :paramtype available_space_in_bytes: long + :keyword space_usage_status: The space usage status. + :paramtype space_usage_status: str + :keyword ps_service_status: The PS service status. + :paramtype ps_service_status: str + :keyword ssl_cert_expiry_date: The PS SSL cert expiry date. + :paramtype ssl_cert_expiry_date: ~datetime.datetime + :keyword ssl_cert_expiry_remaining_days: CS SSL cert expiry date. + :paramtype ssl_cert_expiry_remaining_days: int + :keyword os_version: OS Version of the process server. Note: This will get populated if user + has CS version greater than 9.12.0.0. + :paramtype os_version: str + :keyword health_errors: Health errors. + :paramtype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :keyword agent_expiry_date: Agent expiry date. + :paramtype agent_expiry_date: ~datetime.datetime + :keyword agent_version_details: The agent version details. + :paramtype agent_version_details: + ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails + """ super(ProcessServer, self).__init__(**kwargs) self.friendly_name = friendly_name self.id = id @@ -15582,6 +19964,8 @@ def __init__( self, **kwargs ): + """ + """ super(ProcessServerDetails, self).__init__(**kwargs) self.id = None self.name = None @@ -15625,10 +20009,10 @@ class ProtectableItem(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.ProtectableItemProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The custom data. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.ProtectableItemProperties """ _validation = { @@ -15652,6 +20036,13 @@ def __init__( properties: Optional["ProtectableItemProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The custom data. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.ProtectableItemProperties + """ super(ProtectableItem, self).__init__(location=location, **kwargs) self.properties = properties @@ -15659,10 +20050,10 @@ def __init__( class ProtectableItemCollection(msrest.serialization.Model): """Protectable item collection. - :param value: The Protectable item details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.ProtectableItem] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The Protectable item details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.ProtectableItem] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -15677,6 +20068,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The Protectable item details. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.ProtectableItem] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(ProtectableItemCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -15685,21 +20082,21 @@ def __init__( class ProtectableItemProperties(msrest.serialization.Model): """Replication protected item custom data details. - :param friendly_name: The name. - :type friendly_name: str - :param protection_status: The protection status. - :type protection_status: str - :param replication_protected_item_id: The ARM resource of protected items. - :type replication_protected_item_id: str - :param recovery_services_provider_id: The recovery provider ARM Id. - :type recovery_services_provider_id: str - :param protection_readiness_errors: The Current protection readiness errors. - :type protection_readiness_errors: list[str] - :param supported_replication_providers: The list of replication providers supported for the + :ivar friendly_name: The name. + :vartype friendly_name: str + :ivar protection_status: The protection status. + :vartype protection_status: str + :ivar replication_protected_item_id: The ARM resource of protected items. + :vartype replication_protected_item_id: str + :ivar recovery_services_provider_id: The recovery provider ARM Id. + :vartype recovery_services_provider_id: str + :ivar protection_readiness_errors: The Current protection readiness errors. + :vartype protection_readiness_errors: list[str] + :ivar supported_replication_providers: The list of replication providers supported for the protectable item. - :type supported_replication_providers: list[str] - :param custom_details: The Replication provider custom settings. - :type custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.ConfigurationSettings + :vartype supported_replication_providers: list[str] + :ivar custom_details: The Replication provider custom settings. + :vartype custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.ConfigurationSettings """ _attribute_map = { @@ -15724,6 +20121,24 @@ def __init__( custom_details: Optional["ConfigurationSettings"] = None, **kwargs ): + """ + :keyword friendly_name: The name. + :paramtype friendly_name: str + :keyword protection_status: The protection status. + :paramtype protection_status: str + :keyword replication_protected_item_id: The ARM resource of protected items. + :paramtype replication_protected_item_id: str + :keyword recovery_services_provider_id: The recovery provider ARM Id. + :paramtype recovery_services_provider_id: str + :keyword protection_readiness_errors: The Current protection readiness errors. + :paramtype protection_readiness_errors: list[str] + :keyword supported_replication_providers: The list of replication providers supported for the + protectable item. + :paramtype supported_replication_providers: list[str] + :keyword custom_details: The Replication provider custom settings. + :paramtype custom_details: + ~azure.mgmt.recoveryservicessiterecovery.models.ConfigurationSettings + """ super(ProtectableItemProperties, self).__init__(**kwargs) self.friendly_name = friendly_name self.protection_status = protection_status @@ -15737,8 +20152,8 @@ def __init__( class ProtectableItemQueryParameter(msrest.serialization.Model): """Query parameter to enumerate Protectable items. - :param state: State of the Protectable item query filter. - :type state: str + :ivar state: State of the Protectable item query filter. + :vartype state: str """ _attribute_map = { @@ -15751,6 +20166,10 @@ def __init__( state: Optional[str] = None, **kwargs ): + """ + :keyword state: State of the Protectable item query filter. + :paramtype state: str + """ super(ProtectableItemQueryParameter, self).__init__(**kwargs) self.state = state @@ -15758,24 +20177,24 @@ def __init__( class ProtectedItemsQueryParameter(msrest.serialization.Model): """Query parameter to enumerate protected items. - :param source_fabric_name: The source fabric name filter. - :type source_fabric_name: str - :param recovery_plan_name: The recovery plan filter. - :type recovery_plan_name: str - :param source_fabric_location: The source fabric location filter. - :type source_fabric_location: str - :param fabric_object_id: The fabric object Id filter. - :type fabric_object_id: str - :param v_center_name: The vCenter name filter. - :type v_center_name: str - :param instance_type: The replication provider type. - :type instance_type: str - :param multi_vm_group_create_option: Whether Multi VM group is auto created or specified by + :ivar source_fabric_name: The source fabric name filter. + :vartype source_fabric_name: str + :ivar recovery_plan_name: The recovery plan filter. + :vartype recovery_plan_name: str + :ivar source_fabric_location: The source fabric location filter. + :vartype source_fabric_location: str + :ivar fabric_object_id: The fabric object Id filter. + :vartype fabric_object_id: str + :ivar v_center_name: The vCenter name filter. + :vartype v_center_name: str + :ivar instance_type: The replication provider type. + :vartype instance_type: str + :ivar multi_vm_group_create_option: Whether Multi VM group is auto created or specified by user. Possible values include: "AutoCreated", "UserSpecified". - :type multi_vm_group_create_option: str or + :vartype multi_vm_group_create_option: str or ~azure.mgmt.recoveryservicessiterecovery.models.MultiVmGroupCreateOption - :param process_server_id: The process server Id filter. - :type process_server_id: str + :ivar process_server_id: The process server Id filter. + :vartype process_server_id: str """ _attribute_map = { @@ -15802,6 +20221,26 @@ def __init__( process_server_id: Optional[str] = None, **kwargs ): + """ + :keyword source_fabric_name: The source fabric name filter. + :paramtype source_fabric_name: str + :keyword recovery_plan_name: The recovery plan filter. + :paramtype recovery_plan_name: str + :keyword source_fabric_location: The source fabric location filter. + :paramtype source_fabric_location: str + :keyword fabric_object_id: The fabric object Id filter. + :paramtype fabric_object_id: str + :keyword v_center_name: The vCenter name filter. + :paramtype v_center_name: str + :keyword instance_type: The replication provider type. + :paramtype instance_type: str + :keyword multi_vm_group_create_option: Whether Multi VM group is auto created or specified by + user. Possible values include: "AutoCreated", "UserSpecified". + :paramtype multi_vm_group_create_option: str or + ~azure.mgmt.recoveryservicessiterecovery.models.MultiVmGroupCreateOption + :keyword process_server_id: The process server Id filter. + :paramtype process_server_id: str + """ super(ProtectedItemsQueryParameter, self).__init__(**kwargs) self.source_fabric_name = source_fabric_name self.recovery_plan_name = recovery_plan_name @@ -15824,10 +20263,11 @@ class ProtectionContainer(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The custom data. + :vartype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerProperties """ _validation = { @@ -15851,6 +20291,13 @@ def __init__( properties: Optional["ProtectionContainerProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The custom data. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerProperties + """ super(ProtectionContainer, self).__init__(location=location, **kwargs) self.properties = properties @@ -15858,10 +20305,10 @@ def __init__( class ProtectionContainerCollection(msrest.serialization.Model): """Protection Container collection. - :param value: The Protection Container details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The Protection Container details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -15876,6 +20323,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The Protection Container details. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(ProtectionContainerCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -15902,6 +20355,8 @@ def __init__( self, **kwargs ): + """ + """ super(ProtectionContainerFabricSpecificDetails, self).__init__(**kwargs) self.instance_type = None @@ -15917,10 +20372,10 @@ class ProtectionContainerMapping(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom data. - :type properties: + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The custom data. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMappingProperties """ @@ -15945,6 +20400,13 @@ def __init__( properties: Optional["ProtectionContainerMappingProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The custom data. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMappingProperties + """ super(ProtectionContainerMapping, self).__init__(location=location, **kwargs) self.properties = properties @@ -15952,10 +20414,11 @@ def __init__( class ProtectionContainerMappingCollection(msrest.serialization.Model): """Protection container mapping collection class. - :param value: List of container mappings. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMapping] - :param next_link: Link to fetch rest of the data. - :type next_link: str + :ivar value: List of container mappings. + :vartype value: + list[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMapping] + :ivar next_link: Link to fetch rest of the data. + :vartype next_link: str """ _attribute_map = { @@ -15970,6 +20433,13 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of container mappings. + :paramtype value: + list[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMapping] + :keyword next_link: Link to fetch rest of the data. + :paramtype next_link: str + """ super(ProtectionContainerMappingCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -15978,29 +20448,30 @@ def __init__( class ProtectionContainerMappingProperties(msrest.serialization.Model): """Protection container mapping properties. - :param target_protection_container_id: Paired protection container ARM ID. - :type target_protection_container_id: str - :param target_protection_container_friendly_name: Friendly name of paired container. - :type target_protection_container_friendly_name: str - :param provider_specific_details: Provider specific provider details. - :type provider_specific_details: + :ivar target_protection_container_id: Paired protection container ARM ID. + :vartype target_protection_container_id: str + :ivar target_protection_container_friendly_name: Friendly name of paired container. + :vartype target_protection_container_friendly_name: str + :ivar provider_specific_details: Provider specific provider details. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMappingProviderSpecificDetails - :param health: Health of pairing. - :type health: str - :param health_error_details: Health error. - :type health_error_details: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param policy_id: Policy ARM Id. - :type policy_id: str - :param state: Association Status. - :type state: str - :param source_protection_container_friendly_name: Friendly name of source protection container. - :type source_protection_container_friendly_name: str - :param source_fabric_friendly_name: Friendly name of source fabric. - :type source_fabric_friendly_name: str - :param target_fabric_friendly_name: Friendly name of target fabric. - :type target_fabric_friendly_name: str - :param policy_friendly_name: Friendly name of replication policy. - :type policy_friendly_name: str + :ivar health: Health of pairing. + :vartype health: str + :ivar health_error_details: Health error. + :vartype health_error_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :ivar policy_id: Policy ARM Id. + :vartype policy_id: str + :ivar state: Association Status. + :vartype state: str + :ivar source_protection_container_friendly_name: Friendly name of source protection container. + :vartype source_protection_container_friendly_name: str + :ivar source_fabric_friendly_name: Friendly name of source fabric. + :vartype source_fabric_friendly_name: str + :ivar target_fabric_friendly_name: Friendly name of target fabric. + :vartype target_fabric_friendly_name: str + :ivar policy_friendly_name: Friendly name of replication policy. + :vartype policy_friendly_name: str """ _attribute_map = { @@ -16033,6 +20504,33 @@ def __init__( policy_friendly_name: Optional[str] = None, **kwargs ): + """ + :keyword target_protection_container_id: Paired protection container ARM ID. + :paramtype target_protection_container_id: str + :keyword target_protection_container_friendly_name: Friendly name of paired container. + :paramtype target_protection_container_friendly_name: str + :keyword provider_specific_details: Provider specific provider details. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMappingProviderSpecificDetails + :keyword health: Health of pairing. + :paramtype health: str + :keyword health_error_details: Health error. + :paramtype health_error_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :keyword policy_id: Policy ARM Id. + :paramtype policy_id: str + :keyword state: Association Status. + :paramtype state: str + :keyword source_protection_container_friendly_name: Friendly name of source protection + container. + :paramtype source_protection_container_friendly_name: str + :keyword source_fabric_friendly_name: Friendly name of source fabric. + :paramtype source_fabric_friendly_name: str + :keyword target_fabric_friendly_name: Friendly name of target fabric. + :paramtype target_fabric_friendly_name: str + :keyword policy_friendly_name: Friendly name of replication policy. + :paramtype policy_friendly_name: str + """ super(ProtectionContainerMappingProperties, self).__init__(**kwargs) self.target_protection_container_id = target_protection_container_id self.target_protection_container_friendly_name = target_protection_container_friendly_name @@ -16050,20 +20548,20 @@ def __init__( class ProtectionContainerProperties(msrest.serialization.Model): """Protection profile custom data details. - :param fabric_friendly_name: Fabric friendly name. - :type fabric_friendly_name: str - :param friendly_name: The name. - :type friendly_name: str - :param fabric_type: The fabric type. - :type fabric_type: str - :param protected_item_count: Number of protected PEs. - :type protected_item_count: int - :param pairing_status: The pairing status of this cloud. - :type pairing_status: str - :param role: The role of this cloud. - :type role: str - :param fabric_specific_details: Fabric specific details. - :type fabric_specific_details: + :ivar fabric_friendly_name: Fabric friendly name. + :vartype fabric_friendly_name: str + :ivar friendly_name: The name. + :vartype friendly_name: str + :ivar fabric_type: The fabric type. + :vartype fabric_type: str + :ivar protected_item_count: Number of protected PEs. + :vartype protected_item_count: int + :ivar pairing_status: The pairing status of this cloud. + :vartype pairing_status: str + :ivar role: The role of this cloud. + :vartype role: str + :ivar fabric_specific_details: Fabric specific details. + :vartype fabric_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerFabricSpecificDetails """ @@ -16089,6 +20587,23 @@ def __init__( fabric_specific_details: Optional["ProtectionContainerFabricSpecificDetails"] = None, **kwargs ): + """ + :keyword fabric_friendly_name: Fabric friendly name. + :paramtype fabric_friendly_name: str + :keyword friendly_name: The name. + :paramtype friendly_name: str + :keyword fabric_type: The fabric type. + :paramtype fabric_type: str + :keyword protected_item_count: Number of protected PEs. + :paramtype protected_item_count: int + :keyword pairing_status: The pairing status of this cloud. + :paramtype pairing_status: str + :keyword role: The role of this cloud. + :paramtype role: str + :keyword fabric_specific_details: Fabric specific details. + :paramtype fabric_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerFabricSpecificDetails + """ super(ProtectionContainerProperties, self).__init__(**kwargs) self.fabric_friendly_name = fabric_friendly_name self.friendly_name = friendly_name @@ -16102,16 +20617,16 @@ def __init__( class ProviderError(msrest.serialization.Model): """This class contains the error details per object. - :param error_code: The Error code. - :type error_code: int - :param error_message: The Error message. - :type error_message: str - :param error_id: The Provider error Id. - :type error_id: str - :param possible_causes: The possible causes for the error. - :type possible_causes: str - :param recommended_action: The recommended action to resolve the error. - :type recommended_action: str + :ivar error_code: The Error code. + :vartype error_code: int + :ivar error_message: The Error message. + :vartype error_message: str + :ivar error_id: The Provider error Id. + :vartype error_id: str + :ivar possible_causes: The possible causes for the error. + :vartype possible_causes: str + :ivar recommended_action: The recommended action to resolve the error. + :vartype recommended_action: str """ _attribute_map = { @@ -16132,6 +20647,18 @@ def __init__( recommended_action: Optional[str] = None, **kwargs ): + """ + :keyword error_code: The Error code. + :paramtype error_code: int + :keyword error_message: The Error message. + :paramtype error_message: str + :keyword error_id: The Provider error Id. + :paramtype error_id: str + :keyword possible_causes: The possible causes for the error. + :paramtype possible_causes: str + :keyword recommended_action: The recommended action to resolve the error. + :paramtype recommended_action: str + """ super(ProviderError, self).__init__(**kwargs) self.error_code = error_code self.error_message = error_message @@ -16194,6 +20721,8 @@ def __init__( self, **kwargs ): + """ + """ super(PushInstallerDetails, self).__init__(**kwargs) self.id = None self.name = None @@ -16264,6 +20793,8 @@ def __init__( self, **kwargs ): + """ + """ super(RcmProxyDetails, self).__init__(**kwargs) self.id = None self.name = None @@ -16288,10 +20819,10 @@ class RecoveryPlan(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom details. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The custom details. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProperties """ _validation = { @@ -16315,6 +20846,12 @@ def __init__( properties: Optional["RecoveryPlanProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The custom details. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProperties + """ super(RecoveryPlan, self).__init__(location=location, **kwargs) self.properties = properties @@ -16327,8 +20864,8 @@ class RecoveryPlanProviderSpecificDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -16347,6 +20884,8 @@ def __init__( self, **kwargs ): + """ + """ super(RecoveryPlanProviderSpecificDetails, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -16356,12 +20895,12 @@ class RecoveryPlanA2ADetails(RecoveryPlanProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param primary_zone: The primary zone. - :type primary_zone: str - :param recovery_zone: The recovery zone. - :type recovery_zone: str + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str + :ivar primary_zone: The primary zone. + :vartype primary_zone: str + :ivar recovery_zone: The recovery zone. + :vartype recovery_zone: str """ _validation = { @@ -16381,6 +20920,12 @@ def __init__( recovery_zone: Optional[str] = None, **kwargs ): + """ + :keyword primary_zone: The primary zone. + :paramtype primary_zone: str + :keyword recovery_zone: The recovery zone. + :paramtype recovery_zone: str + """ super(RecoveryPlanA2ADetails, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.primary_zone = primary_zone @@ -16395,8 +20940,8 @@ class RecoveryPlanProviderSpecificFailoverInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -16415,6 +20960,8 @@ def __init__( self, **kwargs ): + """ + """ super(RecoveryPlanProviderSpecificFailoverInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -16424,19 +20971,19 @@ class RecoveryPlanA2AFailoverInput(RecoveryPlanProviderSpecificFailoverInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: Required. The recovery point type. Possible values include: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_type: Required. The recovery point type. Possible values include: "Latest", "LatestApplicationConsistent", "LatestCrashConsistent", "LatestProcessed". - :type recovery_point_type: str or + :vartype recovery_point_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.A2ARpRecoveryPointType - :param cloud_service_creation_option: A value indicating whether to use recovery cloud service + :ivar cloud_service_creation_option: A value indicating whether to use recovery cloud service for TFO or not. - :type cloud_service_creation_option: str - :param multi_vm_sync_point_option: A value indicating whether multi VM sync enabled VMs should + :vartype cloud_service_creation_option: str + :ivar multi_vm_sync_point_option: A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. Possible values include: "UseMultiVmSyncRecoveryPoint", "UsePerVmRecoveryPoint". - :type multi_vm_sync_point_option: str or + :vartype multi_vm_sync_point_option: str or ~azure.mgmt.recoveryservicessiterecovery.models.MultiVmSyncPointOption """ @@ -16460,6 +21007,20 @@ def __init__( multi_vm_sync_point_option: Optional[Union[str, "MultiVmSyncPointOption"]] = None, **kwargs ): + """ + :keyword recovery_point_type: Required. The recovery point type. Possible values include: + "Latest", "LatestApplicationConsistent", "LatestCrashConsistent", "LatestProcessed". + :paramtype recovery_point_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.A2ARpRecoveryPointType + :keyword cloud_service_creation_option: A value indicating whether to use recovery cloud + service for TFO or not. + :paramtype cloud_service_creation_option: str + :keyword multi_vm_sync_point_option: A value indicating whether multi VM sync enabled VMs + should use multi VM sync points for failover. Possible values include: + "UseMultiVmSyncRecoveryPoint", "UsePerVmRecoveryPoint". + :paramtype multi_vm_sync_point_option: str or + ~azure.mgmt.recoveryservicessiterecovery.models.MultiVmSyncPointOption + """ super(RecoveryPlanA2AFailoverInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.recovery_point_type = recovery_point_type @@ -16475,8 +21036,8 @@ class RecoveryPlanProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -16495,6 +21056,8 @@ def __init__( self, **kwargs ): + """ + """ super(RecoveryPlanProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -16504,12 +21067,18 @@ class RecoveryPlanA2AInput(RecoveryPlanProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str - :param primary_zone: The primary zone. - :type primary_zone: str - :param recovery_zone: The recovery zone. - :type recovery_zone: str + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str + :ivar primary_zone: The primary zone. + :vartype primary_zone: str + :ivar recovery_zone: The recovery zone. + :vartype recovery_zone: str + :ivar primary_extended_location: The primary extended location. + :vartype primary_extended_location: + ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocation + :ivar recovery_extended_location: The recovery extended location. + :vartype recovery_extended_location: + ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocation """ _validation = { @@ -16520,6 +21089,8 @@ class RecoveryPlanA2AInput(RecoveryPlanProviderSpecificInput): 'instance_type': {'key': 'instanceType', 'type': 'str'}, 'primary_zone': {'key': 'primaryZone', 'type': 'str'}, 'recovery_zone': {'key': 'recoveryZone', 'type': 'str'}, + 'primary_extended_location': {'key': 'primaryExtendedLocation', 'type': 'ExtendedLocation'}, + 'recovery_extended_location': {'key': 'recoveryExtendedLocation', 'type': 'ExtendedLocation'}, } def __init__( @@ -16527,12 +21098,28 @@ def __init__( *, primary_zone: Optional[str] = None, recovery_zone: Optional[str] = None, - **kwargs - ): + primary_extended_location: Optional["ExtendedLocation"] = None, + recovery_extended_location: Optional["ExtendedLocation"] = None, + **kwargs + ): + """ + :keyword primary_zone: The primary zone. + :paramtype primary_zone: str + :keyword recovery_zone: The recovery zone. + :paramtype recovery_zone: str + :keyword primary_extended_location: The primary extended location. + :paramtype primary_extended_location: + ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocation + :keyword recovery_extended_location: The recovery extended location. + :paramtype recovery_extended_location: + ~azure.mgmt.recoveryservicessiterecovery.models.ExtendedLocation + """ super(RecoveryPlanA2AInput, self).__init__(**kwargs) self.instance_type = 'A2A' # type: str self.primary_zone = primary_zone self.recovery_zone = recovery_zone + self.primary_extended_location = primary_extended_location + self.recovery_extended_location = recovery_extended_location class RecoveryPlanAction(msrest.serialization.Model): @@ -16540,16 +21127,17 @@ class RecoveryPlanAction(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param action_name: Required. The action name. - :type action_name: str - :param failover_types: Required. The list of failover types. - :type failover_types: list[str or + :ivar action_name: Required. The action name. + :vartype action_name: str + :ivar failover_types: Required. The list of failover types. + :vartype failover_types: list[str or ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItemOperation] - :param failover_directions: Required. The list of failover directions. - :type failover_directions: list[str or + :ivar failover_directions: Required. The list of failover directions. + :vartype failover_directions: list[str or ~azure.mgmt.recoveryservicessiterecovery.models.PossibleOperationsDirections] - :param custom_details: Required. The custom details. - :type custom_details: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanActionDetails + :ivar custom_details: Required. The custom details. + :vartype custom_details: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanActionDetails """ _validation = { @@ -16575,6 +21163,19 @@ def __init__( custom_details: "RecoveryPlanActionDetails", **kwargs ): + """ + :keyword action_name: Required. The action name. + :paramtype action_name: str + :keyword failover_types: Required. The list of failover types. + :paramtype failover_types: list[str or + ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItemOperation] + :keyword failover_directions: Required. The list of failover directions. + :paramtype failover_directions: list[str or + ~azure.mgmt.recoveryservicessiterecovery.models.PossibleOperationsDirections] + :keyword custom_details: Required. The custom details. + :paramtype custom_details: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanActionDetails + """ super(RecoveryPlanAction, self).__init__(**kwargs) self.action_name = action_name self.failover_types = failover_types @@ -16590,9 +21191,9 @@ class RecoveryPlanActionDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the type of action details (see + :ivar instance_type: Required. Gets the type of action details (see RecoveryPlanActionDetailsTypes enum for possible values).Constant filled by server. - :type instance_type: str + :vartype instance_type: str """ _validation = { @@ -16611,6 +21212,8 @@ def __init__( self, **kwargs ): + """ + """ super(RecoveryPlanActionDetails, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -16620,16 +21223,16 @@ class RecoveryPlanAutomationRunbookActionDetails(RecoveryPlanActionDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the type of action details (see + :ivar instance_type: Required. Gets the type of action details (see RecoveryPlanActionDetailsTypes enum for possible values).Constant filled by server. - :type instance_type: str - :param runbook_id: The runbook ARM Id. - :type runbook_id: str - :param timeout: The runbook timeout. - :type timeout: str - :param fabric_location: Required. The fabric location. Possible values include: "Primary", + :vartype instance_type: str + :ivar runbook_id: The runbook ARM Id. + :vartype runbook_id: str + :ivar timeout: The runbook timeout. + :vartype timeout: str + :ivar fabric_location: Required. The fabric location. Possible values include: "Primary", "Recovery". - :type fabric_location: str or + :vartype fabric_location: str or ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanActionLocation """ @@ -16653,6 +21256,16 @@ def __init__( timeout: Optional[str] = None, **kwargs ): + """ + :keyword runbook_id: The runbook ARM Id. + :paramtype runbook_id: str + :keyword timeout: The runbook timeout. + :paramtype timeout: str + :keyword fabric_location: Required. The fabric location. Possible values include: "Primary", + "Recovery". + :paramtype fabric_location: str or + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanActionLocation + """ super(RecoveryPlanAutomationRunbookActionDetails, self).__init__(**kwargs) self.instance_type = 'AutomationRunbookActionDetails' # type: str self.runbook_id = runbook_id @@ -16663,10 +21276,10 @@ def __init__( class RecoveryPlanCollection(msrest.serialization.Model): """Recovery plan collection details. - :param value: The list of recovery plans. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The list of recovery plans. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -16681,6 +21294,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The list of recovery plans. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(RecoveryPlanCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -16691,17 +21310,18 @@ class RecoveryPlanGroup(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param group_type: Required. The group type. Possible values include: "Shutdown", "Boot", + :ivar group_type: Required. The group type. Possible values include: "Shutdown", "Boot", "Failover". - :type group_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroupType - :param replication_protected_items: The list of protected items. - :type replication_protected_items: + :vartype group_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroupType + :ivar replication_protected_items: The list of protected items. + :vartype replication_protected_items: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProtectedItem] - :param start_group_actions: The start group actions. - :type start_group_actions: + :ivar start_group_actions: The start group actions. + :vartype start_group_actions: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanAction] - :param end_group_actions: The end group actions. - :type end_group_actions: + :ivar end_group_actions: The end group actions. + :vartype end_group_actions: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanAction] """ @@ -16725,6 +21345,21 @@ def __init__( end_group_actions: Optional[List["RecoveryPlanAction"]] = None, **kwargs ): + """ + :keyword group_type: Required. The group type. Possible values include: "Shutdown", "Boot", + "Failover". + :paramtype group_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroupType + :keyword replication_protected_items: The list of protected items. + :paramtype replication_protected_items: + list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProtectedItem] + :keyword start_group_actions: The start group actions. + :paramtype start_group_actions: + list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanAction] + :keyword end_group_actions: The end group actions. + :paramtype end_group_actions: + list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanAction] + """ super(RecoveryPlanGroup, self).__init__(**kwargs) self.group_type = group_type self.replication_protected_items = replication_protected_items @@ -16740,16 +21375,16 @@ class RecoveryPlanGroupTaskDetails(GroupTaskDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param child_tasks: The child tasks. - :type child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] - :param name: The name. - :type name: str - :param group_id: The group identifier. - :type group_id: str - :param rp_group_type: The group type. - :type rp_group_type: str + :ivar instance_type: Required. The type of task details.Constant filled by server. + :vartype instance_type: str + :ivar child_tasks: The child tasks. + :vartype child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] + :ivar name: The name. + :vartype name: str + :ivar group_id: The group identifier. + :vartype group_id: str + :ivar rp_group_type: The group type. + :vartype rp_group_type: str """ _validation = { @@ -16777,6 +21412,16 @@ def __init__( rp_group_type: Optional[str] = None, **kwargs ): + """ + :keyword child_tasks: The child tasks. + :paramtype child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] + :keyword name: The name. + :paramtype name: str + :keyword group_id: The group identifier. + :paramtype group_id: str + :keyword rp_group_type: The group type. + :paramtype rp_group_type: str + """ super(RecoveryPlanGroupTaskDetails, self).__init__(child_tasks=child_tasks, **kwargs) self.instance_type = 'RecoveryPlanGroupTaskDetails' # type: str self.name = name @@ -16789,14 +21434,15 @@ class RecoveryPlanHyperVReplicaAzureFailbackInput(RecoveryPlanProviderSpecificFa All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param data_sync_option: Required. The data sync option. Possible values include: - "ForDownTime", "ForSynchronization". - :type data_sync_option: str or ~azure.mgmt.recoveryservicessiterecovery.models.DataSyncStatus - :param recovery_vm_creation_option: Required. The ALR option. Possible values include: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar data_sync_option: Required. The data sync option. Possible values include: "ForDownTime", + "ForSynchronization". + :vartype data_sync_option: str or + ~azure.mgmt.recoveryservicessiterecovery.models.DataSyncStatus + :ivar recovery_vm_creation_option: Required. The ALR option. Possible values include: "CreateVmIfNotFound", "NoAction". - :type recovery_vm_creation_option: str or + :vartype recovery_vm_creation_option: str or ~azure.mgmt.recoveryservicessiterecovery.models.AlternateLocationRecoveryOption """ @@ -16819,6 +21465,16 @@ def __init__( recovery_vm_creation_option: Union[str, "AlternateLocationRecoveryOption"], **kwargs ): + """ + :keyword data_sync_option: Required. The data sync option. Possible values include: + "ForDownTime", "ForSynchronization". + :paramtype data_sync_option: str or + ~azure.mgmt.recoveryservicessiterecovery.models.DataSyncStatus + :keyword recovery_vm_creation_option: Required. The ALR option. Possible values include: + "CreateVmIfNotFound", "NoAction". + :paramtype recovery_vm_creation_option: str or + ~azure.mgmt.recoveryservicessiterecovery.models.AlternateLocationRecoveryOption + """ super(RecoveryPlanHyperVReplicaAzureFailbackInput, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaAzureFailback' # type: str self.data_sync_option = data_sync_option @@ -16830,15 +21486,15 @@ class RecoveryPlanHyperVReplicaAzureFailoverInput(RecoveryPlanProviderSpecificFa All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param primary_kek_certificate_pfx: The primary KEK certificate PFX. - :type primary_kek_certificate_pfx: str - :param secondary_kek_certificate_pfx: The secondary KEK certificate PFX. - :type secondary_kek_certificate_pfx: str - :param recovery_point_type: The recovery point type. Possible values include: "Latest", + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar primary_kek_certificate_pfx: The primary KEK certificate PFX. + :vartype primary_kek_certificate_pfx: str + :ivar secondary_kek_certificate_pfx: The secondary KEK certificate PFX. + :vartype secondary_kek_certificate_pfx: str + :ivar recovery_point_type: The recovery point type. Possible values include: "Latest", "LatestApplicationConsistent", "LatestProcessed". - :type recovery_point_type: str or + :vartype recovery_point_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.HyperVReplicaAzureRpRecoveryPointType """ @@ -16861,6 +21517,16 @@ def __init__( recovery_point_type: Optional[Union[str, "HyperVReplicaAzureRpRecoveryPointType"]] = None, **kwargs ): + """ + :keyword primary_kek_certificate_pfx: The primary KEK certificate PFX. + :paramtype primary_kek_certificate_pfx: str + :keyword secondary_kek_certificate_pfx: The secondary KEK certificate PFX. + :paramtype secondary_kek_certificate_pfx: str + :keyword recovery_point_type: The recovery point type. Possible values include: "Latest", + "LatestApplicationConsistent", "LatestProcessed". + :paramtype recovery_point_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.HyperVReplicaAzureRpRecoveryPointType + """ super(RecoveryPlanHyperVReplicaAzureFailoverInput, self).__init__(**kwargs) self.instance_type = 'HyperVReplicaAzure' # type: str self.primary_kek_certificate_pfx = primary_kek_certificate_pfx @@ -16873,15 +21539,15 @@ class RecoveryPlanInMageAzureV2FailoverInput(RecoveryPlanProviderSpecificFailove All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: Required. The recovery point type. Possible values include: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_type: Required. The recovery point type. Possible values include: "Latest", "LatestApplicationConsistent", "LatestCrashConsistent", "LatestProcessed". - :type recovery_point_type: str or + :vartype recovery_point_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.InMageV2RpRecoveryPointType - :param use_multi_vm_sync_point: A value indicating whether multi VM sync enabled VMs should use + :ivar use_multi_vm_sync_point: A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. - :type use_multi_vm_sync_point: str + :vartype use_multi_vm_sync_point: str """ _validation = { @@ -16902,6 +21568,15 @@ def __init__( use_multi_vm_sync_point: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_type: Required. The recovery point type. Possible values include: + "Latest", "LatestApplicationConsistent", "LatestCrashConsistent", "LatestProcessed". + :paramtype recovery_point_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.InMageV2RpRecoveryPointType + :keyword use_multi_vm_sync_point: A value indicating whether multi VM sync enabled VMs should + use multi VM sync points for failover. + :paramtype use_multi_vm_sync_point: str + """ super(RecoveryPlanInMageAzureV2FailoverInput, self).__init__(**kwargs) self.instance_type = 'InMageAzureV2' # type: str self.recovery_point_type = recovery_point_type @@ -16913,11 +21588,11 @@ class RecoveryPlanInMageFailoverInput(RecoveryPlanProviderSpecificFailoverInput) All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: Required. The recovery point type. Possible values include: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_type: Required. The recovery point type. Possible values include: "LatestTime", "LatestTag", "Custom". - :type recovery_point_type: str or + :vartype recovery_point_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.RpInMageRecoveryPointType """ @@ -16937,6 +21612,12 @@ def __init__( recovery_point_type: Union[str, "RpInMageRecoveryPointType"], **kwargs ): + """ + :keyword recovery_point_type: Required. The recovery point type. Possible values include: + "LatestTime", "LatestTag", "Custom". + :paramtype recovery_point_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.RpInMageRecoveryPointType + """ super(RecoveryPlanInMageFailoverInput, self).__init__(**kwargs) self.instance_type = 'InMage' # type: str self.recovery_point_type = recovery_point_type @@ -16947,15 +21628,15 @@ class RecoveryPlanInMageRcmFailbackFailoverInput(RecoveryPlanProviderSpecificFai All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: Required. The recovery point type. Possible values include: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_type: Required. The recovery point type. Possible values include: "ApplicationConsistent", "CrashConsistent". - :type recovery_point_type: str or + :vartype recovery_point_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackRecoveryPointType - :param use_multi_vm_sync_point: A value indicating whether multi VM sync enabled VMs should use + :ivar use_multi_vm_sync_point: A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. - :type use_multi_vm_sync_point: str + :vartype use_multi_vm_sync_point: str """ _validation = { @@ -16976,6 +21657,15 @@ def __init__( use_multi_vm_sync_point: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_type: Required. The recovery point type. Possible values include: + "ApplicationConsistent", "CrashConsistent". + :paramtype recovery_point_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.InMageRcmFailbackRecoveryPointType + :keyword use_multi_vm_sync_point: A value indicating whether multi VM sync enabled VMs should + use multi VM sync points for failover. + :paramtype use_multi_vm_sync_point: str + """ super(RecoveryPlanInMageRcmFailbackFailoverInput, self).__init__(**kwargs) self.instance_type = 'InMageRcmFailback' # type: str self.recovery_point_type = recovery_point_type @@ -16987,15 +21677,15 @@ class RecoveryPlanInMageRcmFailoverInput(RecoveryPlanProviderSpecificFailoverInp All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_type: Required. The recovery point type. Possible values include: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_type: Required. The recovery point type. Possible values include: "Latest", "LatestApplicationConsistent", "LatestCrashConsistent", "LatestProcessed". - :type recovery_point_type: str or + :vartype recovery_point_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanPointType - :param use_multi_vm_sync_point: A value indicating whether multi VM sync enabled VMs should use + :ivar use_multi_vm_sync_point: A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. - :type use_multi_vm_sync_point: str + :vartype use_multi_vm_sync_point: str """ _validation = { @@ -17016,6 +21706,15 @@ def __init__( use_multi_vm_sync_point: Optional[str] = None, **kwargs ): + """ + :keyword recovery_point_type: Required. The recovery point type. Possible values include: + "Latest", "LatestApplicationConsistent", "LatestCrashConsistent", "LatestProcessed". + :paramtype recovery_point_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanPointType + :keyword use_multi_vm_sync_point: A value indicating whether multi VM sync enabled VMs should + use multi VM sync points for failover. + :paramtype use_multi_vm_sync_point: str + """ super(RecoveryPlanInMageRcmFailoverInput, self).__init__(**kwargs) self.instance_type = 'InMageRcm' # type: str self.recovery_point_type = recovery_point_type @@ -17027,11 +21726,11 @@ class RecoveryPlanManualActionDetails(RecoveryPlanActionDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the type of action details (see + :ivar instance_type: Required. Gets the type of action details (see RecoveryPlanActionDetailsTypes enum for possible values).Constant filled by server. - :type instance_type: str - :param description: The manual action description. - :type description: str + :vartype instance_type: str + :ivar description: The manual action description. + :vartype description: str """ _validation = { @@ -17049,6 +21748,10 @@ def __init__( description: Optional[str] = None, **kwargs ): + """ + :keyword description: The manual action description. + :paramtype description: str + """ super(RecoveryPlanManualActionDetails, self).__init__(**kwargs) self.instance_type = 'ManualActionDetails' # type: str self.description = description @@ -17059,8 +21762,8 @@ class RecoveryPlanPlannedFailoverInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. The recovery plan planned failover input properties. - :type properties: + :ivar properties: Required. The recovery plan planned failover input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInputProperties """ @@ -17078,6 +21781,11 @@ def __init__( properties: "RecoveryPlanPlannedFailoverInputProperties", **kwargs ): + """ + :keyword properties: Required. The recovery plan planned failover input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInputProperties + """ super(RecoveryPlanPlannedFailoverInput, self).__init__(**kwargs) self.properties = properties @@ -17087,12 +21795,12 @@ class RecoveryPlanPlannedFailoverInputProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param failover_direction: Required. The failover direction. Possible values include: + :ivar failover_direction: Required. The failover direction. Possible values include: "PrimaryToRecovery", "RecoveryToPrimary". - :type failover_direction: str or + :vartype failover_direction: str or ~azure.mgmt.recoveryservicessiterecovery.models.PossibleOperationsDirections - :param provider_specific_details: The provider specific properties. - :type provider_specific_details: + :ivar provider_specific_details: The provider specific properties. + :vartype provider_specific_details: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput] """ @@ -17112,6 +21820,15 @@ def __init__( provider_specific_details: Optional[List["RecoveryPlanProviderSpecificFailoverInput"]] = None, **kwargs ): + """ + :keyword failover_direction: Required. The failover direction. Possible values include: + "PrimaryToRecovery", "RecoveryToPrimary". + :paramtype failover_direction: str or + ~azure.mgmt.recoveryservicessiterecovery.models.PossibleOperationsDirections + :keyword provider_specific_details: The provider specific properties. + :paramtype provider_specific_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput] + """ super(RecoveryPlanPlannedFailoverInputProperties, self).__init__(**kwargs) self.failover_direction = failover_direction self.provider_specific_details = provider_specific_details @@ -17120,38 +21837,39 @@ def __init__( class RecoveryPlanProperties(msrest.serialization.Model): """Recovery plan properties. - :param friendly_name: The friendly name. - :type friendly_name: str - :param primary_fabric_id: The primary fabric Id. - :type primary_fabric_id: str - :param primary_fabric_friendly_name: The primary fabric friendly name. - :type primary_fabric_friendly_name: str - :param recovery_fabric_id: The recovery fabric Id. - :type recovery_fabric_id: str - :param recovery_fabric_friendly_name: The recovery fabric friendly name. - :type recovery_fabric_friendly_name: str - :param failover_deployment_model: The failover deployment model. - :type failover_deployment_model: str - :param replication_providers: The list of replication providers. - :type replication_providers: list[str] - :param allowed_operations: The list of allowed operations. - :type allowed_operations: list[str] - :param last_planned_failover_time: The start time of the last planned failover. - :type last_planned_failover_time: ~datetime.datetime - :param last_unplanned_failover_time: The start time of the last unplanned failover. - :type last_unplanned_failover_time: ~datetime.datetime - :param last_test_failover_time: The start time of the last test failover. - :type last_test_failover_time: ~datetime.datetime - :param current_scenario: The current scenario details. - :type current_scenario: ~azure.mgmt.recoveryservicessiterecovery.models.CurrentScenarioDetails - :param current_scenario_status: The recovery plan status. - :type current_scenario_status: str - :param current_scenario_status_description: The recovery plan status description. - :type current_scenario_status_description: str - :param groups: The recovery plan groups. - :type groups: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroup] - :param provider_specific_details: The provider id and provider specific details. - :type provider_specific_details: + :ivar friendly_name: The friendly name. + :vartype friendly_name: str + :ivar primary_fabric_id: The primary fabric Id. + :vartype primary_fabric_id: str + :ivar primary_fabric_friendly_name: The primary fabric friendly name. + :vartype primary_fabric_friendly_name: str + :ivar recovery_fabric_id: The recovery fabric Id. + :vartype recovery_fabric_id: str + :ivar recovery_fabric_friendly_name: The recovery fabric friendly name. + :vartype recovery_fabric_friendly_name: str + :ivar failover_deployment_model: The failover deployment model. + :vartype failover_deployment_model: str + :ivar replication_providers: The list of replication providers. + :vartype replication_providers: list[str] + :ivar allowed_operations: The list of allowed operations. + :vartype allowed_operations: list[str] + :ivar last_planned_failover_time: The start time of the last planned failover. + :vartype last_planned_failover_time: ~datetime.datetime + :ivar last_unplanned_failover_time: The start time of the last unplanned failover. + :vartype last_unplanned_failover_time: ~datetime.datetime + :ivar last_test_failover_time: The start time of the last test failover. + :vartype last_test_failover_time: ~datetime.datetime + :ivar current_scenario: The current scenario details. + :vartype current_scenario: + ~azure.mgmt.recoveryservicessiterecovery.models.CurrentScenarioDetails + :ivar current_scenario_status: The recovery plan status. + :vartype current_scenario_status: str + :ivar current_scenario_status_description: The recovery plan status description. + :vartype current_scenario_status_description: str + :ivar groups: The recovery plan groups. + :vartype groups: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroup] + :ivar provider_specific_details: The provider id and provider specific details. + :vartype provider_specific_details: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificDetails] """ @@ -17195,6 +21913,42 @@ def __init__( provider_specific_details: Optional[List["RecoveryPlanProviderSpecificDetails"]] = None, **kwargs ): + """ + :keyword friendly_name: The friendly name. + :paramtype friendly_name: str + :keyword primary_fabric_id: The primary fabric Id. + :paramtype primary_fabric_id: str + :keyword primary_fabric_friendly_name: The primary fabric friendly name. + :paramtype primary_fabric_friendly_name: str + :keyword recovery_fabric_id: The recovery fabric Id. + :paramtype recovery_fabric_id: str + :keyword recovery_fabric_friendly_name: The recovery fabric friendly name. + :paramtype recovery_fabric_friendly_name: str + :keyword failover_deployment_model: The failover deployment model. + :paramtype failover_deployment_model: str + :keyword replication_providers: The list of replication providers. + :paramtype replication_providers: list[str] + :keyword allowed_operations: The list of allowed operations. + :paramtype allowed_operations: list[str] + :keyword last_planned_failover_time: The start time of the last planned failover. + :paramtype last_planned_failover_time: ~datetime.datetime + :keyword last_unplanned_failover_time: The start time of the last unplanned failover. + :paramtype last_unplanned_failover_time: ~datetime.datetime + :keyword last_test_failover_time: The start time of the last test failover. + :paramtype last_test_failover_time: ~datetime.datetime + :keyword current_scenario: The current scenario details. + :paramtype current_scenario: + ~azure.mgmt.recoveryservicessiterecovery.models.CurrentScenarioDetails + :keyword current_scenario_status: The recovery plan status. + :paramtype current_scenario_status: str + :keyword current_scenario_status_description: The recovery plan status description. + :paramtype current_scenario_status_description: str + :keyword groups: The recovery plan groups. + :paramtype groups: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroup] + :keyword provider_specific_details: The provider id and provider specific details. + :paramtype provider_specific_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificDetails] + """ super(RecoveryPlanProperties, self).__init__(**kwargs) self.friendly_name = friendly_name self.primary_fabric_id = primary_fabric_id @@ -17217,10 +21971,10 @@ def __init__( class RecoveryPlanProtectedItem(msrest.serialization.Model): """Recovery plan protected item. - :param id: The ARM Id of the recovery plan protected item. - :type id: str - :param virtual_machine_id: The virtual machine Id. - :type virtual_machine_id: str + :ivar id: The ARM Id of the recovery plan protected item. + :vartype id: str + :ivar virtual_machine_id: The virtual machine Id. + :vartype virtual_machine_id: str """ _attribute_map = { @@ -17235,6 +21989,12 @@ def __init__( virtual_machine_id: Optional[str] = None, **kwargs ): + """ + :keyword id: The ARM Id of the recovery plan protected item. + :paramtype id: str + :keyword virtual_machine_id: The virtual machine Id. + :paramtype virtual_machine_id: str + """ super(RecoveryPlanProtectedItem, self).__init__(**kwargs) self.id = id self.virtual_machine_id = virtual_machine_id @@ -17245,16 +22005,16 @@ class RecoveryPlanScriptActionDetails(RecoveryPlanActionDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the type of action details (see + :ivar instance_type: Required. Gets the type of action details (see RecoveryPlanActionDetailsTypes enum for possible values).Constant filled by server. - :type instance_type: str - :param path: Required. The script path. - :type path: str - :param timeout: The script timeout. - :type timeout: str - :param fabric_location: Required. The fabric location. Possible values include: "Primary", + :vartype instance_type: str + :ivar path: Required. The script path. + :vartype path: str + :ivar timeout: The script timeout. + :vartype timeout: str + :ivar fabric_location: Required. The fabric location. Possible values include: "Primary", "Recovery". - :type fabric_location: str or + :vartype fabric_location: str or ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanActionLocation """ @@ -17279,6 +22039,16 @@ def __init__( timeout: Optional[str] = None, **kwargs ): + """ + :keyword path: Required. The script path. + :paramtype path: str + :keyword timeout: The script timeout. + :paramtype timeout: str + :keyword fabric_location: Required. The fabric location. Possible values include: "Primary", + "Recovery". + :paramtype fabric_location: str or + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanActionLocation + """ super(RecoveryPlanScriptActionDetails, self).__init__(**kwargs) self.instance_type = 'ScriptActionDetails' # type: str self.path = path @@ -17291,16 +22061,16 @@ class RecoveryPlanShutdownGroupTaskDetails(RecoveryPlanGroupTaskDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param child_tasks: The child tasks. - :type child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] - :param name: The name. - :type name: str - :param group_id: The group identifier. - :type group_id: str - :param rp_group_type: The group type. - :type rp_group_type: str + :ivar instance_type: Required. The type of task details.Constant filled by server. + :vartype instance_type: str + :ivar child_tasks: The child tasks. + :vartype child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] + :ivar name: The name. + :vartype name: str + :ivar group_id: The group identifier. + :vartype group_id: str + :ivar rp_group_type: The group type. + :vartype rp_group_type: str """ _validation = { @@ -17324,6 +22094,16 @@ def __init__( rp_group_type: Optional[str] = None, **kwargs ): + """ + :keyword child_tasks: The child tasks. + :paramtype child_tasks: list[~azure.mgmt.recoveryservicessiterecovery.models.ASRTask] + :keyword name: The name. + :paramtype name: str + :keyword group_id: The group identifier. + :paramtype group_id: str + :keyword rp_group_type: The group type. + :paramtype rp_group_type: str + """ super(RecoveryPlanShutdownGroupTaskDetails, self).__init__(child_tasks=child_tasks, name=name, group_id=group_id, rp_group_type=rp_group_type, **kwargs) self.instance_type = 'RecoveryPlanShutdownGroupTaskDetails' # type: str @@ -17333,8 +22113,8 @@ class RecoveryPlanTestFailoverCleanupInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. The recovery plan test failover cleanup input properties. - :type properties: + :ivar properties: Required. The recovery plan test failover cleanup input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInputProperties """ @@ -17352,6 +22132,11 @@ def __init__( properties: "RecoveryPlanTestFailoverCleanupInputProperties", **kwargs ): + """ + :keyword properties: Required. The recovery plan test failover cleanup input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInputProperties + """ super(RecoveryPlanTestFailoverCleanupInput, self).__init__(**kwargs) self.properties = properties @@ -17359,8 +22144,8 @@ def __init__( class RecoveryPlanTestFailoverCleanupInputProperties(msrest.serialization.Model): """Recovery plan test failover cleanup input properties. - :param comments: The test failover cleanup comments. - :type comments: str + :ivar comments: The test failover cleanup comments. + :vartype comments: str """ _validation = { @@ -17377,6 +22162,10 @@ def __init__( comments: Optional[str] = None, **kwargs ): + """ + :keyword comments: The test failover cleanup comments. + :paramtype comments: str + """ super(RecoveryPlanTestFailoverCleanupInputProperties, self).__init__(**kwargs) self.comments = comments @@ -17386,8 +22175,8 @@ class RecoveryPlanTestFailoverInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. The recovery plan test failover input properties. - :type properties: + :ivar properties: Required. The recovery plan test failover input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInputProperties """ @@ -17405,6 +22194,11 @@ def __init__( properties: "RecoveryPlanTestFailoverInputProperties", **kwargs ): + """ + :keyword properties: Required. The recovery plan test failover input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInputProperties + """ super(RecoveryPlanTestFailoverInput, self).__init__(**kwargs) self.properties = properties @@ -17414,16 +22208,16 @@ class RecoveryPlanTestFailoverInputProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param failover_direction: Required. The failover direction. Possible values include: + :ivar failover_direction: Required. The failover direction. Possible values include: "PrimaryToRecovery", "RecoveryToPrimary". - :type failover_direction: str or + :vartype failover_direction: str or ~azure.mgmt.recoveryservicessiterecovery.models.PossibleOperationsDirections - :param network_type: Required. The network type to be used for test failover. - :type network_type: str - :param network_id: The Id of the network to be used for test failover. - :type network_id: str - :param provider_specific_details: The provider specific properties. - :type provider_specific_details: + :ivar network_type: Required. The network type to be used for test failover. + :vartype network_type: str + :ivar network_id: The Id of the network to be used for test failover. + :vartype network_id: str + :ivar provider_specific_details: The provider specific properties. + :vartype provider_specific_details: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput] """ @@ -17448,6 +22242,19 @@ def __init__( provider_specific_details: Optional[List["RecoveryPlanProviderSpecificFailoverInput"]] = None, **kwargs ): + """ + :keyword failover_direction: Required. The failover direction. Possible values include: + "PrimaryToRecovery", "RecoveryToPrimary". + :paramtype failover_direction: str or + ~azure.mgmt.recoveryservicessiterecovery.models.PossibleOperationsDirections + :keyword network_type: Required. The network type to be used for test failover. + :paramtype network_type: str + :keyword network_id: The Id of the network to be used for test failover. + :paramtype network_id: str + :keyword provider_specific_details: The provider specific properties. + :paramtype provider_specific_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput] + """ super(RecoveryPlanTestFailoverInputProperties, self).__init__(**kwargs) self.failover_direction = failover_direction self.network_type = network_type @@ -17460,8 +22267,8 @@ class RecoveryPlanUnplannedFailoverInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. The recovery plan unplanned failover input properties. - :type properties: + :ivar properties: Required. The recovery plan unplanned failover input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInputProperties """ @@ -17479,6 +22286,11 @@ def __init__( properties: "RecoveryPlanUnplannedFailoverInputProperties", **kwargs ): + """ + :keyword properties: Required. The recovery plan unplanned failover input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInputProperties + """ super(RecoveryPlanUnplannedFailoverInput, self).__init__(**kwargs) self.properties = properties @@ -17488,16 +22300,16 @@ class RecoveryPlanUnplannedFailoverInputProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param failover_direction: Required. The failover direction. Possible values include: + :ivar failover_direction: Required. The failover direction. Possible values include: "PrimaryToRecovery", "RecoveryToPrimary". - :type failover_direction: str or + :vartype failover_direction: str or ~azure.mgmt.recoveryservicessiterecovery.models.PossibleOperationsDirections - :param source_site_operations: Required. A value indicating whether source site operations are + :ivar source_site_operations: Required. A value indicating whether source site operations are required. Possible values include: "Required", "NotRequired". - :type source_site_operations: str or + :vartype source_site_operations: str or ~azure.mgmt.recoveryservicessiterecovery.models.SourceSiteOperations - :param provider_specific_details: The provider specific properties. - :type provider_specific_details: + :ivar provider_specific_details: The provider specific properties. + :vartype provider_specific_details: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput] """ @@ -17520,6 +22332,19 @@ def __init__( provider_specific_details: Optional[List["RecoveryPlanProviderSpecificFailoverInput"]] = None, **kwargs ): + """ + :keyword failover_direction: Required. The failover direction. Possible values include: + "PrimaryToRecovery", "RecoveryToPrimary". + :paramtype failover_direction: str or + ~azure.mgmt.recoveryservicessiterecovery.models.PossibleOperationsDirections + :keyword source_site_operations: Required. A value indicating whether source site operations + are required. Possible values include: "Required", "NotRequired". + :paramtype source_site_operations: str or + ~azure.mgmt.recoveryservicessiterecovery.models.SourceSiteOperations + :keyword provider_specific_details: The provider specific properties. + :paramtype provider_specific_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanProviderSpecificFailoverInput] + """ super(RecoveryPlanUnplannedFailoverInputProperties, self).__init__(**kwargs) self.failover_direction = failover_direction self.source_site_operations = source_site_operations @@ -17537,10 +22362,10 @@ class RecoveryPoint(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The recovery point properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The recovery point properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointProperties """ _validation = { @@ -17564,6 +22389,12 @@ def __init__( properties: Optional["RecoveryPointProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The recovery point properties. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointProperties + """ super(RecoveryPoint, self).__init__(location=location, **kwargs) self.properties = properties @@ -17571,10 +22402,10 @@ def __init__( class RecoveryPointCollection(msrest.serialization.Model): """Collection of recovery point details. - :param value: The recovery point details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPoint] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The recovery point details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPoint] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -17589,6 +22420,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The recovery point details. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPoint] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(RecoveryPointCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -17597,12 +22434,12 @@ def __init__( class RecoveryPointProperties(msrest.serialization.Model): """Recovery point properties. - :param recovery_point_time: The recovery point time. - :type recovery_point_time: ~datetime.datetime - :param recovery_point_type: The recovery point type: ApplicationConsistent, CrashConsistent. - :type recovery_point_type: str - :param provider_specific_details: The provider specific details for the recovery point. - :type provider_specific_details: + :ivar recovery_point_time: The recovery point time. + :vartype recovery_point_time: ~datetime.datetime + :ivar recovery_point_type: The recovery point type: ApplicationConsistent, CrashConsistent. + :vartype recovery_point_type: str + :ivar provider_specific_details: The provider specific details for the recovery point. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.ProviderSpecificRecoveryPointDetails """ @@ -17620,6 +22457,15 @@ def __init__( provider_specific_details: Optional["ProviderSpecificRecoveryPointDetails"] = None, **kwargs ): + """ + :keyword recovery_point_time: The recovery point time. + :paramtype recovery_point_time: ~datetime.datetime + :keyword recovery_point_type: The recovery point type: ApplicationConsistent, CrashConsistent. + :paramtype recovery_point_type: str + :keyword provider_specific_details: The provider specific details for the recovery point. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.ProviderSpecificRecoveryPointDetails + """ super(RecoveryPointProperties, self).__init__(**kwargs) self.recovery_point_time = recovery_point_time self.recovery_point_type = recovery_point_type @@ -17637,10 +22483,10 @@ class RecoveryServicesProvider(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: Provider properties. - :type properties: + :ivar location: Resource Location. + :vartype location: str + :ivar properties: Provider properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProviderProperties """ @@ -17665,6 +22511,13 @@ def __init__( properties: Optional["RecoveryServicesProviderProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: Provider properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProviderProperties + """ super(RecoveryServicesProvider, self).__init__(location=location, **kwargs) self.properties = properties @@ -17672,10 +22525,10 @@ def __init__( class RecoveryServicesProviderCollection(msrest.serialization.Model): """Collection of providers. - :param value: The Servers details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProvider] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The Servers details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProvider] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -17690,6 +22543,13 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The Servers details. + :paramtype value: + list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProvider] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(RecoveryServicesProviderCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -17698,50 +22558,52 @@ def __init__( class RecoveryServicesProviderProperties(msrest.serialization.Model): """Recovery services provider properties. - :param fabric_type: Type of the site. - :type fabric_type: str - :param friendly_name: Friendly name of the DRA. - :type friendly_name: str - :param provider_version: The provider version. - :type provider_version: str - :param server_version: The fabric provider. - :type server_version: str - :param provider_version_state: DRA version status. - :type provider_version_state: str - :param provider_version_expiry_date: Expiry date of the version. - :type provider_version_expiry_date: ~datetime.datetime - :param fabric_friendly_name: The fabric friendly name. - :type fabric_friendly_name: str - :param last_heart_beat: Time when last heartbeat was sent by the DRA. - :type last_heart_beat: ~datetime.datetime - :param connection_status: A value indicating whether DRA is responsive. - :type connection_status: str - :param protected_item_count: Number of protected VMs currently managed by the DRA. - :type protected_item_count: int - :param allowed_scenarios: The scenarios allowed on this provider. - :type allowed_scenarios: list[str] - :param health_error_details: The recovery services provider health error details. - :type health_error_details: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param dra_identifier: The DRA Id. - :type dra_identifier: str - :param machine_id: The machine Id. - :type machine_id: str - :param machine_name: The machine name. - :type machine_name: str - :param bios_id: The Bios Id. - :type bios_id: str - :param authentication_identity_details: The authentication identity details. - :type authentication_identity_details: + :ivar fabric_type: Type of the site. + :vartype fabric_type: str + :ivar friendly_name: Friendly name of the DRA. + :vartype friendly_name: str + :ivar provider_version: The provider version. + :vartype provider_version: str + :ivar server_version: The fabric provider. + :vartype server_version: str + :ivar provider_version_state: DRA version status. + :vartype provider_version_state: str + :ivar provider_version_expiry_date: Expiry date of the version. + :vartype provider_version_expiry_date: ~datetime.datetime + :ivar fabric_friendly_name: The fabric friendly name. + :vartype fabric_friendly_name: str + :ivar last_heart_beat: Time when last heartbeat was sent by the DRA. + :vartype last_heart_beat: ~datetime.datetime + :ivar connection_status: A value indicating whether DRA is responsive. + :vartype connection_status: str + :ivar protected_item_count: Number of protected VMs currently managed by the DRA. + :vartype protected_item_count: int + :ivar allowed_scenarios: The scenarios allowed on this provider. + :vartype allowed_scenarios: list[str] + :ivar health_error_details: The recovery services provider health error details. + :vartype health_error_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :ivar dra_identifier: The DRA Id. + :vartype dra_identifier: str + :ivar machine_id: The machine Id. + :vartype machine_id: str + :ivar machine_name: The machine name. + :vartype machine_name: str + :ivar bios_id: The Bios Id. + :vartype bios_id: str + :ivar authentication_identity_details: The authentication identity details. + :vartype authentication_identity_details: ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderDetails - :param resource_access_identity_details: The resource access identity details. - :type resource_access_identity_details: + :ivar resource_access_identity_details: The resource access identity details. + :vartype resource_access_identity_details: ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderDetails - :param data_plane_authentication_identity_details: The data plane authentication identity + :ivar data_plane_authentication_identity_details: The data plane authentication identity details. - :type data_plane_authentication_identity_details: + :vartype data_plane_authentication_identity_details: ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderDetails - :param provider_version_details: The provider version details. - :type provider_version_details: ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails + :ivar provider_version_details: The provider version details. + :vartype provider_version_details: + ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails """ _attribute_map = { @@ -17792,6 +22654,54 @@ def __init__( provider_version_details: Optional["VersionDetails"] = None, **kwargs ): + """ + :keyword fabric_type: Type of the site. + :paramtype fabric_type: str + :keyword friendly_name: Friendly name of the DRA. + :paramtype friendly_name: str + :keyword provider_version: The provider version. + :paramtype provider_version: str + :keyword server_version: The fabric provider. + :paramtype server_version: str + :keyword provider_version_state: DRA version status. + :paramtype provider_version_state: str + :keyword provider_version_expiry_date: Expiry date of the version. + :paramtype provider_version_expiry_date: ~datetime.datetime + :keyword fabric_friendly_name: The fabric friendly name. + :paramtype fabric_friendly_name: str + :keyword last_heart_beat: Time when last heartbeat was sent by the DRA. + :paramtype last_heart_beat: ~datetime.datetime + :keyword connection_status: A value indicating whether DRA is responsive. + :paramtype connection_status: str + :keyword protected_item_count: Number of protected VMs currently managed by the DRA. + :paramtype protected_item_count: int + :keyword allowed_scenarios: The scenarios allowed on this provider. + :paramtype allowed_scenarios: list[str] + :keyword health_error_details: The recovery services provider health error details. + :paramtype health_error_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :keyword dra_identifier: The DRA Id. + :paramtype dra_identifier: str + :keyword machine_id: The machine Id. + :paramtype machine_id: str + :keyword machine_name: The machine name. + :paramtype machine_name: str + :keyword bios_id: The Bios Id. + :paramtype bios_id: str + :keyword authentication_identity_details: The authentication identity details. + :paramtype authentication_identity_details: + ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderDetails + :keyword resource_access_identity_details: The resource access identity details. + :paramtype resource_access_identity_details: + ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderDetails + :keyword data_plane_authentication_identity_details: The data plane authentication identity + details. + :paramtype data_plane_authentication_identity_details: + ~azure.mgmt.recoveryservicessiterecovery.models.IdentityProviderDetails + :keyword provider_version_details: The provider version details. + :paramtype provider_version_details: + ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails + """ super(RecoveryServicesProviderProperties, self).__init__(**kwargs) self.fabric_type = fabric_type self.friendly_name = friendly_name @@ -17818,8 +22728,8 @@ def __init__( class RemoveDisksInput(msrest.serialization.Model): """Input for remove disk(s) operation. - :param properties: Remove disk input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.RemoveDisksInputProperties + :ivar properties: Remove disk input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.RemoveDisksInputProperties """ _attribute_map = { @@ -17832,6 +22742,11 @@ def __init__( properties: Optional["RemoveDisksInputProperties"] = None, **kwargs ): + """ + :keyword properties: Remove disk input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.RemoveDisksInputProperties + """ super(RemoveDisksInput, self).__init__(**kwargs) self.properties = properties @@ -17839,10 +22754,10 @@ def __init__( class RemoveDisksInputProperties(msrest.serialization.Model): """Remove Disk input properties. - :param provider_specific_details: The ReplicationProviderInput. For HyperVReplicaAzure - provider, it will be AzureEnableProtectionInput object. For San provider, it will be + :ivar provider_specific_details: The ReplicationProviderInput. For HyperVReplicaAzure provider, + it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. - :type provider_specific_details: + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.RemoveDisksProviderSpecificInput """ @@ -17856,6 +22771,13 @@ def __init__( provider_specific_details: Optional["RemoveDisksProviderSpecificInput"] = None, **kwargs ): + """ + :keyword provider_specific_details: The ReplicationProviderInput. For HyperVReplicaAzure + provider, it will be AzureEnableProtectionInput object. For San provider, it will be + SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.RemoveDisksProviderSpecificInput + """ super(RemoveDisksInputProperties, self).__init__(**kwargs) self.provider_specific_details = provider_specific_details @@ -17863,8 +22785,8 @@ def __init__( class RemoveProtectionContainerMappingInput(msrest.serialization.Model): """Container unpairing input. - :param properties: Configure protection input properties. - :type properties: + :ivar properties: Configure protection input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInputProperties """ @@ -17878,6 +22800,11 @@ def __init__( properties: Optional["RemoveProtectionContainerMappingInputProperties"] = None, **kwargs ): + """ + :keyword properties: Configure protection input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInputProperties + """ super(RemoveProtectionContainerMappingInput, self).__init__(**kwargs) self.properties = properties @@ -17885,8 +22812,8 @@ def __init__( class RemoveProtectionContainerMappingInputProperties(msrest.serialization.Model): """Unpairing input properties. - :param provider_specific_input: Provider specific input for unpairing. - :type provider_specific_input: + :ivar provider_specific_input: Provider specific input for unpairing. + :vartype provider_specific_input: ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderContainerUnmappingInput """ @@ -17900,6 +22827,11 @@ def __init__( provider_specific_input: Optional["ReplicationProviderContainerUnmappingInput"] = None, **kwargs ): + """ + :keyword provider_specific_input: Provider specific input for unpairing. + :paramtype provider_specific_input: + ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderContainerUnmappingInput + """ super(RemoveProtectionContainerMappingInputProperties, self).__init__(**kwargs) self.provider_specific_input = provider_specific_input @@ -17907,8 +22839,8 @@ def __init__( class RenewCertificateInput(msrest.serialization.Model): """Certificate renewal input. - :param properties: Renew certificate input properties. - :type properties: + :ivar properties: Renew certificate input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.RenewCertificateInputProperties """ @@ -17922,6 +22854,11 @@ def __init__( properties: Optional["RenewCertificateInputProperties"] = None, **kwargs ): + """ + :keyword properties: Renew certificate input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.RenewCertificateInputProperties + """ super(RenewCertificateInput, self).__init__(**kwargs) self.properties = properties @@ -17929,8 +22866,8 @@ def __init__( class RenewCertificateInputProperties(msrest.serialization.Model): """Renew Certificate input properties. - :param renew_certificate_type: Renew certificate type. - :type renew_certificate_type: str + :ivar renew_certificate_type: Renew certificate type. + :vartype renew_certificate_type: str """ _attribute_map = { @@ -17943,6 +22880,10 @@ def __init__( renew_certificate_type: Optional[str] = None, **kwargs ): + """ + :keyword renew_certificate_type: Renew certificate type. + :paramtype renew_certificate_type: str + """ super(RenewCertificateInputProperties, self).__init__(**kwargs) self.renew_certificate_type = renew_certificate_type @@ -18001,6 +22942,8 @@ def __init__( self, **kwargs ): + """ + """ super(ReplicationAgentDetails, self).__init__(**kwargs) self.id = None self.name = None @@ -18013,6 +22956,60 @@ def __init__( self.health_errors = None +class ReplicationAppliance(msrest.serialization.Model): + """Replication appliance definition. + + :ivar properties: Appliance related data. + :vartype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationApplianceProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'ReplicationApplianceProperties'}, + } + + def __init__( + self, + *, + properties: Optional["ReplicationApplianceProperties"] = None, + **kwargs + ): + """ + :keyword properties: Appliance related data. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationApplianceProperties + """ + super(ReplicationAppliance, self).__init__(**kwargs) + self.properties = properties + + +class ReplicationApplianceProperties(msrest.serialization.Model): + """Replication appliance properties. + + :ivar provider_specific_details: Provider specific settings. + :vartype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.ApplianceSpecificDetails + """ + + _attribute_map = { + 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'ApplianceSpecificDetails'}, + } + + def __init__( + self, + *, + provider_specific_details: Optional["ApplianceSpecificDetails"] = None, + **kwargs + ): + """ + :keyword provider_specific_details: Provider specific settings. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.ApplianceSpecificDetails + """ + super(ReplicationApplianceProperties, self).__init__(**kwargs) + self.provider_specific_details = provider_specific_details + + class ReplicationEligibilityResults(msrest.serialization.Model): """Replication eligibility results response model. @@ -18047,6 +23044,8 @@ def __init__( self, **kwargs ): + """ + """ super(ReplicationEligibilityResults, self).__init__(**kwargs) self.name = None self.type = None @@ -18057,8 +23056,8 @@ def __init__( class ReplicationEligibilityResultsCollection(msrest.serialization.Model): """Replication eligibility results collection response model. - :param value: The replication eligibility results details. - :type value: + :ivar value: The replication eligibility results details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationEligibilityResults] """ @@ -18072,6 +23071,11 @@ def __init__( value: Optional[List["ReplicationEligibilityResults"]] = None, **kwargs ): + """ + :keyword value: The replication eligibility results details. + :paramtype value: + list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationEligibilityResults] + """ super(ReplicationEligibilityResultsCollection, self).__init__(**kwargs) self.value = value @@ -18081,14 +23085,14 @@ class ReplicationEligibilityResultsErrorInfo(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param code: The error code. - :type code: str - :param message: The error message. - :type message: str - :param possible_causes: The possible causes. - :type possible_causes: str - :param recommended_action: The recommended action. - :type recommended_action: str + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar possible_causes: The possible causes. + :vartype possible_causes: str + :ivar recommended_action: The recommended action. + :vartype recommended_action: str :ivar status: The error status. :vartype status: str """ @@ -18114,6 +23118,16 @@ def __init__( recommended_action: Optional[str] = None, **kwargs ): + """ + :keyword code: The error code. + :paramtype code: str + :keyword message: The error message. + :paramtype message: str + :keyword possible_causes: The possible causes. + :paramtype possible_causes: str + :keyword recommended_action: The recommended action. + :paramtype recommended_action: str + """ super(ReplicationEligibilityResultsErrorInfo, self).__init__(**kwargs) self.code = code self.message = message @@ -18129,8 +23143,8 @@ class ReplicationEligibilityResultsProperties(msrest.serialization.Model): :ivar client_request_id: The client request Id. :vartype client_request_id: str - :param errors: The error details. - :type errors: + :ivar errors: The error details. + :vartype errors: list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationEligibilityResultsErrorInfo] """ @@ -18149,6 +23163,11 @@ def __init__( errors: Optional[List["ReplicationEligibilityResultsErrorInfo"]] = None, **kwargs ): + """ + :keyword errors: The error details. + :paramtype errors: + list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationEligibilityResultsErrorInfo] + """ super(ReplicationEligibilityResultsProperties, self).__init__(**kwargs) self.client_request_id = None self.errors = errors @@ -18159,9 +23178,9 @@ class ReplicationGroupDetails(ConfigurationSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str """ _validation = { @@ -18176,6 +23195,8 @@ def __init__( self, **kwargs ): + """ + """ super(ReplicationGroupDetails, self).__init__(**kwargs) self.instance_type = 'ReplicationGroupDetails' # type: str @@ -18191,10 +23212,10 @@ class ReplicationProtectedItem(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom data. - :type properties: + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The custom data. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItemProperties """ @@ -18219,6 +23240,13 @@ def __init__( properties: Optional["ReplicationProtectedItemProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The custom data. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItemProperties + """ super(ReplicationProtectedItem, self).__init__(location=location, **kwargs) self.properties = properties @@ -18226,10 +23254,10 @@ def __init__( class ReplicationProtectedItemCollection(msrest.serialization.Model): """Replication protected item collection. - :param value: The Replication protected item details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The Replication protected item details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -18244,6 +23272,13 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The Replication protected item details. + :paramtype value: + list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(ReplicationProtectedItemCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -18252,67 +23287,72 @@ def __init__( class ReplicationProtectedItemProperties(msrest.serialization.Model): """Replication protected item custom data details. - :param friendly_name: The name. - :type friendly_name: str - :param protected_item_type: The type of protected item type. - :type protected_item_type: str - :param protectable_item_id: The protected item ARM Id. - :type protectable_item_id: str - :param recovery_services_provider_id: The recovery provider ARM Id. - :type recovery_services_provider_id: str - :param primary_fabric_friendly_name: The friendly name of the primary fabric. - :type primary_fabric_friendly_name: str - :param primary_fabric_provider: The fabric provider of the primary fabric. - :type primary_fabric_provider: str - :param recovery_fabric_friendly_name: The friendly name of recovery fabric. - :type recovery_fabric_friendly_name: str - :param recovery_fabric_id: The Arm Id of recovery fabric. - :type recovery_fabric_id: str - :param primary_protection_container_friendly_name: The name of primary protection container + :ivar friendly_name: The name. + :vartype friendly_name: str + :ivar protected_item_type: The type of protected item type. + :vartype protected_item_type: str + :ivar protectable_item_id: The protected item ARM Id. + :vartype protectable_item_id: str + :ivar recovery_services_provider_id: The recovery provider ARM Id. + :vartype recovery_services_provider_id: str + :ivar primary_fabric_friendly_name: The friendly name of the primary fabric. + :vartype primary_fabric_friendly_name: str + :ivar primary_fabric_provider: The fabric provider of the primary fabric. + :vartype primary_fabric_provider: str + :ivar recovery_fabric_friendly_name: The friendly name of recovery fabric. + :vartype recovery_fabric_friendly_name: str + :ivar recovery_fabric_id: The Arm Id of recovery fabric. + :vartype recovery_fabric_id: str + :ivar primary_protection_container_friendly_name: The name of primary protection container friendly name. - :type primary_protection_container_friendly_name: str - :param recovery_protection_container_friendly_name: The name of recovery container friendly + :vartype primary_protection_container_friendly_name: str + :ivar recovery_protection_container_friendly_name: The name of recovery container friendly name. - :type recovery_protection_container_friendly_name: str - :param protection_state: The protection status. - :type protection_state: str - :param protection_state_description: The protection state description. - :type protection_state_description: str - :param active_location: The Current active location of the PE. - :type active_location: str - :param test_failover_state: The Test failover state. - :type test_failover_state: str - :param test_failover_state_description: The Test failover state description. - :type test_failover_state_description: str - :param allowed_operations: The allowed operations on the Replication protected item. - :type allowed_operations: list[str] - :param replication_health: The consolidated protection health for the VM taking any issues with + :vartype recovery_protection_container_friendly_name: str + :ivar protection_state: The protection status. + :vartype protection_state: str + :ivar protection_state_description: The protection state description. + :vartype protection_state_description: str + :ivar active_location: The Current active location of the PE. + :vartype active_location: str + :ivar test_failover_state: The Test failover state. + :vartype test_failover_state: str + :ivar test_failover_state_description: The Test failover state description. + :vartype test_failover_state_description: str + :ivar switch_provider_state: The switch provider state. + :vartype switch_provider_state: str + :ivar switch_provider_state_description: The switch provider state description. + :vartype switch_provider_state_description: str + :ivar allowed_operations: The allowed operations on the Replication protected item. + :vartype allowed_operations: list[str] + :ivar replication_health: The consolidated protection health for the VM taking any issues with SRS as well as all the replication units associated with the VM's replication group into account. This is a string representation of the ProtectionHealth enumeration. - :type replication_health: str - :param failover_health: The consolidated failover health for the VM. - :type failover_health: str - :param health_errors: List of health errors. - :type health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param policy_id: The ID of Policy governing this PE. - :type policy_id: str - :param policy_friendly_name: The name of Policy governing this PE. - :type policy_friendly_name: str - :param last_successful_failover_time: The Last successful failover time. - :type last_successful_failover_time: ~datetime.datetime - :param last_successful_test_failover_time: The Last successful test failover time. - :type last_successful_test_failover_time: ~datetime.datetime - :param current_scenario: The current scenario. - :type current_scenario: ~azure.mgmt.recoveryservicessiterecovery.models.CurrentScenarioDetails - :param failover_recovery_point_id: The recovery point ARM Id to which the Vm was failed over. - :type failover_recovery_point_id: str - :param provider_specific_details: The Replication provider custom settings. - :type provider_specific_details: + :vartype replication_health: str + :ivar failover_health: The consolidated failover health for the VM. + :vartype failover_health: str + :ivar health_errors: List of health errors. + :vartype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :ivar policy_id: The ID of Policy governing this PE. + :vartype policy_id: str + :ivar policy_friendly_name: The name of Policy governing this PE. + :vartype policy_friendly_name: str + :ivar last_successful_failover_time: The Last successful failover time. + :vartype last_successful_failover_time: ~datetime.datetime + :ivar last_successful_test_failover_time: The Last successful test failover time. + :vartype last_successful_test_failover_time: ~datetime.datetime + :ivar current_scenario: The current scenario. + :vartype current_scenario: + ~azure.mgmt.recoveryservicessiterecovery.models.CurrentScenarioDetails + :ivar failover_recovery_point_id: The recovery point ARM Id to which the Vm was failed over. + :vartype failover_recovery_point_id: str + :ivar provider_specific_details: The Replication provider custom settings. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderSpecificSettings - :param recovery_container_id: The recovery container Id. - :type recovery_container_id: str - :param event_correlation_id: The correlation Id for events associated with this protected item. - :type event_correlation_id: str + :ivar recovery_container_id: The recovery container Id. + :vartype recovery_container_id: str + :ivar event_correlation_id: The correlation Id for events associated with this protected item. + :vartype event_correlation_id: str """ _attribute_map = { @@ -18331,6 +23371,8 @@ class ReplicationProtectedItemProperties(msrest.serialization.Model): 'active_location': {'key': 'activeLocation', 'type': 'str'}, 'test_failover_state': {'key': 'testFailoverState', 'type': 'str'}, 'test_failover_state_description': {'key': 'testFailoverStateDescription', 'type': 'str'}, + 'switch_provider_state': {'key': 'switchProviderState', 'type': 'str'}, + 'switch_provider_state_description': {'key': 'switchProviderStateDescription', 'type': 'str'}, 'allowed_operations': {'key': 'allowedOperations', 'type': '[str]'}, 'replication_health': {'key': 'replicationHealth', 'type': 'str'}, 'failover_health': {'key': 'failoverHealth', 'type': 'str'}, @@ -18364,6 +23406,8 @@ def __init__( active_location: Optional[str] = None, test_failover_state: Optional[str] = None, test_failover_state_description: Optional[str] = None, + switch_provider_state: Optional[str] = None, + switch_provider_state_description: Optional[str] = None, allowed_operations: Optional[List[str]] = None, replication_health: Optional[str] = None, failover_health: Optional[str] = None, @@ -18379,6 +23423,75 @@ def __init__( event_correlation_id: Optional[str] = None, **kwargs ): + """ + :keyword friendly_name: The name. + :paramtype friendly_name: str + :keyword protected_item_type: The type of protected item type. + :paramtype protected_item_type: str + :keyword protectable_item_id: The protected item ARM Id. + :paramtype protectable_item_id: str + :keyword recovery_services_provider_id: The recovery provider ARM Id. + :paramtype recovery_services_provider_id: str + :keyword primary_fabric_friendly_name: The friendly name of the primary fabric. + :paramtype primary_fabric_friendly_name: str + :keyword primary_fabric_provider: The fabric provider of the primary fabric. + :paramtype primary_fabric_provider: str + :keyword recovery_fabric_friendly_name: The friendly name of recovery fabric. + :paramtype recovery_fabric_friendly_name: str + :keyword recovery_fabric_id: The Arm Id of recovery fabric. + :paramtype recovery_fabric_id: str + :keyword primary_protection_container_friendly_name: The name of primary protection container + friendly name. + :paramtype primary_protection_container_friendly_name: str + :keyword recovery_protection_container_friendly_name: The name of recovery container friendly + name. + :paramtype recovery_protection_container_friendly_name: str + :keyword protection_state: The protection status. + :paramtype protection_state: str + :keyword protection_state_description: The protection state description. + :paramtype protection_state_description: str + :keyword active_location: The Current active location of the PE. + :paramtype active_location: str + :keyword test_failover_state: The Test failover state. + :paramtype test_failover_state: str + :keyword test_failover_state_description: The Test failover state description. + :paramtype test_failover_state_description: str + :keyword switch_provider_state: The switch provider state. + :paramtype switch_provider_state: str + :keyword switch_provider_state_description: The switch provider state description. + :paramtype switch_provider_state_description: str + :keyword allowed_operations: The allowed operations on the Replication protected item. + :paramtype allowed_operations: list[str] + :keyword replication_health: The consolidated protection health for the VM taking any issues + with SRS as well as all the replication units associated with the VM's replication group into + account. This is a string representation of the ProtectionHealth enumeration. + :paramtype replication_health: str + :keyword failover_health: The consolidated failover health for the VM. + :paramtype failover_health: str + :keyword health_errors: List of health errors. + :paramtype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :keyword policy_id: The ID of Policy governing this PE. + :paramtype policy_id: str + :keyword policy_friendly_name: The name of Policy governing this PE. + :paramtype policy_friendly_name: str + :keyword last_successful_failover_time: The Last successful failover time. + :paramtype last_successful_failover_time: ~datetime.datetime + :keyword last_successful_test_failover_time: The Last successful test failover time. + :paramtype last_successful_test_failover_time: ~datetime.datetime + :keyword current_scenario: The current scenario. + :paramtype current_scenario: + ~azure.mgmt.recoveryservicessiterecovery.models.CurrentScenarioDetails + :keyword failover_recovery_point_id: The recovery point ARM Id to which the Vm was failed over. + :paramtype failover_recovery_point_id: str + :keyword provider_specific_details: The Replication provider custom settings. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderSpecificSettings + :keyword recovery_container_id: The recovery container Id. + :paramtype recovery_container_id: str + :keyword event_correlation_id: The correlation Id for events associated with this protected + item. + :paramtype event_correlation_id: str + """ super(ReplicationProtectedItemProperties, self).__init__(**kwargs) self.friendly_name = friendly_name self.protected_item_type = protected_item_type @@ -18395,6 +23508,8 @@ def __init__( self.active_location = active_location self.test_failover_state = test_failover_state self.test_failover_state_description = test_failover_state_description + self.switch_provider_state = switch_provider_state + self.switch_provider_state_description = switch_provider_state_description self.allowed_operations = allowed_operations self.replication_health = replication_health self.failover_health = failover_health @@ -18421,10 +23536,10 @@ class ReplicationProtectionIntent(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The custom data. - :type properties: + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The custom data. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectionIntentProperties """ @@ -18449,6 +23564,13 @@ def __init__( properties: Optional["ReplicationProtectionIntentProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The custom data. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectionIntentProperties + """ super(ReplicationProtectionIntent, self).__init__(location=location, **kwargs) self.properties = properties @@ -18456,10 +23578,11 @@ def __init__( class ReplicationProtectionIntentCollection(msrest.serialization.Model): """Replication protection intent objects collection. - :param value: The Replication protection intent details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectionIntent] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The Replication protection intent details. + :vartype value: + list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectionIntent] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -18474,6 +23597,13 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The Replication protection intent details. + :paramtype value: + list[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectionIntent] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(ReplicationProtectionIntentCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -18484,8 +23614,8 @@ class ReplicationProtectionIntentProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param friendly_name: The name. - :type friendly_name: str + :ivar friendly_name: The name. + :vartype friendly_name: str :ivar job_id: The job Id. :vartype job_id: str :ivar job_state: The job state. @@ -18494,8 +23624,8 @@ class ReplicationProtectionIntentProperties(msrest.serialization.Model): :vartype is_active: bool :ivar creation_time_utc: The creation time in UTC. :vartype creation_time_utc: str - :param provider_specific_details: The Replication provider custom settings. - :type provider_specific_details: + :ivar provider_specific_details: The Replication provider custom settings. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectionIntentProviderSpecificSettings """ @@ -18522,6 +23652,13 @@ def __init__( provider_specific_details: Optional["ReplicationProtectionIntentProviderSpecificSettings"] = None, **kwargs ): + """ + :keyword friendly_name: The name. + :paramtype friendly_name: str + :keyword provider_specific_details: The Replication provider custom settings. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectionIntentProviderSpecificSettings + """ super(ReplicationProtectionIntentProperties, self).__init__(**kwargs) self.friendly_name = friendly_name self.job_id = None @@ -18534,8 +23671,8 @@ def __init__( class ReplicationProviderContainerUnmappingInput(msrest.serialization.Model): """Provider specific input for unpairing operations. - :param instance_type: The class type. - :type instance_type: str + :ivar instance_type: The class type. + :vartype instance_type: str """ _attribute_map = { @@ -18548,6 +23685,10 @@ def __init__( instance_type: Optional[str] = None, **kwargs ): + """ + :keyword instance_type: The class type. + :paramtype instance_type: str + """ super(ReplicationProviderContainerUnmappingInput, self).__init__(**kwargs) self.instance_type = instance_type @@ -18622,6 +23763,8 @@ def __init__( self, **kwargs ): + """ + """ super(ReprotectAgentDetails, self).__init__(**kwargs) self.id = None self.name = None @@ -18641,8 +23784,8 @@ def __init__( class ResolveHealthError(msrest.serialization.Model): """Resolve health errors input properties. - :param health_error_id: Health error id. - :type health_error_id: str + :ivar health_error_id: Health error id. + :vartype health_error_id: str """ _attribute_map = { @@ -18655,6 +23798,10 @@ def __init__( health_error_id: Optional[str] = None, **kwargs ): + """ + :keyword health_error_id: Health error id. + :paramtype health_error_id: str + """ super(ResolveHealthError, self).__init__(**kwargs) self.health_error_id = health_error_id @@ -18662,8 +23809,9 @@ def __init__( class ResolveHealthInput(msrest.serialization.Model): """Resolve health input. - :param properties: Disable resolve health input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.ResolveHealthInputProperties + :ivar properties: Disable resolve health input properties. + :vartype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.ResolveHealthInputProperties """ _attribute_map = { @@ -18676,6 +23824,11 @@ def __init__( properties: Optional["ResolveHealthInputProperties"] = None, **kwargs ): + """ + :keyword properties: Disable resolve health input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.ResolveHealthInputProperties + """ super(ResolveHealthInput, self).__init__(**kwargs) self.properties = properties @@ -18683,8 +23836,9 @@ def __init__( class ResolveHealthInputProperties(msrest.serialization.Model): """Resolve health input properties. - :param health_errors: Health errors. - :type health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.ResolveHealthError] + :ivar health_errors: Health errors. + :vartype health_errors: + list[~azure.mgmt.recoveryservicessiterecovery.models.ResolveHealthError] """ _attribute_map = { @@ -18697,6 +23851,11 @@ def __init__( health_errors: Optional[List["ResolveHealthError"]] = None, **kwargs ): + """ + :keyword health_errors: Health errors. + :paramtype health_errors: + list[~azure.mgmt.recoveryservicessiterecovery.models.ResolveHealthError] + """ super(ResolveHealthInputProperties, self).__init__(**kwargs) self.health_errors = health_errors @@ -18704,12 +23863,12 @@ def __init__( class ResourceHealthSummary(msrest.serialization.Model): """Base class to define the health summary of the resources contained under an Arm resource. - :param resource_count: The count of total resources under the container. - :type resource_count: int - :param issues: The list of summary of health errors across the resources under the container. - :type issues: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthErrorSummary] - :param categorized_resource_counts: The categorized resource counts. - :type categorized_resource_counts: dict[str, int] + :ivar resource_count: The count of total resources under the container. + :vartype resource_count: int + :ivar issues: The list of summary of health errors across the resources under the container. + :vartype issues: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthErrorSummary] + :ivar categorized_resource_counts: The categorized resource counts. + :vartype categorized_resource_counts: dict[str, int] """ _attribute_map = { @@ -18726,6 +23885,14 @@ def __init__( categorized_resource_counts: Optional[Dict[str, int]] = None, **kwargs ): + """ + :keyword resource_count: The count of total resources under the container. + :paramtype resource_count: int + :keyword issues: The list of summary of health errors across the resources under the container. + :paramtype issues: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthErrorSummary] + :keyword categorized_resource_counts: The categorized resource counts. + :paramtype categorized_resource_counts: dict[str, int] + """ super(ResourceHealthSummary, self).__init__(**kwargs) self.resource_count = resource_count self.issues = issues @@ -18735,8 +23902,8 @@ def __init__( class ResumeJobParams(msrest.serialization.Model): """Resume job params. - :param properties: Resume job properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.ResumeJobParamsProperties + :ivar properties: Resume job properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.ResumeJobParamsProperties """ _attribute_map = { @@ -18749,6 +23916,11 @@ def __init__( properties: Optional["ResumeJobParamsProperties"] = None, **kwargs ): + """ + :keyword properties: Resume job properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.ResumeJobParamsProperties + """ super(ResumeJobParams, self).__init__(**kwargs) self.properties = properties @@ -18756,8 +23928,8 @@ def __init__( class ResumeJobParamsProperties(msrest.serialization.Model): """Resume job properties. - :param comments: Resume job comments. - :type comments: str + :ivar comments: Resume job comments. + :vartype comments: str """ _attribute_map = { @@ -18770,6 +23942,10 @@ def __init__( comments: Optional[str] = None, **kwargs ): + """ + :keyword comments: Resume job comments. + :paramtype comments: str + """ super(ResumeJobParamsProperties, self).__init__(**kwargs) self.comments = comments @@ -18779,8 +23955,8 @@ class ResyncInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. Resync input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.ResyncInputProperties + :ivar properties: Required. Resync input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.ResyncInputProperties """ _validation = { @@ -18797,6 +23973,10 @@ def __init__( properties: "ResyncInputProperties", **kwargs ): + """ + :keyword properties: Required. Resync input properties. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.ResyncInputProperties + """ super(ResyncInput, self).__init__(**kwargs) self.properties = properties @@ -18806,8 +23986,8 @@ class ResyncInputProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param provider_specific_details: Required. The provider specific details. - :type provider_specific_details: + :ivar provider_specific_details: Required. The provider specific details. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.ResyncProviderSpecificInput """ @@ -18825,6 +24005,11 @@ def __init__( provider_specific_details: "ResyncProviderSpecificInput", **kwargs ): + """ + :keyword provider_specific_details: Required. The provider specific details. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.ResyncProviderSpecificInput + """ super(ResyncInputProperties, self).__init__(**kwargs) self.provider_specific_details = provider_specific_details @@ -18837,8 +24022,8 @@ class ResyncProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -18857,6 +24042,8 @@ def __init__( self, **kwargs ): + """ + """ super(ResyncProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -18864,14 +24051,14 @@ def __init__( class RetentionVolume(msrest.serialization.Model): """The retention details of the MT. - :param volume_name: The volume name. - :type volume_name: str - :param capacity_in_bytes: The volume capacity. - :type capacity_in_bytes: long - :param free_space_in_bytes: The free space available in this volume. - :type free_space_in_bytes: long - :param threshold_percentage: The threshold percentage. - :type threshold_percentage: int + :ivar volume_name: The volume name. + :vartype volume_name: str + :ivar capacity_in_bytes: The volume capacity. + :vartype capacity_in_bytes: long + :ivar free_space_in_bytes: The free space available in this volume. + :vartype free_space_in_bytes: long + :ivar threshold_percentage: The threshold percentage. + :vartype threshold_percentage: int """ _attribute_map = { @@ -18890,6 +24077,16 @@ def __init__( threshold_percentage: Optional[int] = None, **kwargs ): + """ + :keyword volume_name: The volume name. + :paramtype volume_name: str + :keyword capacity_in_bytes: The volume capacity. + :paramtype capacity_in_bytes: long + :keyword free_space_in_bytes: The free space available in this volume. + :paramtype free_space_in_bytes: long + :keyword threshold_percentage: The threshold percentage. + :paramtype threshold_percentage: int + """ super(RetentionVolume, self).__init__(**kwargs) self.volume_name = volume_name self.capacity_in_bytes = capacity_in_bytes @@ -18900,8 +24097,8 @@ def __init__( class ReverseReplicationInput(msrest.serialization.Model): """Reverse replication input. - :param properties: Reverse replication properties. - :type properties: + :ivar properties: Reverse replication properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.ReverseReplicationInputProperties """ @@ -18915,6 +24112,11 @@ def __init__( properties: Optional["ReverseReplicationInputProperties"] = None, **kwargs ): + """ + :keyword properties: Reverse replication properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.ReverseReplicationInputProperties + """ super(ReverseReplicationInput, self).__init__(**kwargs) self.properties = properties @@ -18922,10 +24124,10 @@ def __init__( class ReverseReplicationInputProperties(msrest.serialization.Model): """Reverse replication input properties. - :param failover_direction: Failover direction. - :type failover_direction: str - :param provider_specific_details: Provider specific reverse replication input. - :type provider_specific_details: + :ivar failover_direction: Failover direction. + :vartype failover_direction: str + :ivar provider_specific_details: Provider specific reverse replication input. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.ReverseReplicationProviderSpecificInput """ @@ -18941,6 +24143,13 @@ def __init__( provider_specific_details: Optional["ReverseReplicationProviderSpecificInput"] = None, **kwargs ): + """ + :keyword failover_direction: Failover direction. + :paramtype failover_direction: str + :keyword provider_specific_details: Provider specific reverse replication input. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.ReverseReplicationProviderSpecificInput + """ super(ReverseReplicationInputProperties, self).__init__(**kwargs) self.failover_direction = failover_direction self.provider_specific_details = provider_specific_details @@ -18949,16 +24158,16 @@ def __init__( class RoleAssignment(msrest.serialization.Model): """Azure role assignment details. - :param id: The ARM Id of the role assignment. - :type id: str - :param name: The name of the role assignment. - :type name: str - :param scope: Role assignment scope. - :type scope: str - :param principal_id: Principal Id. - :type principal_id: str - :param role_definition_id: Role definition id. - :type role_definition_id: str + :ivar id: The ARM Id of the role assignment. + :vartype id: str + :ivar name: The name of the role assignment. + :vartype name: str + :ivar scope: Role assignment scope. + :vartype scope: str + :ivar principal_id: Principal Id. + :vartype principal_id: str + :ivar role_definition_id: Role definition id. + :vartype role_definition_id: str """ _attribute_map = { @@ -18979,6 +24188,18 @@ def __init__( role_definition_id: Optional[str] = None, **kwargs ): + """ + :keyword id: The ARM Id of the role assignment. + :paramtype id: str + :keyword name: The name of the role assignment. + :paramtype name: str + :keyword scope: Role assignment scope. + :paramtype scope: str + :keyword principal_id: Principal Id. + :paramtype principal_id: str + :keyword role_definition_id: Role definition id. + :paramtype role_definition_id: str + """ super(RoleAssignment, self).__init__(**kwargs) self.id = id self.name = name @@ -18990,10 +24211,10 @@ def __init__( class RunAsAccount(msrest.serialization.Model): """CS Accounts Details. - :param account_id: The CS RunAs account Id. - :type account_id: str - :param account_name: The CS RunAs account name. - :type account_name: str + :ivar account_id: The CS RunAs account Id. + :vartype account_id: str + :ivar account_name: The CS RunAs account name. + :vartype account_name: str """ _attribute_map = { @@ -19008,6 +24229,12 @@ def __init__( account_name: Optional[str] = None, **kwargs ): + """ + :keyword account_id: The CS RunAs account Id. + :paramtype account_id: str + :keyword account_name: The CS RunAs account name. + :paramtype account_name: str + """ super(RunAsAccount, self).__init__(**kwargs) self.account_id = account_id self.account_name = account_name @@ -19018,16 +24245,16 @@ class ScriptActionTaskDetails(TaskTypeDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param name: The name. - :type name: str - :param path: The path. - :type path: str - :param output: The output. - :type output: str - :param is_primary_side_script: A value indicating whether it is a primary side script or not. - :type is_primary_side_script: bool + :ivar instance_type: Required. The type of task details.Constant filled by server. + :vartype instance_type: str + :ivar name: The name. + :vartype name: str + :ivar path: The path. + :vartype path: str + :ivar output: The output. + :vartype output: str + :ivar is_primary_side_script: A value indicating whether it is a primary side script or not. + :vartype is_primary_side_script: bool """ _validation = { @@ -19051,6 +24278,16 @@ def __init__( is_primary_side_script: Optional[bool] = None, **kwargs ): + """ + :keyword name: The name. + :paramtype name: str + :keyword path: The path. + :paramtype path: str + :keyword output: The output. + :paramtype output: str + :keyword is_primary_side_script: A value indicating whether it is a primary side script or not. + :paramtype is_primary_side_script: bool + """ super(ScriptActionTaskDetails, self).__init__(**kwargs) self.instance_type = 'ScriptActionTaskDetails' # type: str self.name = name @@ -19062,16 +24299,16 @@ def __init__( class ServiceError(msrest.serialization.Model): """ASR error model. - :param code: Error code. - :type code: str - :param message: Error message. - :type message: str - :param possible_causes: Possible causes of error. - :type possible_causes: str - :param recommended_action: Recommended action to resolve error. - :type recommended_action: str - :param activity_id: Activity Id. - :type activity_id: str + :ivar code: Error code. + :vartype code: str + :ivar message: Error message. + :vartype message: str + :ivar possible_causes: Possible causes of error. + :vartype possible_causes: str + :ivar recommended_action: Recommended action to resolve error. + :vartype recommended_action: str + :ivar activity_id: Activity Id. + :vartype activity_id: str """ _attribute_map = { @@ -19092,6 +24329,18 @@ def __init__( activity_id: Optional[str] = None, **kwargs ): + """ + :keyword code: Error code. + :paramtype code: str + :keyword message: Error message. + :paramtype message: str + :keyword possible_causes: Possible causes of error. + :paramtype possible_causes: str + :keyword recommended_action: Recommended action to resolve error. + :paramtype recommended_action: str + :keyword activity_id: Activity Id. + :paramtype activity_id: str + """ super(ServiceError, self).__init__(**kwargs) self.code = code self.message = message @@ -19111,10 +24360,10 @@ class StorageClassification(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: Properties of the storage object. - :type properties: + :ivar location: Resource Location. + :vartype location: str + :ivar properties: Properties of the storage object. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationProperties """ @@ -19139,6 +24388,13 @@ def __init__( properties: Optional["StorageClassificationProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: Properties of the storage object. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationProperties + """ super(StorageClassification, self).__init__(location=location, **kwargs) self.properties = properties @@ -19146,10 +24402,10 @@ def __init__( class StorageClassificationCollection(msrest.serialization.Model): """Collection of storage details. - :param value: The storage details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassification] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The storage details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassification] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -19164,6 +24420,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The storage details. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassification] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(StorageClassificationCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -19180,10 +24442,10 @@ class StorageClassificationMapping(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: Properties of the storage mapping object. - :type properties: + :ivar location: Resource Location. + :vartype location: str + :ivar properties: Properties of the storage mapping object. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingProperties """ @@ -19208,6 +24470,13 @@ def __init__( properties: Optional["StorageClassificationMappingProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: Properties of the storage mapping object. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingProperties + """ super(StorageClassificationMapping, self).__init__(location=location, **kwargs) self.properties = properties @@ -19215,10 +24484,11 @@ def __init__( class StorageClassificationMappingCollection(msrest.serialization.Model): """Collection of storage mapping details. - :param value: The storage details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMapping] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The storage details. + :vartype value: + list[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMapping] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -19233,6 +24503,13 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The storage details. + :paramtype value: + list[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMapping] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(StorageClassificationMappingCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -19241,8 +24518,9 @@ def __init__( class StorageClassificationMappingInput(msrest.serialization.Model): """Storage mapping input. - :param properties: Storage mapping input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.StorageMappingInputProperties + :ivar properties: Storage mapping input properties. + :vartype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.StorageMappingInputProperties """ _attribute_map = { @@ -19255,6 +24533,11 @@ def __init__( properties: Optional["StorageMappingInputProperties"] = None, **kwargs ): + """ + :keyword properties: Storage mapping input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.StorageMappingInputProperties + """ super(StorageClassificationMappingInput, self).__init__(**kwargs) self.properties = properties @@ -19262,8 +24545,8 @@ def __init__( class StorageClassificationMappingProperties(msrest.serialization.Model): """Storage mapping properties. - :param target_storage_classification_id: Target storage object Id. - :type target_storage_classification_id: str + :ivar target_storage_classification_id: Target storage object Id. + :vartype target_storage_classification_id: str """ _attribute_map = { @@ -19276,6 +24559,10 @@ def __init__( target_storage_classification_id: Optional[str] = None, **kwargs ): + """ + :keyword target_storage_classification_id: Target storage object Id. + :paramtype target_storage_classification_id: str + """ super(StorageClassificationMappingProperties, self).__init__(**kwargs) self.target_storage_classification_id = target_storage_classification_id @@ -19283,8 +24570,8 @@ def __init__( class StorageClassificationProperties(msrest.serialization.Model): """Storage object properties. - :param friendly_name: Friendly name of the Storage classification. - :type friendly_name: str + :ivar friendly_name: Friendly name of the Storage classification. + :vartype friendly_name: str """ _attribute_map = { @@ -19297,6 +24584,10 @@ def __init__( friendly_name: Optional[str] = None, **kwargs ): + """ + :keyword friendly_name: Friendly name of the Storage classification. + :paramtype friendly_name: str + """ super(StorageClassificationProperties, self).__init__(**kwargs) self.friendly_name = friendly_name @@ -19304,8 +24595,8 @@ def __init__( class StorageMappingInputProperties(msrest.serialization.Model): """Storage mapping input properties. - :param target_storage_classification_id: The ID of the storage object. - :type target_storage_classification_id: str + :ivar target_storage_classification_id: The ID of the storage object. + :vartype target_storage_classification_id: str """ _attribute_map = { @@ -19318,6 +24609,10 @@ def __init__( target_storage_classification_id: Optional[str] = None, **kwargs ): + """ + :keyword target_storage_classification_id: The ID of the storage object. + :paramtype target_storage_classification_id: str + """ super(StorageMappingInputProperties, self).__init__(**kwargs) self.target_storage_classification_id = target_storage_classification_id @@ -19325,12 +24620,12 @@ def __init__( class Subnet(msrest.serialization.Model): """Subnets of the network. - :param name: The subnet name. - :type name: str - :param friendly_name: The subnet friendly name. - :type friendly_name: str - :param address_list: The list of addresses for the subnet. - :type address_list: list[str] + :ivar name: The subnet name. + :vartype name: str + :ivar friendly_name: The subnet friendly name. + :vartype friendly_name: str + :ivar address_list: The list of addresses for the subnet. + :vartype address_list: list[str] """ _attribute_map = { @@ -19347,6 +24642,14 @@ def __init__( address_list: Optional[List[str]] = None, **kwargs ): + """ + :keyword name: The subnet name. + :paramtype name: str + :keyword friendly_name: The subnet friendly name. + :paramtype friendly_name: str + :keyword address_list: The list of addresses for the subnet. + :paramtype address_list: list[str] + """ super(Subnet, self).__init__(**kwargs) self.name = name self.friendly_name = friendly_name @@ -19364,10 +24667,10 @@ class SupportedOperatingSystems(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The supported operating systems properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.SupportedOSProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The supported operating systems properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.SupportedOSProperties """ _validation = { @@ -19391,6 +24694,12 @@ def __init__( properties: Optional["SupportedOSProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The supported operating systems properties. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.SupportedOSProperties + """ super(SupportedOperatingSystems, self).__init__(location=location, **kwargs) self.properties = properties @@ -19398,12 +24707,12 @@ def __init__( class SupportedOSDetails(msrest.serialization.Model): """Supported operating system details. - :param os_name: The name. - :type os_name: str - :param os_type: The type. - :type os_type: str - :param os_versions: The list of version for operating system. - :type os_versions: list[~azure.mgmt.recoveryservicessiterecovery.models.OSVersionWrapper] + :ivar os_name: The name. + :vartype os_name: str + :ivar os_type: The type. + :vartype os_type: str + :ivar os_versions: The list of version for operating system. + :vartype os_versions: list[~azure.mgmt.recoveryservicessiterecovery.models.OSVersionWrapper] """ _attribute_map = { @@ -19420,6 +24729,14 @@ def __init__( os_versions: Optional[List["OSVersionWrapper"]] = None, **kwargs ): + """ + :keyword os_name: The name. + :paramtype os_name: str + :keyword os_type: The type. + :paramtype os_type: str + :keyword os_versions: The list of version for operating system. + :paramtype os_versions: list[~azure.mgmt.recoveryservicessiterecovery.models.OSVersionWrapper] + """ super(SupportedOSDetails, self).__init__(**kwargs) self.os_name = os_name self.os_type = os_type @@ -19429,8 +24746,8 @@ def __init__( class SupportedOSProperties(msrest.serialization.Model): """Supported operating systems properties. - :param supported_os_list: The supported operating systems property list. - :type supported_os_list: + :ivar supported_os_list: The supported operating systems property list. + :vartype supported_os_list: list[~azure.mgmt.recoveryservicessiterecovery.models.SupportedOSProperty] """ @@ -19444,6 +24761,11 @@ def __init__( supported_os_list: Optional[List["SupportedOSProperty"]] = None, **kwargs ): + """ + :keyword supported_os_list: The supported operating systems property list. + :paramtype supported_os_list: + list[~azure.mgmt.recoveryservicessiterecovery.models.SupportedOSProperty] + """ super(SupportedOSProperties, self).__init__(**kwargs) self.supported_os_list = supported_os_list @@ -19451,10 +24773,10 @@ def __init__( class SupportedOSProperty(msrest.serialization.Model): """Supported operating systems property. - :param instance_type: The replication provider type. - :type instance_type: str - :param supported_os: The list of supported operating systems. - :type supported_os: list[~azure.mgmt.recoveryservicessiterecovery.models.SupportedOSDetails] + :ivar instance_type: The replication provider type. + :vartype instance_type: str + :ivar supported_os: The list of supported operating systems. + :vartype supported_os: list[~azure.mgmt.recoveryservicessiterecovery.models.SupportedOSDetails] """ _attribute_map = { @@ -19469,6 +24791,13 @@ def __init__( supported_os: Optional[List["SupportedOSDetails"]] = None, **kwargs ): + """ + :keyword instance_type: The replication provider type. + :paramtype instance_type: str + :keyword supported_os: The list of supported operating systems. + :paramtype supported_os: + list[~azure.mgmt.recoveryservicessiterecovery.models.SupportedOSDetails] + """ super(SupportedOSProperty, self).__init__(**kwargs) self.instance_type = instance_type self.supported_os = supported_os @@ -19477,8 +24806,8 @@ def __init__( class SwitchProtectionInput(msrest.serialization.Model): """Switch protection input. - :param properties: Switch protection properties. - :type properties: + :ivar properties: Switch protection properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.SwitchProtectionInputProperties """ @@ -19492,6 +24821,11 @@ def __init__( properties: Optional["SwitchProtectionInputProperties"] = None, **kwargs ): + """ + :keyword properties: Switch protection properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.SwitchProtectionInputProperties + """ super(SwitchProtectionInput, self).__init__(**kwargs) self.properties = properties @@ -19499,10 +24833,10 @@ def __init__( class SwitchProtectionInputProperties(msrest.serialization.Model): """Switch protection input properties. - :param replication_protected_item_name: The unique replication protected item name. - :type replication_protected_item_name: str - :param provider_specific_details: Provider specific switch protection input. - :type provider_specific_details: + :ivar replication_protected_item_name: The unique replication protected item name. + :vartype replication_protected_item_name: str + :ivar provider_specific_details: Provider specific switch protection input. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.SwitchProtectionProviderSpecificInput """ @@ -19518,6 +24852,13 @@ def __init__( provider_specific_details: Optional["SwitchProtectionProviderSpecificInput"] = None, **kwargs ): + """ + :keyword replication_protected_item_name: The unique replication protected item name. + :paramtype replication_protected_item_name: str + :keyword provider_specific_details: Provider specific switch protection input. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.SwitchProtectionProviderSpecificInput + """ super(SwitchProtectionInputProperties, self).__init__(**kwargs) self.replication_protected_item_name = replication_protected_item_name self.provider_specific_details = provider_specific_details @@ -19528,14 +24869,14 @@ class SwitchProtectionJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for + :ivar instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for possible values).Constant filled by server. - :type instance_type: str - :param affected_object_details: The affected object properties like source server, source - cloud, target server, target cloud etc. based on the workflow object details. - :type affected_object_details: dict[str, str] - :param new_replication_protected_item_id: ARM Id of the new replication protected item. - :type new_replication_protected_item_id: str + :vartype instance_type: str + :ivar affected_object_details: The affected object properties like source server, source cloud, + target server, target cloud etc. based on the workflow object details. + :vartype affected_object_details: dict[str, str] + :ivar new_replication_protected_item_id: ARM Id of the new replication protected item. + :vartype new_replication_protected_item_id: str """ _validation = { @@ -19555,22 +24896,91 @@ def __init__( new_replication_protected_item_id: Optional[str] = None, **kwargs ): + """ + :keyword affected_object_details: The affected object properties like source server, source + cloud, target server, target cloud etc. based on the workflow object details. + :paramtype affected_object_details: dict[str, str] + :keyword new_replication_protected_item_id: ARM Id of the new replication protected item. + :paramtype new_replication_protected_item_id: str + """ super(SwitchProtectionJobDetails, self).__init__(affected_object_details=affected_object_details, **kwargs) self.instance_type = 'SwitchProtectionJobDetails' # type: str self.new_replication_protected_item_id = new_replication_protected_item_id +class SwitchProviderInput(msrest.serialization.Model): + """Input definition for switch provider. + + :ivar properties: Switch provider input properties. + :vartype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.SwitchProviderInputProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'SwitchProviderInputProperties'}, + } + + def __init__( + self, + *, + properties: Optional["SwitchProviderInputProperties"] = None, + **kwargs + ): + """ + :keyword properties: Switch provider input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.SwitchProviderInputProperties + """ + super(SwitchProviderInput, self).__init__(**kwargs) + self.properties = properties + + +class SwitchProviderInputProperties(msrest.serialization.Model): + """Input definition for switch provider input properties. + + :ivar target_instance_type: Target provider type. + :vartype target_instance_type: str + :ivar provider_specific_details: Provider specific settings. + :vartype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.SwitchProviderSpecificInput + """ + + _attribute_map = { + 'target_instance_type': {'key': 'targetInstanceType', 'type': 'str'}, + 'provider_specific_details': {'key': 'providerSpecificDetails', 'type': 'SwitchProviderSpecificInput'}, + } + + def __init__( + self, + *, + target_instance_type: Optional[str] = None, + provider_specific_details: Optional["SwitchProviderSpecificInput"] = None, + **kwargs + ): + """ + :keyword target_instance_type: Target provider type. + :paramtype target_instance_type: str + :keyword provider_specific_details: Provider specific settings. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.SwitchProviderSpecificInput + """ + super(SwitchProviderInputProperties, self).__init__(**kwargs) + self.target_instance_type = target_instance_type + self.provider_specific_details = provider_specific_details + + class TargetComputeSize(msrest.serialization.Model): """Represents applicable recovery vm sizes. - :param id: The Id. - :type id: str - :param name: The name. - :type name: str - :param type: The Type of the object. - :type type: str - :param properties: The custom data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.TargetComputeSizeProperties + :ivar id: The Id. + :vartype id: str + :ivar name: The name. + :vartype name: str + :ivar type: The Type of the object. + :vartype type: str + :ivar properties: The custom data. + :vartype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.TargetComputeSizeProperties """ _attribute_map = { @@ -19589,6 +24999,17 @@ def __init__( properties: Optional["TargetComputeSizeProperties"] = None, **kwargs ): + """ + :keyword id: The Id. + :paramtype id: str + :keyword name: The name. + :paramtype name: str + :keyword type: The Type of the object. + :paramtype type: str + :keyword properties: The custom data. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.TargetComputeSizeProperties + """ super(TargetComputeSize, self).__init__(**kwargs) self.id = id self.name = name @@ -19599,10 +25020,10 @@ def __init__( class TargetComputeSizeCollection(msrest.serialization.Model): """Target compute size collection. - :param value: The list of target compute sizes. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.TargetComputeSize] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The list of target compute sizes. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.TargetComputeSize] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -19617,6 +25038,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The list of target compute sizes. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.TargetComputeSize] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(TargetComputeSizeCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -19627,28 +25054,27 @@ class TargetComputeSizeProperties(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Target compute size name. - :type name: str - :param friendly_name: Target compute size display name. - :type friendly_name: str - :param cpu_cores_count: The maximum cpu cores count supported by target compute size. - :type cpu_cores_count: int + :ivar name: Target compute size name. + :vartype name: str + :ivar friendly_name: Target compute size display name. + :vartype friendly_name: str + :ivar cpu_cores_count: The maximum cpu cores count supported by target compute size. + :vartype cpu_cores_count: int :ivar v_cpus_available: The Available vCPUs supported by target compute size. :vartype v_cpus_available: int - :param memory_in_gb: The maximum memory in GB supported by target compute size. - :type memory_in_gb: float - :param max_data_disk_count: The maximum data disks count supported by target compute size. - :type max_data_disk_count: int - :param max_nics_count: The maximum Nics count supported by target compute size. - :type max_nics_count: int - :param errors: The reasons why the target compute size is not applicable for the protected - item. - :type errors: list[~azure.mgmt.recoveryservicessiterecovery.models.ComputeSizeErrorDetails] - :param high_iops_supported: The value indicating whether the target compute size supports high + :ivar memory_in_gb: The maximum memory in GB supported by target compute size. + :vartype memory_in_gb: float + :ivar max_data_disk_count: The maximum data disks count supported by target compute size. + :vartype max_data_disk_count: int + :ivar max_nics_count: The maximum Nics count supported by target compute size. + :vartype max_nics_count: int + :ivar errors: The reasons why the target compute size is not applicable for the protected item. + :vartype errors: list[~azure.mgmt.recoveryservicessiterecovery.models.ComputeSizeErrorDetails] + :ivar high_iops_supported: The value indicating whether the target compute size supports high Iops. - :type high_iops_supported: str - :param hyper_v_generations: The supported HyperV Generations. - :type hyper_v_generations: list[str] + :vartype high_iops_supported: str + :ivar hyper_v_generations: The supported HyperV Generations. + :vartype hyper_v_generations: list[str] """ _validation = { @@ -19682,6 +25108,29 @@ def __init__( hyper_v_generations: Optional[List[str]] = None, **kwargs ): + """ + :keyword name: Target compute size name. + :paramtype name: str + :keyword friendly_name: Target compute size display name. + :paramtype friendly_name: str + :keyword cpu_cores_count: The maximum cpu cores count supported by target compute size. + :paramtype cpu_cores_count: int + :keyword memory_in_gb: The maximum memory in GB supported by target compute size. + :paramtype memory_in_gb: float + :keyword max_data_disk_count: The maximum data disks count supported by target compute size. + :paramtype max_data_disk_count: int + :keyword max_nics_count: The maximum Nics count supported by target compute size. + :paramtype max_nics_count: int + :keyword errors: The reasons why the target compute size is not applicable for the protected + item. + :paramtype errors: + list[~azure.mgmt.recoveryservicessiterecovery.models.ComputeSizeErrorDetails] + :keyword high_iops_supported: The value indicating whether the target compute size supports + high Iops. + :paramtype high_iops_supported: str + :keyword hyper_v_generations: The supported HyperV Generations. + :paramtype hyper_v_generations: list[str] + """ super(TargetComputeSizeProperties, self).__init__(**kwargs) self.name = name self.friendly_name = friendly_name @@ -19700,8 +25149,8 @@ class TestFailoverCleanupInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. Test failover cleanup input properties. - :type properties: + :ivar properties: Required. Test failover cleanup input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.TestFailoverCleanupInputProperties """ @@ -19719,6 +25168,11 @@ def __init__( properties: "TestFailoverCleanupInputProperties", **kwargs ): + """ + :keyword properties: Required. Test failover cleanup input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.TestFailoverCleanupInputProperties + """ super(TestFailoverCleanupInput, self).__init__(**kwargs) self.properties = properties @@ -19726,8 +25180,8 @@ def __init__( class TestFailoverCleanupInputProperties(msrest.serialization.Model): """Input definition for test failover cleanup input properties. - :param comments: Test failover cleanup comments. - :type comments: str + :ivar comments: Test failover cleanup comments. + :vartype comments: str """ _validation = { @@ -19744,6 +25198,10 @@ def __init__( comments: Optional[str] = None, **kwargs ): + """ + :keyword comments: Test failover cleanup comments. + :paramtype comments: str + """ super(TestFailoverCleanupInputProperties, self).__init__(**kwargs) self.comments = comments @@ -19753,8 +25211,9 @@ class TestFailoverInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. Test failover input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.TestFailoverInputProperties + :ivar properties: Required. Test failover input properties. + :vartype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.TestFailoverInputProperties """ _validation = { @@ -19771,6 +25230,11 @@ def __init__( properties: "TestFailoverInputProperties", **kwargs ): + """ + :keyword properties: Required. Test failover input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.TestFailoverInputProperties + """ super(TestFailoverInput, self).__init__(**kwargs) self.properties = properties @@ -19778,14 +25242,14 @@ def __init__( class TestFailoverInputProperties(msrest.serialization.Model): """Input definition for test failover input properties. - :param failover_direction: Test failover direction. - :type failover_direction: str - :param network_type: Network type to be used for test failover. - :type network_type: str - :param network_id: The id of the network to be used for test failover. - :type network_id: str - :param provider_specific_details: Provider specific settings. - :type provider_specific_details: + :ivar failover_direction: Test failover direction. + :vartype failover_direction: str + :ivar network_type: Network type to be used for test failover. + :vartype network_type: str + :ivar network_id: The id of the network to be used for test failover. + :vartype network_id: str + :ivar provider_specific_details: Provider specific settings. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.TestFailoverProviderSpecificInput """ @@ -19805,6 +25269,17 @@ def __init__( provider_specific_details: Optional["TestFailoverProviderSpecificInput"] = None, **kwargs ): + """ + :keyword failover_direction: Test failover direction. + :paramtype failover_direction: str + :keyword network_type: Network type to be used for test failover. + :paramtype network_type: str + :keyword network_id: The id of the network to be used for test failover. + :paramtype network_id: str + :keyword provider_specific_details: Provider specific settings. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.TestFailoverProviderSpecificInput + """ super(TestFailoverInputProperties, self).__init__(**kwargs) self.failover_direction = failover_direction self.network_type = network_type @@ -19817,24 +25292,24 @@ class TestFailoverJobDetails(JobDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for + :ivar instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for possible values).Constant filled by server. - :type instance_type: str - :param affected_object_details: The affected object properties like source server, source - cloud, target server, target cloud etc. based on the workflow object details. - :type affected_object_details: dict[str, str] - :param test_failover_status: The test failover status. - :type test_failover_status: str - :param comments: The test failover comments. - :type comments: str - :param network_name: The test network name. - :type network_name: str - :param network_friendly_name: The test network friendly name. - :type network_friendly_name: str - :param network_type: The test network type (see TestFailoverInput enum for possible values). - :type network_type: str - :param protected_item_details: The test VM details. - :type protected_item_details: + :vartype instance_type: str + :ivar affected_object_details: The affected object properties like source server, source cloud, + target server, target cloud etc. based on the workflow object details. + :vartype affected_object_details: dict[str, str] + :ivar test_failover_status: The test failover status. + :vartype test_failover_status: str + :ivar comments: The test failover comments. + :vartype comments: str + :ivar network_name: The test network name. + :vartype network_name: str + :ivar network_friendly_name: The test network friendly name. + :vartype network_friendly_name: str + :ivar network_type: The test network type (see TestFailoverInput enum for possible values). + :vartype network_type: str + :ivar protected_item_details: The test VM details. + :vartype protected_item_details: list[~azure.mgmt.recoveryservicessiterecovery.models.FailoverReplicationProtectedItemDetails] """ @@ -19865,6 +25340,24 @@ def __init__( protected_item_details: Optional[List["FailoverReplicationProtectedItemDetails"]] = None, **kwargs ): + """ + :keyword affected_object_details: The affected object properties like source server, source + cloud, target server, target cloud etc. based on the workflow object details. + :paramtype affected_object_details: dict[str, str] + :keyword test_failover_status: The test failover status. + :paramtype test_failover_status: str + :keyword comments: The test failover comments. + :paramtype comments: str + :keyword network_name: The test network name. + :paramtype network_name: str + :keyword network_friendly_name: The test network friendly name. + :paramtype network_friendly_name: str + :keyword network_type: The test network type (see TestFailoverInput enum for possible values). + :paramtype network_type: str + :keyword protected_item_details: The test VM details. + :paramtype protected_item_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.FailoverReplicationProtectedItemDetails] + """ super(TestFailoverJobDetails, self).__init__(affected_object_details=affected_object_details, **kwargs) self.instance_type = 'TestFailoverJobDetails' # type: str self.test_failover_status = test_failover_status @@ -19880,8 +25373,8 @@ class TestMigrateCleanupInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. Test migrate cleanup input properties. - :type properties: + :ivar properties: Required. Test migrate cleanup input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateCleanupInputProperties """ @@ -19899,6 +25392,11 @@ def __init__( properties: "TestMigrateCleanupInputProperties", **kwargs ): + """ + :keyword properties: Required. Test migrate cleanup input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateCleanupInputProperties + """ super(TestMigrateCleanupInput, self).__init__(**kwargs) self.properties = properties @@ -19906,8 +25404,8 @@ def __init__( class TestMigrateCleanupInputProperties(msrest.serialization.Model): """Test migrate cleanup input properties. - :param comments: Test migrate cleanup comments. - :type comments: str + :ivar comments: Test migrate cleanup comments. + :vartype comments: str """ _validation = { @@ -19924,6 +25422,10 @@ def __init__( comments: Optional[str] = None, **kwargs ): + """ + :keyword comments: Test migrate cleanup comments. + :paramtype comments: str + """ super(TestMigrateCleanupInputProperties, self).__init__(**kwargs) self.comments = comments @@ -19933,8 +25435,8 @@ class TestMigrateInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. Test migrate input properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateInputProperties + :ivar properties: Required. Test migrate input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateInputProperties """ _validation = { @@ -19951,6 +25453,11 @@ def __init__( properties: "TestMigrateInputProperties", **kwargs ): + """ + :keyword properties: Required. Test migrate input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateInputProperties + """ super(TestMigrateInput, self).__init__(**kwargs) self.properties = properties @@ -19960,8 +25467,8 @@ class TestMigrateInputProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param provider_specific_details: Required. The provider specific details. - :type provider_specific_details: + :ivar provider_specific_details: Required. The provider specific details. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateProviderSpecificInput """ @@ -19979,6 +25486,11 @@ def __init__( provider_specific_details: "TestMigrateProviderSpecificInput", **kwargs ): + """ + :keyword provider_specific_details: Required. The provider specific details. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateProviderSpecificInput + """ super(TestMigrateInputProperties, self).__init__(**kwargs) self.provider_specific_details = provider_specific_details @@ -19991,8 +25503,8 @@ class TestMigrateProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -20011,6 +25523,8 @@ def __init__( self, **kwargs ): + """ + """ super(TestMigrateProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -20020,8 +25534,8 @@ class UnplannedFailoverInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. Unplanned failover input properties. - :type properties: + :ivar properties: Required. Unplanned failover input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.UnplannedFailoverInputProperties """ @@ -20039,6 +25553,11 @@ def __init__( properties: "UnplannedFailoverInputProperties", **kwargs ): + """ + :keyword properties: Required. Unplanned failover input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.UnplannedFailoverInputProperties + """ super(UnplannedFailoverInput, self).__init__(**kwargs) self.properties = properties @@ -20046,12 +25565,12 @@ def __init__( class UnplannedFailoverInputProperties(msrest.serialization.Model): """Input definition for unplanned failover input properties. - :param failover_direction: Failover direction. - :type failover_direction: str - :param source_site_operations: Source site operations status. - :type source_site_operations: str - :param provider_specific_details: Provider specific settings. - :type provider_specific_details: + :ivar failover_direction: Failover direction. + :vartype failover_direction: str + :ivar source_site_operations: Source site operations status. + :vartype source_site_operations: str + :ivar provider_specific_details: Provider specific settings. + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.UnplannedFailoverProviderSpecificInput """ @@ -20069,6 +25588,15 @@ def __init__( provider_specific_details: Optional["UnplannedFailoverProviderSpecificInput"] = None, **kwargs ): + """ + :keyword failover_direction: Failover direction. + :paramtype failover_direction: str + :keyword source_site_operations: Source site operations status. + :paramtype source_site_operations: str + :keyword provider_specific_details: Provider specific settings. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.UnplannedFailoverProviderSpecificInput + """ super(UnplannedFailoverInputProperties, self).__init__(**kwargs) self.failover_direction = failover_direction self.source_site_operations = source_site_operations @@ -20080,8 +25608,8 @@ class UpdateApplianceForReplicationProtectedItemInput(msrest.serialization.Model All required parameters must be populated in order to send to Azure. - :param properties: Required. Update appliance replication protected item properties. - :type properties: + :ivar properties: Required. Update appliance replication protected item properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInputProperties """ @@ -20099,6 +25627,11 @@ def __init__( properties: "UpdateApplianceForReplicationProtectedItemInputProperties", **kwargs ): + """ + :keyword properties: Required. Update appliance replication protected item properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInputProperties + """ super(UpdateApplianceForReplicationProtectedItemInput, self).__init__(**kwargs) self.properties = properties @@ -20108,11 +25641,11 @@ class UpdateApplianceForReplicationProtectedItemInputProperties(msrest.serializa All required parameters must be populated in order to send to Azure. - :param target_appliance_id: Required. The target appliance Id. - :type target_appliance_id: str - :param provider_specific_details: Required. The provider specific input to update replication + :ivar target_appliance_id: Required. The target appliance Id. + :vartype target_appliance_id: str + :ivar provider_specific_details: Required. The provider specific input to update replication protected item. - :type provider_specific_details: + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemProviderSpecificInput """ @@ -20133,6 +25666,14 @@ def __init__( provider_specific_details: "UpdateApplianceForReplicationProtectedItemProviderSpecificInput", **kwargs ): + """ + :keyword target_appliance_id: Required. The target appliance Id. + :paramtype target_appliance_id: str + :keyword provider_specific_details: Required. The provider specific input to update replication + protected item. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemProviderSpecificInput + """ super(UpdateApplianceForReplicationProtectedItemInputProperties, self).__init__(**kwargs) self.target_appliance_id = target_appliance_id self.provider_specific_details = provider_specific_details @@ -20143,10 +25684,10 @@ class UpdateDiskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param disk_id: Required. The disk Id. - :type disk_id: str - :param target_disk_name: The target disk name. - :type target_disk_name: str + :ivar disk_id: Required. The disk Id. + :vartype disk_id: str + :ivar target_disk_name: The target disk name. + :vartype target_disk_name: str """ _validation = { @@ -20165,6 +25706,12 @@ def __init__( target_disk_name: Optional[str] = None, **kwargs ): + """ + :keyword disk_id: Required. The disk Id. + :paramtype disk_id: str + :keyword target_disk_name: The target disk name. + :paramtype target_disk_name: str + """ super(UpdateDiskInput, self).__init__(**kwargs) self.disk_id = disk_id self.target_disk_name = target_disk_name @@ -20173,8 +25720,8 @@ def __init__( class UpdateMigrationItemInput(msrest.serialization.Model): """Update migration item input. - :param properties: Update migration item input properties. - :type properties: + :ivar properties: Update migration item input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMigrationItemInputProperties """ @@ -20188,6 +25735,11 @@ def __init__( properties: Optional["UpdateMigrationItemInputProperties"] = None, **kwargs ): + """ + :keyword properties: Update migration item input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMigrationItemInputProperties + """ super(UpdateMigrationItemInput, self).__init__(**kwargs) self.properties = properties @@ -20197,9 +25749,9 @@ class UpdateMigrationItemInputProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param provider_specific_details: Required. The provider specific input to update migration + :ivar provider_specific_details: Required. The provider specific input to update migration item. - :type provider_specific_details: + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMigrationItemProviderSpecificInput """ @@ -20217,6 +25769,12 @@ def __init__( provider_specific_details: "UpdateMigrationItemProviderSpecificInput", **kwargs ): + """ + :keyword provider_specific_details: Required. The provider specific input to update migration + item. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMigrationItemProviderSpecificInput + """ super(UpdateMigrationItemInputProperties, self).__init__(**kwargs) self.provider_specific_details = provider_specific_details @@ -20229,8 +25787,8 @@ class UpdateMigrationItemProviderSpecificInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -20249,6 +25807,8 @@ def __init__( self, **kwargs ): + """ + """ super(UpdateMigrationItemProviderSpecificInput, self).__init__(**kwargs) self.instance_type = None # type: Optional[str] @@ -20256,8 +25816,8 @@ def __init__( class UpdateMobilityServiceRequest(msrest.serialization.Model): """Request to update the mobility service on a protected item. - :param properties: The properties of the update mobility service request. - :type properties: + :ivar properties: The properties of the update mobility service request. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMobilityServiceRequestProperties """ @@ -20271,6 +25831,11 @@ def __init__( properties: Optional["UpdateMobilityServiceRequestProperties"] = None, **kwargs ): + """ + :keyword properties: The properties of the update mobility service request. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMobilityServiceRequestProperties + """ super(UpdateMobilityServiceRequest, self).__init__(**kwargs) self.properties = properties @@ -20278,8 +25843,8 @@ def __init__( class UpdateMobilityServiceRequestProperties(msrest.serialization.Model): """The properties of an update mobility service request. - :param run_as_account_id: The CS run as account Id. - :type run_as_account_id: str + :ivar run_as_account_id: The CS run as account Id. + :vartype run_as_account_id: str """ _attribute_map = { @@ -20292,6 +25857,10 @@ def __init__( run_as_account_id: Optional[str] = None, **kwargs ): + """ + :keyword run_as_account_id: The CS run as account Id. + :paramtype run_as_account_id: str + """ super(UpdateMobilityServiceRequestProperties, self).__init__(**kwargs) self.run_as_account_id = run_as_account_id @@ -20299,8 +25868,8 @@ def __init__( class UpdateNetworkMappingInput(msrest.serialization.Model): """Update network mapping input. - :param properties: The input properties needed to update network mapping. - :type properties: + :ivar properties: The input properties needed to update network mapping. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateNetworkMappingInputProperties """ @@ -20314,6 +25883,11 @@ def __init__( properties: Optional["UpdateNetworkMappingInputProperties"] = None, **kwargs ): + """ + :keyword properties: The input properties needed to update network mapping. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateNetworkMappingInputProperties + """ super(UpdateNetworkMappingInput, self).__init__(**kwargs) self.properties = properties @@ -20321,12 +25895,12 @@ def __init__( class UpdateNetworkMappingInputProperties(msrest.serialization.Model): """Common input details for network mapping operation. - :param recovery_fabric_name: Recovery fabric name. - :type recovery_fabric_name: str - :param recovery_network_id: Recovery network Id. - :type recovery_network_id: str - :param fabric_specific_details: Fabrics specific input network Id. - :type fabric_specific_details: + :ivar recovery_fabric_name: Recovery fabric name. + :vartype recovery_fabric_name: str + :ivar recovery_network_id: Recovery network Id. + :vartype recovery_network_id: str + :ivar fabric_specific_details: Fabrics specific input network Id. + :vartype fabric_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.FabricSpecificUpdateNetworkMappingInput """ @@ -20344,6 +25918,15 @@ def __init__( fabric_specific_details: Optional["FabricSpecificUpdateNetworkMappingInput"] = None, **kwargs ): + """ + :keyword recovery_fabric_name: Recovery fabric name. + :paramtype recovery_fabric_name: str + :keyword recovery_network_id: Recovery network Id. + :paramtype recovery_network_id: str + :keyword fabric_specific_details: Fabrics specific input network Id. + :paramtype fabric_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.FabricSpecificUpdateNetworkMappingInput + """ super(UpdateNetworkMappingInputProperties, self).__init__(**kwargs) self.recovery_fabric_name = recovery_fabric_name self.recovery_network_id = recovery_network_id @@ -20353,8 +25936,9 @@ def __init__( class UpdatePolicyInput(msrest.serialization.Model): """Update policy input. - :param properties: The ReplicationProviderSettings. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.UpdatePolicyInputProperties + :ivar properties: The ReplicationProviderSettings. + :vartype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdatePolicyInputProperties """ _attribute_map = { @@ -20367,6 +25951,11 @@ def __init__( properties: Optional["UpdatePolicyInputProperties"] = None, **kwargs ): + """ + :keyword properties: The ReplicationProviderSettings. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdatePolicyInputProperties + """ super(UpdatePolicyInput, self).__init__(**kwargs) self.properties = properties @@ -20374,8 +25963,8 @@ def __init__( class UpdatePolicyInputProperties(msrest.serialization.Model): """Policy update properties. - :param replication_provider_settings: The ReplicationProviderSettings. - :type replication_provider_settings: + :ivar replication_provider_settings: The ReplicationProviderSettings. + :vartype replication_provider_settings: ~azure.mgmt.recoveryservicessiterecovery.models.PolicyProviderSpecificInput """ @@ -20389,6 +25978,11 @@ def __init__( replication_provider_settings: Optional["PolicyProviderSpecificInput"] = None, **kwargs ): + """ + :keyword replication_provider_settings: The ReplicationProviderSettings. + :paramtype replication_provider_settings: + ~azure.mgmt.recoveryservicessiterecovery.models.PolicyProviderSpecificInput + """ super(UpdatePolicyInputProperties, self).__init__(**kwargs) self.replication_provider_settings = replication_provider_settings @@ -20396,8 +25990,8 @@ def __init__( class UpdateProtectionContainerMappingInput(msrest.serialization.Model): """Container pairing update input. - :param properties: Update protection container mapping input properties. - :type properties: + :ivar properties: Update protection container mapping input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInputProperties """ @@ -20411,6 +26005,11 @@ def __init__( properties: Optional["UpdateProtectionContainerMappingInputProperties"] = None, **kwargs ): + """ + :keyword properties: Update protection container mapping input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInputProperties + """ super(UpdateProtectionContainerMappingInput, self).__init__(**kwargs) self.properties = properties @@ -20418,9 +26017,9 @@ def __init__( class UpdateProtectionContainerMappingInputProperties(msrest.serialization.Model): """Container pairing update input. - :param provider_specific_input: Provider specific input for updating protection container + :ivar provider_specific_input: Provider specific input for updating protection container mapping. - :type provider_specific_input: + :vartype provider_specific_input: ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderSpecificUpdateContainerMappingInput """ @@ -20434,6 +26033,12 @@ def __init__( provider_specific_input: Optional["ReplicationProviderSpecificUpdateContainerMappingInput"] = None, **kwargs ): + """ + :keyword provider_specific_input: Provider specific input for updating protection container + mapping. + :paramtype provider_specific_input: + ~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProviderSpecificUpdateContainerMappingInput + """ super(UpdateProtectionContainerMappingInputProperties, self).__init__(**kwargs) self.provider_specific_input = provider_specific_input @@ -20441,8 +26046,8 @@ def __init__( class UpdateRecoveryPlanInput(msrest.serialization.Model): """Update recovery plan input class. - :param properties: Recovery plan update properties. - :type properties: + :ivar properties: Recovery plan update properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateRecoveryPlanInputProperties """ @@ -20456,6 +26061,11 @@ def __init__( properties: Optional["UpdateRecoveryPlanInputProperties"] = None, **kwargs ): + """ + :keyword properties: Recovery plan update properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateRecoveryPlanInputProperties + """ super(UpdateRecoveryPlanInput, self).__init__(**kwargs) self.properties = properties @@ -20463,8 +26073,8 @@ def __init__( class UpdateRecoveryPlanInputProperties(msrest.serialization.Model): """Recovery plan update properties. - :param groups: The recovery plan groups. - :type groups: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroup] + :ivar groups: The recovery plan groups. + :vartype groups: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroup] """ _attribute_map = { @@ -20477,6 +26087,10 @@ def __init__( groups: Optional[List["RecoveryPlanGroup"]] = None, **kwargs ): + """ + :keyword groups: The recovery plan groups. + :paramtype groups: list[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanGroup] + """ super(UpdateRecoveryPlanInputProperties, self).__init__(**kwargs) self.groups = groups @@ -20484,8 +26098,8 @@ def __init__( class UpdateReplicationProtectedItemInput(msrest.serialization.Model): """Update replication protected item input. - :param properties: Update replication protected item properties. - :type properties: + :ivar properties: Update replication protected item properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInputProperties """ @@ -20499,6 +26113,11 @@ def __init__( properties: Optional["UpdateReplicationProtectedItemInputProperties"] = None, **kwargs ): + """ + :keyword properties: Update replication protected item properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInputProperties + """ super(UpdateReplicationProtectedItemInput, self).__init__(**kwargs) self.properties = properties @@ -20506,30 +26125,30 @@ def __init__( class UpdateReplicationProtectedItemInputProperties(msrest.serialization.Model): """Update protected item input properties. - :param recovery_azure_vm_name: Target Azure VM name given by the user. - :type recovery_azure_vm_name: str - :param recovery_azure_vm_size: Target Azure VM size. - :type recovery_azure_vm_size: str - :param selected_recovery_azure_network_id: Target Azure Network Id. - :type selected_recovery_azure_network_id: str - :param selected_tfo_azure_network_id: The Azure Network Id for test failover. - :type selected_tfo_azure_network_id: str - :param selected_source_nic_id: The selected source nic Id which will be used as the primary nic + :ivar recovery_azure_vm_name: Target Azure VM name given by the user. + :vartype recovery_azure_vm_name: str + :ivar recovery_azure_vm_size: Target Azure VM size. + :vartype recovery_azure_vm_size: str + :ivar selected_recovery_azure_network_id: Target Azure Network Id. + :vartype selected_recovery_azure_network_id: str + :ivar selected_tfo_azure_network_id: The Azure Network Id for test failover. + :vartype selected_tfo_azure_network_id: str + :ivar selected_source_nic_id: The selected source nic Id which will be used as the primary nic during failover. - :type selected_source_nic_id: str - :param enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after + :vartype selected_source_nic_id: str + :ivar enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. - :type enable_rdp_on_target_option: str - :param vm_nics: The list of VM nic details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicInputDetails] - :param license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", + :vartype enable_rdp_on_target_option: str + :ivar vm_nics: The list of VM nic details. + :vartype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicInputDetails] + :ivar license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", "WindowsServer". - :type license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType - :param recovery_availability_set_id: The target availability set Id. - :type recovery_availability_set_id: str - :param provider_specific_details: The provider specific input to update replication protected + :vartype license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType + :ivar recovery_availability_set_id: The target availability set Id. + :vartype recovery_availability_set_id: str + :ivar provider_specific_details: The provider specific input to update replication protected item. - :type provider_specific_details: + :vartype provider_specific_details: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemProviderInput """ @@ -20561,6 +26180,33 @@ def __init__( provider_specific_details: Optional["UpdateReplicationProtectedItemProviderInput"] = None, **kwargs ): + """ + :keyword recovery_azure_vm_name: Target Azure VM name given by the user. + :paramtype recovery_azure_vm_name: str + :keyword recovery_azure_vm_size: Target Azure VM size. + :paramtype recovery_azure_vm_size: str + :keyword selected_recovery_azure_network_id: Target Azure Network Id. + :paramtype selected_recovery_azure_network_id: str + :keyword selected_tfo_azure_network_id: The Azure Network Id for test failover. + :paramtype selected_tfo_azure_network_id: str + :keyword selected_source_nic_id: The selected source nic Id which will be used as the primary + nic during failover. + :paramtype selected_source_nic_id: str + :keyword enable_rdp_on_target_option: The selected option to enable RDP\SSH on target vm after + failover. String value of SrsDataContract.EnableRDPOnTargetOption enum. + :paramtype enable_rdp_on_target_option: str + :keyword vm_nics: The list of VM nic details. + :paramtype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMNicInputDetails] + :keyword license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", + "WindowsServer". + :paramtype license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType + :keyword recovery_availability_set_id: The target availability set Id. + :paramtype recovery_availability_set_id: str + :keyword provider_specific_details: The provider specific input to update replication protected + item. + :paramtype provider_specific_details: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemProviderInput + """ super(UpdateReplicationProtectedItemInputProperties, self).__init__(**kwargs) self.recovery_azure_vm_name = recovery_azure_vm_name self.recovery_azure_vm_size = recovery_azure_vm_size @@ -20577,8 +26223,8 @@ def __init__( class UpdateVCenterRequest(msrest.serialization.Model): """Input required to update vCenter. - :param properties: The update VCenter Request Properties. - :type properties: + :ivar properties: The update VCenter Request Properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateVCenterRequestProperties """ @@ -20592,6 +26238,11 @@ def __init__( properties: Optional["UpdateVCenterRequestProperties"] = None, **kwargs ): + """ + :keyword properties: The update VCenter Request Properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateVCenterRequestProperties + """ super(UpdateVCenterRequest, self).__init__(**kwargs) self.properties = properties @@ -20599,16 +26250,16 @@ def __init__( class UpdateVCenterRequestProperties(msrest.serialization.Model): """The properties of an update vCenter request. - :param friendly_name: The friendly name of the vCenter. - :type friendly_name: str - :param ip_address: The IP address of the vCenter to be discovered. - :type ip_address: str - :param process_server_id: The process server Id from where the update can be orchestrated. - :type process_server_id: str - :param port: The port number for discovery. - :type port: str - :param run_as_account_id: The CS account Id which has privileges to update the vCenter. - :type run_as_account_id: str + :ivar friendly_name: The friendly name of the vCenter. + :vartype friendly_name: str + :ivar ip_address: The IP address of the vCenter to be discovered. + :vartype ip_address: str + :ivar process_server_id: The process server Id from where the update can be orchestrated. + :vartype process_server_id: str + :ivar port: The port number for discovery. + :vartype port: str + :ivar run_as_account_id: The CS account Id which has privileges to update the vCenter. + :vartype run_as_account_id: str """ _attribute_map = { @@ -20629,6 +26280,18 @@ def __init__( run_as_account_id: Optional[str] = None, **kwargs ): + """ + :keyword friendly_name: The friendly name of the vCenter. + :paramtype friendly_name: str + :keyword ip_address: The IP address of the vCenter to be discovered. + :paramtype ip_address: str + :keyword process_server_id: The process server Id from where the update can be orchestrated. + :paramtype process_server_id: str + :keyword port: The port number for discovery. + :paramtype port: str + :keyword run_as_account_id: The CS account Id which has privileges to update the vCenter. + :paramtype run_as_account_id: str + """ super(UpdateVCenterRequestProperties, self).__init__(**kwargs) self.friendly_name = friendly_name self.ip_address = ip_address @@ -20648,10 +26311,10 @@ class VaultHealthDetails(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The vault health related data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.VaultHealthProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The vault health related data. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.VaultHealthProperties """ _validation = { @@ -20675,6 +26338,12 @@ def __init__( properties: Optional["VaultHealthProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The vault health related data. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.VaultHealthProperties + """ super(VaultHealthDetails, self).__init__(location=location, **kwargs) self.properties = properties @@ -20682,16 +26351,17 @@ def __init__( class VaultHealthProperties(msrest.serialization.Model): """class to define the health summary of the Vault. - :param vault_errors: The list of errors on the vault. - :type vault_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] - :param protected_items_health: The list of the health detail of the protected items in the + :ivar vault_errors: The list of errors on the vault. + :vartype vault_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :ivar protected_items_health: The list of the health detail of the protected items in the vault. - :type protected_items_health: + :vartype protected_items_health: + ~azure.mgmt.recoveryservicessiterecovery.models.ResourceHealthSummary + :ivar fabrics_health: The list of the health detail of the fabrics in the vault. + :vartype fabrics_health: ~azure.mgmt.recoveryservicessiterecovery.models.ResourceHealthSummary + :ivar containers_health: The list of the health detail of the containers in the vault. + :vartype containers_health: ~azure.mgmt.recoveryservicessiterecovery.models.ResourceHealthSummary - :param fabrics_health: The list of the health detail of the fabrics in the vault. - :type fabrics_health: ~azure.mgmt.recoveryservicessiterecovery.models.ResourceHealthSummary - :param containers_health: The list of the health detail of the containers in the vault. - :type containers_health: ~azure.mgmt.recoveryservicessiterecovery.models.ResourceHealthSummary """ _attribute_map = { @@ -20710,6 +26380,20 @@ def __init__( containers_health: Optional["ResourceHealthSummary"] = None, **kwargs ): + """ + :keyword vault_errors: The list of errors on the vault. + :paramtype vault_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :keyword protected_items_health: The list of the health detail of the protected items in the + vault. + :paramtype protected_items_health: + ~azure.mgmt.recoveryservicessiterecovery.models.ResourceHealthSummary + :keyword fabrics_health: The list of the health detail of the fabrics in the vault. + :paramtype fabrics_health: + ~azure.mgmt.recoveryservicessiterecovery.models.ResourceHealthSummary + :keyword containers_health: The list of the health detail of the containers in the vault. + :paramtype containers_health: + ~azure.mgmt.recoveryservicessiterecovery.models.ResourceHealthSummary + """ super(VaultHealthProperties, self).__init__(**kwargs) self.vault_errors = vault_errors self.protected_items_health = protected_items_health @@ -20728,10 +26412,10 @@ class VaultSetting(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: The vault setting properties. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.VaultSettingProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: The vault setting properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.VaultSettingProperties """ _validation = { @@ -20755,6 +26439,12 @@ def __init__( properties: Optional["VaultSettingProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: The vault setting properties. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.VaultSettingProperties + """ super(VaultSetting, self).__init__(location=location, **kwargs) self.properties = properties @@ -20762,10 +26452,10 @@ def __init__( class VaultSettingCollection(msrest.serialization.Model): """Vault setting collection. - :param value: The list of vault setting. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.VaultSetting] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The list of vault setting. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.VaultSetting] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -20780,6 +26470,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The list of vault setting. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.VaultSetting] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(VaultSettingCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -20790,8 +26486,8 @@ class VaultSettingCreationInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param properties: Required. Vault setting creation input properties. - :type properties: + :ivar properties: Required. Vault setting creation input properties. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.VaultSettingCreationInputProperties """ @@ -20809,6 +26505,11 @@ def __init__( properties: "VaultSettingCreationInputProperties", **kwargs ): + """ + :keyword properties: Required. Vault setting creation input properties. + :paramtype properties: + ~azure.mgmt.recoveryservicessiterecovery.models.VaultSettingCreationInputProperties + """ super(VaultSettingCreationInput, self).__init__(**kwargs) self.properties = properties @@ -20816,10 +26517,10 @@ def __init__( class VaultSettingCreationInputProperties(msrest.serialization.Model): """Input to create vault setting. - :param migration_solution_id: The migration solution Id. - :type migration_solution_id: str - :param vmware_to_azure_provider_type: VMware to Azure provider type. - :type vmware_to_azure_provider_type: str + :ivar migration_solution_id: The migration solution Id. + :vartype migration_solution_id: str + :ivar vmware_to_azure_provider_type: VMware to Azure provider type. + :vartype vmware_to_azure_provider_type: str """ _attribute_map = { @@ -20834,6 +26535,12 @@ def __init__( vmware_to_azure_provider_type: Optional[str] = None, **kwargs ): + """ + :keyword migration_solution_id: The migration solution Id. + :paramtype migration_solution_id: str + :keyword vmware_to_azure_provider_type: VMware to Azure provider type. + :paramtype vmware_to_azure_provider_type: str + """ super(VaultSettingCreationInputProperties, self).__init__(**kwargs) self.migration_solution_id = migration_solution_id self.vmware_to_azure_provider_type = vmware_to_azure_provider_type @@ -20842,10 +26549,10 @@ def __init__( class VaultSettingProperties(msrest.serialization.Model): """Vault setting properties. - :param migration_solution_id: The migration solution ARM Id. - :type migration_solution_id: str - :param vmware_to_azure_provider_type: VMware to Azure provider type. - :type vmware_to_azure_provider_type: str + :ivar migration_solution_id: The migration solution ARM Id. + :vartype migration_solution_id: str + :ivar vmware_to_azure_provider_type: VMware to Azure provider type. + :vartype vmware_to_azure_provider_type: str """ _attribute_map = { @@ -20860,6 +26567,12 @@ def __init__( vmware_to_azure_provider_type: Optional[str] = None, **kwargs ): + """ + :keyword migration_solution_id: The migration solution ARM Id. + :paramtype migration_solution_id: str + :keyword vmware_to_azure_provider_type: VMware to Azure provider type. + :paramtype vmware_to_azure_provider_type: str + """ super(VaultSettingProperties, self).__init__(**kwargs) self.migration_solution_id = migration_solution_id self.vmware_to_azure_provider_type = vmware_to_azure_provider_type @@ -20876,10 +26589,10 @@ class VCenter(Resource): :vartype name: str :ivar type: Resource Type. :vartype type: str - :param location: Resource Location. - :type location: str - :param properties: VCenter related data. - :type properties: ~azure.mgmt.recoveryservicessiterecovery.models.VCenterProperties + :ivar location: Resource Location. + :vartype location: str + :ivar properties: VCenter related data. + :vartype properties: ~azure.mgmt.recoveryservicessiterecovery.models.VCenterProperties """ _validation = { @@ -20903,6 +26616,12 @@ def __init__( properties: Optional["VCenterProperties"] = None, **kwargs ): + """ + :keyword location: Resource Location. + :paramtype location: str + :keyword properties: VCenter related data. + :paramtype properties: ~azure.mgmt.recoveryservicessiterecovery.models.VCenterProperties + """ super(VCenter, self).__init__(location=location, **kwargs) self.properties = properties @@ -20910,10 +26629,10 @@ def __init__( class VCenterCollection(msrest.serialization.Model): """Collection of vCenter details. - :param value: The vCenter details. - :type value: list[~azure.mgmt.recoveryservicessiterecovery.models.VCenter] - :param next_link: The value of next link. - :type next_link: str + :ivar value: The vCenter details. + :vartype value: list[~azure.mgmt.recoveryservicessiterecovery.models.VCenter] + :ivar next_link: The value of next link. + :vartype next_link: str """ _attribute_map = { @@ -20928,6 +26647,12 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: The vCenter details. + :paramtype value: list[~azure.mgmt.recoveryservicessiterecovery.models.VCenter] + :keyword next_link: The value of next link. + :paramtype next_link: str + """ super(VCenterCollection, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -20936,28 +26661,28 @@ def __init__( class VCenterProperties(msrest.serialization.Model): """vCenter properties. - :param friendly_name: Friendly name of the vCenter. - :type friendly_name: str - :param internal_id: VCenter internal ID. - :type internal_id: str - :param last_heartbeat: The time when the last heartbeat was received by vCenter. - :type last_heartbeat: ~datetime.datetime - :param discovery_status: The VCenter discovery status. - :type discovery_status: str - :param process_server_id: The process server Id. - :type process_server_id: str - :param ip_address: The IP address of the vCenter. - :type ip_address: str - :param infrastructure_id: The infrastructure Id of vCenter. - :type infrastructure_id: str - :param port: The port number for discovery. - :type port: str - :param run_as_account_id: The account Id which has privileges to discover the vCenter. - :type run_as_account_id: str - :param fabric_arm_resource_name: The ARM resource name of the fabric containing this VCenter. - :type fabric_arm_resource_name: str - :param health_errors: The health errors for this VCenter. - :type health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :ivar friendly_name: Friendly name of the vCenter. + :vartype friendly_name: str + :ivar internal_id: VCenter internal ID. + :vartype internal_id: str + :ivar last_heartbeat: The time when the last heartbeat was received by vCenter. + :vartype last_heartbeat: ~datetime.datetime + :ivar discovery_status: The VCenter discovery status. + :vartype discovery_status: str + :ivar process_server_id: The process server Id. + :vartype process_server_id: str + :ivar ip_address: The IP address of the vCenter. + :vartype ip_address: str + :ivar infrastructure_id: The infrastructure Id of vCenter. + :vartype infrastructure_id: str + :ivar port: The port number for discovery. + :vartype port: str + :ivar run_as_account_id: The account Id which has privileges to discover the vCenter. + :vartype run_as_account_id: str + :ivar fabric_arm_resource_name: The ARM resource name of the fabric containing this VCenter. + :vartype fabric_arm_resource_name: str + :ivar health_errors: The health errors for this VCenter. + :vartype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] """ _attribute_map = { @@ -20990,6 +26715,30 @@ def __init__( health_errors: Optional[List["HealthError"]] = None, **kwargs ): + """ + :keyword friendly_name: Friendly name of the vCenter. + :paramtype friendly_name: str + :keyword internal_id: VCenter internal ID. + :paramtype internal_id: str + :keyword last_heartbeat: The time when the last heartbeat was received by vCenter. + :paramtype last_heartbeat: ~datetime.datetime + :keyword discovery_status: The VCenter discovery status. + :paramtype discovery_status: str + :keyword process_server_id: The process server Id. + :paramtype process_server_id: str + :keyword ip_address: The IP address of the vCenter. + :paramtype ip_address: str + :keyword infrastructure_id: The infrastructure Id of vCenter. + :paramtype infrastructure_id: str + :keyword port: The port number for discovery. + :paramtype port: str + :keyword run_as_account_id: The account Id which has privileges to discover the vCenter. + :paramtype run_as_account_id: str + :keyword fabric_arm_resource_name: The ARM resource name of the fabric containing this VCenter. + :paramtype fabric_arm_resource_name: str + :keyword health_errors: The health errors for this VCenter. + :paramtype health_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + """ super(VCenterProperties, self).__init__(**kwargs) self.friendly_name = friendly_name self.internal_id = internal_id @@ -21007,13 +26756,13 @@ def __init__( class VersionDetails(msrest.serialization.Model): """Version related details. - :param version: The agent version. - :type version: str - :param expiry_date: Version expiry date. - :type expiry_date: ~datetime.datetime - :param status: A value indicating whether security update required. Possible values include: + :ivar version: The agent version. + :vartype version: str + :ivar expiry_date: Version expiry date. + :vartype expiry_date: ~datetime.datetime + :ivar status: A value indicating whether security update required. Possible values include: "Supported", "NotSupported", "Deprecated", "UpdateRequired", "SecurityUpdateRequired". - :type status: str or ~azure.mgmt.recoveryservicessiterecovery.models.AgentVersionStatus + :vartype status: str or ~azure.mgmt.recoveryservicessiterecovery.models.AgentVersionStatus """ _attribute_map = { @@ -21030,6 +26779,15 @@ def __init__( status: Optional[Union[str, "AgentVersionStatus"]] = None, **kwargs ): + """ + :keyword version: The agent version. + :paramtype version: str + :keyword expiry_date: Version expiry date. + :paramtype expiry_date: ~datetime.datetime + :keyword status: A value indicating whether security update required. Possible values include: + "Supported", "NotSupported", "Deprecated", "UpdateRequired", "SecurityUpdateRequired". + :paramtype status: str or ~azure.mgmt.recoveryservicessiterecovery.models.AgentVersionStatus + """ super(VersionDetails, self).__init__(**kwargs) self.version = version self.expiry_date = expiry_date @@ -21041,14 +26799,14 @@ class VirtualMachineTaskDetails(JobTaskDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param job_task: The job entity. - :type job_task: ~azure.mgmt.recoveryservicessiterecovery.models.JobEntity - :param skipped_reason: The skipped reason. - :type skipped_reason: str - :param skipped_reason_string: The skipped reason string. - :type skipped_reason_string: str + :ivar instance_type: Required. The type of task details.Constant filled by server. + :vartype instance_type: str + :ivar job_task: The job entity. + :vartype job_task: ~azure.mgmt.recoveryservicessiterecovery.models.JobEntity + :ivar skipped_reason: The skipped reason. + :vartype skipped_reason: str + :ivar skipped_reason_string: The skipped reason string. + :vartype skipped_reason_string: str """ _validation = { @@ -21070,6 +26828,14 @@ def __init__( skipped_reason_string: Optional[str] = None, **kwargs ): + """ + :keyword job_task: The job entity. + :paramtype job_task: ~azure.mgmt.recoveryservicessiterecovery.models.JobEntity + :keyword skipped_reason: The skipped reason. + :paramtype skipped_reason: str + :keyword skipped_reason_string: The skipped reason string. + :paramtype skipped_reason_string: str + """ super(VirtualMachineTaskDetails, self).__init__(job_task=job_task, **kwargs) self.instance_type = 'VirtualMachineTaskDetails' # type: str self.skipped_reason = skipped_reason @@ -21081,9 +26847,9 @@ class VmmDetails(FabricSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str """ _validation = { @@ -21098,6 +26864,8 @@ def __init__( self, **kwargs ): + """ + """ super(VmmDetails, self).__init__(**kwargs) self.instance_type = 'VMM' # type: str @@ -21107,8 +26875,8 @@ class VmmToAzureCreateNetworkMappingInput(FabricSpecificCreateNetworkMappingInpu All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -21123,6 +26891,8 @@ def __init__( self, **kwargs ): + """ + """ super(VmmToAzureCreateNetworkMappingInput, self).__init__(**kwargs) self.instance_type = 'VmmToAzure' # type: str @@ -21132,8 +26902,8 @@ class VmmToAzureNetworkMappingSettings(NetworkMappingFabricSpecificSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -21148,6 +26918,8 @@ def __init__( self, **kwargs ): + """ + """ super(VmmToAzureNetworkMappingSettings, self).__init__(**kwargs) self.instance_type = 'VmmToAzure' # type: str @@ -21157,8 +26929,8 @@ class VmmToAzureUpdateNetworkMappingInput(FabricSpecificUpdateNetworkMappingInpu All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -21173,6 +26945,8 @@ def __init__( self, **kwargs ): + """ + """ super(VmmToAzureUpdateNetworkMappingInput, self).__init__(**kwargs) self.instance_type = 'VmmToAzure' # type: str @@ -21182,8 +26956,8 @@ class VmmToVmmCreateNetworkMappingInput(FabricSpecificCreateNetworkMappingInput) All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -21198,6 +26972,8 @@ def __init__( self, **kwargs ): + """ + """ super(VmmToVmmCreateNetworkMappingInput, self).__init__(**kwargs) self.instance_type = 'VmmToVmm' # type: str @@ -21207,8 +26983,8 @@ class VmmToVmmNetworkMappingSettings(NetworkMappingFabricSpecificSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the Instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the Instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -21223,6 +26999,8 @@ def __init__( self, **kwargs ): + """ + """ super(VmmToVmmNetworkMappingSettings, self).__init__(**kwargs) self.instance_type = 'VmmToVmm' # type: str @@ -21232,8 +27010,8 @@ class VmmToVmmUpdateNetworkMappingInput(FabricSpecificUpdateNetworkMappingInput) All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The instance type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -21248,6 +27026,8 @@ def __init__( self, **kwargs ): + """ + """ super(VmmToVmmUpdateNetworkMappingInput, self).__init__(**kwargs) self.instance_type = 'VmmToVmm' # type: str @@ -21257,30 +27037,33 @@ class VmmVirtualMachineDetails(HyperVVirtualMachineDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param source_item_id: The source id of the object. - :type source_item_id: str - :param generation: The id of the object in fabric. - :type generation: str - :param os_details: The Last replication time. - :type os_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDetails - :param disk_details: The Last successful failover time. - :type disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] - :param has_physical_disk: A value indicating whether the VM has a physical disk attached. - String value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", - "Present", "NotPresent". - :type has_physical_disk: str or ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus - :param has_fibre_channel_adapter: A value indicating whether the VM has a fibre channel adapter + :vartype instance_type: str + :ivar source_item_id: The source id of the object. + :vartype source_item_id: str + :ivar generation: The id of the object in fabric. + :vartype generation: str + :ivar os_details: The Last replication time. + :vartype os_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDetails + :ivar disk_details: The Last successful failover time. + :vartype disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] + :ivar has_physical_disk: A value indicating whether the VM has a physical disk attached. String + value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", "Present", + "NotPresent". + :vartype has_physical_disk: str or + ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus + :ivar has_fibre_channel_adapter: A value indicating whether the VM has a fibre channel adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", "Present", "NotPresent". - :type has_fibre_channel_adapter: str or + :vartype has_fibre_channel_adapter: str or ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus - :param has_shared_vhd: A value indicating whether the VM has a shared VHD attached. String - value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", "Present", + :ivar has_shared_vhd: A value indicating whether the VM has a shared VHD attached. String value + of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", "Present", "NotPresent". - :type has_shared_vhd: str or ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus + :vartype has_shared_vhd: str or ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus + :ivar hyper_v_host_id: The Id of the hyper-v host in fabric. + :vartype hyper_v_host_id: str """ _validation = { @@ -21296,6 +27079,7 @@ class VmmVirtualMachineDetails(HyperVVirtualMachineDetails): 'has_physical_disk': {'key': 'hasPhysicalDisk', 'type': 'str'}, 'has_fibre_channel_adapter': {'key': 'hasFibreChannelAdapter', 'type': 'str'}, 'has_shared_vhd': {'key': 'hasSharedVhd', 'type': 'str'}, + 'hyper_v_host_id': {'key': 'hyperVHostId', 'type': 'str'}, } def __init__( @@ -21308,59 +27092,87 @@ def __init__( has_physical_disk: Optional[Union[str, "PresenceStatus"]] = None, has_fibre_channel_adapter: Optional[Union[str, "PresenceStatus"]] = None, has_shared_vhd: Optional[Union[str, "PresenceStatus"]] = None, - **kwargs - ): - super(VmmVirtualMachineDetails, self).__init__(source_item_id=source_item_id, generation=generation, os_details=os_details, disk_details=disk_details, has_physical_disk=has_physical_disk, has_fibre_channel_adapter=has_fibre_channel_adapter, has_shared_vhd=has_shared_vhd, **kwargs) + hyper_v_host_id: Optional[str] = None, + **kwargs + ): + """ + :keyword source_item_id: The source id of the object. + :paramtype source_item_id: str + :keyword generation: The id of the object in fabric. + :paramtype generation: str + :keyword os_details: The Last replication time. + :paramtype os_details: ~azure.mgmt.recoveryservicessiterecovery.models.OSDetails + :keyword disk_details: The Last successful failover time. + :paramtype disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.DiskDetails] + :keyword has_physical_disk: A value indicating whether the VM has a physical disk attached. + String value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", + "Present", "NotPresent". + :paramtype has_physical_disk: str or + ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus + :keyword has_fibre_channel_adapter: A value indicating whether the VM has a fibre channel + adapter attached. String value of SrsDataContract.PresenceStatus enum. Possible values include: + "Unknown", "Present", "NotPresent". + :paramtype has_fibre_channel_adapter: str or + ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus + :keyword has_shared_vhd: A value indicating whether the VM has a shared VHD attached. String + value of SrsDataContract.PresenceStatus enum. Possible values include: "Unknown", "Present", + "NotPresent". + :paramtype has_shared_vhd: str or + ~azure.mgmt.recoveryservicessiterecovery.models.PresenceStatus + :keyword hyper_v_host_id: The Id of the hyper-v host in fabric. + :paramtype hyper_v_host_id: str + """ + super(VmmVirtualMachineDetails, self).__init__(source_item_id=source_item_id, generation=generation, os_details=os_details, disk_details=disk_details, has_physical_disk=has_physical_disk, has_fibre_channel_adapter=has_fibre_channel_adapter, has_shared_vhd=has_shared_vhd, hyper_v_host_id=hyper_v_host_id, **kwargs) self.instance_type = 'VmmVirtualMachine' # type: str class VMNicDetails(msrest.serialization.Model): """Hyper V VM network details. - :param nic_id: The nic Id. - :type nic_id: str - :param replica_nic_id: The replica nic Id. - :type replica_nic_id: str - :param source_nic_arm_id: The source nic ARM Id. - :type source_nic_arm_id: str - :param v_m_network_name: VM network name. - :type v_m_network_name: str - :param recovery_vm_network_id: Recovery VM network Id. - :type recovery_vm_network_id: str - :param ip_configs: The IP configurations of the NIC. - :type ip_configs: list[~azure.mgmt.recoveryservicessiterecovery.models.IPConfigDetails] - :param selection_type: Selection type for failover. - :type selection_type: str - :param recovery_network_security_group_id: The id of the NSG associated with the NIC. - :type recovery_network_security_group_id: str - :param enable_accelerated_networking_on_recovery: A value indicating whether the NIC has + :ivar nic_id: The nic Id. + :vartype nic_id: str + :ivar replica_nic_id: The replica nic Id. + :vartype replica_nic_id: str + :ivar source_nic_arm_id: The source nic ARM Id. + :vartype source_nic_arm_id: str + :ivar v_m_network_name: VM network name. + :vartype v_m_network_name: str + :ivar recovery_vm_network_id: Recovery VM network Id. + :vartype recovery_vm_network_id: str + :ivar ip_configs: The IP configurations of the NIC. + :vartype ip_configs: list[~azure.mgmt.recoveryservicessiterecovery.models.IPConfigDetails] + :ivar selection_type: Selection type for failover. + :vartype selection_type: str + :ivar recovery_network_security_group_id: The id of the NSG associated with the NIC. + :vartype recovery_network_security_group_id: str + :ivar enable_accelerated_networking_on_recovery: A value indicating whether the NIC has accelerated networking enabled. - :type enable_accelerated_networking_on_recovery: bool - :param tfo_vm_network_id: The network to be used by NIC during test failover. - :type tfo_vm_network_id: str - :param tfo_network_security_group_id: The NSG to be used by NIC during test failover. - :type tfo_network_security_group_id: str - :param enable_accelerated_networking_on_tfo: Whether the TFO NIC has accelerated networking + :vartype enable_accelerated_networking_on_recovery: bool + :ivar tfo_vm_network_id: The network to be used by NIC during test failover. + :vartype tfo_vm_network_id: str + :ivar tfo_network_security_group_id: The NSG to be used by NIC during test failover. + :vartype tfo_network_security_group_id: str + :ivar enable_accelerated_networking_on_tfo: Whether the TFO NIC has accelerated networking enabled. - :type enable_accelerated_networking_on_tfo: bool - :param recovery_nic_name: The name of the NIC to be used when creating target NICs. - :type recovery_nic_name: str - :param recovery_nic_resource_group_name: The resource group of the NIC to be used when creating + :vartype enable_accelerated_networking_on_tfo: bool + :ivar recovery_nic_name: The name of the NIC to be used when creating target NICs. + :vartype recovery_nic_name: str + :ivar recovery_nic_resource_group_name: The resource group of the NIC to be used when creating target NICs. - :type recovery_nic_resource_group_name: str - :param reuse_existing_nic: A value indicating whether an existing NIC is allowed to be reused + :vartype recovery_nic_resource_group_name: str + :ivar reuse_existing_nic: A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. - :type reuse_existing_nic: bool - :param tfo_recovery_nic_name: The name of the NIC to be used when creating target NICs in TFO. - :type tfo_recovery_nic_name: str - :param tfo_recovery_nic_resource_group_name: The resource group of the NIC to be used when + :vartype reuse_existing_nic: bool + :ivar tfo_recovery_nic_name: The name of the NIC to be used when creating target NICs in TFO. + :vartype tfo_recovery_nic_name: str + :ivar tfo_recovery_nic_resource_group_name: The resource group of the NIC to be used when creating target NICs in TFO. - :type tfo_recovery_nic_resource_group_name: str - :param tfo_reuse_existing_nic: A value indicating whether an existing NIC is allowed to be + :vartype tfo_recovery_nic_resource_group_name: str + :ivar tfo_reuse_existing_nic: A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. - :type tfo_reuse_existing_nic: bool - :param target_nic_name: Target NIC name. - :type target_nic_name: str + :vartype tfo_reuse_existing_nic: bool + :ivar target_nic_name: Target NIC name. + :vartype target_nic_name: str """ _attribute_map = { @@ -21409,6 +27221,53 @@ def __init__( target_nic_name: Optional[str] = None, **kwargs ): + """ + :keyword nic_id: The nic Id. + :paramtype nic_id: str + :keyword replica_nic_id: The replica nic Id. + :paramtype replica_nic_id: str + :keyword source_nic_arm_id: The source nic ARM Id. + :paramtype source_nic_arm_id: str + :keyword v_m_network_name: VM network name. + :paramtype v_m_network_name: str + :keyword recovery_vm_network_id: Recovery VM network Id. + :paramtype recovery_vm_network_id: str + :keyword ip_configs: The IP configurations of the NIC. + :paramtype ip_configs: list[~azure.mgmt.recoveryservicessiterecovery.models.IPConfigDetails] + :keyword selection_type: Selection type for failover. + :paramtype selection_type: str + :keyword recovery_network_security_group_id: The id of the NSG associated with the NIC. + :paramtype recovery_network_security_group_id: str + :keyword enable_accelerated_networking_on_recovery: A value indicating whether the NIC has + accelerated networking enabled. + :paramtype enable_accelerated_networking_on_recovery: bool + :keyword tfo_vm_network_id: The network to be used by NIC during test failover. + :paramtype tfo_vm_network_id: str + :keyword tfo_network_security_group_id: The NSG to be used by NIC during test failover. + :paramtype tfo_network_security_group_id: str + :keyword enable_accelerated_networking_on_tfo: Whether the TFO NIC has accelerated networking + enabled. + :paramtype enable_accelerated_networking_on_tfo: bool + :keyword recovery_nic_name: The name of the NIC to be used when creating target NICs. + :paramtype recovery_nic_name: str + :keyword recovery_nic_resource_group_name: The resource group of the NIC to be used when + creating target NICs. + :paramtype recovery_nic_resource_group_name: str + :keyword reuse_existing_nic: A value indicating whether an existing NIC is allowed to be reused + during failover subject to availability. + :paramtype reuse_existing_nic: bool + :keyword tfo_recovery_nic_name: The name of the NIC to be used when creating target NICs in + TFO. + :paramtype tfo_recovery_nic_name: str + :keyword tfo_recovery_nic_resource_group_name: The resource group of the NIC to be used when + creating target NICs in TFO. + :paramtype tfo_recovery_nic_resource_group_name: str + :keyword tfo_reuse_existing_nic: A value indicating whether an existing NIC is allowed to be + reused during test failover subject to availability. + :paramtype tfo_reuse_existing_nic: bool + :keyword target_nic_name: Target NIC name. + :paramtype target_nic_name: str + """ super(VMNicDetails, self).__init__(**kwargs) self.nic_id = nic_id self.replica_nic_id = replica_nic_id @@ -21434,40 +27293,40 @@ def __init__( class VMNicInputDetails(msrest.serialization.Model): """Hyper V VM network input details. - :param nic_id: The nic Id. - :type nic_id: str - :param ip_configs: The IP configurations to be used by NIC during test failover and failover. - :type ip_configs: list[~azure.mgmt.recoveryservicessiterecovery.models.IPConfigInputDetails] - :param selection_type: Selection type for failover. - :type selection_type: str - :param recovery_network_security_group_id: The id of the NSG associated with the NIC. - :type recovery_network_security_group_id: str - :param enable_accelerated_networking_on_recovery: Whether the NIC has accelerated networking + :ivar nic_id: The nic Id. + :vartype nic_id: str + :ivar ip_configs: The IP configurations to be used by NIC during test failover and failover. + :vartype ip_configs: list[~azure.mgmt.recoveryservicessiterecovery.models.IPConfigInputDetails] + :ivar selection_type: Selection type for failover. + :vartype selection_type: str + :ivar recovery_network_security_group_id: The id of the NSG associated with the NIC. + :vartype recovery_network_security_group_id: str + :ivar enable_accelerated_networking_on_recovery: Whether the NIC has accelerated networking enabled. - :type enable_accelerated_networking_on_recovery: bool - :param tfo_network_security_group_id: The NSG to be used by NIC during test failover. - :type tfo_network_security_group_id: str - :param enable_accelerated_networking_on_tfo: Whether the test NIC has accelerated networking + :vartype enable_accelerated_networking_on_recovery: bool + :ivar tfo_network_security_group_id: The NSG to be used by NIC during test failover. + :vartype tfo_network_security_group_id: str + :ivar enable_accelerated_networking_on_tfo: Whether the test NIC has accelerated networking enabled. - :type enable_accelerated_networking_on_tfo: bool - :param recovery_nic_name: The name of the NIC to be used when creating target NICs. - :type recovery_nic_name: str - :param recovery_nic_resource_group_name: The resource group of the NIC to be used when creating + :vartype enable_accelerated_networking_on_tfo: bool + :ivar recovery_nic_name: The name of the NIC to be used when creating target NICs. + :vartype recovery_nic_name: str + :ivar recovery_nic_resource_group_name: The resource group of the NIC to be used when creating target NICs. - :type recovery_nic_resource_group_name: str - :param reuse_existing_nic: A value indicating whether an existing NIC is allowed to be reused + :vartype recovery_nic_resource_group_name: str + :ivar reuse_existing_nic: A value indicating whether an existing NIC is allowed to be reused during failover subject to availability. - :type reuse_existing_nic: bool - :param tfo_nic_name: The name of the NIC to be used when creating target NICs in TFO. - :type tfo_nic_name: str - :param tfo_nic_resource_group_name: The resource group of the NIC to be used when creating + :vartype reuse_existing_nic: bool + :ivar tfo_nic_name: The name of the NIC to be used when creating target NICs in TFO. + :vartype tfo_nic_name: str + :ivar tfo_nic_resource_group_name: The resource group of the NIC to be used when creating target NICs in TFO. - :type tfo_nic_resource_group_name: str - :param tfo_reuse_existing_nic: A value indicating whether an existing NIC is allowed to be + :vartype tfo_nic_resource_group_name: str + :ivar tfo_reuse_existing_nic: A value indicating whether an existing NIC is allowed to be reused during test failover subject to availability. - :type tfo_reuse_existing_nic: bool - :param target_nic_name: Target NIC name. - :type target_nic_name: str + :vartype tfo_reuse_existing_nic: bool + :ivar target_nic_name: Target NIC name. + :vartype target_nic_name: str """ _attribute_map = { @@ -21506,6 +27365,43 @@ def __init__( target_nic_name: Optional[str] = None, **kwargs ): + """ + :keyword nic_id: The nic Id. + :paramtype nic_id: str + :keyword ip_configs: The IP configurations to be used by NIC during test failover and failover. + :paramtype ip_configs: + list[~azure.mgmt.recoveryservicessiterecovery.models.IPConfigInputDetails] + :keyword selection_type: Selection type for failover. + :paramtype selection_type: str + :keyword recovery_network_security_group_id: The id of the NSG associated with the NIC. + :paramtype recovery_network_security_group_id: str + :keyword enable_accelerated_networking_on_recovery: Whether the NIC has accelerated networking + enabled. + :paramtype enable_accelerated_networking_on_recovery: bool + :keyword tfo_network_security_group_id: The NSG to be used by NIC during test failover. + :paramtype tfo_network_security_group_id: str + :keyword enable_accelerated_networking_on_tfo: Whether the test NIC has accelerated networking + enabled. + :paramtype enable_accelerated_networking_on_tfo: bool + :keyword recovery_nic_name: The name of the NIC to be used when creating target NICs. + :paramtype recovery_nic_name: str + :keyword recovery_nic_resource_group_name: The resource group of the NIC to be used when + creating target NICs. + :paramtype recovery_nic_resource_group_name: str + :keyword reuse_existing_nic: A value indicating whether an existing NIC is allowed to be reused + during failover subject to availability. + :paramtype reuse_existing_nic: bool + :keyword tfo_nic_name: The name of the NIC to be used when creating target NICs in TFO. + :paramtype tfo_nic_name: str + :keyword tfo_nic_resource_group_name: The resource group of the NIC to be used when creating + target NICs in TFO. + :paramtype tfo_nic_resource_group_name: str + :keyword tfo_reuse_existing_nic: A value indicating whether an existing NIC is allowed to be + reused during test failover subject to availability. + :paramtype tfo_reuse_existing_nic: bool + :keyword target_nic_name: Target NIC name. + :paramtype target_nic_name: str + """ super(VMNicInputDetails, self).__init__(**kwargs) self.nic_id = nic_id self.ip_configs = ip_configs @@ -21528,14 +27424,14 @@ class VmNicUpdatesTaskDetails(TaskTypeDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The type of task details.Constant filled by server. - :type instance_type: str - :param vm_id: Virtual machine Id. - :type vm_id: str - :param nic_id: Nic Id. - :type nic_id: str - :param name: Name of the Nic. - :type name: str + :ivar instance_type: Required. The type of task details.Constant filled by server. + :vartype instance_type: str + :ivar vm_id: Virtual machine Id. + :vartype vm_id: str + :ivar nic_id: Nic Id. + :vartype nic_id: str + :ivar name: Name of the Nic. + :vartype name: str """ _validation = { @@ -21557,6 +27453,14 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword vm_id: Virtual machine Id. + :paramtype vm_id: str + :keyword nic_id: Nic Id. + :paramtype nic_id: str + :keyword name: Name of the Nic. + :paramtype name: str + """ super(VmNicUpdatesTaskDetails, self).__init__(**kwargs) self.instance_type = 'VmNicUpdatesTaskDetails' # type: str self.vm_id = vm_id @@ -21569,8 +27473,8 @@ class VMwareCbtContainerCreationInput(ReplicationProviderSpecificContainerCreati All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str """ _validation = { @@ -21585,6 +27489,8 @@ def __init__( self, **kwargs ): + """ + """ super(VMwareCbtContainerCreationInput, self).__init__(**kwargs) self.instance_type = 'VMwareCbt' # type: str @@ -21594,30 +27500,26 @@ class VMwareCbtContainerMappingInput(ReplicationProviderSpecificContainerMapping All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param key_vault_id: Required. The target key vault ARM Id. - :type key_vault_id: str - :param key_vault_uri: Required. The target key vault URL. - :type key_vault_uri: str - :param storage_account_id: Required. The storage account ARM Id. - :type storage_account_id: str - :param storage_account_sas_secret_name: Required. The secret name of the storage account. - :type storage_account_sas_secret_name: str - :param service_bus_connection_string_secret_name: Required. The secret name of the service bus - connection string. - :type service_bus_connection_string_secret_name: str - :param target_location: Required. The target location. - :type target_location: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar key_vault_id: The target key vault ARM Id. + :vartype key_vault_id: str + :ivar key_vault_uri: The target key vault URL. + :vartype key_vault_uri: str + :ivar storage_account_id: Required. The storage account ARM Id. + :vartype storage_account_id: str + :ivar storage_account_sas_secret_name: The secret name of the storage account. + :vartype storage_account_sas_secret_name: str + :ivar service_bus_connection_string_secret_name: The secret name of the service bus connection + string. + :vartype service_bus_connection_string_secret_name: str + :ivar target_location: Required. The target location. + :vartype target_location: str """ _validation = { 'instance_type': {'required': True}, - 'key_vault_id': {'required': True}, - 'key_vault_uri': {'required': True}, 'storage_account_id': {'required': True}, - 'storage_account_sas_secret_name': {'required': True}, - 'service_bus_connection_string_secret_name': {'required': True}, 'target_location': {'required': True}, } @@ -21634,14 +27536,29 @@ class VMwareCbtContainerMappingInput(ReplicationProviderSpecificContainerMapping def __init__( self, *, - key_vault_id: str, - key_vault_uri: str, storage_account_id: str, - storage_account_sas_secret_name: str, - service_bus_connection_string_secret_name: str, target_location: str, - **kwargs - ): + key_vault_id: Optional[str] = None, + key_vault_uri: Optional[str] = None, + storage_account_sas_secret_name: Optional[str] = None, + service_bus_connection_string_secret_name: Optional[str] = None, + **kwargs + ): + """ + :keyword key_vault_id: The target key vault ARM Id. + :paramtype key_vault_id: str + :keyword key_vault_uri: The target key vault URL. + :paramtype key_vault_uri: str + :keyword storage_account_id: Required. The storage account ARM Id. + :paramtype storage_account_id: str + :keyword storage_account_sas_secret_name: The secret name of the storage account. + :paramtype storage_account_sas_secret_name: str + :keyword service_bus_connection_string_secret_name: The secret name of the service bus + connection string. + :paramtype service_bus_connection_string_secret_name: str + :keyword target_location: Required. The target location. + :paramtype target_location: str + """ super(VMwareCbtContainerMappingInput, self).__init__(**kwargs) self.instance_type = 'VMwareCbt' # type: str self.key_vault_id = key_vault_id @@ -21657,20 +27574,20 @@ class VMwareCbtDiskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param disk_id: Required. The disk Id. - :type disk_id: str - :param disk_type: The disk type. Possible values include: "Standard_LRS", "Premium_LRS", + :ivar disk_id: Required. The disk Id. + :vartype disk_id: str + :ivar disk_type: The disk type. Possible values include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType - :param is_os_disk: Required. A value indicating whether the disk is the OS disk. - :type is_os_disk: str - :param log_storage_account_id: Required. The log storage account ARM Id. - :type log_storage_account_id: str - :param log_storage_account_sas_secret_name: Required. The key vault secret name of the log + :vartype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :ivar is_os_disk: Required. A value indicating whether the disk is the OS disk. + :vartype is_os_disk: str + :ivar log_storage_account_id: Required. The log storage account ARM Id. + :vartype log_storage_account_id: str + :ivar log_storage_account_sas_secret_name: Required. The key vault secret name of the log storage account. - :type log_storage_account_sas_secret_name: str - :param disk_encryption_set_id: The DiskEncryptionSet ARM Id. - :type disk_encryption_set_id: str + :vartype log_storage_account_sas_secret_name: str + :ivar disk_encryption_set_id: The DiskEncryptionSet ARM Id. + :vartype disk_encryption_set_id: str """ _validation = { @@ -21700,6 +27617,22 @@ def __init__( disk_encryption_set_id: Optional[str] = None, **kwargs ): + """ + :keyword disk_id: Required. The disk Id. + :paramtype disk_id: str + :keyword disk_type: The disk type. Possible values include: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS". + :paramtype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :keyword is_os_disk: Required. A value indicating whether the disk is the OS disk. + :paramtype is_os_disk: str + :keyword log_storage_account_id: Required. The log storage account ARM Id. + :paramtype log_storage_account_id: str + :keyword log_storage_account_sas_secret_name: Required. The key vault secret name of the log + storage account. + :paramtype log_storage_account_sas_secret_name: str + :keyword disk_encryption_set_id: The DiskEncryptionSet ARM Id. + :paramtype disk_encryption_set_id: str + """ super(VMwareCbtDiskInput, self).__init__(**kwargs) self.disk_id = disk_id self.disk_type = disk_type @@ -21714,53 +27647,57 @@ class VMwareCbtEnableMigrationInput(EnableMigrationProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param vmware_machine_id: Required. The ARM Id of the VM discovered in VMware. - :type vmware_machine_id: str - :param disks_to_include: Required. The disks to include list. - :type disks_to_include: + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar vmware_machine_id: Required. The ARM Id of the VM discovered in VMware. + :vartype vmware_machine_id: str + :ivar disks_to_include: Required. The disks to include list. + :vartype disks_to_include: list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtDiskInput] - :param license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", + :ivar license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", "WindowsServer". - :type license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType - :param sql_server_license_type: The SQL Server license type. Possible values include: + :vartype license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType + :ivar sql_server_license_type: The SQL Server license type. Possible values include: "NotSpecified", "NoLicenseType", "PAYG", "AHUB". - :type sql_server_license_type: str or + :vartype sql_server_license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType - :param data_mover_run_as_account_id: Required. The data mover run as account Id. - :type data_mover_run_as_account_id: str - :param snapshot_run_as_account_id: Required. The snapshot run as account Id. - :type snapshot_run_as_account_id: str - :param target_vm_name: The target VM name. - :type target_vm_name: str - :param target_vm_size: The target VM size. - :type target_vm_size: str - :param target_resource_group_id: Required. The target resource group ARM Id. - :type target_resource_group_id: str - :param target_network_id: Required. The target network ARM Id. - :type target_network_id: str - :param target_subnet_name: The target subnet name. - :type target_subnet_name: str - :param target_availability_set_id: The target availability set ARM Id. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group ARM Id. - :type target_proximity_placement_group_id: str - :param target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account + :ivar data_mover_run_as_account_id: Required. The data mover run as account Id. + :vartype data_mover_run_as_account_id: str + :ivar snapshot_run_as_account_id: Required. The snapshot run as account Id. + :vartype snapshot_run_as_account_id: str + :ivar target_vm_name: The target VM name. + :vartype target_vm_name: str + :ivar target_vm_size: The target VM size. + :vartype target_vm_size: str + :ivar target_resource_group_id: Required. The target resource group ARM Id. + :vartype target_resource_group_id: str + :ivar target_network_id: Required. The target network ARM Id. + :vartype target_network_id: str + :ivar test_network_id: The selected test network ARM Id. + :vartype test_network_id: str + :ivar target_subnet_name: The target subnet name. + :vartype target_subnet_name: str + :ivar test_subnet_name: The selected test subnet name. + :vartype test_subnet_name: str + :ivar target_availability_set_id: The target availability set ARM Id. + :vartype target_availability_set_id: str + :ivar target_availability_zone: The target availability zone. + :vartype target_availability_zone: str + :ivar target_proximity_placement_group_id: The target proximity placement group ARM Id. + :vartype target_proximity_placement_group_id: str + :ivar target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account ARM Id. - :type target_boot_diagnostics_storage_account_id: str - :param perform_auto_resync: A value indicating whether auto resync is to be done. - :type perform_auto_resync: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param seed_disk_tags: The tags for the seed disks. - :type seed_disk_tags: dict[str, str] - :param target_disk_tags: The tags for the target disks. - :type target_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] + :vartype target_boot_diagnostics_storage_account_id: str + :ivar perform_auto_resync: A value indicating whether auto resync is to be done. + :vartype perform_auto_resync: str + :ivar target_vm_tags: The target VM tags. + :vartype target_vm_tags: dict[str, str] + :ivar seed_disk_tags: The tags for the seed disks. + :vartype seed_disk_tags: dict[str, str] + :ivar target_disk_tags: The tags for the target disks. + :vartype target_disk_tags: dict[str, str] + :ivar target_nic_tags: The tags for the target NICs. + :vartype target_nic_tags: dict[str, str] """ _validation = { @@ -21785,7 +27722,9 @@ class VMwareCbtEnableMigrationInput(EnableMigrationProviderSpecificInput): 'target_vm_size': {'key': 'targetVmSize', 'type': 'str'}, 'target_resource_group_id': {'key': 'targetResourceGroupId', 'type': 'str'}, 'target_network_id': {'key': 'targetNetworkId', 'type': 'str'}, + 'test_network_id': {'key': 'testNetworkId', 'type': 'str'}, 'target_subnet_name': {'key': 'targetSubnetName', 'type': 'str'}, + 'test_subnet_name': {'key': 'testSubnetName', 'type': 'str'}, 'target_availability_set_id': {'key': 'targetAvailabilitySetId', 'type': 'str'}, 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, 'target_proximity_placement_group_id': {'key': 'targetProximityPlacementGroupId', 'type': 'str'}, @@ -21810,7 +27749,9 @@ def __init__( sql_server_license_type: Optional[Union[str, "SqlServerLicenseType"]] = None, target_vm_name: Optional[str] = None, target_vm_size: Optional[str] = None, + test_network_id: Optional[str] = None, target_subnet_name: Optional[str] = None, + test_subnet_name: Optional[str] = None, target_availability_set_id: Optional[str] = None, target_availability_zone: Optional[str] = None, target_proximity_placement_group_id: Optional[str] = None, @@ -21822,6 +27763,57 @@ def __init__( target_nic_tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword vmware_machine_id: Required. The ARM Id of the VM discovered in VMware. + :paramtype vmware_machine_id: str + :keyword disks_to_include: Required. The disks to include list. + :paramtype disks_to_include: + list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtDiskInput] + :keyword license_type: License type. Possible values include: "NotSpecified", "NoLicenseType", + "WindowsServer". + :paramtype license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType + :keyword sql_server_license_type: The SQL Server license type. Possible values include: + "NotSpecified", "NoLicenseType", "PAYG", "AHUB". + :paramtype sql_server_license_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType + :keyword data_mover_run_as_account_id: Required. The data mover run as account Id. + :paramtype data_mover_run_as_account_id: str + :keyword snapshot_run_as_account_id: Required. The snapshot run as account Id. + :paramtype snapshot_run_as_account_id: str + :keyword target_vm_name: The target VM name. + :paramtype target_vm_name: str + :keyword target_vm_size: The target VM size. + :paramtype target_vm_size: str + :keyword target_resource_group_id: Required. The target resource group ARM Id. + :paramtype target_resource_group_id: str + :keyword target_network_id: Required. The target network ARM Id. + :paramtype target_network_id: str + :keyword test_network_id: The selected test network ARM Id. + :paramtype test_network_id: str + :keyword target_subnet_name: The target subnet name. + :paramtype target_subnet_name: str + :keyword test_subnet_name: The selected test subnet name. + :paramtype test_subnet_name: str + :keyword target_availability_set_id: The target availability set ARM Id. + :paramtype target_availability_set_id: str + :keyword target_availability_zone: The target availability zone. + :paramtype target_availability_zone: str + :keyword target_proximity_placement_group_id: The target proximity placement group ARM Id. + :paramtype target_proximity_placement_group_id: str + :keyword target_boot_diagnostics_storage_account_id: The target boot diagnostics storage + account ARM Id. + :paramtype target_boot_diagnostics_storage_account_id: str + :keyword perform_auto_resync: A value indicating whether auto resync is to be done. + :paramtype perform_auto_resync: str + :keyword target_vm_tags: The target VM tags. + :paramtype target_vm_tags: dict[str, str] + :keyword seed_disk_tags: The tags for the seed disks. + :paramtype seed_disk_tags: dict[str, str] + :keyword target_disk_tags: The tags for the target disks. + :paramtype target_disk_tags: dict[str, str] + :keyword target_nic_tags: The tags for the target NICs. + :paramtype target_nic_tags: dict[str, str] + """ super(VMwareCbtEnableMigrationInput, self).__init__(**kwargs) self.instance_type = 'VMwareCbt' # type: str self.vmware_machine_id = vmware_machine_id @@ -21834,7 +27826,9 @@ def __init__( self.target_vm_size = target_vm_size self.target_resource_group_id = target_resource_group_id self.target_network_id = target_network_id + self.test_network_id = test_network_id self.target_subnet_name = target_subnet_name + self.test_subnet_name = test_subnet_name self.target_availability_set_id = target_availability_set_id self.target_availability_zone = target_availability_zone self.target_proximity_placement_group_id = target_proximity_placement_group_id @@ -21853,9 +27847,9 @@ class VMwareCbtEventDetails(EventProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str :ivar migration_item_name: The migration item name. :vartype migration_item_name: str """ @@ -21874,6 +27868,8 @@ def __init__( self, **kwargs ): + """ + """ super(VMwareCbtEventDetails, self).__init__(**kwargs) self.instance_type = 'VMwareCbt' # type: str self.migration_item_name = None @@ -21884,10 +27880,10 @@ class VMwareCbtMigrateInput(MigrateProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param perform_shutdown: Required. A value indicating whether VM is to be shutdown. - :type perform_shutdown: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar perform_shutdown: Required. A value indicating whether VM is to be shutdown. + :vartype perform_shutdown: str """ _validation = { @@ -21906,6 +27902,10 @@ def __init__( perform_shutdown: str, **kwargs ): + """ + :keyword perform_shutdown: Required. A value indicating whether VM is to be shutdown. + :paramtype perform_shutdown: str + """ super(VMwareCbtMigrateInput, self).__init__(**kwargs) self.instance_type = 'VMwareCbt' # type: str self.perform_shutdown = perform_shutdown @@ -21918,8 +27918,8 @@ class VMwareCbtMigrationDetails(MigrationProviderSpecificSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the instance type.Constant filled by server. - :type instance_type: str + :ivar instance_type: Required. Gets the instance type.Constant filled by server. + :vartype instance_type: str :ivar vmware_machine_id: The ARM Id of the VM discovered in VMware. :vartype vmware_machine_id: str :ivar os_type: The type of the OS on the VM. @@ -21928,42 +27928,42 @@ class VMwareCbtMigrationDetails(MigrationProviderSpecificSettings): :vartype firmware_type: str :ivar target_generation: The target generation. :vartype target_generation: str - :param license_type: License Type of the VM to be used. - :type license_type: str - :param sql_server_license_type: The SQL Server license type. - :type sql_server_license_type: str + :ivar license_type: License Type of the VM to be used. + :vartype license_type: str + :ivar sql_server_license_type: The SQL Server license type. + :vartype sql_server_license_type: str :ivar data_mover_run_as_account_id: The data mover run as account Id. :vartype data_mover_run_as_account_id: str :ivar snapshot_run_as_account_id: The snapshot run as account Id. :vartype snapshot_run_as_account_id: str - :param target_vm_name: Target VM name. - :type target_vm_name: str - :param target_vm_size: The target VM size. - :type target_vm_size: str + :ivar target_vm_name: Target VM name. + :vartype target_vm_name: str + :ivar target_vm_size: The target VM size. + :vartype target_vm_size: str :ivar target_location: The target location. :vartype target_location: str - :param target_resource_group_id: The target resource group Id. - :type target_resource_group_id: str - :param target_availability_set_id: The target availability set Id. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group Id. - :type target_proximity_placement_group_id: str - :param target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account + :ivar target_resource_group_id: The target resource group Id. + :vartype target_resource_group_id: str + :ivar target_availability_set_id: The target availability set Id. + :vartype target_availability_set_id: str + :ivar target_availability_zone: The target availability zone. + :vartype target_availability_zone: str + :ivar target_proximity_placement_group_id: The target proximity placement group Id. + :vartype target_proximity_placement_group_id: str + :ivar target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account ARM Id. - :type target_boot_diagnostics_storage_account_id: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param protected_disks: The list of protected disks. - :type protected_disks: + :vartype target_boot_diagnostics_storage_account_id: str + :ivar target_vm_tags: The target VM tags. + :vartype target_vm_tags: dict[str, str] + :ivar protected_disks: The list of protected disks. + :vartype protected_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtProtectedDiskDetails] - :param target_network_id: The target network Id. - :type target_network_id: str - :param vm_nics: The network details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtNicDetails] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] + :ivar target_network_id: The target network Id. + :vartype target_network_id: str + :ivar vm_nics: The network details. + :vartype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtNicDetails] + :ivar target_nic_tags: The tags for the target NICs. + :vartype target_nic_tags: dict[str, str] :ivar migration_recovery_point_id: The recovery point Id to which the VM was migrated. :vartype migration_recovery_point_id: str :ivar last_recovery_point_received: The last recovery point received time. @@ -21985,12 +27985,12 @@ class VMwareCbtMigrationDetails(MigrationProviderSpecificSettings): :ivar resync_state: The resync state. Possible values include: "None", "PreparedForResynchronization", "StartedResynchronization". :vartype resync_state: str or ~azure.mgmt.recoveryservicessiterecovery.models.ResyncState - :param perform_auto_resync: A value indicating whether auto resync is to be done. - :type perform_auto_resync: str - :param seed_disk_tags: The tags for the seed disks. - :type seed_disk_tags: dict[str, str] - :param target_disk_tags: The tags for the target disks. - :type target_disk_tags: dict[str, str] + :ivar perform_auto_resync: A value indicating whether auto resync is to be done. + :vartype perform_auto_resync: str + :ivar seed_disk_tags: The tags for the seed disks. + :vartype seed_disk_tags: dict[str, str] + :ivar target_disk_tags: The tags for the target disks. + :vartype target_disk_tags: dict[str, str] """ _validation = { @@ -22074,6 +28074,44 @@ def __init__( target_disk_tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword license_type: License Type of the VM to be used. + :paramtype license_type: str + :keyword sql_server_license_type: The SQL Server license type. + :paramtype sql_server_license_type: str + :keyword target_vm_name: Target VM name. + :paramtype target_vm_name: str + :keyword target_vm_size: The target VM size. + :paramtype target_vm_size: str + :keyword target_resource_group_id: The target resource group Id. + :paramtype target_resource_group_id: str + :keyword target_availability_set_id: The target availability set Id. + :paramtype target_availability_set_id: str + :keyword target_availability_zone: The target availability zone. + :paramtype target_availability_zone: str + :keyword target_proximity_placement_group_id: The target proximity placement group Id. + :paramtype target_proximity_placement_group_id: str + :keyword target_boot_diagnostics_storage_account_id: The target boot diagnostics storage + account ARM Id. + :paramtype target_boot_diagnostics_storage_account_id: str + :keyword target_vm_tags: The target VM tags. + :paramtype target_vm_tags: dict[str, str] + :keyword protected_disks: The list of protected disks. + :paramtype protected_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtProtectedDiskDetails] + :keyword target_network_id: The target network Id. + :paramtype target_network_id: str + :keyword vm_nics: The network details. + :paramtype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtNicDetails] + :keyword target_nic_tags: The tags for the target NICs. + :paramtype target_nic_tags: dict[str, str] + :keyword perform_auto_resync: A value indicating whether auto resync is to be done. + :paramtype perform_auto_resync: str + :keyword seed_disk_tags: The tags for the seed disks. + :paramtype seed_disk_tags: dict[str, str] + :keyword target_disk_tags: The tags for the target disks. + :paramtype target_disk_tags: dict[str, str] + """ super(VMwareCbtMigrationDetails, self).__init__(**kwargs) self.instance_type = 'VMwareCbt' # type: str self.vmware_machine_id = None @@ -22119,8 +28157,8 @@ class VMwareCbtNicDetails(msrest.serialization.Model): :ivar nic_id: The NIC Id. :vartype nic_id: str - :param is_primary_nic: A value indicating whether this is the primary NIC. - :type is_primary_nic: str + :ivar is_primary_nic: A value indicating whether this is the primary NIC. + :vartype is_primary_nic: str :ivar source_ip_address: The source IP address. :vartype source_ip_address: str :ivar source_ip_address_type: The source IP address type. Possible values include: "Dynamic", @@ -22129,19 +28167,28 @@ class VMwareCbtNicDetails(msrest.serialization.Model): ~azure.mgmt.recoveryservicessiterecovery.models.EthernetAddressType :ivar source_network_id: Source network Id. :vartype source_network_id: str - :param target_ip_address: The target IP address. - :type target_ip_address: str - :param target_ip_address_type: The target IP address type. Possible values include: "Dynamic", + :ivar target_ip_address: The target IP address. + :vartype target_ip_address: str + :ivar target_ip_address_type: The target IP address type. Possible values include: "Dynamic", "Static". - :type target_ip_address_type: str or + :vartype target_ip_address_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.EthernetAddressType - :param target_subnet_name: Target subnet name. - :type target_subnet_name: str - :param target_nic_name: Target NIC name. - :type target_nic_name: str - :param is_selected_for_migration: A value indicating whether this NIC is selected for - migration. - :type is_selected_for_migration: str + :ivar target_subnet_name: Target subnet name. + :vartype target_subnet_name: str + :ivar test_network_id: Source network Id. + :vartype test_network_id: str + :ivar test_subnet_name: Test subnet name. + :vartype test_subnet_name: str + :ivar test_ip_address: The test IP address. + :vartype test_ip_address: str + :ivar test_ip_address_type: The test IP address type. Possible values include: "Dynamic", + "Static". + :vartype test_ip_address_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.EthernetAddressType + :ivar target_nic_name: Target NIC name. + :vartype target_nic_name: str + :ivar is_selected_for_migration: A value indicating whether this NIC is selected for migration. + :vartype is_selected_for_migration: str """ _validation = { @@ -22160,6 +28207,10 @@ class VMwareCbtNicDetails(msrest.serialization.Model): 'target_ip_address': {'key': 'targetIPAddress', 'type': 'str'}, 'target_ip_address_type': {'key': 'targetIPAddressType', 'type': 'str'}, 'target_subnet_name': {'key': 'targetSubnetName', 'type': 'str'}, + 'test_network_id': {'key': 'testNetworkId', 'type': 'str'}, + 'test_subnet_name': {'key': 'testSubnetName', 'type': 'str'}, + 'test_ip_address': {'key': 'testIPAddress', 'type': 'str'}, + 'test_ip_address_type': {'key': 'testIPAddressType', 'type': 'str'}, 'target_nic_name': {'key': 'targetNicName', 'type': 'str'}, 'is_selected_for_migration': {'key': 'isSelectedForMigration', 'type': 'str'}, } @@ -22171,10 +28222,41 @@ def __init__( target_ip_address: Optional[str] = None, target_ip_address_type: Optional[Union[str, "EthernetAddressType"]] = None, target_subnet_name: Optional[str] = None, + test_network_id: Optional[str] = None, + test_subnet_name: Optional[str] = None, + test_ip_address: Optional[str] = None, + test_ip_address_type: Optional[Union[str, "EthernetAddressType"]] = None, target_nic_name: Optional[str] = None, is_selected_for_migration: Optional[str] = None, **kwargs ): + """ + :keyword is_primary_nic: A value indicating whether this is the primary NIC. + :paramtype is_primary_nic: str + :keyword target_ip_address: The target IP address. + :paramtype target_ip_address: str + :keyword target_ip_address_type: The target IP address type. Possible values include: + "Dynamic", "Static". + :paramtype target_ip_address_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.EthernetAddressType + :keyword target_subnet_name: Target subnet name. + :paramtype target_subnet_name: str + :keyword test_network_id: Source network Id. + :paramtype test_network_id: str + :keyword test_subnet_name: Test subnet name. + :paramtype test_subnet_name: str + :keyword test_ip_address: The test IP address. + :paramtype test_ip_address: str + :keyword test_ip_address_type: The test IP address type. Possible values include: "Dynamic", + "Static". + :paramtype test_ip_address_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.EthernetAddressType + :keyword target_nic_name: Target NIC name. + :paramtype target_nic_name: str + :keyword is_selected_for_migration: A value indicating whether this NIC is selected for + migration. + :paramtype is_selected_for_migration: str + """ super(VMwareCbtNicDetails, self).__init__(**kwargs) self.nic_id = None self.is_primary_nic = is_primary_nic @@ -22184,6 +28266,10 @@ def __init__( self.target_ip_address = target_ip_address self.target_ip_address_type = target_ip_address_type self.target_subnet_name = target_subnet_name + self.test_network_id = test_network_id + self.test_subnet_name = test_subnet_name + self.test_ip_address = test_ip_address + self.test_ip_address_type = test_ip_address_type self.target_nic_name = target_nic_name self.is_selected_for_migration = is_selected_for_migration @@ -22193,19 +28279,22 @@ class VMwareCbtNicInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param nic_id: Required. The NIC Id. - :type nic_id: str - :param is_primary_nic: Required. A value indicating whether this is the primary NIC. - :type is_primary_nic: str - :param target_subnet_name: Target subnet name. - :type target_subnet_name: str - :param target_static_ip_address: The static IP address. - :type target_static_ip_address: str - :param is_selected_for_migration: A value indicating whether this NIC is selected for - migration. - :type is_selected_for_migration: str - :param target_nic_name: Target NIC name. - :type target_nic_name: str + :ivar nic_id: Required. The NIC Id. + :vartype nic_id: str + :ivar is_primary_nic: Required. A value indicating whether this is the primary NIC. + :vartype is_primary_nic: str + :ivar target_subnet_name: Target subnet name. + :vartype target_subnet_name: str + :ivar target_static_ip_address: The static IP address. + :vartype target_static_ip_address: str + :ivar is_selected_for_migration: A value indicating whether this NIC is selected for migration. + :vartype is_selected_for_migration: str + :ivar target_nic_name: Target NIC name. + :vartype target_nic_name: str + :ivar test_subnet_name: The test subnet name. + :vartype test_subnet_name: str + :ivar test_static_ip_address: The test static IP address. + :vartype test_static_ip_address: str """ _validation = { @@ -22220,6 +28309,8 @@ class VMwareCbtNicInput(msrest.serialization.Model): 'target_static_ip_address': {'key': 'targetStaticIPAddress', 'type': 'str'}, 'is_selected_for_migration': {'key': 'isSelectedForMigration', 'type': 'str'}, 'target_nic_name': {'key': 'targetNicName', 'type': 'str'}, + 'test_subnet_name': {'key': 'testSubnetName', 'type': 'str'}, + 'test_static_ip_address': {'key': 'testStaticIPAddress', 'type': 'str'}, } def __init__( @@ -22231,8 +28322,29 @@ def __init__( target_static_ip_address: Optional[str] = None, is_selected_for_migration: Optional[str] = None, target_nic_name: Optional[str] = None, + test_subnet_name: Optional[str] = None, + test_static_ip_address: Optional[str] = None, **kwargs ): + """ + :keyword nic_id: Required. The NIC Id. + :paramtype nic_id: str + :keyword is_primary_nic: Required. A value indicating whether this is the primary NIC. + :paramtype is_primary_nic: str + :keyword target_subnet_name: Target subnet name. + :paramtype target_subnet_name: str + :keyword target_static_ip_address: The static IP address. + :paramtype target_static_ip_address: str + :keyword is_selected_for_migration: A value indicating whether this NIC is selected for + migration. + :paramtype is_selected_for_migration: str + :keyword target_nic_name: Target NIC name. + :paramtype target_nic_name: str + :keyword test_subnet_name: The test subnet name. + :paramtype test_subnet_name: str + :keyword test_static_ip_address: The test static IP address. + :paramtype test_static_ip_address: str + """ super(VMwareCbtNicInput, self).__init__(**kwargs) self.nic_id = nic_id self.is_primary_nic = is_primary_nic @@ -22240,6 +28352,8 @@ def __init__( self.target_static_ip_address = target_static_ip_address self.is_selected_for_migration = is_selected_for_migration self.target_nic_name = target_nic_name + self.test_subnet_name = test_subnet_name + self.test_static_ip_address = test_static_ip_address class VMwareCbtPolicyCreationInput(PolicyProviderSpecificInput): @@ -22247,16 +28361,16 @@ class VMwareCbtPolicyCreationInput(PolicyProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_history_in_minutes: The duration in minutes until which the recovery + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_history_in_minutes: The duration in minutes until which the recovery points need to be stored. - :type recovery_point_history_in_minutes: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in + :vartype recovery_point_history_in_minutes: int + :ivar crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in minutes). - :type crash_consistent_frequency_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). - :type app_consistent_frequency_in_minutes: int + :vartype crash_consistent_frequency_in_minutes: int + :ivar app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in minutes). + :vartype app_consistent_frequency_in_minutes: int """ _validation = { @@ -22278,6 +28392,17 @@ def __init__( app_consistent_frequency_in_minutes: Optional[int] = None, **kwargs ): + """ + :keyword recovery_point_history_in_minutes: The duration in minutes until which the recovery + points need to be stored. + :paramtype recovery_point_history_in_minutes: int + :keyword crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency (in + minutes). + :paramtype crash_consistent_frequency_in_minutes: int + :keyword app_consistent_frequency_in_minutes: The app consistent snapshot frequency (in + minutes). + :paramtype app_consistent_frequency_in_minutes: int + """ super(VMwareCbtPolicyCreationInput, self).__init__(**kwargs) self.instance_type = 'VMwareCbt' # type: str self.recovery_point_history_in_minutes = recovery_point_history_in_minutes @@ -22290,17 +28415,17 @@ class VmwareCbtPolicyDetails(PolicyProviderSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param recovery_point_history_in_minutes: The duration in minutes until which the recovery + :vartype instance_type: str + :ivar recovery_point_history_in_minutes: The duration in minutes until which the recovery points need to be stored. - :type recovery_point_history_in_minutes: int - :param app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. - :type app_consistent_frequency_in_minutes: int - :param crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in + :vartype recovery_point_history_in_minutes: int + :ivar app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. + :vartype app_consistent_frequency_in_minutes: int + :ivar crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in minutes. - :type crash_consistent_frequency_in_minutes: int + :vartype crash_consistent_frequency_in_minutes: int """ _validation = { @@ -22322,6 +28447,16 @@ def __init__( crash_consistent_frequency_in_minutes: Optional[int] = None, **kwargs ): + """ + :keyword recovery_point_history_in_minutes: The duration in minutes until which the recovery + points need to be stored. + :paramtype recovery_point_history_in_minutes: int + :keyword app_consistent_frequency_in_minutes: The app consistent snapshot frequency in minutes. + :paramtype app_consistent_frequency_in_minutes: int + :keyword crash_consistent_frequency_in_minutes: The crash consistent snapshot frequency in + minutes. + :paramtype crash_consistent_frequency_in_minutes: int + """ super(VmwareCbtPolicyDetails, self).__init__(**kwargs) self.instance_type = 'VMwareCbt' # type: str self.recovery_point_history_in_minutes = recovery_point_history_in_minutes @@ -22338,9 +28473,9 @@ class VMwareCbtProtectedDiskDetails(msrest.serialization.Model): :vartype disk_id: str :ivar disk_name: The disk name. :vartype disk_name: str - :param disk_type: The disk type. Possible values include: "Standard_LRS", "Premium_LRS", + :ivar disk_type: The disk type. Possible values include: "Standard_LRS", "Premium_LRS", "StandardSSD_LRS". - :type disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :vartype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType :ivar disk_path: The disk path. :vartype disk_path: str :ivar is_os_disk: A value indicating whether the disk is the OS disk. @@ -22358,8 +28493,8 @@ class VMwareCbtProtectedDiskDetails(msrest.serialization.Model): :vartype seed_managed_disk_id: str :ivar target_managed_disk_id: The ARM Id of the target managed disk. :vartype target_managed_disk_id: str - :param target_disk_name: The name for the target managed disk. - :type target_disk_name: str + :ivar target_disk_name: The name for the target managed disk. + :vartype target_disk_name: str """ _validation = { @@ -22397,6 +28532,13 @@ def __init__( target_disk_name: Optional[str] = None, **kwargs ): + """ + :keyword disk_type: The disk type. Possible values include: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS". + :paramtype disk_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.DiskAccountType + :keyword target_disk_name: The name for the target managed disk. + :paramtype target_disk_name: str + """ super(VMwareCbtProtectedDiskDetails, self).__init__(**kwargs) self.disk_id = None self.disk_name = None @@ -22419,9 +28561,9 @@ class VMwareCbtProtectionContainerMappingDetails(ProtectionContainerMappingProvi All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str :ivar key_vault_id: The target key vault ARM Id. :vartype key_vault_id: str :ivar key_vault_uri: The target key vault URI. @@ -22461,6 +28603,8 @@ def __init__( self, **kwargs ): + """ + """ super(VMwareCbtProtectionContainerMappingDetails, self).__init__(**kwargs) self.instance_type = 'VMwareCbt' # type: str self.key_vault_id = None @@ -22476,10 +28620,10 @@ class VMwareCbtResyncInput(ResyncProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param skip_cbt_reset: Required. A value indicating whether CBT is to be reset. - :type skip_cbt_reset: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar skip_cbt_reset: Required. A value indicating whether CBT is to be reset. + :vartype skip_cbt_reset: str """ _validation = { @@ -22498,6 +28642,10 @@ def __init__( skip_cbt_reset: str, **kwargs ): + """ + :keyword skip_cbt_reset: Required. A value indicating whether CBT is to be reset. + :paramtype skip_cbt_reset: str + """ super(VMwareCbtResyncInput, self).__init__(**kwargs) self.instance_type = 'VMwareCbt' # type: str self.skip_cbt_reset = skip_cbt_reset @@ -22508,12 +28656,14 @@ class VMwareCbtTestMigrateInput(TestMigrateProviderSpecificInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param recovery_point_id: Required. The recovery point Id. - :type recovery_point_id: str - :param network_id: Required. The test network Id. - :type network_id: str + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar recovery_point_id: Required. The recovery point Id. + :vartype recovery_point_id: str + :ivar network_id: Required. The test network Id. + :vartype network_id: str + :ivar vm_nics: The list of NIC details. + :vartype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtNicInput] """ _validation = { @@ -22526,6 +28676,7 @@ class VMwareCbtTestMigrateInput(TestMigrateProviderSpecificInput): 'instance_type': {'key': 'instanceType', 'type': 'str'}, 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, 'network_id': {'key': 'networkId', 'type': 'str'}, + 'vm_nics': {'key': 'vmNics', 'type': '[VMwareCbtNicInput]'}, } def __init__( @@ -22533,12 +28684,22 @@ def __init__( *, recovery_point_id: str, network_id: str, + vm_nics: Optional[List["VMwareCbtNicInput"]] = None, **kwargs ): + """ + :keyword recovery_point_id: Required. The recovery point Id. + :paramtype recovery_point_id: str + :keyword network_id: Required. The test network Id. + :paramtype network_id: str + :keyword vm_nics: The list of NIC details. + :paramtype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtNicInput] + """ super(VMwareCbtTestMigrateInput, self).__init__(**kwargs) self.instance_type = 'VMwareCbt' # type: str self.recovery_point_id = recovery_point_id self.network_id = network_id + self.vm_nics = vm_nics class VMwareCbtUpdateDiskInput(msrest.serialization.Model): @@ -22546,10 +28707,10 @@ class VMwareCbtUpdateDiskInput(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param disk_id: Required. The disk Id. - :type disk_id: str - :param target_disk_name: The target disk name. - :type target_disk_name: str + :ivar disk_id: Required. The disk Id. + :vartype disk_id: str + :ivar target_disk_name: The target disk name. + :vartype target_disk_name: str """ _validation = { @@ -22568,6 +28729,12 @@ def __init__( target_disk_name: Optional[str] = None, **kwargs ): + """ + :keyword disk_id: Required. The disk Id. + :paramtype disk_id: str + :keyword target_disk_name: The target disk name. + :paramtype target_disk_name: str + """ super(VMwareCbtUpdateDiskInput, self).__init__(**kwargs) self.disk_id = disk_id self.target_disk_name = target_disk_name @@ -22578,44 +28745,47 @@ class VMwareCbtUpdateMigrationItemInput(UpdateMigrationItemProviderSpecificInput All required parameters must be populated in order to send to Azure. - :param instance_type: Required. The class type.Constant filled by server. - :type instance_type: str - :param target_vm_name: The target VM name. - :type target_vm_name: str - :param target_vm_size: The target VM size. - :type target_vm_size: str - :param target_resource_group_id: The target resource group ARM Id. - :type target_resource_group_id: str - :param target_availability_set_id: The target availability set ARM Id. - :type target_availability_set_id: str - :param target_availability_zone: The target availability zone. - :type target_availability_zone: str - :param target_proximity_placement_group_id: The target proximity placement group ARM Id. - :type target_proximity_placement_group_id: str - :param target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account + :ivar instance_type: Required. The class type.Constant filled by server. + :vartype instance_type: str + :ivar target_vm_name: The target VM name. + :vartype target_vm_name: str + :ivar target_vm_size: The target VM size. + :vartype target_vm_size: str + :ivar target_resource_group_id: The target resource group ARM Id. + :vartype target_resource_group_id: str + :ivar target_availability_set_id: The target availability set ARM Id. + :vartype target_availability_set_id: str + :ivar target_availability_zone: The target availability zone. + :vartype target_availability_zone: str + :ivar target_proximity_placement_group_id: The target proximity placement group ARM Id. + :vartype target_proximity_placement_group_id: str + :ivar target_boot_diagnostics_storage_account_id: The target boot diagnostics storage account ARM Id. - :type target_boot_diagnostics_storage_account_id: str - :param target_network_id: The target network ARM Id. - :type target_network_id: str - :param vm_nics: The list of NIC details. - :type vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtNicInput] - :param vm_disks: The list of disk update properties. - :type vm_disks: list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtUpdateDiskInput] - :param license_type: The license type. Possible values include: "NotSpecified", - "NoLicenseType", "WindowsServer". - :type license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType - :param sql_server_license_type: The SQL Server license type. Possible values include: + :vartype target_boot_diagnostics_storage_account_id: str + :ivar target_network_id: The target network ARM Id. + :vartype target_network_id: str + :ivar test_network_id: The test network ARM Id. + :vartype test_network_id: str + :ivar vm_nics: The list of NIC details. + :vartype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtNicInput] + :ivar vm_disks: The list of disk update properties. + :vartype vm_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtUpdateDiskInput] + :ivar license_type: The license type. Possible values include: "NotSpecified", "NoLicenseType", + "WindowsServer". + :vartype license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType + :ivar sql_server_license_type: The SQL Server license type. Possible values include: "NotSpecified", "NoLicenseType", "PAYG", "AHUB". - :type sql_server_license_type: str or + :vartype sql_server_license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType - :param perform_auto_resync: A value indicating whether auto resync is to be done. - :type perform_auto_resync: str - :param target_vm_tags: The target VM tags. - :type target_vm_tags: dict[str, str] - :param target_disk_tags: The tags for the target disks. - :type target_disk_tags: dict[str, str] - :param target_nic_tags: The tags for the target NICs. - :type target_nic_tags: dict[str, str] + :ivar perform_auto_resync: A value indicating whether auto resync is to be done. + :vartype perform_auto_resync: str + :ivar target_vm_tags: The target VM tags. + :vartype target_vm_tags: dict[str, str] + :ivar target_disk_tags: The tags for the target disks. + :vartype target_disk_tags: dict[str, str] + :ivar target_nic_tags: The tags for the target NICs. + :vartype target_nic_tags: dict[str, str] """ _validation = { @@ -22632,6 +28802,7 @@ class VMwareCbtUpdateMigrationItemInput(UpdateMigrationItemProviderSpecificInput 'target_proximity_placement_group_id': {'key': 'targetProximityPlacementGroupId', 'type': 'str'}, 'target_boot_diagnostics_storage_account_id': {'key': 'targetBootDiagnosticsStorageAccountId', 'type': 'str'}, 'target_network_id': {'key': 'targetNetworkId', 'type': 'str'}, + 'test_network_id': {'key': 'testNetworkId', 'type': 'str'}, 'vm_nics': {'key': 'vmNics', 'type': '[VMwareCbtNicInput]'}, 'vm_disks': {'key': 'vmDisks', 'type': '[VMwareCbtUpdateDiskInput]'}, 'license_type': {'key': 'licenseType', 'type': 'str'}, @@ -22653,6 +28824,7 @@ def __init__( target_proximity_placement_group_id: Optional[str] = None, target_boot_diagnostics_storage_account_id: Optional[str] = None, target_network_id: Optional[str] = None, + test_network_id: Optional[str] = None, vm_nics: Optional[List["VMwareCbtNicInput"]] = None, vm_disks: Optional[List["VMwareCbtUpdateDiskInput"]] = None, license_type: Optional[Union[str, "LicenseType"]] = None, @@ -22663,6 +28835,47 @@ def __init__( target_nic_tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword target_vm_name: The target VM name. + :paramtype target_vm_name: str + :keyword target_vm_size: The target VM size. + :paramtype target_vm_size: str + :keyword target_resource_group_id: The target resource group ARM Id. + :paramtype target_resource_group_id: str + :keyword target_availability_set_id: The target availability set ARM Id. + :paramtype target_availability_set_id: str + :keyword target_availability_zone: The target availability zone. + :paramtype target_availability_zone: str + :keyword target_proximity_placement_group_id: The target proximity placement group ARM Id. + :paramtype target_proximity_placement_group_id: str + :keyword target_boot_diagnostics_storage_account_id: The target boot diagnostics storage + account ARM Id. + :paramtype target_boot_diagnostics_storage_account_id: str + :keyword target_network_id: The target network ARM Id. + :paramtype target_network_id: str + :keyword test_network_id: The test network ARM Id. + :paramtype test_network_id: str + :keyword vm_nics: The list of NIC details. + :paramtype vm_nics: list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtNicInput] + :keyword vm_disks: The list of disk update properties. + :paramtype vm_disks: + list[~azure.mgmt.recoveryservicessiterecovery.models.VMwareCbtUpdateDiskInput] + :keyword license_type: The license type. Possible values include: "NotSpecified", + "NoLicenseType", "WindowsServer". + :paramtype license_type: str or ~azure.mgmt.recoveryservicessiterecovery.models.LicenseType + :keyword sql_server_license_type: The SQL Server license type. Possible values include: + "NotSpecified", "NoLicenseType", "PAYG", "AHUB". + :paramtype sql_server_license_type: str or + ~azure.mgmt.recoveryservicessiterecovery.models.SqlServerLicenseType + :keyword perform_auto_resync: A value indicating whether auto resync is to be done. + :paramtype perform_auto_resync: str + :keyword target_vm_tags: The target VM tags. + :paramtype target_vm_tags: dict[str, str] + :keyword target_disk_tags: The tags for the target disks. + :paramtype target_disk_tags: dict[str, str] + :keyword target_nic_tags: The tags for the target NICs. + :paramtype target_nic_tags: dict[str, str] + """ super(VMwareCbtUpdateMigrationItemInput, self).__init__(**kwargs) self.instance_type = 'VMwareCbt' # type: str self.target_vm_name = target_vm_name @@ -22673,6 +28886,7 @@ def __init__( self.target_proximity_placement_group_id = target_proximity_placement_group_id self.target_boot_diagnostics_storage_account_id = target_boot_diagnostics_storage_account_id self.target_network_id = target_network_id + self.test_network_id = test_network_id self.vm_nics = vm_nics self.vm_disks = vm_disks self.license_type = license_type @@ -22688,74 +28902,77 @@ class VMwareDetails(FabricSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param process_servers: The list of Process Servers associated with the fabric. - :type process_servers: list[~azure.mgmt.recoveryservicessiterecovery.models.ProcessServer] - :param master_target_servers: The list of Master Target servers associated with the fabric. - :type master_target_servers: + :vartype instance_type: str + :ivar process_servers: The list of Process Servers associated with the fabric. + :vartype process_servers: list[~azure.mgmt.recoveryservicessiterecovery.models.ProcessServer] + :ivar master_target_servers: The list of Master Target servers associated with the fabric. + :vartype master_target_servers: list[~azure.mgmt.recoveryservicessiterecovery.models.MasterTargetServer] - :param run_as_accounts: The list of run as accounts created on the server. - :type run_as_accounts: list[~azure.mgmt.recoveryservicessiterecovery.models.RunAsAccount] - :param replication_pair_count: The number of replication pairs configured in this CS. - :type replication_pair_count: str - :param process_server_count: The number of process servers. - :type process_server_count: str - :param agent_count: The number of source and target servers configured to talk to this CS. - :type agent_count: str - :param protected_servers: The number of protected servers. - :type protected_servers: str - :param system_load: The percentage of the system load. - :type system_load: str - :param system_load_status: The system load status. - :type system_load_status: str - :param cpu_load: The percentage of the CPU load. - :type cpu_load: str - :param cpu_load_status: The CPU load status. - :type cpu_load_status: str - :param total_memory_in_bytes: The total memory. - :type total_memory_in_bytes: long - :param available_memory_in_bytes: The available memory. - :type available_memory_in_bytes: long - :param memory_usage_status: The memory usage status. - :type memory_usage_status: str - :param total_space_in_bytes: The total space. - :type total_space_in_bytes: long - :param available_space_in_bytes: The available space. - :type available_space_in_bytes: long - :param space_usage_status: The space usage status. - :type space_usage_status: str - :param web_load: The web load. - :type web_load: str - :param web_load_status: The web load status. - :type web_load_status: str - :param database_server_load: The database server load. - :type database_server_load: str - :param database_server_load_status: The database server load status. - :type database_server_load_status: str - :param cs_service_status: The CS service status. - :type cs_service_status: str - :param ip_address: The IP address. - :type ip_address: str - :param agent_version: The agent Version. - :type agent_version: str - :param host_name: The host name. - :type host_name: str - :param last_heartbeat: The last heartbeat received from CS server. - :type last_heartbeat: ~datetime.datetime - :param version_status: Version status. - :type version_status: str - :param ssl_cert_expiry_date: CS SSL cert expiry date. - :type ssl_cert_expiry_date: ~datetime.datetime - :param ssl_cert_expiry_remaining_days: CS SSL cert expiry date. - :type ssl_cert_expiry_remaining_days: int - :param ps_template_version: PS template version. - :type ps_template_version: str - :param agent_expiry_date: Agent expiry date. - :type agent_expiry_date: ~datetime.datetime - :param agent_version_details: The agent version details. - :type agent_version_details: ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails + :ivar run_as_accounts: The list of run as accounts created on the server. + :vartype run_as_accounts: list[~azure.mgmt.recoveryservicessiterecovery.models.RunAsAccount] + :ivar replication_pair_count: The number of replication pairs configured in this CS. + :vartype replication_pair_count: str + :ivar process_server_count: The number of process servers. + :vartype process_server_count: str + :ivar agent_count: The number of source and target servers configured to talk to this CS. + :vartype agent_count: str + :ivar protected_servers: The number of protected servers. + :vartype protected_servers: str + :ivar system_load: The percentage of the system load. + :vartype system_load: str + :ivar system_load_status: The system load status. + :vartype system_load_status: str + :ivar cpu_load: The percentage of the CPU load. + :vartype cpu_load: str + :ivar cpu_load_status: The CPU load status. + :vartype cpu_load_status: str + :ivar total_memory_in_bytes: The total memory. + :vartype total_memory_in_bytes: long + :ivar available_memory_in_bytes: The available memory. + :vartype available_memory_in_bytes: long + :ivar memory_usage_status: The memory usage status. + :vartype memory_usage_status: str + :ivar total_space_in_bytes: The total space. + :vartype total_space_in_bytes: long + :ivar available_space_in_bytes: The available space. + :vartype available_space_in_bytes: long + :ivar space_usage_status: The space usage status. + :vartype space_usage_status: str + :ivar web_load: The web load. + :vartype web_load: str + :ivar web_load_status: The web load status. + :vartype web_load_status: str + :ivar database_server_load: The database server load. + :vartype database_server_load: str + :ivar database_server_load_status: The database server load status. + :vartype database_server_load_status: str + :ivar cs_service_status: The CS service status. + :vartype cs_service_status: str + :ivar ip_address: The IP address. + :vartype ip_address: str + :ivar agent_version: The agent Version. + :vartype agent_version: str + :ivar host_name: The host name. + :vartype host_name: str + :ivar last_heartbeat: The last heartbeat received from CS server. + :vartype last_heartbeat: ~datetime.datetime + :ivar version_status: Version status. + :vartype version_status: str + :ivar ssl_cert_expiry_date: CS SSL cert expiry date. + :vartype ssl_cert_expiry_date: ~datetime.datetime + :ivar ssl_cert_expiry_remaining_days: CS SSL cert expiry date. + :vartype ssl_cert_expiry_remaining_days: int + :ivar ps_template_version: PS template version. + :vartype ps_template_version: str + :ivar agent_expiry_date: Agent expiry date. + :vartype agent_expiry_date: ~datetime.datetime + :ivar agent_version_details: The agent version details. + :vartype agent_version_details: ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails + :ivar switch_provider_blocking_error_details: The switch provider blocking error information. + :vartype switch_provider_blocking_error_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageFabricSwitchProviderBlockingErrorDetails] """ _validation = { @@ -22796,6 +29013,7 @@ class VMwareDetails(FabricSpecificDetails): 'ps_template_version': {'key': 'psTemplateVersion', 'type': 'str'}, 'agent_expiry_date': {'key': 'agentExpiryDate', 'type': 'iso-8601'}, 'agent_version_details': {'key': 'agentVersionDetails', 'type': 'VersionDetails'}, + 'switch_provider_blocking_error_details': {'key': 'switchProviderBlockingErrorDetails', 'type': '[InMageFabricSwitchProviderBlockingErrorDetails]'}, } def __init__( @@ -22833,8 +29051,81 @@ def __init__( ps_template_version: Optional[str] = None, agent_expiry_date: Optional[datetime.datetime] = None, agent_version_details: Optional["VersionDetails"] = None, - **kwargs - ): + switch_provider_blocking_error_details: Optional[List["InMageFabricSwitchProviderBlockingErrorDetails"]] = None, + **kwargs + ): + """ + :keyword process_servers: The list of Process Servers associated with the fabric. + :paramtype process_servers: list[~azure.mgmt.recoveryservicessiterecovery.models.ProcessServer] + :keyword master_target_servers: The list of Master Target servers associated with the fabric. + :paramtype master_target_servers: + list[~azure.mgmt.recoveryservicessiterecovery.models.MasterTargetServer] + :keyword run_as_accounts: The list of run as accounts created on the server. + :paramtype run_as_accounts: list[~azure.mgmt.recoveryservicessiterecovery.models.RunAsAccount] + :keyword replication_pair_count: The number of replication pairs configured in this CS. + :paramtype replication_pair_count: str + :keyword process_server_count: The number of process servers. + :paramtype process_server_count: str + :keyword agent_count: The number of source and target servers configured to talk to this CS. + :paramtype agent_count: str + :keyword protected_servers: The number of protected servers. + :paramtype protected_servers: str + :keyword system_load: The percentage of the system load. + :paramtype system_load: str + :keyword system_load_status: The system load status. + :paramtype system_load_status: str + :keyword cpu_load: The percentage of the CPU load. + :paramtype cpu_load: str + :keyword cpu_load_status: The CPU load status. + :paramtype cpu_load_status: str + :keyword total_memory_in_bytes: The total memory. + :paramtype total_memory_in_bytes: long + :keyword available_memory_in_bytes: The available memory. + :paramtype available_memory_in_bytes: long + :keyword memory_usage_status: The memory usage status. + :paramtype memory_usage_status: str + :keyword total_space_in_bytes: The total space. + :paramtype total_space_in_bytes: long + :keyword available_space_in_bytes: The available space. + :paramtype available_space_in_bytes: long + :keyword space_usage_status: The space usage status. + :paramtype space_usage_status: str + :keyword web_load: The web load. + :paramtype web_load: str + :keyword web_load_status: The web load status. + :paramtype web_load_status: str + :keyword database_server_load: The database server load. + :paramtype database_server_load: str + :keyword database_server_load_status: The database server load status. + :paramtype database_server_load_status: str + :keyword cs_service_status: The CS service status. + :paramtype cs_service_status: str + :keyword ip_address: The IP address. + :paramtype ip_address: str + :keyword agent_version: The agent Version. + :paramtype agent_version: str + :keyword host_name: The host name. + :paramtype host_name: str + :keyword last_heartbeat: The last heartbeat received from CS server. + :paramtype last_heartbeat: ~datetime.datetime + :keyword version_status: Version status. + :paramtype version_status: str + :keyword ssl_cert_expiry_date: CS SSL cert expiry date. + :paramtype ssl_cert_expiry_date: ~datetime.datetime + :keyword ssl_cert_expiry_remaining_days: CS SSL cert expiry date. + :paramtype ssl_cert_expiry_remaining_days: int + :keyword ps_template_version: PS template version. + :paramtype ps_template_version: str + :keyword agent_expiry_date: Agent expiry date. + :paramtype agent_expiry_date: ~datetime.datetime + :keyword agent_version_details: The agent version details. + :paramtype agent_version_details: + ~azure.mgmt.recoveryservicessiterecovery.models.VersionDetails + :keyword switch_provider_blocking_error_details: The switch provider blocking error + information. + :paramtype switch_provider_blocking_error_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageFabricSwitchProviderBlockingErrorDetails] + """ super(VMwareDetails, self).__init__(**kwargs) self.instance_type = 'VMware' # type: str self.process_servers = process_servers @@ -22869,6 +29160,7 @@ def __init__( self.ps_template_version = ps_template_version self.agent_expiry_date = agent_expiry_date self.agent_version_details = agent_version_details + self.switch_provider_blocking_error_details = switch_provider_blocking_error_details class VMwareV2FabricCreationInput(FabricSpecificCreationInput): @@ -22876,14 +29168,14 @@ class VMwareV2FabricCreationInput(FabricSpecificCreationInput): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type.Constant filled by server. - :type instance_type: str - :param vmware_site_id: The ARM Id of the VMware site. - :type vmware_site_id: str - :param physical_site_id: The ARM Id of the physical site. - :type physical_site_id: str - :param migration_solution_id: Required. The ARM Id of the migration solution. - :type migration_solution_id: str + :ivar instance_type: Required. Gets the class type.Constant filled by server. + :vartype instance_type: str + :ivar vmware_site_id: The ARM Id of the VMware site. + :vartype vmware_site_id: str + :ivar physical_site_id: The ARM Id of the physical site. + :vartype physical_site_id: str + :ivar migration_solution_id: Required. The ARM Id of the migration solution. + :vartype migration_solution_id: str """ _validation = { @@ -22906,6 +29198,14 @@ def __init__( physical_site_id: Optional[str] = None, **kwargs ): + """ + :keyword vmware_site_id: The ARM Id of the VMware site. + :paramtype vmware_site_id: str + :keyword physical_site_id: The ARM Id of the physical site. + :paramtype physical_site_id: str + :keyword migration_solution_id: Required. The ARM Id of the migration solution. + :paramtype migration_solution_id: str + """ super(VMwareV2FabricCreationInput, self).__init__(**kwargs) self.instance_type = 'VMwareV2' # type: str self.vmware_site_id = vmware_site_id @@ -22920,9 +29220,9 @@ class VMwareV2FabricSpecificDetails(FabricSpecificDetails): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str + :vartype instance_type: str :ivar vmware_site_id: The ARM Id of the VMware site. :vartype vmware_site_id: str :ivar physical_site_id: The ARM Id of the physical site. @@ -22966,6 +29266,8 @@ def __init__( self, **kwargs ): + """ + """ super(VMwareV2FabricSpecificDetails, self).__init__(**kwargs) self.instance_type = 'VMwareV2' # type: str self.vmware_site_id = None @@ -22982,31 +29284,31 @@ class VMwareVirtualMachineDetails(ConfigurationSettings): All required parameters must be populated in order to send to Azure. - :param instance_type: Required. Gets the class type. Overridden in derived classes.Constant + :ivar instance_type: Required. Gets the class type. Overridden in derived classes.Constant filled by server. - :type instance_type: str - :param agent_generated_id: The ID generated by the InMage agent after it gets installed on + :vartype instance_type: str + :ivar agent_generated_id: The ID generated by the InMage agent after it gets installed on guest. This is the ID to be used during InMage CreateProtection. - :type agent_generated_id: str - :param agent_installed: The value indicating if InMage scout agent is installed on guest. - :type agent_installed: str - :param os_type: The OsType installed on VM. - :type os_type: str - :param agent_version: The agent version. - :type agent_version: str - :param ip_address: The IP address. - :type ip_address: str - :param powered_on: The value indicating whether VM is powered on. - :type powered_on: str - :param v_center_infrastructure_id: The VCenter infrastructure Id. - :type v_center_infrastructure_id: str - :param discovery_type: A value indicating the discovery type of the machine. Value can be + :vartype agent_generated_id: str + :ivar agent_installed: The value indicating if InMage scout agent is installed on guest. + :vartype agent_installed: str + :ivar os_type: The OsType installed on VM. + :vartype os_type: str + :ivar agent_version: The agent version. + :vartype agent_version: str + :ivar ip_address: The IP address. + :vartype ip_address: str + :ivar powered_on: The value indicating whether VM is powered on. + :vartype powered_on: str + :ivar v_center_infrastructure_id: The VCenter infrastructure Id. + :vartype v_center_infrastructure_id: str + :ivar discovery_type: A value indicating the discovery type of the machine. Value can be vCenter or physical. - :type discovery_type: str - :param disk_details: The disk details. - :type disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageDiskDetails] - :param validation_errors: The validation errors. - :type validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + :vartype discovery_type: str + :ivar disk_details: The disk details. + :vartype disk_details: list[~azure.mgmt.recoveryservicessiterecovery.models.InMageDiskDetails] + :ivar validation_errors: The validation errors. + :vartype validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] """ _validation = { @@ -23042,6 +29344,31 @@ def __init__( validation_errors: Optional[List["HealthError"]] = None, **kwargs ): + """ + :keyword agent_generated_id: The ID generated by the InMage agent after it gets installed on + guest. This is the ID to be used during InMage CreateProtection. + :paramtype agent_generated_id: str + :keyword agent_installed: The value indicating if InMage scout agent is installed on guest. + :paramtype agent_installed: str + :keyword os_type: The OsType installed on VM. + :paramtype os_type: str + :keyword agent_version: The agent version. + :paramtype agent_version: str + :keyword ip_address: The IP address. + :paramtype ip_address: str + :keyword powered_on: The value indicating whether VM is powered on. + :paramtype powered_on: str + :keyword v_center_infrastructure_id: The VCenter infrastructure Id. + :paramtype v_center_infrastructure_id: str + :keyword discovery_type: A value indicating the discovery type of the machine. Value can be + vCenter or physical. + :paramtype discovery_type: str + :keyword disk_details: The disk details. + :paramtype disk_details: + list[~azure.mgmt.recoveryservicessiterecovery.models.InMageDiskDetails] + :keyword validation_errors: The validation errors. + :paramtype validation_errors: list[~azure.mgmt.recoveryservicessiterecovery.models.HealthError] + """ super(VMwareVirtualMachineDetails, self).__init__(**kwargs) self.instance_type = 'VMwareVirtualMachine' # type: str self.agent_generated_id = agent_generated_id diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/_site_recovery_management_client_enums.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/_site_recovery_management_client_enums.py index 8986b8a0a7be..2de5dce53c4b 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/_site_recovery_management_client_enums.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/models/_site_recovery_management_client_enums.py @@ -6,27 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum, EnumMeta +from enum import Enum from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class A2ARecoveryAvailabilityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class A2ARecoveryAvailabilityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The recovery availability type of the virtual machine. """ @@ -34,7 +19,7 @@ class A2ARecoveryAvailabilityType(with_metaclass(_CaseInsensitiveEnumMeta, str, AVAILABILITY_SET = "AvailabilitySet" AVAILABILITY_ZONE = "AvailabilityZone" -class A2ARpRecoveryPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class A2ARpRecoveryPointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The recovery point type. """ @@ -43,14 +28,14 @@ class A2ARpRecoveryPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) LATEST_CRASH_CONSISTENT = "LatestCrashConsistent" LATEST_PROCESSED = "LatestProcessed" -class AgentAutoUpdateStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentAutoUpdateStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A value indicating whether the auto update is enabled. """ DISABLED = "Disabled" ENABLED = "Enabled" -class AgentUpgradeBlockedReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentUpgradeBlockedReason(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): ALREADY_ON_LATEST_VERSION = "AlreadyOnLatestVersion" REBOOT_REQUIRED = "RebootRequired" @@ -67,7 +52,7 @@ class AgentUpgradeBlockedReason(with_metaclass(_CaseInsensitiveEnumMeta, str, En INVALID_DRIVER_VERSION = "InvalidDriverVersion" UNKNOWN = "Unknown" -class AgentVersionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AgentVersionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A value indicating whether security update required. """ @@ -77,35 +62,42 @@ class AgentVersionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): UPDATE_REQUIRED = "UpdateRequired" SECURITY_UPDATE_REQUIRED = "SecurityUpdateRequired" -class AlternateLocationRecoveryOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AlternateLocationRecoveryOption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The ALR option. """ CREATE_VM_IF_NOT_FOUND = "CreateVmIfNotFound" NO_ACTION = "NoAction" -class AutoProtectionOfDataDisk(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AutomationAccountAuthenticationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """A value indicating the type authentication to use for automation Account. + """ + + RUN_AS_ACCOUNT = "RunAsAccount" + SYSTEM_ASSIGNED_IDENTITY = "SystemAssignedIdentity" + +class AutoProtectionOfDataDisk(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A value indicating whether the auto protection is enabled. """ DISABLED = "Disabled" ENABLED = "Enabled" -class DataSyncStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DataSyncStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The data sync option. """ FOR_DOWN_TIME = "ForDownTime" FOR_SYNCHRONIZATION = "ForSynchronization" -class DisableProtectionReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DisableProtectionReason(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Disable protection reason. It can have values NotSpecified/MigrationComplete. """ NOT_SPECIFIED = "NotSpecified" MIGRATION_COMPLETE = "MigrationComplete" -class DiskAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DiskAccountType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The DiskType. """ @@ -113,7 +105,7 @@ class DiskAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PREMIUM_LRS = "Premium_LRS" STANDARD_SSD_LRS = "StandardSSD_LRS" -class DiskReplicationProgressHealth(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DiskReplicationProgressHealth(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The progress health. """ @@ -123,14 +115,14 @@ class DiskReplicationProgressHealth(with_metaclass(_CaseInsensitiveEnumMeta, str NO_PROGRESS = "NoProgress" QUEUED = "Queued" -class EthernetAddressType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class EthernetAddressType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The source IP address type. """ DYNAMIC = "Dynamic" STATIC = "Static" -class ExportJobOutputSerializationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ExportJobOutputSerializationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The output type of the jobs. """ @@ -138,7 +130,13 @@ class ExportJobOutputSerializationType(with_metaclass(_CaseInsensitiveEnumMeta, XML = "Xml" EXCEL = "Excel" -class FailoverDeploymentModel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ExtendedLocationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The extended location type. + """ + + EDGE_ZONE = "EdgeZone" + +class FailoverDeploymentModel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The failover deployment model. """ @@ -146,7 +144,7 @@ class FailoverDeploymentModel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum CLASSIC = "Classic" RESOURCE_MANAGER = "ResourceManager" -class HealthErrorCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class HealthErrorCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The category of the health error. """ @@ -162,14 +160,14 @@ class HealthErrorCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): AGENT_AUTO_UPDATE_RUN_AS_ACCOUNT_EXPIRY = "AgentAutoUpdateRunAsAccountExpiry" AGENT_AUTO_UPDATE_RUN_AS_ACCOUNT_EXPIRED = "AgentAutoUpdateRunAsAccountExpired" -class HealthErrorCustomerResolvability(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class HealthErrorCustomerResolvability(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Value indicating whether the health error is customer resolvable. """ ALLOWED = "Allowed" NOT_ALLOWED = "NotAllowed" -class HyperVReplicaAzureRpRecoveryPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class HyperVReplicaAzureRpRecoveryPointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The recovery point type. """ @@ -177,14 +175,14 @@ class HyperVReplicaAzureRpRecoveryPointType(with_metaclass(_CaseInsensitiveEnumM LATEST_APPLICATION_CONSISTENT = "LatestApplicationConsistent" LATEST_PROCESSED = "LatestProcessed" -class InMageRcmFailbackRecoveryPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class InMageRcmFailbackRecoveryPointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The recovery point type. """ APPLICATION_CONSISTENT = "ApplicationConsistent" CRASH_CONSISTENT = "CrashConsistent" -class InMageV2RpRecoveryPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class InMageV2RpRecoveryPointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The recovery point type. """ @@ -193,7 +191,7 @@ class InMageV2RpRecoveryPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, LATEST_CRASH_CONSISTENT = "LatestCrashConsistent" LATEST_PROCESSED = "LatestProcessed" -class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class LicenseType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """License type. """ @@ -201,7 +199,7 @@ class LicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NO_LICENSE_TYPE = "NoLicenseType" WINDOWS_SERVER = "WindowsServer" -class MigrationItemOperation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MigrationItemOperation(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): DISABLE_MIGRATION = "DisableMigration" TEST_MIGRATE = "TestMigrate" @@ -209,7 +207,7 @@ class MigrationItemOperation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) MIGRATE = "Migrate" START_RESYNC = "StartResync" -class MigrationRecoveryPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MigrationRecoveryPointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The recovery point type. """ @@ -217,7 +215,7 @@ class MigrationRecoveryPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, E APPLICATION_CONSISTENT = "ApplicationConsistent" CRASH_CONSISTENT = "CrashConsistent" -class MigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MigrationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The migration status. """ @@ -233,7 +231,7 @@ class MigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MIGRATION_SUCCEEDED = "MigrationSucceeded" MIGRATION_FAILED = "MigrationFailed" -class MobilityAgentUpgradeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MobilityAgentUpgradeState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The agent auto upgrade state. """ @@ -242,14 +240,14 @@ class MobilityAgentUpgradeState(with_metaclass(_CaseInsensitiveEnumMeta, str, En COMPLETED = "Completed" COMMIT = "Commit" -class MultiVmGroupCreateOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MultiVmGroupCreateOption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Whether Multi VM group is auto created or specified by user. """ AUTO_CREATED = "AutoCreated" USER_SPECIFIED = "UserSpecified" -class MultiVmSyncPointOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class MultiVmSyncPointOption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A value indicating whether multi VM sync enabled VMs should use multi VM sync points for failover. """ @@ -257,7 +255,7 @@ class MultiVmSyncPointOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) USE_MULTI_VM_SYNC_RECOVERY_POINT = "UseMultiVmSyncRecoveryPoint" USE_PER_VM_RECOVERY_POINT = "UsePerVmRecoveryPoint" -class PlannedFailoverStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PlannedFailoverStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The last planned failover status. """ @@ -266,12 +264,12 @@ class PlannedFailoverStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) CANCELLED = "Cancelled" UNKNOWN = "Unknown" -class PossibleOperationsDirections(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PossibleOperationsDirections(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): PRIMARY_TO_RECOVERY = "PrimaryToRecovery" RECOVERY_TO_PRIMARY = "RecoveryToPrimary" -class PresenceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PresenceStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A value indicating whether the VM has a physical disk attached. String value of SrsDataContract.PresenceStatus enum. """ @@ -280,7 +278,7 @@ class PresenceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PRESENT = "Present" NOT_PRESENT = "NotPresent" -class ProtectionHealth(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ProtectionHealth(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The health. """ @@ -289,7 +287,7 @@ class ProtectionHealth(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WARNING = "Warning" CRITICAL = "Critical" -class RcmComponentStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RcmComponentStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The throughput status. """ @@ -298,14 +296,14 @@ class RcmComponentStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): CRITICAL = "Critical" UNKNOWN = "Unknown" -class RecoveryPlanActionLocation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RecoveryPlanActionLocation(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The fabric location. """ PRIMARY = "Primary" RECOVERY = "Recovery" -class RecoveryPlanGroupType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RecoveryPlanGroupType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The group type. """ @@ -313,7 +311,7 @@ class RecoveryPlanGroupType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) BOOT = "Boot" FAILOVER = "Failover" -class RecoveryPlanPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RecoveryPlanPointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The recovery point type. """ @@ -322,14 +320,14 @@ class RecoveryPlanPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) LATEST_CRASH_CONSISTENT = "LatestCrashConsistent" LATEST_PROCESSED = "LatestProcessed" -class RecoveryPointSyncType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RecoveryPointSyncType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A value indicating whether the recovery point is multi VM consistent. """ MULTI_VM_SYNC_RECOVERY_POINT = "MultiVmSyncRecoveryPoint" PER_VM_RECOVERY_POINT = "PerVmRecoveryPoint" -class RecoveryPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RecoveryPointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The recovery point type. Values from LatestTime, LatestTag or Custom. In the case of custom, the recovery point provided by RecoveryPointId will be used. In the other two cases, recovery point id will be ignored. @@ -339,7 +337,7 @@ class RecoveryPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): LATEST_TAG = "LatestTag" CUSTOM = "Custom" -class ReplicationProtectedItemOperation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ReplicationProtectedItemOperation(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): REVERSE_REPLICATE = "ReverseReplicate" COMMIT = "Commit" @@ -356,7 +354,7 @@ class ReplicationProtectedItemOperation(with_metaclass(_CaseInsensitiveEnumMeta, SWITCH_PROTECTION = "SwitchProtection" COMPLETE_MIGRATION = "CompleteMigration" -class ResyncState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResyncState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The resync state. """ @@ -364,7 +362,7 @@ class ResyncState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PREPARED_FOR_RESYNCHRONIZATION = "PreparedForResynchronization" STARTED_RESYNCHRONIZATION = "StartedResynchronization" -class RpInMageRecoveryPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RpInMageRecoveryPointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The recovery point type. """ @@ -372,7 +370,7 @@ class RpInMageRecoveryPointType(with_metaclass(_CaseInsensitiveEnumMeta, str, En LATEST_TAG = "LatestTag" CUSTOM = "Custom" -class SetMultiVmSyncStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SetMultiVmSyncStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A value indicating whether multi-VM sync has to be enabled. Value should be 'Enabled' or 'Disabled'. """ @@ -380,7 +378,7 @@ class SetMultiVmSyncStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ENABLE = "Enable" DISABLE = "Disable" -class Severity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Severity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Severity of error. """ @@ -389,14 +387,14 @@ class Severity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ERROR = "Error" INFO = "Info" -class SourceSiteOperations(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SourceSiteOperations(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """A value indicating whether source site operations are required. """ REQUIRED = "Required" NOT_REQUIRED = "NotRequired" -class SqlServerLicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SqlServerLicenseType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The SQL Server license type. """ @@ -405,7 +403,7 @@ class SqlServerLicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PAYG = "PAYG" AHUB = "AHUB" -class TestMigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class TestMigrationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The test migrate state. """ @@ -415,7 +413,7 @@ class TestMigrationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): TEST_MIGRATION_FAILED = "TestMigrationFailed" TEST_MIGRATION_CLEANUP_IN_PROGRESS = "TestMigrationCleanupInProgress" -class VmEncryptionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class VmEncryptionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The encryption type of the VM. """ @@ -423,7 +421,7 @@ class VmEncryptionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ONE_PASS_ENCRYPTED = "OnePassEncrypted" TWO_PASS_ENCRYPTED = "TwoPassEncrypted" -class VmReplicationProgressHealth(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class VmReplicationProgressHealth(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The initial replication progress health. """ diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/__init__.py index baa6aa965187..09aaae1400a4 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/__init__.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/__init__.py @@ -8,6 +8,7 @@ from ._operations import Operations from ._replication_alert_settings_operations import ReplicationAlertSettingsOperations +from ._replication_appliances_operations import ReplicationAppliancesOperations from ._replication_eligibility_results_operations import ReplicationEligibilityResultsOperations from ._replication_events_operations import ReplicationEventsOperations from ._replication_fabrics_operations import ReplicationFabricsOperations @@ -37,6 +38,7 @@ __all__ = [ 'Operations', 'ReplicationAlertSettingsOperations', + 'ReplicationAppliancesOperations', 'ReplicationEligibilityResultsOperations', 'ReplicationEventsOperations', 'ReplicationFabricsOperations', diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_migration_recovery_points_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_migration_recovery_points_operations.py index 1f0caf914f06..c046be4a8f90 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_migration_recovery_points_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_migration_recovery_points_operations.py @@ -5,23 +5,109 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_migration_items_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "migrationItemName": _SERIALIZER.url("migration_item_name", migration_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + migration_recovery_point_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints/{migrationRecoveryPointName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "migrationItemName": _SERIALIZER.url("migration_item_name", migration_item_name, 'str'), + "migrationRecoveryPointName": _SERIALIZER.url("migration_recovery_point_name", migration_recovery_point_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class MigrationRecoveryPointsOperations(object): """MigrationRecoveryPointsOperations operations. @@ -45,14 +131,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_migration_items( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MigrationRecoveryPointCollection"] + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + **kwargs: Any + ) -> Iterable["_models.MigrationRecoveryPointCollection"]: """Gets the recovery points for a migration item. Gets the recovery points for a migration item. @@ -64,8 +150,10 @@ def list_by_replication_migration_items( :param migration_item_name: Migration item name. :type migration_item_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MigrationRecoveryPointCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.MigrationRecoveryPointCollection] + :return: An iterator like instance of either MigrationRecoveryPointCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.MigrationRecoveryPointCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationRecoveryPointCollection"] @@ -73,39 +161,39 @@ def list_by_replication_migration_items( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_migration_items.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_migration_items_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + template_url=self.list_by_replication_migration_items.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_migration_items_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('MigrationRecoveryPointCollection', pipeline_response) + deserialized = self._deserialize("MigrationRecoveryPointCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -123,20 +211,21 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_replication_migration_items.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - migration_recovery_point_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.MigrationRecoveryPoint" + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + migration_recovery_point_name: str, + **kwargs: Any + ) -> "_models.MigrationRecoveryPoint": """Gets a recovery point for a migration item. Gets a recovery point for a migration item. @@ -159,31 +248,21 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - 'migrationRecoveryPointName': self._serialize.url("migration_recovery_point_name", migration_recovery_point_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + migration_recovery_point_name=migration_recovery_point_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,4 +276,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrationRecoveryPoints/{migrationRecoveryPointName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_operations.py index fcb02725c73a..252c2791005d 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_operations.py @@ -5,23 +5,58 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/operations') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class Operations(object): """Operations operations. @@ -45,18 +80,20 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationsDiscoveryCollection"] + **kwargs: Any + ) -> Iterable["_models.OperationsDiscoveryCollection"]: """Returns the list of available operations. Operation to return the list of available operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationsDiscoveryCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.OperationsDiscoveryCollection] + :return: An iterator like instance of either OperationsDiscoveryCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.OperationsDiscoveryCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsDiscoveryCollection"] @@ -64,35 +101,31 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('OperationsDiscoveryCollection', pipeline_response) + deserialized = self._deserialize("OperationsDiscoveryCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,6 +143,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_recovery_points_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_recovery_points_operations.py index 78d736b589bd..500164234557 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_recovery_points_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_recovery_points_operations.py @@ -5,23 +5,109 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_protected_items_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + recovery_point_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints/{recoveryPointName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + "recoveryPointName": _SERIALIZER.url("recovery_point_name", recovery_point_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class RecoveryPointsOperations(object): """RecoveryPointsOperations operations. @@ -45,14 +131,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_protected_items( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RecoveryPointCollection"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any + ) -> Iterable["_models.RecoveryPointCollection"]: """Gets the list of recovery points for a replication protected item. Lists the available recovery points for a replication protected item. @@ -64,8 +150,10 @@ def list_by_replication_protected_items( :param replicated_protected_item_name: The replication protected item name. :type replicated_protected_item_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RecoveryPointCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointCollection] + :return: An iterator like instance of either RecoveryPointCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPointCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPointCollection"] @@ -73,39 +161,39 @@ def list_by_replication_protected_items( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_protected_items.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protected_items_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=self.list_by_replication_protected_items.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protected_items_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('RecoveryPointCollection', pipeline_response) + deserialized = self._deserialize("RecoveryPointCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -123,20 +211,21 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_replication_protected_items.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - recovery_point_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RecoveryPoint" + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + recovery_point_name: str, + **kwargs: Any + ) -> "_models.RecoveryPoint": """Gets a recovery point. Get the details of specified recovery point. @@ -159,31 +248,21 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - 'recoveryPointName': self._serialize.url("recovery_point_name", recovery_point_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + recovery_point_name=recovery_point_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,4 +276,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/recoveryPoints/{recoveryPointName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_alert_settings_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_alert_settings_operations.py index 2019db6e50a6..5c1230c9c9ad 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_alert_settings_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_alert_settings_operations.py @@ -5,23 +5,144 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + alert_setting_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "alertSettingName": _SERIALIZER.url("alert_setting_name", alert_setting_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + alert_setting_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "alertSettingName": _SERIALIZER.url("alert_setting_name", alert_setting_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ReplicationAlertSettingsOperations(object): """ReplicationAlertSettingsOperations operations. @@ -45,18 +166,19 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AlertCollection"] + **kwargs: Any + ) -> Iterable["_models.AlertCollection"]: """Gets the list of configured email notification(alert) configurations. Gets the list of email notification(alert) configurations for the vault. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AlertCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.AlertCollection] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.AlertCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AlertCollection"] @@ -64,36 +186,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('AlertCollection', pipeline_response) + deserialized = self._deserialize("AlertCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -111,17 +230,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings'} # type: ignore + @distributed_trace def get( self, - alert_setting_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Alert" + alert_setting_name: str, + **kwargs: Any + ) -> "_models.Alert": """Gets an email notification(alert) configuration. Gets the details of the specified email notification(alert) configuration. @@ -138,28 +258,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'alertSettingName': self._serialize.url("alert_setting_name", alert_setting_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + alert_setting_name=alert_setting_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -173,15 +283,17 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}'} # type: ignore + + @distributed_trace def create( self, - alert_setting_name, # type: str - request, # type: "_models.ConfigureAlertRequest" - **kwargs # type: Any - ): - # type: (...) -> "_models.Alert" + alert_setting_name: str, + request: "_models.ConfigureAlertRequest", + **kwargs: Any + ) -> "_models.Alert": """Configures email notifications for this vault. Create or update an email notification(alert) configuration. @@ -200,33 +312,23 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'alertSettingName': self._serialize.url("alert_setting_name", alert_setting_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(request, 'ConfigureAlertRequest') + + request = build_create_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + alert_setting_name=alert_setting_name, + content_type=content_type, + json=_json, + template_url=self.create.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(request, 'ConfigureAlertRequest') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -240,4 +342,6 @@ def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAlertSettings/{alertSettingName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_appliances_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_appliances_operations.py new file mode 100644 index 000000000000..43507e169a8e --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_appliances_operations.py @@ -0,0 +1,162 @@ +# 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. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAppliances') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class ReplicationAppliancesOperations(object): + """ReplicationAppliancesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.recoveryservicessiterecovery.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + filter: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.ApplianceCollection"]: + """Gets the list of appliances. + + Gets the list of Azure Site Recovery appliances for the vault. + + :param filter: OData filter options. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApplianceCollection or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ApplianceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplianceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ApplianceCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationAppliances'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_eligibility_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_eligibility_results_operations.py index e133f0e83691..4eb383da7556 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_eligibility_results_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_eligibility_results_operations.py @@ -5,22 +5,94 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + resource_group_name: str, + subscription_id: str, + virtual_machine_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "virtualMachineName": _SERIALIZER.url("virtual_machine_name", virtual_machine_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_group_name: str, + subscription_id: str, + virtual_machine_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "virtualMachineName": _SERIALIZER.url("virtual_machine_name", virtual_machine_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationEligibilityResultsOperations(object): """ReplicationEligibilityResultsOperations operations. @@ -44,12 +116,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - virtual_machine_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ReplicationEligibilityResultsCollection" + virtual_machine_name: str, + **kwargs: Any + ) -> "_models.ReplicationEligibilityResultsCollection": """Gets the validation errors in case the VM is unsuitable for protection. Validates whether a given VM can be protected or not in which case returns list of errors. @@ -66,27 +138,17 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = build_list_request( + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + virtual_machine_name=virtual_machine_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,14 +162,16 @@ def list( return cls(pipeline_response, deserialized, {}) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults'} # type: ignore + + @distributed_trace def get( self, - virtual_machine_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ReplicationEligibilityResults" + virtual_machine_name: str, + **kwargs: Any + ) -> "_models.ReplicationEligibilityResults": """Gets the validation errors in case the VM is unsuitable for protection. Validates whether a given VM can be protected or not in which case returns list of errors. @@ -124,27 +188,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + virtual_machine_name=virtual_machine_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -158,4 +212,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}/providers/Microsoft.RecoveryServices/replicationEligibilityResults/default'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_events_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_events_operations.py index 18bd5de7871a..6e9a460eac13 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_events_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_events_operations.py @@ -5,23 +5,101 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + event_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents/{eventName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "eventName": _SERIALIZER.url("event_name", event_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationEventsOperations(object): """ReplicationEventsOperations operations. @@ -45,12 +123,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - filter=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EventCollection"] + filter: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.EventCollection"]: """Gets the list of Azure Site Recovery events. Gets the list of Azure Site Recovery events for the vault. @@ -59,7 +137,8 @@ def list( :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EventCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.EventCollection] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.EventCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.EventCollection"] @@ -67,38 +146,35 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('EventCollection', pipeline_response) + deserialized = self._deserialize("EventCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -116,17 +192,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents'} # type: ignore + @distributed_trace def get( self, - event_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Event" + event_name: str, + **kwargs: Any + ) -> "_models.Event": """Get the details of an Azure Site recovery event. The operation to get the details of an Azure Site recovery event. @@ -143,28 +220,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'eventName': self._serialize.url("event_name", event_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + event_name=event_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -178,4 +245,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationEvents/{eventName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_fabrics_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_fabrics_operations.py index 63d4f5712439..e39f932832be 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_fabrics_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_fabrics_operations.py @@ -5,25 +5,372 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_purge_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_check_consistency_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_migrate_to_aad_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_reassociate_gateway_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/remove') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_renew_certificate_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ReplicationFabricsOperations(object): """ReplicationFabricsOperations operations. @@ -47,18 +394,19 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.FabricCollection"] + **kwargs: Any + ) -> Iterable["_models.FabricCollection"]: """Gets the list of ASR fabrics. Gets a list of the Azure Site Recovery fabrics in the vault. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either FabricCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.FabricCollection] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.FabricCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.FabricCollection"] @@ -66,36 +414,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('FabricCollection', pipeline_response) + deserialized = self._deserialize("FabricCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,18 +458,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - filter=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.Fabric" + fabric_name: str, + filter: Optional[str] = None, + **kwargs: Any + ) -> "_models.Fabric": """Gets the details of an ASR fabric. Gets the details of an Azure Site Recovery fabric. @@ -143,30 +489,19 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + filter=filter, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,47 +515,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}'} # type: ignore + def _create_initial( self, - fabric_name, # type: str - input, # type: "_models.FabricCreationInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Fabric"] + fabric_name: str, + input: "_models.FabricCreationInput", + **kwargs: Any + ) -> Optional["_models.Fabric"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Fabric"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'FabricCreationInput') + + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'FabricCreationInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,15 +562,17 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}'} # type: ignore + + @distributed_trace def begin_create( self, - fabric_name, # type: str - input, # type: "_models.FabricCreationInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Fabric"] + fabric_name: str, + input: "_models.FabricCreationInput", + **kwargs: Any + ) -> LROPoller["_models.Fabric"]: """Creates an Azure Site Recovery fabric. The operation to create an Azure Site Recovery fabric (for e.g. Hyper-V site). @@ -255,15 +583,18 @@ def begin_create( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.FabricCreationInput :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. + :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. + :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 Fabric or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Fabric"] lro_delay = kwargs.pop( 'polling_interval', @@ -274,28 +605,21 @@ def begin_create( raw_result = self._create_initial( fabric_name=fabric_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Fabric', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -307,39 +631,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}'} # type: ignore def _purge_initial( self, - fabric_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + fabric_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._purge_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_purge_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self._purge_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -352,12 +668,13 @@ def _purge_initial( _purge_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}'} # type: ignore + + @distributed_trace def begin_purge( self, - fabric_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + fabric_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Purges the site. The operation to purge(force delete) an Azure Site Recovery fabric. @@ -366,15 +683,17 @@ def begin_purge( :type fabric_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -387,22 +706,14 @@ def begin_purge( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -414,41 +725,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}'} # type: ignore def _check_consistency_initial( self, - fabric_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Fabric"] + fabric_name: str, + **kwargs: Any + ) -> Optional["_models.Fabric"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Fabric"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._check_consistency_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_check_consistency_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self._check_consistency_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -464,14 +765,16 @@ def _check_consistency_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _check_consistency_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency'} # type: ignore + + @distributed_trace def begin_check_consistency( self, - fabric_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Fabric"] + fabric_name: str, + **kwargs: Any + ) -> LROPoller["_models.Fabric"]: """Checks the consistency of the ASR fabric. The operation to perform a consistency check on the fabric. @@ -480,15 +783,17 @@ def begin_check_consistency( :type fabric_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. + :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. + :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 Fabric or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Fabric"] lro_delay = kwargs.pop( 'polling_interval', @@ -501,25 +806,17 @@ def begin_check_consistency( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Fabric', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -531,39 +828,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_check_consistency.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/checkConsistency'} # type: ignore def _migrate_to_aad_initial( self, - fabric_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + fabric_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._migrate_to_aad_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_migrate_to_aad_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self._migrate_to_aad_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -576,12 +865,13 @@ def _migrate_to_aad_initial( _migrate_to_aad_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad'} # type: ignore + + @distributed_trace def begin_migrate_to_aad( self, - fabric_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + fabric_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Migrates the site to AAD. The operation to migrate an Azure Site Recovery fabric to AAD. @@ -590,15 +880,17 @@ def begin_migrate_to_aad( :type fabric_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -611,22 +903,14 @@ def begin_migrate_to_aad( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -638,47 +922,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_to_aad.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/migratetoaad'} # type: ignore def _reassociate_gateway_initial( self, - fabric_name, # type: str - failover_process_server_request, # type: "_models.FailoverProcessServerRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Fabric"] + fabric_name: str, + failover_process_server_request: "_models.FailoverProcessServerRequest", + **kwargs: Any + ) -> Optional["_models.Fabric"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Fabric"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reassociate_gateway_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(failover_process_server_request, 'FailoverProcessServerRequest') + + request = build_reassociate_gateway_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + content_type=content_type, + json=_json, + template_url=self._reassociate_gateway_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(failover_process_server_request, 'FailoverProcessServerRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -694,15 +968,17 @@ def _reassociate_gateway_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _reassociate_gateway_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway'} # type: ignore + + @distributed_trace def begin_reassociate_gateway( self, - fabric_name, # type: str - failover_process_server_request, # type: "_models.FailoverProcessServerRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Fabric"] + fabric_name: str, + failover_process_server_request: "_models.FailoverProcessServerRequest", + **kwargs: Any + ) -> LROPoller["_models.Fabric"]: """Perform failover of the process server. The operation to move replications from a process server to another process server. @@ -710,18 +986,22 @@ def begin_reassociate_gateway( :param fabric_name: The name of the fabric containing the process server. :type fabric_name: str :param failover_process_server_request: The input to the failover process server operation. - :type failover_process_server_request: ~azure.mgmt.recoveryservicessiterecovery.models.FailoverProcessServerRequest + :type failover_process_server_request: + ~azure.mgmt.recoveryservicessiterecovery.models.FailoverProcessServerRequest :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. + :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. + :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 Fabric or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Fabric"] lro_delay = kwargs.pop( 'polling_interval', @@ -732,28 +1012,21 @@ def begin_reassociate_gateway( raw_result = self._reassociate_gateway_initial( fabric_name=fabric_name, failover_process_server_request=failover_process_server_request, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Fabric', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -765,39 +1038,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reassociate_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/reassociateGateway'} # type: ignore def _delete_initial( self, - fabric_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + fabric_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -810,12 +1075,13 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/remove'} # type: ignore + + @distributed_trace def begin_delete( self, - fabric_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + fabric_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes the site. The operation to delete or remove an Azure Site Recovery fabric. @@ -824,15 +1090,17 @@ def begin_delete( :type fabric_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -845,22 +1113,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -872,47 +1132,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/remove'} # type: ignore def _renew_certificate_initial( self, - fabric_name, # type: str - renew_certificate, # type: "_models.RenewCertificateInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Fabric"] + fabric_name: str, + renew_certificate: "_models.RenewCertificateInput", + **kwargs: Any + ) -> Optional["_models.Fabric"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Fabric"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._renew_certificate_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(renew_certificate, 'RenewCertificateInput') + + request = build_renew_certificate_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + content_type=content_type, + json=_json, + template_url=self._renew_certificate_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(renew_certificate, 'RenewCertificateInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -928,15 +1178,17 @@ def _renew_certificate_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _renew_certificate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate'} # type: ignore + + @distributed_trace def begin_renew_certificate( self, - fabric_name, # type: str - renew_certificate, # type: "_models.RenewCertificateInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Fabric"] + fabric_name: str, + renew_certificate: "_models.RenewCertificateInput", + **kwargs: Any + ) -> LROPoller["_models.Fabric"]: """Renews certificate for the fabric. Renews the connection certificate for the ASR replication fabric. @@ -947,15 +1199,18 @@ def begin_renew_certificate( :type renew_certificate: ~azure.mgmt.recoveryservicessiterecovery.models.RenewCertificateInput :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. + :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. + :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 Fabric or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Fabric] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Fabric"] lro_delay = kwargs.pop( 'polling_interval', @@ -966,28 +1221,21 @@ def begin_renew_certificate( raw_result = self._renew_certificate_initial( fabric_name=fabric_name, renew_certificate=renew_certificate, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Fabric', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -999,4 +1247,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_renew_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/renewCertificate'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_jobs_operations.py index c693bf8e175b..2eba24198b84 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_jobs_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_jobs_operations.py @@ -5,25 +5,268 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_cancel_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/cancel') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_restart_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + job_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/restart') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_resume_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + job_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/resume') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "jobName": _SERIALIZER.url("job_name", job_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_export_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/export') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ReplicationJobsOperations(object): """ReplicationJobsOperations operations. @@ -47,12 +290,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - filter=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobCollection"] + filter: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.JobCollection"]: """Gets the list of jobs. Gets the list of Azure Site Recovery Jobs for the vault. @@ -61,7 +304,8 @@ def list( :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either JobCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.JobCollection] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.JobCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.JobCollection"] @@ -69,38 +313,35 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('JobCollection', pipeline_response) + deserialized = self._deserialize("JobCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -118,17 +359,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs'} # type: ignore + @distributed_trace def get( self, - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Job" + job_name: str, + **kwargs: Any + ) -> "_models.Job": """Gets the job details. Get the details of an Azure Site Recovery job. @@ -145,28 +387,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + job_name=job_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,41 +412,32 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}'} # type: ignore + def _cancel_initial( self, - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Job"] + job_name: str, + **kwargs: Any + ) -> Optional["_models.Job"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Job"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._cancel_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_cancel_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + job_name=job_name, + template_url=self._cancel_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -230,14 +453,16 @@ def _cancel_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/cancel'} # type: ignore + + @distributed_trace def begin_cancel( self, - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Job"] + job_name: str, + **kwargs: Any + ) -> LROPoller["_models.Job"]: """Cancels the specified job. The operation to cancel an Azure Site Recovery job. @@ -246,15 +471,17 @@ def begin_cancel( :type job_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. + :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. + :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 Job or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Job] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] lro_delay = kwargs.pop( 'polling_interval', @@ -267,25 +494,17 @@ def begin_cancel( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Job', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -297,41 +516,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/cancel'} # type: ignore def _restart_initial( self, - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Job"] + job_name: str, + **kwargs: Any + ) -> Optional["_models.Job"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Job"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._restart_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_restart_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + job_name=job_name, + template_url=self._restart_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -347,14 +556,16 @@ def _restart_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _restart_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/restart'} # type: ignore + + @distributed_trace def begin_restart( self, - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Job"] + job_name: str, + **kwargs: Any + ) -> LROPoller["_models.Job"]: """Restarts the specified job. The operation to restart an Azure Site Recovery job. @@ -363,15 +574,17 @@ def begin_restart( :type job_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. + :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. + :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 Job or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Job] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] lro_delay = kwargs.pop( 'polling_interval', @@ -384,25 +597,17 @@ def begin_restart( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Job', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -414,47 +619,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/restart'} # type: ignore def _resume_initial( self, - job_name, # type: str - resume_job_params, # type: "_models.ResumeJobParams" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Job"] + job_name: str, + resume_job_params: "_models.ResumeJobParams", + **kwargs: Any + ) -> Optional["_models.Job"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Job"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._resume_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(resume_job_params, 'ResumeJobParams') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_resume_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + job_name=job_name, + content_type=content_type, + json=_json, + template_url=self._resume_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(resume_job_params, 'ResumeJobParams') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -470,15 +665,17 @@ def _resume_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _resume_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/resume'} # type: ignore + + @distributed_trace def begin_resume( self, - job_name, # type: str - resume_job_params, # type: "_models.ResumeJobParams" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Job"] + job_name: str, + resume_job_params: "_models.ResumeJobParams", + **kwargs: Any + ) -> LROPoller["_models.Job"]: """Resumes the specified job. The operation to resume an Azure Site Recovery job. @@ -489,15 +686,18 @@ def begin_resume( :type resume_job_params: ~azure.mgmt.recoveryservicessiterecovery.models.ResumeJobParams :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. + :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. + :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 Job or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Job] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] lro_delay = kwargs.pop( 'polling_interval', @@ -508,28 +708,21 @@ def begin_resume( raw_result = self._resume_initial( job_name=job_name, resume_job_params=resume_job_params, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Job', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -541,45 +734,35 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/{jobName}/resume'} # type: ignore def _export_initial( self, - job_query_parameter, # type: "_models.JobQueryParameter" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Job"] + job_query_parameter: "_models.JobQueryParameter", + **kwargs: Any + ) -> Optional["_models.Job"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Job"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._export_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(job_query_parameter, 'JobQueryParameter') + + request = build_export_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._export_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(job_query_parameter, 'JobQueryParameter') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -595,14 +778,16 @@ def _export_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _export_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/export'} # type: ignore + + @distributed_trace def begin_export( self, - job_query_parameter, # type: "_models.JobQueryParameter" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Job"] + job_query_parameter: "_models.JobQueryParameter", + **kwargs: Any + ) -> LROPoller["_models.Job"]: """Exports the details of the Azure Site Recovery jobs of the vault. The operation to export the details of the Azure Site Recovery jobs of the vault. @@ -611,15 +796,18 @@ def begin_export( :type job_query_parameter: ~azure.mgmt.recoveryservicessiterecovery.models.JobQueryParameter :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. + :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. + :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 Job or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Job] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] lro_delay = kwargs.pop( 'polling_interval', @@ -629,27 +817,21 @@ def begin_export( if cont_token is None: raw_result = self._export_initial( job_query_parameter=job_query_parameter, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Job', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -661,4 +843,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_export.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationJobs/export'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_logical_networks_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_logical_networks_operations.py index ea40311d1381..bf50405b051b 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_logical_networks_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_logical_networks_operations.py @@ -5,23 +5,101 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_fabrics_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + logical_network_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks/{logicalNetworkName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "logicalNetworkName": _SERIALIZER.url("logical_network_name", logical_network_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationLogicalNetworksOperations(object): """ReplicationLogicalNetworksOperations operations. @@ -45,12 +123,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_fabrics( self, - fabric_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LogicalNetworkCollection"] + fabric_name: str, + **kwargs: Any + ) -> Iterable["_models.LogicalNetworkCollection"]: """Gets the list of logical networks under a fabric. Lists all the logical networks of the Azure Site Recovery fabric. @@ -58,8 +136,10 @@ def list_by_replication_fabrics( :param fabric_name: Server Id. :type fabric_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LogicalNetworkCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.LogicalNetworkCollection] + :return: An iterator like instance of either LogicalNetworkCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.LogicalNetworkCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.LogicalNetworkCollection"] @@ -67,37 +147,35 @@ def list_by_replication_fabrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_fabrics.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self.list_by_replication_fabrics.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('LogicalNetworkCollection', pipeline_response) + deserialized = self._deserialize("LogicalNetworkCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,18 +193,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_replication_fabrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - logical_network_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.LogicalNetwork" + fabric_name: str, + logical_network_name: str, + **kwargs: Any + ) -> "_models.LogicalNetwork": """Gets a logical network with specified server id and logical network name. Gets the details of a logical network. @@ -145,29 +224,19 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'logicalNetworkName': self._serialize.url("logical_network_name", logical_network_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + logical_network_name=logical_network_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -181,4 +250,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationLogicalNetworks/{logicalNetworkName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_migration_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_migration_items_operations.py index 0cda240e18c6..6425b2da925b 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_migration_items_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_migration_items_operations.py @@ -5,25 +5,502 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_protection_containers_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + *, + skip_token: Optional[str] = None, + take_token: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + if take_token is not None: + query_parameters['takeToken'] = _SERIALIZER.query("take_token", take_token, 'str') + if filter is not None: + query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "migrationItemName": _SERIALIZER.url("migration_item_name", migration_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "migrationItemName": _SERIALIZER.url("migration_item_name", migration_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + *, + delete_option: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "migrationItemName": _SERIALIZER.url("migration_item_name", migration_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if delete_option is not None: + query_parameters['deleteOption'] = _SERIALIZER.query("delete_option", delete_option, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_update_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "migrationItemName": _SERIALIZER.url("migration_item_name", migration_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_migrate_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "migrationItemName": _SERIALIZER.url("migration_item_name", migration_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_resync_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "migrationItemName": _SERIALIZER.url("migration_item_name", migration_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_test_migrate_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "migrationItemName": _SERIALIZER.url("migration_item_name", migration_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_test_migrate_cleanup_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "migrationItemName": _SERIALIZER.url("migration_item_name", migration_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + *, + skip_token: Optional[str] = None, + take_token: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationMigrationItems') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + if take_token is not None: + query_parameters['takeToken'] = _SERIALIZER.query("take_token", take_token, 'str') + if filter is not None: + query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationMigrationItemsOperations(object): """ReplicationMigrationItemsOperations operations. @@ -47,16 +524,16 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_protection_containers( self, - fabric_name, # type: str - protection_container_name, # type: str - skip_token=None, # type: Optional[str] - take_token=None, # type: Optional[str] - filter=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MigrationItemCollection"] + fabric_name: str, + protection_container_name: str, + skip_token: Optional[str] = None, + take_token: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.MigrationItemCollection"]: """Gets the list of migration items in the protection container. Gets the list of ASR migration items in the protection container. @@ -72,8 +549,10 @@ def list_by_replication_protection_containers( :param filter: OData filter options. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MigrationItemCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItemCollection] + :return: An iterator like instance of either MigrationItemCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItemCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItemCollection"] @@ -81,44 +560,43 @@ def list_by_replication_protection_containers( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_protection_containers.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - if take_token is not None: - query_parameters['takeToken'] = self._serialize.query("take_token", take_token, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + skip_token=skip_token, + take_token=take_token, + filter=filter, + template_url=self.list_by_replication_protection_containers.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + skip_token=skip_token, + take_token=take_token, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('MigrationItemCollection', pipeline_response) + deserialized = self._deserialize("MigrationItemCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -136,19 +614,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_replication_protection_containers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.MigrationItem" + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + **kwargs: Any + ) -> "_models.MigrationItem": """Gets the details of a migration item. Gets the details of a migration item. @@ -169,30 +648,20 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -206,51 +675,42 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'} # type: ignore + def _create_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - input, # type: "_models.EnableMigrationInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.MigrationItem"] + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + input: "_models.EnableMigrationInput", + **kwargs: Any + ) -> Optional["_models.MigrationItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MigrationItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'EnableMigrationInput') + + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'EnableMigrationInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -266,17 +726,19 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'} # type: ignore + + @distributed_trace def begin_create( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - input, # type: "_models.EnableMigrationInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.MigrationItem"] + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + input: "_models.EnableMigrationInput", + **kwargs: Any + ) -> LROPoller["_models.MigrationItem"]: """Enables migration. The operation to create an ASR migration item (enable migration). @@ -291,15 +753,20 @@ def begin_create( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.EnableMigrationInput :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. + :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 MigrationItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 MigrationItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -312,30 +779,21 @@ def begin_create( protection_container_name=protection_container_name, migration_item_name=migration_item_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('MigrationItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -347,46 +805,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'} # type: ignore def _delete_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - delete_option=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + delete_option: Optional[str] = None, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if delete_option is not None: - query_parameters['deleteOption'] = self._serialize.query("delete_option", delete_option, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + delete_option=delete_option, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -399,15 +848,16 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'} # type: ignore + + @distributed_trace def begin_delete( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - delete_option=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + delete_option: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[None]: """Delete the migration item. The operation to delete an ASR migration item. @@ -422,15 +872,17 @@ def begin_delete( :type delete_option: 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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -446,24 +898,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -475,51 +917,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'} # type: ignore def _update_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - input, # type: "_models.UpdateMigrationItemInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.MigrationItem"] + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + input: "_models.UpdateMigrationItemInput", + **kwargs: Any + ) -> Optional["_models.MigrationItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MigrationItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'UpdateMigrationItemInput') + + request = build_update_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'UpdateMigrationItemInput') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -535,17 +967,19 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'} # type: ignore + + @distributed_trace def begin_update( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - input, # type: "_models.UpdateMigrationItemInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.MigrationItem"] + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + input: "_models.UpdateMigrationItemInput", + **kwargs: Any + ) -> LROPoller["_models.MigrationItem"]: """Updates migration item. The operation to update the recovery settings of an ASR migration item. @@ -560,15 +994,20 @@ def begin_update( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMigrationItemInput :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. + :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 MigrationItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 MigrationItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -581,30 +1020,21 @@ def begin_update( protection_container_name=protection_container_name, migration_item_name=migration_item_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('MigrationItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -616,51 +1046,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}'} # type: ignore def _migrate_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - migrate_input, # type: "_models.MigrateInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.MigrationItem"] + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + migrate_input: "_models.MigrateInput", + **kwargs: Any + ) -> Optional["_models.MigrationItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MigrationItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._migrate_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(migrate_input, 'MigrateInput') + + request = build_migrate_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + content_type=content_type, + json=_json, + template_url=self._migrate_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(migrate_input, 'MigrateInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -676,17 +1096,19 @@ def _migrate_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _migrate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate'} # type: ignore + + @distributed_trace def begin_migrate( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - migrate_input, # type: "_models.MigrateInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.MigrationItem"] + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + migrate_input: "_models.MigrateInput", + **kwargs: Any + ) -> LROPoller["_models.MigrationItem"]: """Migrate item. The operation to initiate migration of the item. @@ -701,15 +1123,20 @@ def begin_migrate( :type migrate_input: ~azure.mgmt.recoveryservicessiterecovery.models.MigrateInput :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. + :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 MigrationItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 MigrationItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -722,30 +1149,21 @@ def begin_migrate( protection_container_name=protection_container_name, migration_item_name=migration_item_name, migrate_input=migrate_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('MigrationItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -757,51 +1175,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/migrate'} # type: ignore def _resync_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - input, # type: "_models.ResyncInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.MigrationItem"] + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + input: "_models.ResyncInput", + **kwargs: Any + ) -> Optional["_models.MigrationItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MigrationItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._resync_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'ResyncInput') + + request = build_resync_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + content_type=content_type, + json=_json, + template_url=self._resync_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'ResyncInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -817,17 +1225,19 @@ def _resync_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _resync_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync'} # type: ignore + + @distributed_trace def begin_resync( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - input, # type: "_models.ResyncInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.MigrationItem"] + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + input: "_models.ResyncInput", + **kwargs: Any + ) -> LROPoller["_models.MigrationItem"]: """Resynchronizes replication. The operation to resynchronize replication of an ASR migration item. @@ -842,15 +1252,20 @@ def begin_resync( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.ResyncInput :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. + :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 MigrationItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 MigrationItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -863,30 +1278,21 @@ def begin_resync( protection_container_name=protection_container_name, migration_item_name=migration_item_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('MigrationItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -898,51 +1304,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_resync.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/resync'} # type: ignore def _test_migrate_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - test_migrate_input, # type: "_models.TestMigrateInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.MigrationItem"] + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + test_migrate_input: "_models.TestMigrateInput", + **kwargs: Any + ) -> Optional["_models.MigrationItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MigrationItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._test_migrate_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(test_migrate_input, 'TestMigrateInput') + + request = build_test_migrate_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + content_type=content_type, + json=_json, + template_url=self._test_migrate_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(test_migrate_input, 'TestMigrateInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -958,17 +1354,19 @@ def _test_migrate_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _test_migrate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate'} # type: ignore + + @distributed_trace def begin_test_migrate( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - test_migrate_input, # type: "_models.TestMigrateInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.MigrationItem"] + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + test_migrate_input: "_models.TestMigrateInput", + **kwargs: Any + ) -> LROPoller["_models.MigrationItem"]: """Test migrate item. The operation to initiate test migration of the item. @@ -983,15 +1381,20 @@ def begin_test_migrate( :type test_migrate_input: ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateInput :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. + :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 MigrationItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 MigrationItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1004,30 +1407,21 @@ def begin_test_migrate( protection_container_name=protection_container_name, migration_item_name=migration_item_name, test_migrate_input=test_migrate_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('MigrationItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1039,51 +1433,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_test_migrate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrate'} # type: ignore def _test_migrate_cleanup_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - test_migrate_cleanup_input, # type: "_models.TestMigrateCleanupInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.MigrationItem"] + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + test_migrate_cleanup_input: "_models.TestMigrateCleanupInput", + **kwargs: Any + ) -> Optional["_models.MigrationItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.MigrationItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._test_migrate_cleanup_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(test_migrate_cleanup_input, 'TestMigrateCleanupInput') + + request = build_test_migrate_cleanup_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + migration_item_name=migration_item_name, + content_type=content_type, + json=_json, + template_url=self._test_migrate_cleanup_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(test_migrate_cleanup_input, 'TestMigrateCleanupInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1099,17 +1483,19 @@ def _test_migrate_cleanup_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _test_migrate_cleanup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup'} # type: ignore + + @distributed_trace def begin_test_migrate_cleanup( self, - fabric_name, # type: str - protection_container_name, # type: str - migration_item_name, # type: str - test_migrate_cleanup_input, # type: "_models.TestMigrateCleanupInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.MigrationItem"] + fabric_name: str, + protection_container_name: str, + migration_item_name: str, + test_migrate_cleanup_input: "_models.TestMigrateCleanupInput", + **kwargs: Any + ) -> LROPoller["_models.MigrationItem"]: """Test migrate cleanup. The operation to initiate test migrate cleanup. @@ -1121,18 +1507,24 @@ def begin_test_migrate_cleanup( :param migration_item_name: Migration item name. :type migration_item_name: str :param test_migrate_cleanup_input: Test migrate cleanup input. - :type test_migrate_cleanup_input: ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateCleanupInput + :type test_migrate_cleanup_input: + ~azure.mgmt.recoveryservicessiterecovery.models.TestMigrateCleanupInput :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. + :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 MigrationItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 MigrationItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1145,30 +1537,21 @@ def begin_test_migrate_cleanup( protection_container_name=protection_container_name, migration_item_name=migration_item_name, test_migrate_cleanup_input=test_migrate_cleanup_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('MigrationItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'migrationItemName': self._serialize.url("migration_item_name", migration_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1180,16 +1563,17 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_test_migrate_cleanup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationMigrationItems/{migrationItemName}/testMigrateCleanup'} # type: ignore + @distributed_trace def list( self, - skip_token=None, # type: Optional[str] - take_token=None, # type: Optional[str] - filter=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.MigrationItemCollection"] + skip_token: Optional[str] = None, + take_token: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.MigrationItemCollection"]: """Gets the list of migration items in the vault. Gets the list of migration items in the vault. @@ -1201,8 +1585,10 @@ def list( :param filter: OData filter options. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either MigrationItemCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItemCollection] + :return: An iterator like instance of either MigrationItemCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.MigrationItemCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.MigrationItemCollection"] @@ -1210,42 +1596,39 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - if take_token is not None: - query_parameters['takeToken'] = self._serialize.query("take_token", take_token, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + take_token=take_token, + filter=filter, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + take_token=take_token, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('MigrationItemCollection', pipeline_response) + deserialized = self._deserialize("MigrationItemCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -1263,6 +1646,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_network_mappings_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_network_mappings_operations.py index b1eb41ba95cc..1776f315baaa 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_network_mappings_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_network_mappings_operations.py @@ -5,25 +5,278 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_networks_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + network_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "networkName": _SERIALIZER.url("network_name", network_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + network_name: str, + network_mapping_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "networkName": _SERIALIZER.url("network_name", network_name, 'str'), + "networkMappingName": _SERIALIZER.url("network_mapping_name", network_mapping_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + network_name: str, + network_mapping_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "networkName": _SERIALIZER.url("network_name", network_name, 'str'), + "networkMappingName": _SERIALIZER.url("network_mapping_name", network_mapping_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + network_name: str, + network_mapping_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "networkName": _SERIALIZER.url("network_name", network_name, 'str'), + "networkMappingName": _SERIALIZER.url("network_mapping_name", network_mapping_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_update_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + network_name: str, + network_mapping_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "networkName": _SERIALIZER.url("network_name", network_name, 'str'), + "networkMappingName": _SERIALIZER.url("network_mapping_name", network_mapping_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworkMappings') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationNetworkMappingsOperations(object): """ReplicationNetworkMappingsOperations operations. @@ -47,13 +300,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_networks( self, - fabric_name, # type: str - network_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkMappingCollection"] + fabric_name: str, + network_name: str, + **kwargs: Any + ) -> Iterable["_models.NetworkMappingCollection"]: """Gets all the network mappings under a network. Lists all ASR network mappings for the specified network. @@ -63,8 +316,10 @@ def list_by_replication_networks( :param network_name: Primary network name. :type network_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkMappingCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingCollection] + :return: An iterator like instance of either NetworkMappingCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkMappingCollection"] @@ -72,38 +327,37 @@ def list_by_replication_networks( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_networks.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_networks_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + network_name=network_name, + template_url=self.list_by_replication_networks.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_networks_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + network_name=network_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkMappingCollection', pipeline_response) + deserialized = self._deserialize("NetworkMappingCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -121,19 +375,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_replication_networks.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - network_name, # type: str - network_mapping_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkMapping" + fabric_name: str, + network_name: str, + network_mapping_name: str, + **kwargs: Any + ) -> "_models.NetworkMapping": """Gets network mapping by name. Gets the details of an ASR network mapping. @@ -154,30 +409,20 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - 'networkMappingName': self._serialize.url("network_mapping_name", network_mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + network_name=network_name, + network_mapping_name=network_mapping_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -191,51 +436,42 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}'} # type: ignore + def _create_initial( self, - fabric_name, # type: str - network_name, # type: str - network_mapping_name, # type: str - input, # type: "_models.CreateNetworkMappingInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.NetworkMapping"] + fabric_name: str, + network_name: str, + network_mapping_name: str, + input: "_models.CreateNetworkMappingInput", + **kwargs: Any + ) -> Optional["_models.NetworkMapping"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkMapping"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - 'networkMappingName': self._serialize.url("network_mapping_name", network_mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'CreateNetworkMappingInput') + + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + network_name=network_name, + network_mapping_name=network_mapping_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'CreateNetworkMappingInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,17 +487,19 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}'} # type: ignore + + @distributed_trace def begin_create( self, - fabric_name, # type: str - network_name, # type: str - network_mapping_name, # type: str - input, # type: "_models.CreateNetworkMappingInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NetworkMapping"] + fabric_name: str, + network_name: str, + network_mapping_name: str, + input: "_models.CreateNetworkMappingInput", + **kwargs: Any + ) -> LROPoller["_models.NetworkMapping"]: """Creates network mapping. The operation to create an ASR network mapping. @@ -276,15 +514,20 @@ def begin_create( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.CreateNetworkMappingInput :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. + :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 NetworkMapping or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMapping] - :raises ~azure.core.exceptions.HttpResponseError: + :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 NetworkMapping or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMapping] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkMapping"] lro_delay = kwargs.pop( 'polling_interval', @@ -297,30 +540,21 @@ def begin_create( network_name=network_name, network_mapping_name=network_mapping_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('NetworkMapping', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - 'networkMappingName': self._serialize.url("network_mapping_name", network_mapping_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -332,43 +566,35 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}'} # type: ignore def _delete_initial( self, - fabric_name, # type: str - network_name, # type: str - network_mapping_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + fabric_name: str, + network_name: str, + network_mapping_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - 'networkMappingName': self._serialize.url("network_mapping_name", network_mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + network_name=network_name, + network_mapping_name=network_mapping_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -381,14 +607,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}'} # type: ignore + + @distributed_trace def begin_delete( self, - fabric_name, # type: str - network_name, # type: str - network_mapping_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + fabric_name: str, + network_name: str, + network_mapping_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Delete network mapping. The operation to delete a network mapping. @@ -401,15 +628,17 @@ def begin_delete( :type network_mapping_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -424,24 +653,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - 'networkMappingName': self._serialize.url("network_mapping_name", network_mapping_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -453,51 +672,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}'} # type: ignore def _update_initial( self, - fabric_name, # type: str - network_name, # type: str - network_mapping_name, # type: str - input, # type: "_models.UpdateNetworkMappingInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.NetworkMapping"] + fabric_name: str, + network_name: str, + network_mapping_name: str, + input: "_models.UpdateNetworkMappingInput", + **kwargs: Any + ) -> Optional["_models.NetworkMapping"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkMapping"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - 'networkMappingName': self._serialize.url("network_mapping_name", network_mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'UpdateNetworkMappingInput') + + request = build_update_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + network_name=network_name, + network_mapping_name=network_mapping_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'UpdateNetworkMappingInput') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -513,17 +722,19 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}'} # type: ignore + + @distributed_trace def begin_update( self, - fabric_name, # type: str - network_name, # type: str - network_mapping_name, # type: str - input, # type: "_models.UpdateNetworkMappingInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NetworkMapping"] + fabric_name: str, + network_name: str, + network_mapping_name: str, + input: "_models.UpdateNetworkMappingInput", + **kwargs: Any + ) -> LROPoller["_models.NetworkMapping"]: """Updates network mapping. The operation to update an ASR network mapping. @@ -538,15 +749,20 @@ def begin_update( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateNetworkMappingInput :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. + :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 NetworkMapping or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMapping] - :raises ~azure.core.exceptions.HttpResponseError: + :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 NetworkMapping or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMapping] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkMapping"] lro_delay = kwargs.pop( 'polling_interval', @@ -559,30 +775,21 @@ def begin_update( network_name=network_name, network_mapping_name=network_mapping_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('NetworkMapping', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - 'networkMappingName': self._serialize.url("network_mapping_name", network_mapping_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -594,20 +801,23 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}/replicationNetworkMappings/{networkMappingName}'} # type: ignore + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkMappingCollection"] + **kwargs: Any + ) -> Iterable["_models.NetworkMappingCollection"]: """Gets all the network mappings under a vault. Lists all ASR network mappings in the vault. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkMappingCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingCollection] + :return: An iterator like instance of either NetworkMappingCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkMappingCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkMappingCollection"] @@ -615,36 +825,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkMappingCollection', pipeline_response) + deserialized = self._deserialize("NetworkMappingCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -662,6 +869,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_networks_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_networks_operations.py index 4bcde4baf9b1..55a9586859b0 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_networks_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_networks_operations.py @@ -5,23 +5,136 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_fabrics_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + network_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "networkName": _SERIALIZER.url("network_name", network_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationNetworks') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationNetworksOperations(object): """ReplicationNetworksOperations operations. @@ -45,12 +158,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_fabrics( self, - fabric_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkCollection"] + fabric_name: str, + **kwargs: Any + ) -> Iterable["_models.NetworkCollection"]: """Gets the list of networks under a fabric. Lists the networks available for a fabric. @@ -59,7 +172,8 @@ def list_by_replication_fabrics( :type fabric_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either NetworkCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkCollection] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkCollection"] @@ -67,37 +181,35 @@ def list_by_replication_fabrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_fabrics.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self.list_by_replication_fabrics.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkCollection', pipeline_response) + deserialized = self._deserialize("NetworkCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,18 +227,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_replication_fabrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - network_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Network" + fabric_name: str, + network_name: str, + **kwargs: Any + ) -> "_models.Network": """Gets a network with specified server id and network name. Gets the details of a network. @@ -145,29 +258,19 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'networkName': self._serialize.url("network_name", network_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + network_name=network_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -181,20 +284,23 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationNetworks/{networkName}'} # type: ignore + + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkCollection"] + **kwargs: Any + ) -> Iterable["_models.NetworkCollection"]: """Gets the list of networks. View-only API. Lists the networks available in a vault. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either NetworkCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkCollection] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.NetworkCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkCollection"] @@ -202,36 +308,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkCollection', pipeline_response) + deserialized = self._deserialize("NetworkCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -249,6 +352,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_policies_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_policies_operations.py index 5e8c4df515f8..ea9829287732 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_policies_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_policies_operations.py @@ -5,25 +5,223 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + policy_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "policyName": _SERIALIZER.url("policy_name", policy_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + policy_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "policyName": _SERIALIZER.url("policy_name", policy_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + policy_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "policyName": _SERIALIZER.url("policy_name", policy_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_update_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + policy_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "policyName": _SERIALIZER.url("policy_name", policy_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ReplicationPoliciesOperations(object): """ReplicationPoliciesOperations operations. @@ -47,18 +245,19 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PolicyCollection"] + **kwargs: Any + ) -> Iterable["_models.PolicyCollection"]: """Gets the list of replication policies. Lists the replication policies for a vault. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PolicyCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.PolicyCollection] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.PolicyCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyCollection"] @@ -66,36 +265,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('PolicyCollection', pipeline_response) + deserialized = self._deserialize("PolicyCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,17 +309,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies'} # type: ignore + @distributed_trace def get( self, - policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Policy" + policy_name: str, + **kwargs: Any + ) -> "_models.Policy": """Gets the requested policy. Gets the details of a replication policy. @@ -140,28 +337,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'policyName': self._serialize.url("policy_name", policy_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + policy_name=policy_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -175,47 +362,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}'} # type: ignore + def _create_initial( self, - policy_name, # type: str - input, # type: "_models.CreatePolicyInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Policy"] + policy_name: str, + input: "_models.CreatePolicyInput", + **kwargs: Any + ) -> Optional["_models.Policy"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Policy"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'policyName': self._serialize.url("policy_name", policy_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(input, 'CreatePolicyInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + policy_name=policy_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'CreatePolicyInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -231,15 +409,17 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}'} # type: ignore + + @distributed_trace def begin_create( self, - policy_name, # type: str - input, # type: "_models.CreatePolicyInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Policy"] + policy_name: str, + input: "_models.CreatePolicyInput", + **kwargs: Any + ) -> LROPoller["_models.Policy"]: """Creates the policy. The operation to create a replication policy. @@ -250,15 +430,18 @@ def begin_create( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.CreatePolicyInput :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. + :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. + :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 Policy or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Policy] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Policy"] lro_delay = kwargs.pop( 'polling_interval', @@ -269,28 +452,21 @@ def begin_create( raw_result = self._create_initial( policy_name=policy_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Policy', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'policyName': self._serialize.url("policy_name", policy_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -302,39 +478,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}'} # type: ignore def _delete_initial( self, - policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + policy_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'policyName': self._serialize.url("policy_name", policy_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + policy_name=policy_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -347,12 +515,13 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}'} # type: ignore + + @distributed_trace def begin_delete( self, - policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + policy_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Delete the policy. The operation to delete a replication policy. @@ -361,15 +530,17 @@ def begin_delete( :type policy_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -382,22 +553,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'policyName': self._serialize.url("policy_name", policy_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -409,47 +572,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}'} # type: ignore def _update_initial( self, - policy_name, # type: str - input, # type: "_models.UpdatePolicyInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Policy"] + policy_name: str, + input: "_models.UpdatePolicyInput", + **kwargs: Any + ) -> Optional["_models.Policy"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Policy"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'policyName': self._serialize.url("policy_name", policy_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'UpdatePolicyInput') + + request = build_update_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + policy_name=policy_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'UpdatePolicyInput') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -465,15 +618,17 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}'} # type: ignore + + @distributed_trace def begin_update( self, - policy_name, # type: str - input, # type: "_models.UpdatePolicyInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Policy"] + policy_name: str, + input: "_models.UpdatePolicyInput", + **kwargs: Any + ) -> LROPoller["_models.Policy"]: """Updates the policy. The operation to update a replication policy. @@ -484,15 +639,18 @@ def begin_update( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.UpdatePolicyInput :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. + :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. + :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 Policy or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.Policy] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.Policy"] lro_delay = kwargs.pop( 'polling_interval', @@ -503,28 +661,21 @@ def begin_update( raw_result = self._update_initial( policy_name=policy_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('Policy', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'policyName': self._serialize.url("policy_name", policy_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -536,4 +687,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationPolicies/{policyName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protectable_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protectable_items_operations.py index df2a3b109109..987dfd11831f 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protectable_items_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protectable_items_operations.py @@ -5,23 +5,115 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_protection_containers_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + *, + filter: Optional[str] = None, + take: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + if take is not None: + query_parameters['$take'] = _SERIALIZER.query("take", take, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + protectable_item_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems/{protectableItemName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "protectableItemName": _SERIALIZER.url("protectable_item_name", protectable_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationProtectableItemsOperations(object): """ReplicationProtectableItemsOperations operations. @@ -45,16 +137,16 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_protection_containers( self, - fabric_name, # type: str - protection_container_name, # type: str - filter=None, # type: Optional[str] - take=None, # type: Optional[str] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ProtectableItemCollection"] + fabric_name: str, + protection_container_name: str, + filter: Optional[str] = None, + take: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.ProtectableItemCollection"]: """Gets the list of protectable items. Lists the protectable items in a protection container. @@ -70,8 +162,10 @@ def list_by_replication_protection_containers( :param skip_token: skipToken OData query parameter. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProtectableItemCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectableItemCollection] + :return: An iterator like instance of either ProtectableItemCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectableItemCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectableItemCollection"] @@ -79,44 +173,43 @@ def list_by_replication_protection_containers( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_protection_containers.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if take is not None: - query_parameters['$take'] = self._serialize.query("take", take, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + filter=filter, + take=take, + skip_token=skip_token, + template_url=self.list_by_replication_protection_containers.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + filter=filter, + take=take, + skip_token=skip_token, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ProtectableItemCollection', pipeline_response) + deserialized = self._deserialize("ProtectableItemCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -134,19 +227,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_replication_protection_containers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - protection_container_name, # type: str - protectable_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ProtectableItem" + fabric_name: str, + protection_container_name: str, + protectable_item_name: str, + **kwargs: Any + ) -> "_models.ProtectableItem": """Gets the details of a protectable item. The operation to get the details of a protectable item. @@ -167,30 +261,20 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'protectableItemName': self._serialize.url("protectable_item_name", protectable_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + protectable_item_name=protectable_item_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -204,4 +288,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectableItems/{protectableItemName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protected_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protected_items_operations.py index 79533a7f16d9..14e85acfbcab 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protected_items_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protected_items_operations.py @@ -5,25 +5,1056 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_protection_containers_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_purge_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_update_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_add_disks_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_apply_recovery_point_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_failover_cancel_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_failover_commit_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_planned_failover_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_remove_disks_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_repair_replication_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_reprotect_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_resolve_health_errors_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/resolveHealthErrors') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_switch_provider_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/switchProvider') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_test_failover_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_test_failover_cleanup_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_unplanned_failover_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_appliance_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateAppliance') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_update_mobility_service_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replication_protected_item_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicationProtectedItemName": _SERIALIZER.url("replication_protected_item_name", replication_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + *, + skip_token: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectedItems') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + if filter is not None: + query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationProtectedItemsOperations(object): """ReplicationProtectedItemsOperations operations. @@ -47,13 +1078,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_protection_containers( self, - fabric_name, # type: str - protection_container_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ReplicationProtectedItemCollection"] + fabric_name: str, + protection_container_name: str, + **kwargs: Any + ) -> Iterable["_models.ReplicationProtectedItemCollection"]: """Gets the list of Replication protected items. Gets the list of ASR replication protected items in the protection container. @@ -63,8 +1094,10 @@ def list_by_replication_protection_containers( :param protection_container_name: Protection container name. :type protection_container_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ReplicationProtectedItemCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItemCollection] + :return: An iterator like instance of either ReplicationProtectedItemCollection or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItemCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItemCollection"] @@ -72,38 +1105,37 @@ def list_by_replication_protection_containers( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_protection_containers.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + template_url=self.list_by_replication_protection_containers.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ReplicationProtectedItemCollection', pipeline_response) + deserialized = self._deserialize("ReplicationProtectedItemCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -121,19 +1153,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_replication_protection_containers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ReplicationProtectedItem" + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any + ) -> "_models.ReplicationProtectedItem": """Gets the details of a Replication protected item. Gets the details of an ASR replication protected item. @@ -154,30 +1187,20 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -191,51 +1214,42 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'} # type: ignore + def _create_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - input, # type: "_models.EnableProtectionInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + input: "_models.EnableProtectionInput", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'EnableProtectionInput') + + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'EnableProtectionInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,17 +1265,19 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'} # type: ignore + + @distributed_trace def begin_create( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - input, # type: "_models.EnableProtectionInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + input: "_models.EnableProtectionInput", + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Enables protection. The operation to create an ASR replication protected item (Enable replication). @@ -276,15 +1292,20 @@ def begin_create( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.EnableProtectionInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -297,30 +1318,21 @@ def begin_create( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -332,43 +1344,35 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'} # type: ignore def _purge_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._purge_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_purge_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=self._purge_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -381,14 +1385,15 @@ def _purge_initial( _purge_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'} # type: ignore + + @distributed_trace def begin_purge( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Purges protection. The operation to delete or purge a replication protected item. This operation will force delete @@ -403,15 +1408,17 @@ def begin_purge( :type replicated_protected_item_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -426,24 +1433,14 @@ def begin_purge( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -455,51 +1452,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'} # type: ignore def _update_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - update_protection_input, # type: "_models.UpdateReplicationProtectedItemInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + update_protection_input: "_models.UpdateReplicationProtectedItemInput", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(update_protection_input, 'UpdateReplicationProtectedItemInput') + + request = build_update_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(update_protection_input, 'UpdateReplicationProtectedItemInput') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -515,17 +1502,19 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'} # type: ignore + + @distributed_trace def begin_update( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - update_protection_input, # type: "_models.UpdateReplicationProtectedItemInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + update_protection_input: "_models.UpdateReplicationProtectedItemInput", + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Updates the replication protected item settings. The operation to update the recovery settings of an ASR replication protected item. @@ -537,18 +1526,24 @@ def begin_update( :param replicated_protected_item_name: Replication protected item name. :type replicated_protected_item_name: str :param update_protection_input: Update protection input. - :type update_protection_input: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInput + :type update_protection_input: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateReplicationProtectedItemInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -561,30 +1556,21 @@ def begin_update( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, update_protection_input=update_protection_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -596,51 +1582,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}'} # type: ignore def _add_disks_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - add_disks_input, # type: "_models.AddDisksInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + add_disks_input: "_models.AddDisksInput", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._add_disks_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(add_disks_input, 'AddDisksInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_add_disks_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._add_disks_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(add_disks_input, 'AddDisksInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -656,17 +1632,19 @@ def _add_disks_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _add_disks_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks'} # type: ignore + + @distributed_trace def begin_add_disks( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - add_disks_input, # type: "_models.AddDisksInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + add_disks_input: "_models.AddDisksInput", + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Add disk(s) for protection. Operation to add disks(s) to the replication protected item. @@ -681,15 +1659,20 @@ def begin_add_disks( :type add_disks_input: ~azure.mgmt.recoveryservicessiterecovery.models.AddDisksInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -702,30 +1685,21 @@ def begin_add_disks( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, add_disks_input=add_disks_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -737,51 +1711,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_add_disks.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/addDisks'} # type: ignore def _apply_recovery_point_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - apply_recovery_point_input, # type: "_models.ApplyRecoveryPointInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + apply_recovery_point_input: "_models.ApplyRecoveryPointInput", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._apply_recovery_point_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(apply_recovery_point_input, 'ApplyRecoveryPointInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_apply_recovery_point_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._apply_recovery_point_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(apply_recovery_point_input, 'ApplyRecoveryPointInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -797,17 +1761,19 @@ def _apply_recovery_point_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _apply_recovery_point_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint'} # type: ignore + + @distributed_trace def begin_apply_recovery_point( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - apply_recovery_point_input, # type: "_models.ApplyRecoveryPointInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + apply_recovery_point_input: "_models.ApplyRecoveryPointInput", + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Change or apply recovery point. The operation to change the recovery point of a failed over replication protected item. @@ -819,18 +1785,24 @@ def begin_apply_recovery_point( :param replicated_protected_item_name: The replicated protected item name. :type replicated_protected_item_name: str :param apply_recovery_point_input: The ApplyRecoveryPointInput. - :type apply_recovery_point_input: ~azure.mgmt.recoveryservicessiterecovery.models.ApplyRecoveryPointInput + :type apply_recovery_point_input: + ~azure.mgmt.recoveryservicessiterecovery.models.ApplyRecoveryPointInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -843,30 +1815,21 @@ def begin_apply_recovery_point( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, apply_recovery_point_input=apply_recovery_point_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -878,45 +1841,35 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_apply_recovery_point.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/applyRecoveryPoint'} # type: ignore def _failover_cancel_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._failover_cancel_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_failover_cancel_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=self._failover_cancel_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -932,16 +1885,18 @@ def _failover_cancel_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _failover_cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel'} # type: ignore + + @distributed_trace def begin_failover_cancel( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Execute cancel failover. Operation to cancel the failover of the replication protected item. @@ -954,15 +1909,19 @@ def begin_failover_cancel( :type replicated_protected_item_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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -977,27 +1936,17 @@ def begin_failover_cancel( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1009,45 +1958,35 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_failover_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCancel'} # type: ignore def _failover_commit_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._failover_commit_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_failover_commit_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=self._failover_commit_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1063,16 +2002,18 @@ def _failover_commit_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _failover_commit_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit'} # type: ignore + + @distributed_trace def begin_failover_commit( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Execute commit failover. Operation to commit the failover of the replication protected item. @@ -1085,15 +2026,19 @@ def begin_failover_commit( :type replicated_protected_item_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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1108,27 +2053,17 @@ def begin_failover_commit( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1140,51 +2075,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_failover_commit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/failoverCommit'} # type: ignore def _planned_failover_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - failover_input, # type: "_models.PlannedFailoverInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + failover_input: "_models.PlannedFailoverInput", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._planned_failover_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(failover_input, 'PlannedFailoverInput') + + request = build_planned_failover_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._planned_failover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(failover_input, 'PlannedFailoverInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1200,17 +2125,19 @@ def _planned_failover_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _planned_failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover'} # type: ignore + + @distributed_trace def begin_planned_failover( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - failover_input, # type: "_models.PlannedFailoverInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + failover_input: "_models.PlannedFailoverInput", + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Execute planned failover. Operation to initiate a planned failover of the replication protected item. @@ -1225,15 +2152,20 @@ def begin_planned_failover( :type failover_input: ~azure.mgmt.recoveryservicessiterecovery.models.PlannedFailoverInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1246,30 +2178,21 @@ def begin_planned_failover( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, failover_input=failover_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1281,49 +2204,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_planned_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/plannedFailover'} # type: ignore def _delete_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - disable_protection_input, # type: "_models.DisableProtectionInput" - **kwargs # type: Any - ): - # type: (...) -> None + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + disable_protection_input: "_models.DisableProtectionInput", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + _json = self._serialize.body(disable_protection_input, 'DisableProtectionInput') + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(disable_protection_input, 'DisableProtectionInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1336,15 +2251,16 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove'} # type: ignore + + @distributed_trace def begin_delete( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - disable_protection_input, # type: "_models.DisableProtectionInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + disable_protection_input: "_models.DisableProtectionInput", + **kwargs: Any + ) -> LROPoller[None]: """Disables protection. The operation to disable replication on a replication protected item. This will also remove the @@ -1357,18 +2273,22 @@ def begin_delete( :param replicated_protected_item_name: Replication protected item name. :type replicated_protected_item_name: str :param disable_protection_input: Disable protection input. - :type disable_protection_input: ~azure.mgmt.recoveryservicessiterecovery.models.DisableProtectionInput + :type disable_protection_input: + ~azure.mgmt.recoveryservicessiterecovery.models.DisableProtectionInput :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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -1381,27 +2301,18 @@ def begin_delete( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, disable_protection_input=disable_protection_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1413,51 +2324,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/remove'} # type: ignore def _remove_disks_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - remove_disks_input, # type: "_models.RemoveDisksInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + remove_disks_input: "_models.RemoveDisksInput", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._remove_disks_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(remove_disks_input, 'RemoveDisksInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_remove_disks_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._remove_disks_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(remove_disks_input, 'RemoveDisksInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1473,17 +2374,19 @@ def _remove_disks_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _remove_disks_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks'} # type: ignore + + @distributed_trace def begin_remove_disks( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - remove_disks_input, # type: "_models.RemoveDisksInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + remove_disks_input: "_models.RemoveDisksInput", + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Removes disk(s). Operation to remove disk(s) from the replication protected item. @@ -1498,15 +2401,20 @@ def begin_remove_disks( :type remove_disks_input: ~azure.mgmt.recoveryservicessiterecovery.models.RemoveDisksInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1519,30 +2427,21 @@ def begin_remove_disks( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, remove_disks_input=remove_disks_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1554,45 +2453,35 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_remove_disks.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/removeDisks'} # type: ignore def _repair_replication_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._repair_replication_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_repair_replication_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=self._repair_replication_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1608,16 +2497,18 @@ def _repair_replication_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _repair_replication_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication'} # type: ignore + + @distributed_trace def begin_repair_replication( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Resynchronize or repair replication. The operation to start resynchronize/repair replication for a replication protected item @@ -1631,15 +2522,19 @@ def begin_repair_replication( :type replicated_protected_item_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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1654,27 +2549,17 @@ def begin_repair_replication( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1686,51 +2571,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_repair_replication.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/repairReplication'} # type: ignore def _reprotect_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - reprotect_input, # type: "_models.ReverseReplicationInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + reprotect_input: "_models.ReverseReplicationInput", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._reprotect_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(reprotect_input, 'ReverseReplicationInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_reprotect_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._reprotect_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(reprotect_input, 'ReverseReplicationInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1746,17 +2621,19 @@ def _reprotect_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _reprotect_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect'} # type: ignore + + @distributed_trace def begin_reprotect( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - reprotect_input, # type: "_models.ReverseReplicationInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + reprotect_input: "_models.ReverseReplicationInput", + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Execute Reverse Replication\Reprotect. Operation to reprotect or reverse replicate a failed over replication protected item. @@ -1771,15 +2648,20 @@ def begin_reprotect( :type reprotect_input: ~azure.mgmt.recoveryservicessiterecovery.models.ReverseReplicationInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1792,30 +2674,21 @@ def begin_reprotect( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, reprotect_input=reprotect_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1827,51 +2700,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reprotect.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/reProtect'} # type: ignore def _resolve_health_errors_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - resolve_health_input, # type: "_models.ResolveHealthInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + resolve_health_input: "_models.ResolveHealthInput", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._resolve_health_errors_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(resolve_health_input, 'ResolveHealthInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_resolve_health_errors_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._resolve_health_errors_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(resolve_health_input, 'ResolveHealthInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1887,17 +2750,19 @@ def _resolve_health_errors_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _resolve_health_errors_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/resolveHealthErrors'} # type: ignore + + @distributed_trace def begin_resolve_health_errors( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - resolve_health_input, # type: "_models.ResolveHealthInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + resolve_health_input: "_models.ResolveHealthInput", + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Resolve health errors. Operation to resolve health issues of the replication protected item. @@ -1912,15 +2777,20 @@ def begin_resolve_health_errors( :type resolve_health_input: ~azure.mgmt.recoveryservicessiterecovery.models.ResolveHealthInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -1933,30 +2803,21 @@ def begin_resolve_health_errors( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, resolve_health_input=resolve_health_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1968,51 +2829,171 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_resolve_health_errors.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/resolveHealthErrors'} # type: ignore - def _test_failover_initial( + def _switch_provider_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - testfailover_input, # type: "_models.TestFailoverInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + switch_provider_input: "_models.SwitchProviderInput", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._test_failover_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(switch_provider_input, 'SwitchProviderInput') + + request = build_switch_provider_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._switch_provider_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _switch_provider_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/switchProvider'} # type: ignore + + + @distributed_trace + def begin_switch_provider( + self, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + switch_provider_input: "_models.SwitchProviderInput", + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: + """Execute switch provider. + + Operation to initiate a switch provider of the replication protected item. + + :param fabric_name: Unique fabric name. + :type fabric_name: str + :param protection_container_name: Protection container name. + :type protection_container_name: str + :param replicated_protected_item_name: Replication protected item name. + :type replicated_protected_item_name: str + :param switch_provider_input: Switch provider input. + :type switch_provider_input: + ~azure.mgmt.recoveryservicessiterecovery.models.SwitchProviderInput + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._switch_provider_initial( + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + switch_provider_input=switch_provider_input, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = 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 + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_switch_provider.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/switchProvider'} # type: ignore + + def _test_failover_initial( + self, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + testfailover_input: "_models.TestFailoverInput", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - url = self._client.format_url(url, **path_format_arguments) + error_map.update(kwargs.pop('error_map', {})) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(testfailover_input, 'TestFailoverInput') + + request = build_test_failover_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._test_failover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(testfailover_input, 'TestFailoverInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2028,17 +3009,19 @@ def _test_failover_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _test_failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover'} # type: ignore + + @distributed_trace def begin_test_failover( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - testfailover_input, # type: "_models.TestFailoverInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + testfailover_input: "_models.TestFailoverInput", + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Execute test failover. Operation to perform a test failover of the replication protected item. @@ -2053,15 +3036,20 @@ def begin_test_failover( :type testfailover_input: ~azure.mgmt.recoveryservicessiterecovery.models.TestFailoverInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -2074,30 +3062,21 @@ def begin_test_failover( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, testfailover_input=testfailover_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2109,51 +3088,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_test_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailover'} # type: ignore def _test_failover_cleanup_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - cleanup_input, # type: "_models.TestFailoverCleanupInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + cleanup_input: "_models.TestFailoverCleanupInput", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._test_failover_cleanup_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(cleanup_input, 'TestFailoverCleanupInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_test_failover_cleanup_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._test_failover_cleanup_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(cleanup_input, 'TestFailoverCleanupInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2169,17 +3138,19 @@ def _test_failover_cleanup_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _test_failover_cleanup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup'} # type: ignore + + @distributed_trace def begin_test_failover_cleanup( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - cleanup_input, # type: "_models.TestFailoverCleanupInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + cleanup_input: "_models.TestFailoverCleanupInput", + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Execute test failover cleanup. Operation to clean up the test failover of a replication protected item. @@ -2194,15 +3165,20 @@ def begin_test_failover_cleanup( :type cleanup_input: ~azure.mgmt.recoveryservicessiterecovery.models.TestFailoverCleanupInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -2215,30 +3191,21 @@ def begin_test_failover_cleanup( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, cleanup_input=cleanup_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2250,51 +3217,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_test_failover_cleanup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/testFailoverCleanup'} # type: ignore def _unplanned_failover_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - failover_input, # type: "_models.UnplannedFailoverInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + failover_input: "_models.UnplannedFailoverInput", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._unplanned_failover_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(failover_input, 'UnplannedFailoverInput') + + request = build_unplanned_failover_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._unplanned_failover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(failover_input, 'UnplannedFailoverInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2310,17 +3267,19 @@ def _unplanned_failover_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _unplanned_failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover'} # type: ignore + + @distributed_trace def begin_unplanned_failover( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - failover_input, # type: "_models.UnplannedFailoverInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + failover_input: "_models.UnplannedFailoverInput", + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Execute unplanned failover. Operation to initiate a failover of the replication protected item. @@ -2335,15 +3294,20 @@ def begin_unplanned_failover( :type failover_input: ~azure.mgmt.recoveryservicessiterecovery.models.UnplannedFailoverInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -2356,30 +3320,21 @@ def begin_unplanned_failover( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, failover_input=failover_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2391,51 +3346,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_unplanned_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/unplannedFailover'} # type: ignore def _update_appliance_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - appliance_update_input, # type: "_models.UpdateApplianceForReplicationProtectedItemInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + appliance_update_input: "_models.UpdateApplianceForReplicationProtectedItemInput", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_appliance_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(appliance_update_input, 'UpdateApplianceForReplicationProtectedItemInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_update_appliance_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._update_appliance_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(appliance_update_input, 'UpdateApplianceForReplicationProtectedItemInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2451,17 +3396,19 @@ def _update_appliance_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_appliance_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateAppliance'} # type: ignore + + @distributed_trace def begin_update_appliance( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - appliance_update_input, # type: "_models.UpdateApplianceForReplicationProtectedItemInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + appliance_update_input: "_models.UpdateApplianceForReplicationProtectedItemInput", + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Updates appliance for replication protected Item. The operation to update appliance of an ASR replication protected item. @@ -2473,18 +3420,24 @@ def begin_update_appliance( :param replicated_protected_item_name: Replication protected item name. :type replicated_protected_item_name: str :param appliance_update_input: Appliance update protection input. - :type appliance_update_input: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput + :type appliance_update_input: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateApplianceForReplicationProtectedItemInput :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -2497,30 +3450,21 @@ def begin_update_appliance( protection_container_name=protection_container_name, replicated_protected_item_name=replicated_protected_item_name, appliance_update_input=appliance_update_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2532,51 +3476,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_appliance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/updateAppliance'} # type: ignore def _update_mobility_service_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - replication_protected_item_name, # type: str - update_mobility_service_request, # type: "_models.UpdateMobilityServiceRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replication_protected_item_name: str, + update_mobility_service_request: "_models.UpdateMobilityServiceRequest", + **kwargs: Any + ) -> Optional["_models.ReplicationProtectedItem"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ReplicationProtectedItem"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_mobility_service_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicationProtectedItemName': self._serialize.url("replication_protected_item_name", replication_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(update_mobility_service_request, 'UpdateMobilityServiceRequest') + + request = build_update_mobility_service_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replication_protected_item_name=replication_protected_item_name, + content_type=content_type, + json=_json, + template_url=self._update_mobility_service_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(update_mobility_service_request, 'UpdateMobilityServiceRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -2592,17 +3526,19 @@ def _update_mobility_service_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_mobility_service_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService'} # type: ignore + + @distributed_trace def begin_update_mobility_service( self, - fabric_name, # type: str - protection_container_name, # type: str - replication_protected_item_name, # type: str - update_mobility_service_request, # type: "_models.UpdateMobilityServiceRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ReplicationProtectedItem"] + fabric_name: str, + protection_container_name: str, + replication_protected_item_name: str, + update_mobility_service_request: "_models.UpdateMobilityServiceRequest", + **kwargs: Any + ) -> LROPoller["_models.ReplicationProtectedItem"]: """Update the mobility service on a protected item. The operation to update(push update) the installed mobility service software on a replication @@ -2617,18 +3553,24 @@ def begin_update_mobility_service( :type replication_protected_item_name: str :param update_mobility_service_request: Request to update the mobility service on the protected item. - :type update_mobility_service_request: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest + :type update_mobility_service_request: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateMobilityServiceRequest :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. + :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 ReplicationProtectedItem or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ReplicationProtectedItem or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItem"] lro_delay = kwargs.pop( 'polling_interval', @@ -2641,30 +3583,21 @@ def begin_update_mobility_service( protection_container_name=protection_container_name, replication_protected_item_name=replication_protected_item_name, update_mobility_service_request=update_mobility_service_request, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ReplicationProtectedItem', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicationProtectedItemName': self._serialize.url("replication_protected_item_name", replication_protected_item_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -2676,15 +3609,16 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_mobility_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicationProtectedItemName}/updateMobilityService'} # type: ignore + @distributed_trace def list( self, - skip_token=None, # type: Optional[str] - filter=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ReplicationProtectedItemCollection"] + skip_token: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.ReplicationProtectedItemCollection"]: """Gets the list of replication protected items. Gets the list of ASR replication protected items in the vault. @@ -2695,8 +3629,10 @@ def list( :param filter: OData filter options. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ReplicationProtectedItemCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItemCollection] + :return: An iterator like instance of either ReplicationProtectedItemCollection or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItemCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectedItemCollection"] @@ -2704,40 +3640,37 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + filter=filter, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + filter=filter, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ReplicationProtectedItemCollection', pipeline_response) + deserialized = self._deserialize("ReplicationProtectedItemCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -2755,6 +3688,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protection_container_mappings_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protection_container_mappings_operations.py index ee58c95f7b15..d3183f8ea1b6 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protection_container_mappings_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protection_container_mappings_operations.py @@ -5,25 +5,326 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_protection_containers_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + mapping_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "mappingName": _SERIALIZER.url("mapping_name", mapping_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + mapping_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "mappingName": _SERIALIZER.url("mapping_name", mapping_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_purge_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + mapping_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "mappingName": _SERIALIZER.url("mapping_name", mapping_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_update_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + mapping_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "mappingName": _SERIALIZER.url("mapping_name", mapping_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + mapping_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "mappingName": _SERIALIZER.url("mapping_name", mapping_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainerMappings') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationProtectionContainerMappingsOperations(object): """ReplicationProtectionContainerMappingsOperations operations. @@ -47,13 +348,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_protection_containers( self, - fabric_name, # type: str - protection_container_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ProtectionContainerMappingCollection"] + fabric_name: str, + protection_container_name: str, + **kwargs: Any + ) -> Iterable["_models.ProtectionContainerMappingCollection"]: """Gets the list of protection container mappings for a protection container. Lists the protection container mappings for a protection container. @@ -63,8 +364,10 @@ def list_by_replication_protection_containers( :param protection_container_name: Protection container name. :type protection_container_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProtectionContainerMappingCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMappingCollection] + :return: An iterator like instance of either ProtectionContainerMappingCollection or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMappingCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerMappingCollection"] @@ -72,38 +375,37 @@ def list_by_replication_protection_containers( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_protection_containers.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + template_url=self.list_by_replication_protection_containers.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protection_containers_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ProtectionContainerMappingCollection', pipeline_response) + deserialized = self._deserialize("ProtectionContainerMappingCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -121,19 +423,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_replication_protection_containers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - protection_container_name, # type: str - mapping_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ProtectionContainerMapping" + fabric_name: str, + protection_container_name: str, + mapping_name: str, + **kwargs: Any + ) -> "_models.ProtectionContainerMapping": """Gets a protection container mapping. Gets the details of a protection container mapping. @@ -154,30 +457,20 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + mapping_name=mapping_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -191,51 +484,42 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}'} # type: ignore + def _create_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - mapping_name, # type: str - creation_input, # type: "_models.CreateProtectionContainerMappingInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ProtectionContainerMapping"] + fabric_name: str, + protection_container_name: str, + mapping_name: str, + creation_input: "_models.CreateProtectionContainerMappingInput", + **kwargs: Any + ) -> Optional["_models.ProtectionContainerMapping"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectionContainerMapping"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(creation_input, 'CreateProtectionContainerMappingInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + mapping_name=mapping_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(creation_input, 'CreateProtectionContainerMappingInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,17 +535,19 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}'} # type: ignore + + @distributed_trace def begin_create( self, - fabric_name, # type: str - protection_container_name, # type: str - mapping_name, # type: str - creation_input, # type: "_models.CreateProtectionContainerMappingInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ProtectionContainerMapping"] + fabric_name: str, + protection_container_name: str, + mapping_name: str, + creation_input: "_models.CreateProtectionContainerMappingInput", + **kwargs: Any + ) -> LROPoller["_models.ProtectionContainerMapping"]: """Create protection container mapping. The operation to create a protection container mapping. @@ -273,18 +559,24 @@ def begin_create( :param mapping_name: Protection container mapping name. :type mapping_name: str :param creation_input: Mapping creation input. - :type creation_input: ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInput + :type creation_input: + ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionContainerMappingInput :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. + :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 ProtectionContainerMapping or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMapping] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ProtectionContainerMapping or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMapping] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerMapping"] lro_delay = kwargs.pop( 'polling_interval', @@ -297,30 +589,21 @@ def begin_create( protection_container_name=protection_container_name, mapping_name=mapping_name, creation_input=creation_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ProtectionContainerMapping', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -332,43 +615,35 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}'} # type: ignore def _purge_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - mapping_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + fabric_name: str, + protection_container_name: str, + mapping_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._purge_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_purge_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + mapping_name=mapping_name, + template_url=self._purge_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -381,14 +656,15 @@ def _purge_initial( _purge_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}'} # type: ignore + + @distributed_trace def begin_purge( self, - fabric_name, # type: str - protection_container_name, # type: str - mapping_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + fabric_name: str, + protection_container_name: str, + mapping_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Purge protection container mapping. The operation to purge(force delete) a protection container mapping. @@ -401,15 +677,17 @@ def begin_purge( :type mapping_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -424,24 +702,14 @@ def begin_purge( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -453,51 +721,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}'} # type: ignore def _update_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - mapping_name, # type: str - update_input, # type: "_models.UpdateProtectionContainerMappingInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ProtectionContainerMapping"] + fabric_name: str, + protection_container_name: str, + mapping_name: str, + update_input: "_models.UpdateProtectionContainerMappingInput", + **kwargs: Any + ) -> Optional["_models.ProtectionContainerMapping"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectionContainerMapping"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(update_input, 'UpdateProtectionContainerMappingInput') + + request = build_update_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + mapping_name=mapping_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(update_input, 'UpdateProtectionContainerMappingInput') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -513,17 +771,19 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}'} # type: ignore + + @distributed_trace def begin_update( self, - fabric_name, # type: str - protection_container_name, # type: str - mapping_name, # type: str - update_input, # type: "_models.UpdateProtectionContainerMappingInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ProtectionContainerMapping"] + fabric_name: str, + protection_container_name: str, + mapping_name: str, + update_input: "_models.UpdateProtectionContainerMappingInput", + **kwargs: Any + ) -> LROPoller["_models.ProtectionContainerMapping"]: """Update protection container mapping. The operation to update protection container mapping. @@ -535,18 +795,24 @@ def begin_update( :param mapping_name: Protection container mapping name. :type mapping_name: str :param update_input: Mapping update input. - :type update_input: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInput + :type update_input: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateProtectionContainerMappingInput :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. + :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 ProtectionContainerMapping or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMapping] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ProtectionContainerMapping or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMapping] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerMapping"] lro_delay = kwargs.pop( 'polling_interval', @@ -559,30 +825,21 @@ def begin_update( protection_container_name=protection_container_name, mapping_name=mapping_name, update_input=update_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ProtectionContainerMapping', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -594,49 +851,41 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}'} # type: ignore def _delete_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - mapping_name, # type: str - removal_input, # type: "_models.RemoveProtectionContainerMappingInput" - **kwargs # type: Any - ): - # type: (...) -> None + fabric_name: str, + protection_container_name: str, + mapping_name: str, + removal_input: "_models.RemoveProtectionContainerMappingInput", + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + _json = self._serialize.body(removal_input, 'RemoveProtectionContainerMappingInput') + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + mapping_name=mapping_name, + content_type=content_type, + json=_json, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(removal_input, 'RemoveProtectionContainerMappingInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -649,15 +898,16 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove'} # type: ignore + + @distributed_trace def begin_delete( self, - fabric_name, # type: str - protection_container_name, # type: str - mapping_name, # type: str - removal_input, # type: "_models.RemoveProtectionContainerMappingInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + fabric_name: str, + protection_container_name: str, + mapping_name: str, + removal_input: "_models.RemoveProtectionContainerMappingInput", + **kwargs: Any + ) -> LROPoller[None]: """Remove protection container mapping. The operation to delete or remove a protection container mapping. @@ -669,18 +919,22 @@ def begin_delete( :param mapping_name: Protection container mapping name. :type mapping_name: str :param removal_input: Removal input. - :type removal_input: ~azure.mgmt.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput + :type removal_input: + ~azure.mgmt.recoveryservicessiterecovery.models.RemoveProtectionContainerMappingInput :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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -693,27 +947,18 @@ def begin_delete( protection_container_name=protection_container_name, mapping_name=mapping_name, removal_input=removal_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'mappingName': self._serialize.url("mapping_name", mapping_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -725,20 +970,23 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectionContainerMappings/{mappingName}/remove'} # type: ignore + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ProtectionContainerMappingCollection"] + **kwargs: Any + ) -> Iterable["_models.ProtectionContainerMappingCollection"]: """Gets the list of all protection container mappings in a vault. Lists the protection container mappings in the vault. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProtectionContainerMappingCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMappingCollection] + :return: An iterator like instance of either ProtectionContainerMappingCollection or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerMappingCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerMappingCollection"] @@ -746,36 +994,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ProtectionContainerMappingCollection', pipeline_response) + deserialized = self._deserialize("ProtectionContainerMappingCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -793,6 +1038,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protection_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protection_containers_operations.py index 9e8b7e05492b..49b87505382e 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protection_containers_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protection_containers_operations.py @@ -5,25 +5,316 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_fabrics_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_discover_protectable_item_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/discoverProtectableItem') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/remove') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_switch_protection_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchprotection') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionContainers') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationProtectionContainersOperations(object): """ReplicationProtectionContainersOperations operations. @@ -47,12 +338,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_fabrics( self, - fabric_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ProtectionContainerCollection"] + fabric_name: str, + **kwargs: Any + ) -> Iterable["_models.ProtectionContainerCollection"]: """Gets the list of protection container for a fabric. Lists the protection containers in the specified fabric. @@ -60,8 +351,10 @@ def list_by_replication_fabrics( :param fabric_name: Fabric name. :type fabric_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProtectionContainerCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerCollection] + :return: An iterator like instance of either ProtectionContainerCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerCollection"] @@ -69,37 +362,35 @@ def list_by_replication_fabrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_fabrics.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self.list_by_replication_fabrics.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ProtectionContainerCollection', pipeline_response) + deserialized = self._deserialize("ProtectionContainerCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,18 +408,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_replication_fabrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - protection_container_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ProtectionContainer" + fabric_name: str, + protection_container_name: str, + **kwargs: Any + ) -> "_models.ProtectionContainer": """Gets the protection container details. Gets the details of a protection container. @@ -147,29 +439,19 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -183,49 +465,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}'} # type: ignore + def _create_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - creation_input, # type: "_models.CreateProtectionContainerInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ProtectionContainer"] + fabric_name: str, + protection_container_name: str, + creation_input: "_models.CreateProtectionContainerInput", + **kwargs: Any + ) -> Optional["_models.ProtectionContainer"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectionContainer"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(creation_input, 'CreateProtectionContainerInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(creation_input, 'CreateProtectionContainerInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -241,16 +514,18 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}'} # type: ignore + + @distributed_trace def begin_create( self, - fabric_name, # type: str - protection_container_name, # type: str - creation_input, # type: "_models.CreateProtectionContainerInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ProtectionContainer"] + fabric_name: str, + protection_container_name: str, + creation_input: "_models.CreateProtectionContainerInput", + **kwargs: Any + ) -> LROPoller["_models.ProtectionContainer"]: """Create a protection container. Operation to create a protection container. @@ -260,18 +535,24 @@ def begin_create( :param protection_container_name: Unique protection container ARM name. :type protection_container_name: str :param creation_input: Creation input. - :type creation_input: ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionContainerInput + :type creation_input: + ~azure.mgmt.recoveryservicessiterecovery.models.CreateProtectionContainerInput :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. + :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 ProtectionContainer or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ProtectionContainer or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -283,29 +564,21 @@ def begin_create( fabric_name=fabric_name, protection_container_name=protection_container_name, creation_input=creation_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ProtectionContainer', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -317,49 +590,39 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}'} # type: ignore def _discover_protectable_item_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - discover_protectable_item_request, # type: "_models.DiscoverProtectableItemRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ProtectionContainer"] + fabric_name: str, + protection_container_name: str, + discover_protectable_item_request: "_models.DiscoverProtectableItemRequest", + **kwargs: Any + ) -> Optional["_models.ProtectionContainer"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectionContainer"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._discover_protectable_item_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(discover_protectable_item_request, 'DiscoverProtectableItemRequest') + + request = build_discover_protectable_item_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + content_type=content_type, + json=_json, + template_url=self._discover_protectable_item_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(discover_protectable_item_request, 'DiscoverProtectableItemRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -375,16 +638,18 @@ def _discover_protectable_item_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _discover_protectable_item_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/discoverProtectableItem'} # type: ignore + + @distributed_trace def begin_discover_protectable_item( self, - fabric_name, # type: str - protection_container_name, # type: str - discover_protectable_item_request, # type: "_models.DiscoverProtectableItemRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ProtectionContainer"] + fabric_name: str, + protection_container_name: str, + discover_protectable_item_request: "_models.DiscoverProtectableItemRequest", + **kwargs: Any + ) -> LROPoller["_models.ProtectionContainer"]: """Adds a protectable item to the replication protection container. The operation to a add a protectable item to a protection container(Add physical server). @@ -394,18 +659,24 @@ def begin_discover_protectable_item( :param protection_container_name: The name of the protection container. :type protection_container_name: str :param discover_protectable_item_request: The request object to add a protectable item. - :type discover_protectable_item_request: ~azure.mgmt.recoveryservicessiterecovery.models.DiscoverProtectableItemRequest + :type discover_protectable_item_request: + ~azure.mgmt.recoveryservicessiterecovery.models.DiscoverProtectableItemRequest :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. + :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 ProtectionContainer or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ProtectionContainer or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -417,29 +688,21 @@ def begin_discover_protectable_item( fabric_name=fabric_name, protection_container_name=protection_container_name, discover_protectable_item_request=discover_protectable_item_request, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ProtectionContainer', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -451,41 +714,33 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_discover_protectable_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/discoverProtectableItem'} # type: ignore def _delete_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + fabric_name: str, + protection_container_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -498,13 +753,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/remove'} # type: ignore + + @distributed_trace def begin_delete( self, - fabric_name, # type: str - protection_container_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + fabric_name: str, + protection_container_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Removes a protection container. Operation to remove a protection container. @@ -515,15 +771,17 @@ def begin_delete( :type protection_container_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -537,23 +795,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -565,49 +814,39 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/remove'} # type: ignore def _switch_protection_initial( self, - fabric_name, # type: str - protection_container_name, # type: str - switch_input, # type: "_models.SwitchProtectionInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ProtectionContainer"] + fabric_name: str, + protection_container_name: str, + switch_input: "_models.SwitchProtectionInput", + **kwargs: Any + ) -> Optional["_models.ProtectionContainer"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectionContainer"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._switch_protection_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(switch_input, 'SwitchProtectionInput') + + request = build_switch_protection_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + content_type=content_type, + json=_json, + template_url=self._switch_protection_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(switch_input, 'SwitchProtectionInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -623,16 +862,18 @@ def _switch_protection_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _switch_protection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchprotection'} # type: ignore + + @distributed_trace def begin_switch_protection( self, - fabric_name, # type: str - protection_container_name, # type: str - switch_input, # type: "_models.SwitchProtectionInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ProtectionContainer"] + fabric_name: str, + protection_container_name: str, + switch_input: "_models.SwitchProtectionInput", + **kwargs: Any + ) -> LROPoller["_models.ProtectionContainer"]: """Switches protection from one container to another or one replication provider to another. Operation to switch protection from one container to another or one replication provider to @@ -646,15 +887,20 @@ def begin_switch_protection( :type switch_input: ~azure.mgmt.recoveryservicessiterecovery.models.SwitchProtectionInput :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. + :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 ProtectionContainer or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] - :raises ~azure.core.exceptions.HttpResponseError: + :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 ProtectionContainer or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainer] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainer"] lro_delay = kwargs.pop( 'polling_interval', @@ -666,29 +912,21 @@ def begin_switch_protection( fabric_name=fabric_name, protection_container_name=protection_container_name, switch_input=switch_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('ProtectionContainer', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -700,20 +938,23 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_switch_protection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/switchprotection'} # type: ignore + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ProtectionContainerCollection"] + **kwargs: Any + ) -> Iterable["_models.ProtectionContainerCollection"]: """Gets the list of all protection containers in a vault. Lists the protection containers in a vault. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProtectionContainerCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerCollection] + :return: An iterator like instance of either ProtectionContainerCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ProtectionContainerCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerCollection"] @@ -721,36 +962,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ProtectionContainerCollection', pipeline_response) + deserialized = self._deserialize("ProtectionContainerCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -768,6 +1006,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protection_intents_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protection_intents_operations.py index 452a54d00232..a8c029e21514 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protection_intents_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_protection_intents_operations.py @@ -5,23 +5,151 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + *, + skip_token: Optional[str] = None, + take_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['skipToken'] = _SERIALIZER.query("skip_token", skip_token, 'str') + if take_token is not None: + query_parameters['takeToken'] = _SERIALIZER.query("take_token", take_token, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + intent_object_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "intentObjectName": _SERIALIZER.url("intent_object_name", intent_object_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + intent_object_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "intentObjectName": _SERIALIZER.url("intent_object_name", intent_object_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ReplicationProtectionIntentsOperations(object): """ReplicationProtectionIntentsOperations operations. @@ -45,13 +173,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - skip_token=None, # type: Optional[str] - take_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ReplicationProtectionIntentCollection"] + skip_token: Optional[str] = None, + take_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.ReplicationProtectionIntentCollection"]: """Gets the list of replication protection intent objects. Gets the list of ASR replication protection intent objects in the vault. @@ -61,8 +189,10 @@ def list( :param take_token: The page size. :type take_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ReplicationProtectionIntentCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectionIntentCollection] + :return: An iterator like instance of either ReplicationProtectionIntentCollection or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectionIntentCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ReplicationProtectionIntentCollection"] @@ -70,40 +200,37 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if skip_token is not None: - query_parameters['skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - if take_token is not None: - query_parameters['takeToken'] = self._serialize.query("take_token", take_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + take_token=take_token, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + take_token=take_token, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('ReplicationProtectionIntentCollection', pipeline_response) + deserialized = self._deserialize("ReplicationProtectionIntentCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -121,17 +248,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents'} # type: ignore + @distributed_trace def get( self, - intent_object_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ReplicationProtectionIntent" + intent_object_name: str, + **kwargs: Any + ) -> "_models.ReplicationProtectionIntent": """Gets the details of a Replication protection intent item. Gets the details of an ASR replication protection intent. @@ -148,28 +276,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'intentObjectName': self._serialize.url("intent_object_name", intent_object_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + intent_object_name=intent_object_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -183,15 +301,17 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}'} # type: ignore + + @distributed_trace def create( self, - intent_object_name, # type: str - input, # type: "_models.CreateProtectionIntentInput" - **kwargs # type: Any - ): - # type: (...) -> "_models.ReplicationProtectionIntent" + intent_object_name: str, + input: "_models.CreateProtectionIntentInput", + **kwargs: Any + ) -> "_models.ReplicationProtectionIntent": """Create protection intent Resource. The operation to create an ASR replication protection intent item. @@ -210,33 +330,23 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'intentObjectName': self._serialize.url("intent_object_name", intent_object_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'CreateProtectionIntentInput') + + request = build_create_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + intent_object_name=intent_object_name, + content_type=content_type, + json=_json, + template_url=self.create.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'CreateProtectionIntentInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -250,4 +360,6 @@ def create( return cls(pipeline_response, deserialized, {}) return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationProtectionIntents/{intentObjectName}'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_recovery_plans_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_recovery_plans_operations.py index 3bdd7240eafc..e51d0510cf1a 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_recovery_plans_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_recovery_plans_operations.py @@ -5,25 +5,518 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + recovery_plan_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "recoveryPlanName": _SERIALIZER.url("recovery_plan_name", recovery_plan_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + recovery_plan_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "recoveryPlanName": _SERIALIZER.url("recovery_plan_name", recovery_plan_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + recovery_plan_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "recoveryPlanName": _SERIALIZER.url("recovery_plan_name", recovery_plan_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_update_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + recovery_plan_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "recoveryPlanName": _SERIALIZER.url("recovery_plan_name", recovery_plan_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_failover_cancel_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + recovery_plan_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "recoveryPlanName": _SERIALIZER.url("recovery_plan_name", recovery_plan_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_failover_commit_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + recovery_plan_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "recoveryPlanName": _SERIALIZER.url("recovery_plan_name", recovery_plan_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_planned_failover_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + recovery_plan_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "recoveryPlanName": _SERIALIZER.url("recovery_plan_name", recovery_plan_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_reprotect_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + recovery_plan_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "recoveryPlanName": _SERIALIZER.url("recovery_plan_name", recovery_plan_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_test_failover_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + recovery_plan_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "recoveryPlanName": _SERIALIZER.url("recovery_plan_name", recovery_plan_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_test_failover_cleanup_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + recovery_plan_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "recoveryPlanName": _SERIALIZER.url("recovery_plan_name", recovery_plan_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_unplanned_failover_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + recovery_plan_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "recoveryPlanName": _SERIALIZER.url("recovery_plan_name", recovery_plan_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ReplicationRecoveryPlansOperations(object): """ReplicationRecoveryPlansOperations operations. @@ -47,18 +540,20 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RecoveryPlanCollection"] + **kwargs: Any + ) -> Iterable["_models.RecoveryPlanCollection"]: """Gets the list of recovery plans. Lists the recovery plans in the vault. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RecoveryPlanCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanCollection] + :return: An iterator like instance of either RecoveryPlanCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlanCollection"] @@ -66,36 +561,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('RecoveryPlanCollection', pipeline_response) + deserialized = self._deserialize("RecoveryPlanCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,17 +605,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans'} # type: ignore + @distributed_trace def get( self, - recovery_plan_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RecoveryPlan" + recovery_plan_name: str, + **kwargs: Any + ) -> "_models.RecoveryPlan": """Gets the requested recovery plan. Gets the details of the recovery plan. @@ -140,28 +633,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -175,47 +658,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}'} # type: ignore + def _create_initial( self, - recovery_plan_name, # type: str - input, # type: "_models.CreateRecoveryPlanInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RecoveryPlan"] + recovery_plan_name: str, + input: "_models.CreateRecoveryPlanInput", + **kwargs: Any + ) -> Optional["_models.RecoveryPlan"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RecoveryPlan"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'CreateRecoveryPlanInput') + + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'CreateRecoveryPlanInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -231,15 +705,17 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}'} # type: ignore + + @distributed_trace def begin_create( self, - recovery_plan_name, # type: str - input, # type: "_models.CreateRecoveryPlanInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RecoveryPlan"] + recovery_plan_name: str, + input: "_models.CreateRecoveryPlanInput", + **kwargs: Any + ) -> LROPoller["_models.RecoveryPlan"]: """Creates a recovery plan with the given details. The operation to create a recovery plan. @@ -250,15 +726,20 @@ def begin_create( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.CreateRecoveryPlanInput :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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -269,28 +750,21 @@ def begin_create( raw_result = self._create_initial( recovery_plan_name=recovery_plan_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -302,39 +776,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}'} # type: ignore def _delete_initial( self, - recovery_plan_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + recovery_plan_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -347,12 +813,13 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}'} # type: ignore + + @distributed_trace def begin_delete( self, - recovery_plan_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + recovery_plan_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Deletes the specified recovery plan. Delete a recovery plan. @@ -361,15 +828,17 @@ def begin_delete( :type recovery_plan_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -382,22 +851,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -409,47 +870,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}'} # type: ignore def _update_initial( self, - recovery_plan_name, # type: str - input, # type: "_models.UpdateRecoveryPlanInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RecoveryPlan"] + recovery_plan_name: str, + input: "_models.UpdateRecoveryPlanInput", + **kwargs: Any + ) -> Optional["_models.RecoveryPlan"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RecoveryPlan"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(input, 'UpdateRecoveryPlanInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_update_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'UpdateRecoveryPlanInput') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -465,15 +916,17 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}'} # type: ignore + + @distributed_trace def begin_update( self, - recovery_plan_name, # type: str - input, # type: "_models.UpdateRecoveryPlanInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RecoveryPlan"] + recovery_plan_name: str, + input: "_models.UpdateRecoveryPlanInput", + **kwargs: Any + ) -> LROPoller["_models.RecoveryPlan"]: """Updates the given recovery plan. The operation to update a recovery plan. @@ -484,15 +937,20 @@ def begin_update( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateRecoveryPlanInput :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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -503,28 +961,21 @@ def begin_update( raw_result = self._update_initial( recovery_plan_name=recovery_plan_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -536,41 +987,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}'} # type: ignore def _failover_cancel_initial( self, - recovery_plan_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RecoveryPlan"] + recovery_plan_name: str, + **kwargs: Any + ) -> Optional["_models.RecoveryPlan"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RecoveryPlan"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._failover_cancel_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_failover_cancel_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + template_url=self._failover_cancel_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -586,14 +1027,16 @@ def _failover_cancel_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _failover_cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel'} # type: ignore + + @distributed_trace def begin_failover_cancel( self, - recovery_plan_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RecoveryPlan"] + recovery_plan_name: str, + **kwargs: Any + ) -> LROPoller["_models.RecoveryPlan"]: """Execute cancel failover of the recovery plan. The operation to cancel the failover of a recovery plan. @@ -602,15 +1045,19 @@ def begin_failover_cancel( :type recovery_plan_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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -623,25 +1070,17 @@ def begin_failover_cancel( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -653,41 +1092,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_failover_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCancel'} # type: ignore def _failover_commit_initial( self, - recovery_plan_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RecoveryPlan"] + recovery_plan_name: str, + **kwargs: Any + ) -> Optional["_models.RecoveryPlan"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RecoveryPlan"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._failover_commit_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_failover_commit_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + template_url=self._failover_commit_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -703,14 +1132,16 @@ def _failover_commit_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _failover_commit_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit'} # type: ignore + + @distributed_trace def begin_failover_commit( self, - recovery_plan_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RecoveryPlan"] + recovery_plan_name: str, + **kwargs: Any + ) -> LROPoller["_models.RecoveryPlan"]: """Execute commit failover of the recovery plan. The operation to commit the failover of a recovery plan. @@ -719,15 +1150,19 @@ def begin_failover_commit( :type recovery_plan_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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -740,25 +1175,17 @@ def begin_failover_commit( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -770,47 +1197,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_failover_commit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/failoverCommit'} # type: ignore def _planned_failover_initial( self, - recovery_plan_name, # type: str - input, # type: "_models.RecoveryPlanPlannedFailoverInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RecoveryPlan"] + recovery_plan_name: str, + input: "_models.RecoveryPlanPlannedFailoverInput", + **kwargs: Any + ) -> Optional["_models.RecoveryPlan"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RecoveryPlan"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._planned_failover_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(input, 'RecoveryPlanPlannedFailoverInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_planned_failover_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + content_type=content_type, + json=_json, + template_url=self._planned_failover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'RecoveryPlanPlannedFailoverInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -826,15 +1243,17 @@ def _planned_failover_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _planned_failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover'} # type: ignore + + @distributed_trace def begin_planned_failover( self, - recovery_plan_name, # type: str - input, # type: "_models.RecoveryPlanPlannedFailoverInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RecoveryPlan"] + recovery_plan_name: str, + input: "_models.RecoveryPlanPlannedFailoverInput", + **kwargs: Any + ) -> LROPoller["_models.RecoveryPlan"]: """Execute planned failover of the recovery plan. The operation to start the planned failover of a recovery plan. @@ -845,15 +1264,20 @@ def begin_planned_failover( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanPlannedFailoverInput :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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -864,28 +1288,21 @@ def begin_planned_failover( raw_result = self._planned_failover_initial( recovery_plan_name=recovery_plan_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -897,41 +1314,31 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_planned_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/plannedFailover'} # type: ignore def _reprotect_initial( self, - recovery_plan_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RecoveryPlan"] + recovery_plan_name: str, + **kwargs: Any + ) -> Optional["_models.RecoveryPlan"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RecoveryPlan"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._reprotect_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_reprotect_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + template_url=self._reprotect_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -947,14 +1354,16 @@ def _reprotect_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _reprotect_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect'} # type: ignore + + @distributed_trace def begin_reprotect( self, - recovery_plan_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RecoveryPlan"] + recovery_plan_name: str, + **kwargs: Any + ) -> LROPoller["_models.RecoveryPlan"]: """Execute reprotect of the recovery plan. The operation to reprotect(reverse replicate) a recovery plan. @@ -963,15 +1372,19 @@ def begin_reprotect( :type recovery_plan_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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -984,25 +1397,17 @@ def begin_reprotect( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1014,47 +1419,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_reprotect.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/reProtect'} # type: ignore def _test_failover_initial( self, - recovery_plan_name, # type: str - input, # type: "_models.RecoveryPlanTestFailoverInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RecoveryPlan"] + recovery_plan_name: str, + input: "_models.RecoveryPlanTestFailoverInput", + **kwargs: Any + ) -> Optional["_models.RecoveryPlan"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RecoveryPlan"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._test_failover_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'RecoveryPlanTestFailoverInput') + + request = build_test_failover_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + content_type=content_type, + json=_json, + template_url=self._test_failover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'RecoveryPlanTestFailoverInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1070,15 +1465,17 @@ def _test_failover_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _test_failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover'} # type: ignore + + @distributed_trace def begin_test_failover( self, - recovery_plan_name, # type: str - input, # type: "_models.RecoveryPlanTestFailoverInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RecoveryPlan"] + recovery_plan_name: str, + input: "_models.RecoveryPlanTestFailoverInput", + **kwargs: Any + ) -> LROPoller["_models.RecoveryPlan"]: """Execute test failover of the recovery plan. The operation to start the test failover of a recovery plan. @@ -1089,15 +1486,20 @@ def begin_test_failover( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverInput :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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -1108,28 +1510,21 @@ def begin_test_failover( raw_result = self._test_failover_initial( recovery_plan_name=recovery_plan_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1141,47 +1536,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_test_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailover'} # type: ignore def _test_failover_cleanup_initial( self, - recovery_plan_name, # type: str - input, # type: "_models.RecoveryPlanTestFailoverCleanupInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RecoveryPlan"] + recovery_plan_name: str, + input: "_models.RecoveryPlanTestFailoverCleanupInput", + **kwargs: Any + ) -> Optional["_models.RecoveryPlan"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RecoveryPlan"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._test_failover_cleanup_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'RecoveryPlanTestFailoverCleanupInput') + + request = build_test_failover_cleanup_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + content_type=content_type, + json=_json, + template_url=self._test_failover_cleanup_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'RecoveryPlanTestFailoverCleanupInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1197,15 +1582,17 @@ def _test_failover_cleanup_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _test_failover_cleanup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup'} # type: ignore + + @distributed_trace def begin_test_failover_cleanup( self, - recovery_plan_name, # type: str - input, # type: "_models.RecoveryPlanTestFailoverCleanupInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RecoveryPlan"] + recovery_plan_name: str, + input: "_models.RecoveryPlanTestFailoverCleanupInput", + **kwargs: Any + ) -> LROPoller["_models.RecoveryPlan"]: """Execute test failover cleanup of the recovery plan. The operation to cleanup test failover of a recovery plan. @@ -1213,18 +1600,24 @@ def begin_test_failover_cleanup( :param recovery_plan_name: Recovery plan name. :type recovery_plan_name: str :param input: Recovery plan test failover cleanup input. - :type input: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput + :type input: + ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanTestFailoverCleanupInput :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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -1235,28 +1628,21 @@ def begin_test_failover_cleanup( raw_result = self._test_failover_cleanup_initial( recovery_plan_name=recovery_plan_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1268,47 +1654,37 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_test_failover_cleanup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/testFailoverCleanup'} # type: ignore def _unplanned_failover_initial( self, - recovery_plan_name, # type: str - input, # type: "_models.RecoveryPlanUnplannedFailoverInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RecoveryPlan"] + recovery_plan_name: str, + input: "_models.RecoveryPlanUnplannedFailoverInput", + **kwargs: Any + ) -> Optional["_models.RecoveryPlan"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RecoveryPlan"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._unplanned_failover_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(input, 'RecoveryPlanUnplannedFailoverInput') + + request = build_unplanned_failover_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + recovery_plan_name=recovery_plan_name, + content_type=content_type, + json=_json, + template_url=self._unplanned_failover_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'RecoveryPlanUnplannedFailoverInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -1324,15 +1700,17 @@ def _unplanned_failover_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _unplanned_failover_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover'} # type: ignore + + @distributed_trace def begin_unplanned_failover( self, - recovery_plan_name, # type: str - input, # type: "_models.RecoveryPlanUnplannedFailoverInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RecoveryPlan"] + recovery_plan_name: str, + input: "_models.RecoveryPlanUnplannedFailoverInput", + **kwargs: Any + ) -> LROPoller["_models.RecoveryPlan"]: """Execute unplanned failover of the recovery plan. The operation to start the unplanned failover of a recovery plan. @@ -1343,15 +1721,20 @@ def begin_unplanned_failover( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlanUnplannedFailoverInput :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. + :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 RecoveryPlan or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryPlan or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryPlan] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPlan"] lro_delay = kwargs.pop( 'polling_interval', @@ -1362,28 +1745,21 @@ def begin_unplanned_failover( raw_result = self._unplanned_failover_initial( recovery_plan_name=recovery_plan_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryPlan', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'recoveryPlanName': self._serialize.url("recovery_plan_name", recovery_plan_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -1395,4 +1771,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_unplanned_failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryPlans/{recoveryPlanName}/unplannedFailover'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_recovery_services_providers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_recovery_services_providers_operations.py index 5e8f20fb840e..637b7b7868e4 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_recovery_services_providers_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_recovery_services_providers_operations.py @@ -5,25 +5,292 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_fabrics_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + provider_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "providerName": _SERIALIZER.url("provider_name", provider_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + provider_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "providerName": _SERIALIZER.url("provider_name", provider_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_purge_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + provider_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "providerName": _SERIALIZER.url("provider_name", provider_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_refresh_provider_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + provider_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "providerName": _SERIALIZER.url("provider_name", provider_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + provider_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "providerName": _SERIALIZER.url("provider_name", provider_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationRecoveryServicesProviders') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationRecoveryServicesProvidersOperations(object): """ReplicationRecoveryServicesProvidersOperations operations. @@ -47,12 +314,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_fabrics( self, - fabric_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RecoveryServicesProviderCollection"] + fabric_name: str, + **kwargs: Any + ) -> Iterable["_models.RecoveryServicesProviderCollection"]: """Gets the list of registered recovery services providers for the fabric. Lists the registered recovery services providers for the specified fabric. @@ -60,8 +327,10 @@ def list_by_replication_fabrics( :param fabric_name: Fabric name. :type fabric_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RecoveryServicesProviderCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProviderCollection] + :return: An iterator like instance of either RecoveryServicesProviderCollection or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProviderCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryServicesProviderCollection"] @@ -69,37 +338,35 @@ def list_by_replication_fabrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_fabrics.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self.list_by_replication_fabrics.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('RecoveryServicesProviderCollection', pipeline_response) + deserialized = self._deserialize("RecoveryServicesProviderCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,18 +384,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_replication_fabrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - provider_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RecoveryServicesProvider" + fabric_name: str, + provider_name: str, + **kwargs: Any + ) -> "_models.RecoveryServicesProvider": """Gets the details of a recovery services provider. Gets the details of registered recovery services provider. @@ -147,29 +415,19 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + provider_name=provider_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -183,49 +441,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}'} # type: ignore + def _create_initial( self, - fabric_name, # type: str - provider_name, # type: str - add_provider_input, # type: "_models.AddRecoveryServicesProviderInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RecoveryServicesProvider"] + fabric_name: str, + provider_name: str, + add_provider_input: "_models.AddRecoveryServicesProviderInput", + **kwargs: Any + ) -> Optional["_models.RecoveryServicesProvider"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RecoveryServicesProvider"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(add_provider_input, 'AddRecoveryServicesProviderInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + provider_name=provider_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(add_provider_input, 'AddRecoveryServicesProviderInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -241,16 +490,18 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}'} # type: ignore + + @distributed_trace def begin_create( self, - fabric_name, # type: str - provider_name, # type: str - add_provider_input, # type: "_models.AddRecoveryServicesProviderInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RecoveryServicesProvider"] + fabric_name: str, + provider_name: str, + add_provider_input: "_models.AddRecoveryServicesProviderInput", + **kwargs: Any + ) -> LROPoller["_models.RecoveryServicesProvider"]: """Adds a recovery services provider. The operation to add a recovery services provider. @@ -260,18 +511,24 @@ def begin_create( :param provider_name: Recovery services provider name. :type provider_name: str :param add_provider_input: Add provider input. - :type add_provider_input: ~azure.mgmt.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInput + :type add_provider_input: + ~azure.mgmt.recoveryservicessiterecovery.models.AddRecoveryServicesProviderInput :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. + :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 RecoveryServicesProvider or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProvider] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryServicesProvider or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProvider] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryServicesProvider"] lro_delay = kwargs.pop( 'polling_interval', @@ -283,29 +540,21 @@ def begin_create( fabric_name=fabric_name, provider_name=provider_name, add_provider_input=add_provider_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryServicesProvider', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -317,41 +566,33 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}'} # type: ignore def _purge_initial( self, - fabric_name, # type: str - provider_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + fabric_name: str, + provider_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._purge_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_purge_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + provider_name=provider_name, + template_url=self._purge_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -364,13 +605,14 @@ def _purge_initial( _purge_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}'} # type: ignore + + @distributed_trace def begin_purge( self, - fabric_name, # type: str - provider_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + fabric_name: str, + provider_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Purges recovery service provider from fabric. The operation to purge(force delete) a recovery services provider from the vault. @@ -381,15 +623,17 @@ def begin_purge( :type provider_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -403,23 +647,14 @@ def begin_purge( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -431,43 +666,33 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}'} # type: ignore def _refresh_provider_initial( self, - fabric_name, # type: str - provider_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.RecoveryServicesProvider"] + fabric_name: str, + provider_name: str, + **kwargs: Any + ) -> Optional["_models.RecoveryServicesProvider"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.RecoveryServicesProvider"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._refresh_provider_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_refresh_provider_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + provider_name=provider_name, + template_url=self._refresh_provider_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -483,15 +708,17 @@ def _refresh_provider_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _refresh_provider_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider'} # type: ignore + + @distributed_trace def begin_refresh_provider( self, - fabric_name, # type: str - provider_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RecoveryServicesProvider"] + fabric_name: str, + provider_name: str, + **kwargs: Any + ) -> LROPoller["_models.RecoveryServicesProvider"]: """Refresh details from the recovery services provider. The operation to refresh the information from the recovery services provider. @@ -502,15 +729,19 @@ def begin_refresh_provider( :type provider_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. + :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 RecoveryServicesProvider or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProvider] - :raises ~azure.core.exceptions.HttpResponseError: + :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 RecoveryServicesProvider or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProvider] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryServicesProvider"] lro_delay = kwargs.pop( 'polling_interval', @@ -524,26 +755,17 @@ def begin_refresh_provider( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('RecoveryServicesProvider', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -555,41 +777,33 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_refresh_provider.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/refreshProvider'} # type: ignore def _delete_initial( self, - fabric_name, # type: str - provider_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + fabric_name: str, + provider_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + provider_name=provider_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -602,14 +816,18 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove'} # type: ignore + + @distributed_trace def begin_delete( self, - fabric_name, # type: str - provider_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is unsupported. To maintain backward compatibility for released clients the object "deleteRspInput" is used (if the object is empty we assume that it is old client and continue the old behavior). + fabric_name: str, + provider_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes provider from fabric. Note: Deleting provider for any fabric other than SingleHost is + unsupported. To maintain backward compatibility for released clients the object + "deleteRspInput" is used (if the object is empty we assume that it is old client and continue + the old behavior). The operation to removes/delete(unregister) a recovery services provider from the vault. @@ -619,15 +837,17 @@ def begin_delete( :type provider_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -641,23 +861,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'providerName': self._serialize.url("provider_name", provider_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -669,20 +880,23 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationRecoveryServicesProviders/{providerName}/remove'} # type: ignore + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RecoveryServicesProviderCollection"] + **kwargs: Any + ) -> Iterable["_models.RecoveryServicesProviderCollection"]: """Gets the list of registered recovery services providers in the vault. This is a view only api. Lists the registered recovery services providers in the vault. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RecoveryServicesProviderCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProviderCollection] + :return: An iterator like instance of either RecoveryServicesProviderCollection or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.RecoveryServicesProviderCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryServicesProviderCollection"] @@ -690,36 +904,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('RecoveryServicesProviderCollection', pipeline_response) + deserialized = self._deserialize("RecoveryServicesProviderCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -737,6 +948,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_storage_classification_mappings_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_storage_classification_mappings_operations.py index 7cb2f2dd90df..e651411bf617 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_storage_classification_mappings_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_storage_classification_mappings_operations.py @@ -5,25 +5,228 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_storage_classifications_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + storage_classification_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "storageClassificationName": _SERIALIZER.url("storage_classification_name", storage_classification_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + storage_classification_name: str, + storage_classification_mapping_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "storageClassificationName": _SERIALIZER.url("storage_classification_name", storage_classification_name, 'str'), + "storageClassificationMappingName": _SERIALIZER.url("storage_classification_mapping_name", storage_classification_mapping_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + storage_classification_name: str, + storage_classification_mapping_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "storageClassificationName": _SERIALIZER.url("storage_classification_name", storage_classification_name, 'str'), + "storageClassificationMappingName": _SERIALIZER.url("storage_classification_mapping_name", storage_classification_mapping_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + storage_classification_name: str, + storage_classification_mapping_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "storageClassificationName": _SERIALIZER.url("storage_classification_name", storage_classification_name, 'str'), + "storageClassificationMappingName": _SERIALIZER.url("storage_classification_mapping_name", storage_classification_mapping_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassificationMappings') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationStorageClassificationMappingsOperations(object): """ReplicationStorageClassificationMappingsOperations operations. @@ -47,13 +250,13 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_storage_classifications( self, - fabric_name, # type: str - storage_classification_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.StorageClassificationMappingCollection"] + fabric_name: str, + storage_classification_name: str, + **kwargs: Any + ) -> Iterable["_models.StorageClassificationMappingCollection"]: """Gets the list of storage classification mappings objects under a storage. Lists the storage classification mappings for the fabric. @@ -63,8 +266,10 @@ def list_by_replication_storage_classifications( :param storage_classification_name: Storage classification name. :type storage_classification_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either StorageClassificationMappingCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingCollection] + :return: An iterator like instance of either StorageClassificationMappingCollection or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageClassificationMappingCollection"] @@ -72,38 +277,37 @@ def list_by_replication_storage_classifications( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_storage_classifications.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'storageClassificationName': self._serialize.url("storage_classification_name", storage_classification_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_storage_classifications_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + storage_classification_name=storage_classification_name, + template_url=self.list_by_replication_storage_classifications.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_storage_classifications_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + storage_classification_name=storage_classification_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('StorageClassificationMappingCollection', pipeline_response) + deserialized = self._deserialize("StorageClassificationMappingCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -121,19 +325,20 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_replication_storage_classifications.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - storage_classification_name, # type: str - storage_classification_mapping_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.StorageClassificationMapping" + fabric_name: str, + storage_classification_name: str, + storage_classification_mapping_name: str, + **kwargs: Any + ) -> "_models.StorageClassificationMapping": """Gets the details of a storage classification mapping. Gets the details of the specified storage classification mapping. @@ -154,30 +359,20 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'storageClassificationName': self._serialize.url("storage_classification_name", storage_classification_name, 'str'), - 'storageClassificationMappingName': self._serialize.url("storage_classification_mapping_name", storage_classification_mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + storage_classification_name=storage_classification_name, + storage_classification_mapping_name=storage_classification_mapping_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -191,51 +386,42 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}'} # type: ignore + def _create_initial( self, - fabric_name, # type: str - storage_classification_name, # type: str - storage_classification_mapping_name, # type: str - pairing_input, # type: "_models.StorageClassificationMappingInput" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.StorageClassificationMapping"] + fabric_name: str, + storage_classification_name: str, + storage_classification_mapping_name: str, + pairing_input: "_models.StorageClassificationMappingInput", + **kwargs: Any + ) -> Optional["_models.StorageClassificationMapping"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StorageClassificationMapping"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'storageClassificationName': self._serialize.url("storage_classification_name", storage_classification_name, 'str'), - 'storageClassificationMappingName': self._serialize.url("storage_classification_mapping_name", storage_classification_mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(pairing_input, 'StorageClassificationMappingInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + storage_classification_name=storage_classification_name, + storage_classification_mapping_name=storage_classification_mapping_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(pairing_input, 'StorageClassificationMappingInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,17 +437,19 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}'} # type: ignore + + @distributed_trace def begin_create( self, - fabric_name, # type: str - storage_classification_name, # type: str - storage_classification_mapping_name, # type: str - pairing_input, # type: "_models.StorageClassificationMappingInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.StorageClassificationMapping"] + fabric_name: str, + storage_classification_name: str, + storage_classification_mapping_name: str, + pairing_input: "_models.StorageClassificationMappingInput", + **kwargs: Any + ) -> LROPoller["_models.StorageClassificationMapping"]: """Create storage classification mapping. The operation to create a storage classification mapping. @@ -273,18 +461,24 @@ def begin_create( :param storage_classification_mapping_name: Storage classification mapping name. :type storage_classification_mapping_name: str :param pairing_input: Pairing input. - :type pairing_input: ~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingInput + :type pairing_input: + ~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingInput :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. + :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 StorageClassificationMapping or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMapping] - :raises ~azure.core.exceptions.HttpResponseError: + :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 StorageClassificationMapping or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMapping] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageClassificationMapping"] lro_delay = kwargs.pop( 'polling_interval', @@ -297,30 +491,21 @@ def begin_create( storage_classification_name=storage_classification_name, storage_classification_mapping_name=storage_classification_mapping_name, pairing_input=pairing_input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('StorageClassificationMapping', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'storageClassificationName': self._serialize.url("storage_classification_name", storage_classification_name, 'str'), - 'storageClassificationMappingName': self._serialize.url("storage_classification_mapping_name", storage_classification_mapping_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -332,43 +517,35 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}'} # type: ignore def _delete_initial( self, - fabric_name, # type: str - storage_classification_name, # type: str - storage_classification_mapping_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + fabric_name: str, + storage_classification_name: str, + storage_classification_mapping_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'storageClassificationName': self._serialize.url("storage_classification_name", storage_classification_name, 'str'), - 'storageClassificationMappingName': self._serialize.url("storage_classification_mapping_name", storage_classification_mapping_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + storage_classification_name=storage_classification_name, + storage_classification_mapping_name=storage_classification_mapping_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -381,14 +558,15 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}'} # type: ignore + + @distributed_trace def begin_delete( self, - fabric_name, # type: str - storage_classification_name, # type: str - storage_classification_mapping_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + fabric_name: str, + storage_classification_name: str, + storage_classification_mapping_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Delete a storage classification mapping. The operation to delete a storage classification mapping. @@ -401,15 +579,17 @@ def begin_delete( :type storage_classification_mapping_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -424,24 +604,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'storageClassificationName': self._serialize.url("storage_classification_name", storage_classification_name, 'str'), - 'storageClassificationMappingName': self._serialize.url("storage_classification_mapping_name", storage_classification_mapping_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -453,20 +623,23 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}/replicationStorageClassificationMappings/{storageClassificationMappingName}'} # type: ignore + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.StorageClassificationMappingCollection"] + **kwargs: Any + ) -> Iterable["_models.StorageClassificationMappingCollection"]: """Gets the list of storage classification mappings objects under a vault. Lists the storage classification mappings in the vault. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either StorageClassificationMappingCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingCollection] + :return: An iterator like instance of either StorageClassificationMappingCollection or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationMappingCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageClassificationMappingCollection"] @@ -474,36 +647,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('StorageClassificationMappingCollection', pipeline_response) + deserialized = self._deserialize("StorageClassificationMappingCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -521,6 +691,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_storage_classifications_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_storage_classifications_operations.py index a686f82ec3c0..079d4866ee13 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_storage_classifications_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_storage_classifications_operations.py @@ -5,23 +5,136 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_fabrics_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + storage_classification_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "storageClassificationName": _SERIALIZER.url("storage_classification_name", storage_classification_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationStorageClassifications') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationStorageClassificationsOperations(object): """ReplicationStorageClassificationsOperations operations. @@ -45,12 +158,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_fabrics( self, - fabric_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.StorageClassificationCollection"] + fabric_name: str, + **kwargs: Any + ) -> Iterable["_models.StorageClassificationCollection"]: """Gets the list of storage classification objects under a fabric. Lists the storage classifications available in the specified fabric. @@ -58,8 +171,10 @@ def list_by_replication_fabrics( :param fabric_name: Site name of interest. :type fabric_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either StorageClassificationCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationCollection] + :return: An iterator like instance of either StorageClassificationCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageClassificationCollection"] @@ -67,37 +182,35 @@ def list_by_replication_fabrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_fabrics.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self.list_by_replication_fabrics.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('StorageClassificationCollection', pipeline_response) + deserialized = self._deserialize("StorageClassificationCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,18 +228,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_replication_fabrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - storage_classification_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.StorageClassification" + fabric_name: str, + storage_classification_name: str, + **kwargs: Any + ) -> "_models.StorageClassification": """Gets the details of a storage classification. Gets the details of the specified storage classification. @@ -145,29 +259,19 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'storageClassificationName': self._serialize.url("storage_classification_name", storage_classification_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + storage_classification_name=storage_classification_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -181,20 +285,24 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationStorageClassifications/{storageClassificationName}'} # type: ignore + + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.StorageClassificationCollection"] + **kwargs: Any + ) -> Iterable["_models.StorageClassificationCollection"]: """Gets the list of storage classification objects under a vault. Lists the storage classifications in the vault. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either StorageClassificationCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationCollection] + :return: An iterator like instance of either StorageClassificationCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.StorageClassificationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageClassificationCollection"] @@ -202,36 +310,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('StorageClassificationCollection', pipeline_response) + deserialized = self._deserialize("StorageClassificationCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -249,6 +354,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_vault_health_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_vault_health_operations.py index b7277e7ba229..2961761391f2 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_vault_health_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_vault_health_operations.py @@ -5,24 +5,96 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_refresh_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationVaultHealthOperations(object): """ReplicationVaultHealthOperations operations. @@ -46,11 +118,11 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get( self, - **kwargs # type: Any - ): - # type: (...) -> "_models.VaultHealthDetails" + **kwargs: Any + ) -> "_models.VaultHealthDetails": """Gets the health summary for the vault. Gets the health details of the vault. @@ -65,27 +137,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,39 +161,30 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth'} # type: ignore + def _refresh_initial( self, - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.VaultHealthDetails"] + **kwargs: Any + ) -> Optional["_models.VaultHealthDetails"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VaultHealthDetails"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self._refresh_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_refresh_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self._refresh_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -147,28 +200,34 @@ def _refresh_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _refresh_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh'} # type: ignore + + @distributed_trace def begin_refresh( self, - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.VaultHealthDetails"] + **kwargs: Any + ) -> LROPoller["_models.VaultHealthDetails"]: """Refreshes health summary of the vault. Refreshes health summary of the vault. :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. + :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 VaultHealthDetails or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.VaultHealthDetails] - :raises ~azure.core.exceptions.HttpResponseError: + :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 VaultHealthDetails or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.VaultHealthDetails] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.VaultHealthDetails"] lro_delay = kwargs.pop( 'polling_interval', @@ -180,24 +239,17 @@ def begin_refresh( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('VaultHealthDetails', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -209,4 +261,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_refresh.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_vault_setting_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_vault_setting_operations.py index ad44479aaecf..a3da52f54f99 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_vault_setting_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replication_vault_setting_operations.py @@ -5,25 +5,146 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + vault_setting_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "vaultSettingName": _SERIALIZER.url("vault_setting_name", vault_setting_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + vault_setting_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "vaultSettingName": _SERIALIZER.url("vault_setting_name", vault_setting_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) class ReplicationVaultSettingOperations(object): """ReplicationVaultSettingOperations operations. @@ -47,18 +168,20 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.VaultSettingCollection"] + **kwargs: Any + ) -> Iterable["_models.VaultSettingCollection"]: """Gets the list of vault setting. Gets the list of vault setting. This includes the Migration Hub connection settings. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VaultSettingCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.VaultSettingCollection] + :return: An iterator like instance of either VaultSettingCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.VaultSettingCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.VaultSettingCollection"] @@ -66,36 +189,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('VaultSettingCollection', pipeline_response) + deserialized = self._deserialize("VaultSettingCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -113,17 +233,18 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings'} # type: ignore + @distributed_trace def get( self, - vault_setting_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VaultSetting" + vault_setting_name: str, + **kwargs: Any + ) -> "_models.VaultSetting": """Gets the vault setting. Gets the vault setting. This includes the Migration Hub connection settings. @@ -140,28 +261,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'vaultSettingName': self._serialize.url("vault_setting_name", vault_setting_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + vault_setting_name=vault_setting_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -175,47 +286,38 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}'} # type: ignore + def _create_initial( self, - vault_setting_name, # type: str - input, # type: "_models.VaultSettingCreationInput" - **kwargs # type: Any - ): - # type: (...) -> "_models.VaultSetting" + vault_setting_name: str, + input: "_models.VaultSettingCreationInput", + **kwargs: Any + ) -> "_models.VaultSetting": cls = kwargs.pop('cls', None) # type: ClsType["_models.VaultSetting"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'vaultSettingName': self._serialize.url("vault_setting_name", vault_setting_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(input, 'VaultSettingCreationInput') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + vault_setting_name=vault_setting_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(input, 'VaultSettingCreationInput') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -229,16 +331,19 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}'} # type: ignore + + @distributed_trace def begin_create( self, - vault_setting_name, # type: str - input, # type: "_models.VaultSettingCreationInput" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.VaultSetting"] - """Updates vault setting. A vault setting object is a singleton per vault and it is always present by default. + vault_setting_name: str, + input: "_models.VaultSettingCreationInput", + **kwargs: Any + ) -> LROPoller["_models.VaultSetting"]: + """Updates vault setting. A vault setting object is a singleton per vault and it is always present + by default. The operation to configure vault setting. @@ -248,15 +353,20 @@ def begin_create( :type input: ~azure.mgmt.recoveryservicessiterecovery.models.VaultSettingCreationInput :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. + :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 VaultSetting or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.VaultSetting] - :raises ~azure.core.exceptions.HttpResponseError: + :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 VaultSetting or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.VaultSetting] + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.VaultSetting"] lro_delay = kwargs.pop( 'polling_interval', @@ -267,28 +377,21 @@ def begin_create( raw_result = self._create_initial( vault_setting_name=vault_setting_name, input=input, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('VaultSetting', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'vaultSettingName': self._serialize.url("vault_setting_name", vault_setting_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -300,4 +403,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultSettings/{vaultSettingName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replicationv_centers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replicationv_centers_operations.py index 380e2d21010c..c1b268f03350 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replicationv_centers_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_replicationv_centers_operations.py @@ -5,25 +5,268 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +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.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_fabrics_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + vcenter_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "vcenterName": _SERIALIZER.url("vcenter_name", vcenter_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_create_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + vcenter_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "vcenterName": _SERIALIZER.url("vcenter_name", vcenter_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_delete_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + vcenter_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "vcenterName": _SERIALIZER.url("vcenter_name", vcenter_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + return HttpRequest( + method="DELETE", + url=url, + params=query_parameters, + **kwargs + ) + + +def build_update_request_initial( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + vcenter_name: str, + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "vcenterName": _SERIALIZER.url("vcenter_name", vcenter_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_list_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationvCenters') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class ReplicationvCentersOperations(object): """ReplicationvCentersOperations operations. @@ -47,12 +290,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_fabrics( self, - fabric_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.VCenterCollection"] + fabric_name: str, + **kwargs: Any + ) -> Iterable["_models.VCenterCollection"]: """Gets the list of vCenter registered under a fabric. Lists the vCenter servers registered in a fabric. @@ -61,7 +304,8 @@ def list_by_replication_fabrics( :type fabric_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VCenterCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.VCenterCollection] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.VCenterCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenterCollection"] @@ -69,37 +313,35 @@ def list_by_replication_fabrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_fabrics.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=self.list_by_replication_fabrics.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_fabrics_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('VCenterCollection', pipeline_response) + deserialized = self._deserialize("VCenterCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,18 +359,19 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) list_by_replication_fabrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters'} # type: ignore + @distributed_trace def get( self, - fabric_name, # type: str - vcenter_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VCenter" + fabric_name: str, + vcenter_name: str, + **kwargs: Any + ) -> "_models.VCenter": """Gets the details of a vCenter. Gets the details of a registered vCenter server(Add vCenter server). @@ -147,29 +390,19 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + vcenter_name=vcenter_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -183,49 +416,40 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}'} # type: ignore + def _create_initial( self, - fabric_name, # type: str - vcenter_name, # type: str - add_v_center_request, # type: "_models.AddVCenterRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.VCenter"] + fabric_name: str, + vcenter_name: str, + add_v_center_request: "_models.AddVCenterRequest", + **kwargs: Any + ) -> Optional["_models.VCenter"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VCenter"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(add_v_center_request, 'AddVCenterRequest') + + request = build_create_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + vcenter_name=vcenter_name, + content_type=content_type, + json=_json, + template_url=self._create_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(add_v_center_request, 'AddVCenterRequest') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -241,16 +465,18 @@ def _create_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}'} # type: ignore + + @distributed_trace def begin_create( self, - fabric_name, # type: str - vcenter_name, # type: str - add_v_center_request, # type: "_models.AddVCenterRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.VCenter"] + fabric_name: str, + vcenter_name: str, + add_v_center_request: "_models.AddVCenterRequest", + **kwargs: Any + ) -> LROPoller["_models.VCenter"]: """Add vCenter. The operation to create a vCenter object.. @@ -263,15 +489,18 @@ def begin_create( :type add_v_center_request: ~azure.mgmt.recoveryservicessiterecovery.models.AddVCenterRequest :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. + :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. + :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 VCenter or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.VCenter] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenter"] lro_delay = kwargs.pop( 'polling_interval', @@ -283,29 +512,21 @@ def begin_create( fabric_name=fabric_name, vcenter_name=vcenter_name, add_v_center_request=add_v_center_request, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('VCenter', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -317,41 +538,33 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}'} # type: ignore def _delete_initial( self, - fabric_name, # type: str - vcenter_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + fabric_name: str, + vcenter_name: str, + **kwargs: Any + ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] + + request = build_delete_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + vcenter_name=vcenter_name, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -364,13 +577,14 @@ def _delete_initial( _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}'} # type: ignore + + @distributed_trace def begin_delete( self, - fabric_name, # type: str - vcenter_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] + fabric_name: str, + vcenter_name: str, + **kwargs: Any + ) -> LROPoller[None]: """Remove vcenter operation. The operation to remove(unregister) a registered vCenter server from the vault. @@ -381,15 +595,17 @@ def begin_delete( :type vcenter_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. + :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. + :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: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -403,23 +619,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -431,49 +638,39 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}'} # type: ignore def _update_initial( self, - fabric_name, # type: str - vcenter_name, # type: str - update_v_center_request, # type: "_models.UpdateVCenterRequest" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.VCenter"] + fabric_name: str, + vcenter_name: str, + update_v_center_request: "_models.UpdateVCenterRequest", + **kwargs: Any + ) -> Optional["_models.VCenter"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VCenter"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + _json = self._serialize.body(update_v_center_request, 'UpdateVCenterRequest') + + request = build_update_request_initial( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + vcenter_name=vcenter_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(update_v_center_request, 'UpdateVCenterRequest') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -489,16 +686,18 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}'} # type: ignore + + @distributed_trace def begin_update( self, - fabric_name, # type: str - vcenter_name, # type: str - update_v_center_request, # type: "_models.UpdateVCenterRequest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.VCenter"] + fabric_name: str, + vcenter_name: str, + update_v_center_request: "_models.UpdateVCenterRequest", + **kwargs: Any + ) -> LROPoller["_models.VCenter"]: """Update vCenter operation. The operation to update a registered vCenter. @@ -508,18 +707,22 @@ def begin_update( :param vcenter_name: vcenter name. :type vcenter_name: str :param update_v_center_request: The input to the update vCenter operation. - :type update_v_center_request: ~azure.mgmt.recoveryservicessiterecovery.models.UpdateVCenterRequest + :type update_v_center_request: + ~azure.mgmt.recoveryservicessiterecovery.models.UpdateVCenterRequest :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. + :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. + :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 VCenter or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.VCenter] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenter"] lro_delay = kwargs.pop( 'polling_interval', @@ -531,29 +734,21 @@ def begin_update( fabric_name=fabric_name, vcenter_name=vcenter_name, update_v_center_request=update_v_center_request, + content_type=content_type, cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): + response = pipeline_response.http_response deserialized = self._deserialize('VCenter', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'vcenterName': self._serialize.url("vcenter_name", vcenter_name, 'str'), - } - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -565,20 +760,22 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vcenterName}'} # type: ignore + @distributed_trace def list( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.VCenterCollection"] + **kwargs: Any + ) -> Iterable["_models.VCenterCollection"]: """Gets the list of vCenter registered under the vault. Lists the vCenter servers registered in the vault. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either VCenterCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.VCenterCollection] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.VCenterCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.VCenterCollection"] @@ -586,36 +783,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('VCenterCollection', pipeline_response) + deserialized = self._deserialize("VCenterCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -633,6 +827,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_supported_operating_systems_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_supported_operating_systems_operations.py index 48a0c5322e2f..d90b24e262dd 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_supported_operating_systems_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_supported_operating_systems_operations.py @@ -5,22 +5,63 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_get_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + *, + instance_type: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationSupportedOperatingSystems') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if instance_type is not None: + query_parameters['instanceType'] = _SERIALIZER.query("instance_type", instance_type, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class SupportedOperatingSystemsOperations(object): """SupportedOperatingSystemsOperations operations. @@ -44,12 +85,12 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get( self, - instance_type=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.SupportedOperatingSystems" + instance_type: Optional[str] = None, + **kwargs: Any + ) -> "_models.SupportedOperatingSystems": """Gets the data of supported operating systems by SRS. Gets the data of supported operating systems by SRS. @@ -66,29 +107,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if instance_type is not None: - query_parameters['instanceType'] = self._serialize.query("instance_type", instance_type, 'str') + + request = build_get_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + instance_type=instance_type, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -102,4 +132,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationSupportedOperatingSystems'} # type: ignore + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_target_compute_sizes_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_target_compute_sizes_operations.py index 0f33a774a7a4..97831aed7461 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_target_compute_sizes_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicessiterecovery/azure/mgmt/recoveryservicessiterecovery/operations/_target_compute_sizes_operations.py @@ -5,23 +5,66 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat +from msrest import Serializer from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_list_by_replication_protected_items_request( + resource_name: str, + resource_group_name: str, + subscription_id: str, + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2022-01-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/targetComputeSizes') + path_format_arguments = { + "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'), + "protectionContainerName": _SERIALIZER.url("protection_container_name", protection_container_name, 'str'), + "replicatedProtectedItemName": _SERIALIZER.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) class TargetComputeSizesOperations(object): """TargetComputeSizesOperations operations. @@ -45,14 +88,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list_by_replication_protected_items( self, - fabric_name, # type: str - protection_container_name, # type: str - replicated_protected_item_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.TargetComputeSizeCollection"] + fabric_name: str, + protection_container_name: str, + replicated_protected_item_name: str, + **kwargs: Any + ) -> Iterable["_models.TargetComputeSizeCollection"]: """Gets the list of target compute sizes for the replication protected item. Lists the available target compute sizes for a replication protected item. @@ -64,8 +107,10 @@ def list_by_replication_protected_items( :param replicated_protected_item_name: Replication protected item name. :type replicated_protected_item_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either TargetComputeSizeCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.TargetComputeSizeCollection] + :return: An iterator like instance of either TargetComputeSizeCollection or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicessiterecovery.models.TargetComputeSizeCollection] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TargetComputeSizeCollection"] @@ -73,39 +118,39 @@ def list_by_replication_protected_items( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-01" - accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - if not next_link: - # Construct URL - url = self.list_by_replication_protected_items.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceName': self._serialize.url("self._config.resource_name", self._config.resource_name, 'str'), - 'resourceGroupName': self._serialize.url("self._config.resource_group_name", self._config.resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), - 'protectionContainerName': self._serialize.url("protection_container_name", protection_container_name, 'str'), - 'replicatedProtectedItemName': self._serialize.url("replicated_protected_item_name", replicated_protected_item_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protected_items_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=self.list_by_replication_protected_items.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_by_replication_protected_items_request( + resource_name=self._config.resource_name, + resource_group_name=self._config.resource_group_name, + subscription_id=self._config.subscription_id, + fabric_name=fabric_name, + protection_container_name=protection_container_name, + replicated_protected_item_name=replicated_protected_item_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" return request def extract_data(pipeline_response): - deserialized = self._deserialize('TargetComputeSizeCollection', pipeline_response) + deserialized = self._deserialize("TargetComputeSizeCollection", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -123,6 +168,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data )