diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/CHANGELOG.md b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/CHANGELOG.md new file mode 100644 index 000000000000..aae7e8dbf1b9 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/CHANGELOG.md @@ -0,0 +1,447 @@ +# Release History + +## 1.0.0b1 (2021-05-14) + +This is beta preview version. + +This version uses a next-generation code generator that introduces important breaking changes, but also important new features (like unified authentication and async programming). + +**General breaking changes** + +- Credential system has been completly revamped: + + - `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported, use the `azure-identity` classes instead: https://pypi.org/project/azure-identity/ + - `credentials` parameter has been renamed `credential` + +- The `config` attribute no longer exists on a client, configuration should be passed as kwarg. Example: `MyClient(credential, subscription_id, enable_logging=True)`. For a complete set of + supported options, see the [parameters accept in init documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies) +- You can't import a `version` module anymore, use `__version__` instead +- Operations that used to return a `msrest.polling.LROPoller` now returns a `azure.core.polling.LROPoller` and are prefixed with `begin_`. +- Exceptions tree have been simplified and most exceptions are now `azure.core.exceptions.HttpResponseError` (`CloudError` has been removed). +- Most of the operation kwarg have changed. Some of the most noticeable: + + - `raw` has been removed. Equivalent feature can be found using `cls`, a callback that will give access to internal HTTP response for advanced user + - For a complete set of + supported options, see the [parameters accept in Request documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies) + +**General new features** + +- Type annotations support using `typing`. SDKs are mypy ready. +- This client has now stable and official support for async. Check the `aio` namespace of your package to find the async client. +- This client now support natively tracing library like OpenCensus or OpenTelemetry. See this [tracing quickstart](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/core/azure-core-tracing-opentelemetry) for an overview. + +## 0.11.0 (2020-12-28) + +**Features** + + - Model IaasVMRecoveryPoint has a new parameter zones + - Model IaasVMRestoreRequest has a new parameter zones + +## 0.10.0 (2020-12-08) + +**Features** + + - Model IaasVMRestoreRequest has a new parameter disk_encryption_set_id + - Model IaasVMRestoreRequest has a new parameter restore_with_managed_disks + - Model BackupResourceConfig has a new parameter cross_region_restore_flag + - Model AzureFileshareProtectedItem has a new parameter health_status + - Added operation RecoveryPointsOperations.get_access_token + - Added operation group AadPropertiesOperations + - Added operation group CrossRegionRestoreOperations + - Added operation group BackupCrrJobDetailsOperations + - Added operation group PrivateEndpointOperations + - Added operation group BackupCrrJobsOperations + - Added operation group RecoveryPointsCrrOperations + - Added operation group CrrOperationResultsOperations + - Added operation group CrrOperationStatusOperations + - Added operation group BackupProtectedItemsCrrOperations + +**Breaking changes** + + - Removed operation RecoveryServicesBackupClientOperationsMixin.get_operation_status1 + +## 0.9.0 (2020-12-07) + +**Features** + + - Model AzureFileshareProtectedItem has a new parameter kpis_healths + - Model AzureIaaSVMProtectedItem has a new parameter kpis_healths + - Model AzureIaaSClassicComputeVMProtectedItem has a new parameter kpis_healths + - Model AzureVmWorkloadProtectedItem has a new parameter kpis_healths + - Model AzureVmWorkloadSAPHanaDatabaseProtectedItem has a new parameter kpis_healths + - Model AzureIaaSComputeVMProtectedItem has a new parameter kpis_healths + - Model AzureVmWorkloadSAPAseDatabaseProtectedItem has a new parameter kpis_healths + - Model AzureVmWorkloadSQLDatabaseProtectedItem has a new parameter kpis_healths + - Added operation RecoveryServicesBackupClientOperationsMixin.bms_prepare_data_move + - Added operation RecoveryServicesBackupClientOperationsMixin.bms_trigger_data_move + - Added operation RecoveryServicesBackupClientOperationsMixin.get_operation_status1 + - Added operation group BackupResourceEncryptionConfigsOperations + - Added operation group BMSPrepareDataMoveOperationResultOperations + +**Breaking changes** + + - Model AzureFileshareProtectedItem no longer has parameter health_status + - Model AzureFileshareProtectedItem no longer has parameter health_details + - Model AzureVmWorkloadProtectedItem no longer has parameter health_status + - Model AzureVmWorkloadProtectedItem no longer has parameter health_details + - Model AzureVmWorkloadSAPHanaDatabaseProtectedItem no longer has parameter health_status + - Model AzureVmWorkloadSAPHanaDatabaseProtectedItem no longer has parameter health_details + - Model AzureVmWorkloadSAPAseDatabaseProtectedItem no longer has parameter health_status + - Model AzureVmWorkloadSAPAseDatabaseProtectedItem no longer has parameter health_details + - Model AzureVmWorkloadSQLDatabaseProtectedItem no longer has parameter health_status + - Model AzureVmWorkloadSQLDatabaseProtectedItem no longer has parameter health_details + +## 0.8.0 (2020-06-05) + +**Features** + + - Model AzureVmWorkloadSAPHanaDatabaseProtectedItem has a new parameter health_details + - Model AzureVmWorkloadSAPHanaDatabaseProtectedItem has a new parameter health_status + - Model AzureVmWorkloadSQLDatabaseProtectedItem has a new parameter health_details + - Model AzureVmWorkloadSQLDatabaseProtectedItem has a new parameter health_status + - Model AzureFileshareProtectedItem has a new parameter health_details + - Model AzureVmWorkloadSAPAseDatabaseProtectedItem has a new parameter health_details + - Model AzureVmWorkloadSAPAseDatabaseProtectedItem has a new parameter health_status + - Model AzureVmWorkloadProtectedItem has a new parameter health_details + - Model AzureVmWorkloadProtectedItem has a new parameter health_status + +## 0.7.0 (2020-03-24) + +**Features** + + - Added operation BackupResourceVaultConfigsOperations.put + - Added operation group RecoveryServicesBackupClientOperationsMixin + - Added operation group PrivateEndpointConnectionOperations + +## 0.6.0 (2020-01-14) + +**Features** + + - Model TargetRestoreInfo has a new parameter + target_directory_for_file_restore + - Model AzureIaaSVMProtectionPolicy has a new parameter + instant_rp_details + +## 0.5.0 (2019-11-21) + +**Features** + + - Model AzureVmWorkloadProtectedItem has a new parameter + deferred_delete_time_remaining + - Model AzureVmWorkloadProtectedItem has a new parameter + is_deferred_delete_schedule_upcoming + - Model AzureVmWorkloadProtectedItem has a new parameter is_rehydrate + - Model AzureVmWorkloadProtectedItem has a new parameter + deferred_delete_time_in_utc + - Model AzureVmWorkloadProtectedItem has a new parameter + is_scheduled_for_deferred_delete + - Model AzureFileshareProtectedItemExtendedInfo has a new parameter + resource_state + - Model AzureFileshareProtectedItemExtendedInfo has a new parameter + resource_state_sync_time + - Model AzureIaaSClassicComputeVMProtectedItem has a new parameter + deferred_delete_time_remaining + - Model AzureIaaSClassicComputeVMProtectedItem has a new parameter + is_deferred_delete_schedule_upcoming + - Model AzureIaaSClassicComputeVMProtectedItem has a new parameter + extended_properties + - Model AzureIaaSClassicComputeVMProtectedItem has a new parameter + is_rehydrate + - Model AzureIaaSClassicComputeVMProtectedItem has a new parameter + deferred_delete_time_in_utc + - Model AzureIaaSClassicComputeVMProtectedItem has a new parameter + is_scheduled_for_deferred_delete + - Model AzureWorkloadSAPHanaPointInTimeRestoreRequest has a new + parameter recovery_mode + - Model AzureVmWorkloadProtectionPolicy has a new parameter + make_policy_consistent + - Model AzureIaaSVMProtectedItem has a new parameter + deferred_delete_time_remaining + - Model AzureIaaSVMProtectedItem has a new parameter + is_deferred_delete_schedule_upcoming + - Model AzureIaaSVMProtectedItem has a new parameter + extended_properties + - Model AzureIaaSVMProtectedItem has a new parameter is_rehydrate + - Model AzureIaaSVMProtectedItem has a new parameter + deferred_delete_time_in_utc + - Model AzureIaaSVMProtectedItem has a new parameter + is_scheduled_for_deferred_delete + - Model DPMProtectedItem has a new parameter + deferred_delete_time_in_utc + - Model DPMProtectedItem has a new parameter is_rehydrate + - Model DPMProtectedItem has a new parameter + deferred_delete_time_remaining + - Model DPMProtectedItem has a new parameter + is_deferred_delete_schedule_upcoming + - Model AzureWorkloadRestoreRequest has a new parameter recovery_mode + - Model AzureWorkloadSAPHanaRestoreRequest has a new parameter + recovery_mode + - Model ProtectedItem has a new parameter + deferred_delete_time_remaining + - Model ProtectedItem has a new parameter + is_deferred_delete_schedule_upcoming + - Model ProtectedItem has a new parameter is_rehydrate + - Model ProtectedItem has a new parameter + deferred_delete_time_in_utc + - Model ProtectedItem has a new parameter + is_scheduled_for_deferred_delete + - Model AzureWorkloadSQLRestoreRequest has a new parameter + recovery_mode + - Model InquiryValidation has a new parameter additional_detail + - Model AzureVmWorkloadSQLDatabaseProtectedItem has a new parameter + deferred_delete_time_remaining + - Model AzureVmWorkloadSQLDatabaseProtectedItem has a new parameter + is_deferred_delete_schedule_upcoming + - Model AzureVmWorkloadSQLDatabaseProtectedItem has a new parameter + is_rehydrate + - Model AzureVmWorkloadSQLDatabaseProtectedItem has a new parameter + deferred_delete_time_in_utc + - Model AzureVmWorkloadSQLDatabaseProtectedItem has a new parameter + is_scheduled_for_deferred_delete + - Model AzureVmWorkloadSAPAseDatabaseProtectedItem has a new parameter + deferred_delete_time_remaining + - Model AzureVmWorkloadSAPAseDatabaseProtectedItem has a new parameter + is_deferred_delete_schedule_upcoming + - Model AzureVmWorkloadSAPAseDatabaseProtectedItem has a new parameter + is_rehydrate + - Model AzureVmWorkloadSAPAseDatabaseProtectedItem has a new parameter + deferred_delete_time_in_utc + - Model AzureVmWorkloadSAPAseDatabaseProtectedItem has a new parameter + is_scheduled_for_deferred_delete + - Model AzureWorkloadSQLPointInTimeRestoreRequest has a new parameter + recovery_mode + - Model AzureIaaSComputeVMProtectedItem has a new parameter + deferred_delete_time_remaining + - Model AzureIaaSComputeVMProtectedItem has a new parameter + is_deferred_delete_schedule_upcoming + - Model AzureIaaSComputeVMProtectedItem has a new parameter + extended_properties + - Model AzureIaaSComputeVMProtectedItem has a new parameter + is_rehydrate + - Model AzureIaaSComputeVMProtectedItem has a new parameter + deferred_delete_time_in_utc + - Model AzureIaaSComputeVMProtectedItem has a new parameter + is_scheduled_for_deferred_delete + - Model IaasVMRestoreRequest has a new parameter + restore_disk_lun_list + - Model AzureFileShareRecoveryPoint has a new parameter + recovery_point_size_in_gb + - Model BackupResourceVaultConfig has a new parameter + soft_delete_feature_state + - Model AzureVmWorkloadSAPHanaDatabaseProtectedItem has a new + parameter deferred_delete_time_remaining + - Model AzureVmWorkloadSAPHanaDatabaseProtectedItem has a new + parameter is_deferred_delete_schedule_upcoming + - Model AzureVmWorkloadSAPHanaDatabaseProtectedItem has a new + parameter is_rehydrate + - Model AzureVmWorkloadSAPHanaDatabaseProtectedItem has a new + parameter deferred_delete_time_in_utc + - Model AzureVmWorkloadSAPHanaDatabaseProtectedItem has a new + parameter is_scheduled_for_deferred_delete + - Model MabFileFolderProtectedItem has a new parameter + last_backup_time + - Model MabFileFolderProtectedItem has a new parameter + deferred_delete_time_remaining + - Model MabFileFolderProtectedItem has a new parameter + is_deferred_delete_schedule_upcoming + - Model MabFileFolderProtectedItem has a new parameter is_rehydrate + - Model MabFileFolderProtectedItem has a new parameter + deferred_delete_time_in_utc + - Model IaasVMRecoveryPoint has a new parameter + recovery_point_disk_configuration + - Model GenericProtectedItem has a new parameter + deferred_delete_time_remaining + - Model GenericProtectedItem has a new parameter + is_deferred_delete_schedule_upcoming + - Model GenericProtectedItem has a new parameter is_rehydrate + - Model GenericProtectedItem has a new parameter + deferred_delete_time_in_utc + - Model GenericProtectedItem has a new parameter + is_scheduled_for_deferred_delete + - Model AzureWorkloadPointInTimeRestoreRequest has a new parameter + recovery_mode + - Model ExportJobsOperationResultInfo has a new parameter + excel_file_blob_sas_key + - Model ExportJobsOperationResultInfo has a new parameter + excel_file_blob_url + - Model AzureFileshareProtectedItem has a new parameter + deferred_delete_time_remaining + - Model AzureFileshareProtectedItem has a new parameter + is_deferred_delete_schedule_upcoming + - Model AzureFileshareProtectedItem has a new parameter is_rehydrate + - Model AzureFileshareProtectedItem has a new parameter + deferred_delete_time_in_utc + - Model AzureFileshareProtectedItem has a new parameter + is_scheduled_for_deferred_delete + - Model AzureSqlProtectedItem has a new parameter + deferred_delete_time_remaining + - Model AzureSqlProtectedItem has a new parameter + is_deferred_delete_schedule_upcoming + - Model AzureSqlProtectedItem has a new parameter is_rehydrate + - Model AzureSqlProtectedItem has a new parameter + deferred_delete_time_in_utc + - Model AzureSqlProtectedItem has a new parameter + is_scheduled_for_deferred_delete + +**General Breaking changes** + +This version uses a next-generation code generator that might introduce +breaking changes if from some import. In summary, some modules were +incorrectly visible/importable and have been renamed. This fixed several +issues caused by usage of classes that were not supposed to be used in +the first place. RecoveryServicesBackupClient cannot be imported from +azure.mgmt.recoveryservicesbackup.recovery_services_backup_client +anymore (import from azure.mgmt.recoveryservicesbackup works like +before) RecoveryServicesBackupClientConfiguration import has been moved +from +azure.mgmt.recoveryservicesbackup.recovery_services_backup_client to +azure.mgmt.recoveryservicesbackup A model MyClass from a "models" +sub-module cannot be imported anymore using +azure.mgmt.recoveryservicesbackup.models.my_class (import from +azure.mgmt.recoveryservicesbackup.models works like before) An operation +class MyClassOperations from an operations sub-module cannot be imported +anymore using +azure.mgmt.recoveryservicesbackup.operations.my_class_operations +(import from azure.mgmt.recoveryservicesbackup.operations works like +before) Last but not least, HTTP connection pooling is now enabled by +default. You should always use a client as a context manager, or call +close(), or use no more than one client per process. + +## 0.4.0 (2019-05-21) + +**Features** + + - Model AzureWorkloadRestoreRequest has a new parameter target_info + - Model AzureVmWorkloadSAPHanaDatabaseProtectableItem has a new + parameter is_auto_protected + - Model AzureVmWorkloadSAPHanaSystemProtectableItem has a new + parameter is_auto_protected + - Model AzureIaaSVMJobTaskDetails has a new parameter + task_execution_details + - Model AzureWorkloadContainer has a new parameter operation_type + - Model AzureVmWorkloadSQLInstanceProtectableItem has a new parameter + is_auto_protected + - Model AzureIaaSVMJobExtendedInfo has a new parameter + estimated_remaining_duration + - Model AzureVmWorkloadSQLAvailabilityGroupProtectableItem has a new + parameter is_auto_protected + - Model AzureVmWorkloadProtectableItem has a new parameter + is_auto_protected + - Model AzureVMAppContainerProtectionContainer has a new parameter + operation_type + - Model AzureSQLAGWorkloadContainerProtectionContainer has a new + parameter operation_type + - Model AzureVmWorkloadSQLDatabaseProtectableItem has a new parameter + is_auto_protected + - Added operation BackupResourceStorageConfigsOperations.patch + - Added operation ProtectionIntentOperations.delete + - Added operation ProtectionIntentOperations.get + - Added operation group BackupProtectionIntentOperations + - Added operation group OperationOperations + +## 0.3.0 (2018-06-27) + +**Features** + + - SAP HANA contract changes (new filters added to existing API's.). + This feature is still in development phase and not open for usage + yet. + - Instant RP field added in create policy. + - Comments added for some contracts. + +**Python details** + + - Model DPMProtectedItem has a new parameter create_mode + - Model MabFileFolderProtectedItem has a new parameter create_mode + - Model AzureIaaSClassicComputeVMProtectedItem has a new parameter + create_mode + - Model AzureWorkloadContainer has a new parameter workload_type + - Model AzureIaaSVMProtectionPolicy has a new parameter + instant_rp_retention_range_in_days + - Model AzureFileshareProtectedItem has a new parameter create_mode + - Model AzureSQLAGWorkloadContainerProtectionContainer has a new + parameter workload_type + - Model AzureSqlProtectedItem has a new parameter create_mode + - Model AzureIaaSVMJobExtendedInfo has a new parameter + internal_property_bag + - Model KeyAndSecretDetails has a new parameter encryption_mechanism + - Model AzureIaaSVMProtectedItem has a new parameter create_mode + - Model AzureVMAppContainerProtectionContainer has a new parameter + workload_type + - Model AzureVmWorkloadSQLDatabaseProtectedItem has a new parameter + create_mode + - Model IaasVMRecoveryPoint has a new parameter os_type + - Model ProtectionPolicyQueryObject has a new parameter workload_type + - Model AzureIaaSComputeVMProtectedItem has a new parameter + create_mode + - Model Settings has a new parameter is_compression + - Model GenericProtectedItem has a new parameter create_mode + - Model AzureWorkloadJob has a new parameter workload_type + - Model ProtectedItem has a new parameter create_mode + - Operation ProtectionContainersOperations.inquire has a new "filter" + parameter + +## 0.2.0 (2018-05-25) + +**Features** + + - Client class can be used as a context manager to keep the underlying + HTTP session open for performance + +**General Breaking changes** + +This version uses a next-generation code generator that *might* +introduce breaking changes. + + - Model signatures now use only keyword-argument syntax. All + positional arguments must be re-written as keyword-arguments. To + keep auto-completion in most cases, models are now generated for + Python 2 and Python 3. Python 3 uses the "*" syntax for + keyword-only arguments. + - Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to + improve the behavior when unrecognized enum values are encountered. + While this is not a breaking change, the distinctions are important, + and are documented here: + At a glance: + - "is" should not be used at all. + - "format" will return the string value, where "%s" string + formatting will return `NameOfEnum.stringvalue`. Format syntax + should be prefered. + - New Long Running Operation: + - Return type changes from + `msrestazure.azure_operation.AzureOperationPoller` to + `msrest.polling.LROPoller`. External API is the same. + - Return type is now **always** a `msrest.polling.LROPoller`, + regardless of the optional parameters used. + - The behavior has changed when using `raw=True`. Instead of + returning the initial call result as `ClientRawResponse`, + without polling, now this returns an LROPoller. After polling, + the final resource will be returned as a `ClientRawResponse`. + - New `polling` parameter. The default behavior is + `Polling=True` which will poll using ARM algorithm. When + `Polling=False`, the response of the initial call will be + returned without polling. + - `polling` parameter accepts instances of subclasses of + `msrest.polling.PollingMethod`. + - `add_done_callback` will no longer raise if called after + polling is finished, but will instead execute the callback right + away. + +**Bugfixes** + + - Compatibility of the sdist with wheel 0.31.0 + +## 0.1.2 (2019-03-12) + + - Updating permissible versions of the msrestazure package to unblock + [Azure/azure-cli#6973](https://github.com/Azure/azure-cli/issues/6973). + +## 0.1.1 (2017-08-09) + +**Bug fixes** + + - Fix duration parsing (#1214) + +## 0.1.0 (2017-06-05) + + - Initial Release diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/MANIFEST.in b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/MANIFEST.in new file mode 100644 index 000000000000..3a9b6517412b --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/MANIFEST.in @@ -0,0 +1,6 @@ +include _meta.json +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/README.md b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/README.md new file mode 100644 index 000000000000..549be51d806d --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/README.md @@ -0,0 +1,27 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure Recoveryservicesbackup Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + + +# Usage + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [Recoveryservicesbackup Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-recoveryservicesbackup%2FREADME.png) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/_meta.json b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/_meta.json new file mode 100644 index 000000000000..5cedd35bedc4 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "3.4.2", + "use": "@autorest/python@5.6.6", + "commit": "fc5e2fbcfc3f585d38bdb1c513ce1ad2c570cf3d", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/recoveryservicesbackup/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.6.6 --version=3.4.2", + "readme": "specification/recoveryservicesbackup/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/__init__.py new file mode 100644 index 000000000000..802d9218dc4b --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/__init__.py @@ -0,0 +1,19 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._recovery_services_backup_client import RecoveryServicesBackupClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['RecoveryServicesBackupClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_configuration.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_configuration.py new file mode 100644 index 000000000000..520604f0d762 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_configuration.py @@ -0,0 +1,70 @@ +# 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. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class RecoveryServicesBackupClientConfiguration(Configuration): + """Configuration for RecoveryServicesBackupClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :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 + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + 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(RecoveryServicesBackupClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-recoveryservicesbackup/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + 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) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_metadata.json b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_metadata.json new file mode 100644 index 000000000000..bb308c32f2eb --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_metadata.json @@ -0,0 +1,243 @@ +{ + "chosen_version": "", + "total_api_version_list": ["2018-12-20", "2021-03-01"], + "client": { + "name": "RecoveryServicesBackupClient", + "filename": "_recovery_services_backup_client", + "description": "Open API 2.0 Specs for Azure RecoveryServices Backup service.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": 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\": [\"RecoveryServicesBackupClientConfiguration\"], \"._operations_mixin\": [\"RecoveryServicesBackupClientOperationsMixin\"]}}, \"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\": [\"RecoveryServicesBackupClientConfiguration\"], \"._operations_mixin\": [\"RecoveryServicesBackupClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The subscription Id.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The subscription Id.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "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\"]}}}" + }, + "operation_groups": { + "protection_intent": "ProtectionIntentOperations", + "backup_status": "BackupStatusOperations", + "feature_support": "FeatureSupportOperations", + "backup_protection_intent": "BackupProtectionIntentOperations", + "backup_usage_summaries": "BackupUsageSummariesOperations", + "operations": "Operations", + "backup_resource_vault_configs": "BackupResourceVaultConfigsOperations", + "backup_resource_encryption_configs": "BackupResourceEncryptionConfigsOperations", + "private_endpoint_connection": "PrivateEndpointConnectionOperations", + "private_endpoint": "PrivateEndpointOperations", + "bms_prepare_data_move_operation_result": "BMSPrepareDataMoveOperationResultOperations", + "protected_items": "ProtectedItemsOperations", + "protected_item_operation_results": "ProtectedItemOperationResultsOperations", + "recovery_points": "RecoveryPointsOperations", + "restores": "RestoresOperations", + "backup_policies": "BackupPoliciesOperations", + "protection_policies": "ProtectionPoliciesOperations", + "protection_policy_operation_results": "ProtectionPolicyOperationResultsOperations", + "backup_jobs": "BackupJobsOperations", + "job_details": "JobDetailsOperations", + "job_cancellations": "JobCancellationsOperations", + "job_operation_results": "JobOperationResultsOperations", + "export_jobs_operation_results": "ExportJobsOperationResultsOperations", + "jobs": "JobsOperations", + "backup_protected_items": "BackupProtectedItemsOperations", + "operation": "OperationOperations", + "backup_engines": "BackupEnginesOperations", + "protection_container_refresh_operation_results": "ProtectionContainerRefreshOperationResultsOperations", + "protectable_containers": "ProtectableContainersOperations", + "protection_containers": "ProtectionContainersOperations", + "backup_workload_items": "BackupWorkloadItemsOperations", + "protection_container_operation_results": "ProtectionContainerOperationResultsOperations", + "backups": "BackupsOperations", + "protected_item_operation_statuses": "ProtectedItemOperationStatusesOperations", + "item_level_recovery_connections": "ItemLevelRecoveryConnectionsOperations", + "backup_operation_results": "BackupOperationResultsOperations", + "backup_operation_statuses": "BackupOperationStatusesOperations", + "protection_policy_operation_statuses": "ProtectionPolicyOperationStatusesOperations", + "backup_protectable_items": "BackupProtectableItemsOperations", + "backup_protection_containers": "BackupProtectionContainersOperations", + "security_pins": "SecurityPINsOperations", + "recovery_points_recommended_for_move": "RecoveryPointsRecommendedForMoveOperations", + "aad_properties": "AadPropertiesOperations", + "cross_region_restore": "CrossRegionRestoreOperations", + "backup_crr_job_details": "BackupCrrJobDetailsOperations", + "backup_crr_jobs": "BackupCrrJobsOperations", + "crr_operation_results": "CrrOperationResultsOperations", + "crr_operation_status": "CrrOperationStatusOperations", + "backup_resource_storage_configs": "BackupResourceStorageConfigsOperations", + "recovery_points_crr": "RecoveryPointsCrrOperations", + "backup_protected_items_crr": "BackupProtectedItemsCrrOperations" + }, + "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\"], \"azure.core.polling\": [\"LROPoller\", \"NoPolling\", \"PollingMethod\"], \"azure.mgmt.core.polling.arm_polling\": [\"ARMPolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "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\"], \"azure.core.polling\": [\"AsyncLROPoller\", \"AsyncNoPolling\", \"AsyncPollingMethod\"], \"azure.mgmt.core.polling.async_arm_polling\": [\"AsyncARMPolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "operations": { + "get_operation_status" : { + "sync": { + "signature": "def get_operation_status(\n self,\n vault_name, # type: str\n resource_group_name, # type: str\n operation_id, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Fetches operation status for data move operation on vault.\n\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\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 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: OperationStatus, or the result of cls(response)\n:rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def get_operation_status(\n self,\n vault_name: str,\n resource_group_name: str,\n operation_id: str,\n **kwargs\n) -\u003e \"_models.OperationStatus\":\n", + "doc": "\"\"\"Fetches operation status for data move operation on vault.\n\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\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 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: OperationStatus, or the result of cls(response)\n:rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "vault_name, resource_group_name, operation_id" + }, + "_bms_prepare_data_move_initial" : { + "sync": { + "signature": "def _bms_prepare_data_move_initial(\n self,\n vault_name, # type: str\n resource_group_name, # type: str\n parameters, # type: \"_models.PrepareDataMoveRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\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 parameters: Prepare data move request.\n:type parameters: ~azure.mgmt.recoveryservicesbackup.models.PrepareDataMoveRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _bms_prepare_data_move_initial(\n self,\n vault_name: str,\n resource_group_name: str,\n parameters: \"_models.PrepareDataMoveRequest\",\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"\n\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\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 parameters: Prepare data move request.\n:type parameters: ~azure.mgmt.recoveryservicesbackup.models.PrepareDataMoveRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "vault_name, resource_group_name, parameters" + }, + "begin_bms_prepare_data_move" : { + "sync": { + "signature": "def begin_bms_prepare_data_move(\n self,\n vault_name, # type: str\n resource_group_name, # type: str\n parameters, # type: \"_models.PrepareDataMoveRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Prepares source vault for Data Move operation.\n\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\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 parameters: Prepare data move request.\n:type parameters: ~azure.mgmt.recoveryservicesbackup.models.PrepareDataMoveRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the ARMPolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_bms_prepare_data_move(\n self,\n vault_name: str,\n resource_group_name: str,\n parameters: \"_models.PrepareDataMoveRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Prepares source vault for Data Move operation.\n\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\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 parameters: Prepare data move request.\n:type parameters: ~azure.mgmt.recoveryservicesbackup.models.PrepareDataMoveRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncARMPolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "vault_name, resource_group_name, parameters" + }, + "_bms_trigger_data_move_initial" : { + "sync": { + "signature": "def _bms_trigger_data_move_initial(\n self,\n vault_name, # type: str\n resource_group_name, # type: str\n parameters, # type: \"_models.TriggerDataMoveRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\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 parameters: Trigger data move request.\n:type parameters: ~azure.mgmt.recoveryservicesbackup.models.TriggerDataMoveRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _bms_trigger_data_move_initial(\n self,\n vault_name: str,\n resource_group_name: str,\n parameters: \"_models.TriggerDataMoveRequest\",\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"\n\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\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 parameters: Trigger data move request.\n:type parameters: ~azure.mgmt.recoveryservicesbackup.models.TriggerDataMoveRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "vault_name, resource_group_name, parameters" + }, + "begin_bms_trigger_data_move" : { + "sync": { + "signature": "def begin_bms_trigger_data_move(\n self,\n vault_name, # type: str\n resource_group_name, # type: str\n parameters, # type: \"_models.TriggerDataMoveRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Triggers Data Move Operation on target vault.\n\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\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 parameters: Trigger data move request.\n:type parameters: ~azure.mgmt.recoveryservicesbackup.models.TriggerDataMoveRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the ARMPolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_bms_trigger_data_move(\n self,\n vault_name: str,\n resource_group_name: str,\n parameters: \"_models.TriggerDataMoveRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Triggers Data Move Operation on target vault.\n\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\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 parameters: Trigger data move request.\n:type parameters: ~azure.mgmt.recoveryservicesbackup.models.TriggerDataMoveRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncARMPolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "vault_name, resource_group_name, parameters" + }, + "_move_recovery_point_initial" : { + "sync": { + "signature": "def _move_recovery_point_initial(\n self,\n vault_name, # type: str\n resource_group_name, # type: str\n fabric_name, # type: str\n container_name, # type: str\n protected_item_name, # type: str\n recovery_point_id, # type: str\n parameters, # type: \"_models.MoveRPAcrossTiersRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"\n\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\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 fabric_name:\n:type fabric_name: str\n:param container_name:\n:type container_name: str\n:param protected_item_name:\n:type protected_item_name: str\n:param recovery_point_id:\n:type recovery_point_id: str\n:param parameters: Move Resource Across Tiers Request.\n:type parameters: ~azure.mgmt.recoveryservicesbackup.models.MoveRPAcrossTiersRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def _move_recovery_point_initial(\n self,\n vault_name: str,\n resource_group_name: str,\n fabric_name: str,\n container_name: str,\n protected_item_name: str,\n recovery_point_id: str,\n parameters: \"_models.MoveRPAcrossTiersRequest\",\n **kwargs\n) -\u003e None:\n", + "doc": "\"\"\"\n\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\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 fabric_name:\n:type fabric_name: str\n:param container_name:\n:type container_name: str\n:param protected_item_name:\n:type protected_item_name: str\n:param recovery_point_id:\n:type recovery_point_id: str\n:param parameters: Move Resource Across Tiers Request.\n:type parameters: ~azure.mgmt.recoveryservicesbackup.models.MoveRPAcrossTiersRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: None, or the result of cls(response)\n:rtype: None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, parameters" + }, + "begin_move_recovery_point" : { + "sync": { + "signature": "def begin_move_recovery_point(\n self,\n vault_name, # type: str\n resource_group_name, # type: str\n fabric_name, # type: str\n container_name, # type: str\n protected_item_name, # type: str\n recovery_point_id, # type: str\n parameters, # type: \"_models.MoveRPAcrossTiersRequest\"\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Move recovery point from one datastore to another store.\n\nMove recovery point from one datastore to another store.\n\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\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 fabric_name:\n:type fabric_name: str\n:param container_name:\n:type container_name: str\n:param protected_item_name:\n:type protected_item_name: str\n:param recovery_point_id:\n:type recovery_point_id: str\n:param parameters: Move Resource Across Tiers Request.\n:type parameters: ~azure.mgmt.recoveryservicesbackup.models.MoveRPAcrossTiersRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the ARMPolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of LROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.LROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def begin_move_recovery_point(\n self,\n vault_name: str,\n resource_group_name: str,\n fabric_name: str,\n container_name: str,\n protected_item_name: str,\n recovery_point_id: str,\n parameters: \"_models.MoveRPAcrossTiersRequest\",\n **kwargs\n) -\u003e AsyncLROPoller[None]:\n", + "doc": "\"\"\"Move recovery point from one datastore to another store.\n\nMove recovery point from one datastore to another store.\n\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\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 fabric_name:\n:type fabric_name: str\n:param container_name:\n:type container_name: str\n:param protected_item_name:\n:type protected_item_name: str\n:param recovery_point_id:\n:type recovery_point_id: str\n:param parameters: Move Resource Across Tiers Request.\n:type parameters: ~azure.mgmt.recoveryservicesbackup.models.MoveRPAcrossTiersRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: Pass in True if you\u0027d like the AsyncARMPolling polling method,\n False for no polling, or your own initialized polling object for a personal polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)\n:rtype: ~azure.core.polling.AsyncLROPoller[None]\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"" + }, + "call": "vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, parameters" + } + } + } +} \ No newline at end of file diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_recovery_services_backup_client.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_recovery_services_backup_client.py new file mode 100644 index 000000000000..0c04efa81354 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_recovery_services_backup_client.py @@ -0,0 +1,340 @@ +# 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. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +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 RecoveryServicesBackupClientConfiguration +from .operations import ProtectionIntentOperations +from .operations import BackupStatusOperations +from .operations import FeatureSupportOperations +from .operations import BackupProtectionIntentOperations +from .operations import BackupUsageSummariesOperations +from .operations import Operations +from .operations import BackupResourceVaultConfigsOperations +from .operations import BackupResourceEncryptionConfigsOperations +from .operations import PrivateEndpointConnectionOperations +from .operations import PrivateEndpointOperations +from .operations import RecoveryServicesBackupClientOperationsMixin +from .operations import BMSPrepareDataMoveOperationResultOperations +from .operations import ProtectedItemsOperations +from .operations import ProtectedItemOperationResultsOperations +from .operations import RecoveryPointsOperations +from .operations import RestoresOperations +from .operations import BackupPoliciesOperations +from .operations import ProtectionPoliciesOperations +from .operations import ProtectionPolicyOperationResultsOperations +from .operations import BackupJobsOperations +from .operations import JobDetailsOperations +from .operations import JobCancellationsOperations +from .operations import JobOperationResultsOperations +from .operations import ExportJobsOperationResultsOperations +from .operations import JobsOperations +from .operations import BackupProtectedItemsOperations +from .operations import OperationOperations +from .operations import BackupEnginesOperations +from .operations import ProtectionContainerRefreshOperationResultsOperations +from .operations import ProtectableContainersOperations +from .operations import ProtectionContainersOperations +from .operations import BackupWorkloadItemsOperations +from .operations import ProtectionContainerOperationResultsOperations +from .operations import BackupsOperations +from .operations import ProtectedItemOperationStatusesOperations +from .operations import ItemLevelRecoveryConnectionsOperations +from .operations import BackupOperationResultsOperations +from .operations import BackupOperationStatusesOperations +from .operations import ProtectionPolicyOperationStatusesOperations +from .operations import BackupProtectableItemsOperations +from .operations import BackupProtectionContainersOperations +from .operations import SecurityPINsOperations +from .operations import RecoveryPointsRecommendedForMoveOperations +from .operations import AadPropertiesOperations +from .operations import CrossRegionRestoreOperations +from .operations import BackupCrrJobDetailsOperations +from .operations import BackupCrrJobsOperations +from .operations import CrrOperationResultsOperations +from .operations import CrrOperationStatusOperations +from .operations import BackupResourceStorageConfigsOperations +from .operations import RecoveryPointsCrrOperations +from .operations import BackupProtectedItemsCrrOperations +from . import models + + +class RecoveryServicesBackupClient(RecoveryServicesBackupClientOperationsMixin): + """Open API 2.0 Specs for Azure RecoveryServices Backup service. + + :ivar protection_intent: ProtectionIntentOperations operations + :vartype protection_intent: azure.mgmt.recoveryservicesbackup.operations.ProtectionIntentOperations + :ivar backup_status: BackupStatusOperations operations + :vartype backup_status: azure.mgmt.recoveryservicesbackup.operations.BackupStatusOperations + :ivar feature_support: FeatureSupportOperations operations + :vartype feature_support: azure.mgmt.recoveryservicesbackup.operations.FeatureSupportOperations + :ivar backup_protection_intent: BackupProtectionIntentOperations operations + :vartype backup_protection_intent: azure.mgmt.recoveryservicesbackup.operations.BackupProtectionIntentOperations + :ivar backup_usage_summaries: BackupUsageSummariesOperations operations + :vartype backup_usage_summaries: azure.mgmt.recoveryservicesbackup.operations.BackupUsageSummariesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.recoveryservicesbackup.operations.Operations + :ivar backup_resource_vault_configs: BackupResourceVaultConfigsOperations operations + :vartype backup_resource_vault_configs: azure.mgmt.recoveryservicesbackup.operations.BackupResourceVaultConfigsOperations + :ivar backup_resource_encryption_configs: BackupResourceEncryptionConfigsOperations operations + :vartype backup_resource_encryption_configs: azure.mgmt.recoveryservicesbackup.operations.BackupResourceEncryptionConfigsOperations + :ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations + :vartype private_endpoint_connection: azure.mgmt.recoveryservicesbackup.operations.PrivateEndpointConnectionOperations + :ivar private_endpoint: PrivateEndpointOperations operations + :vartype private_endpoint: azure.mgmt.recoveryservicesbackup.operations.PrivateEndpointOperations + :ivar bms_prepare_data_move_operation_result: BMSPrepareDataMoveOperationResultOperations operations + :vartype bms_prepare_data_move_operation_result: azure.mgmt.recoveryservicesbackup.operations.BMSPrepareDataMoveOperationResultOperations + :ivar protected_items: ProtectedItemsOperations operations + :vartype protected_items: azure.mgmt.recoveryservicesbackup.operations.ProtectedItemsOperations + :ivar protected_item_operation_results: ProtectedItemOperationResultsOperations operations + :vartype protected_item_operation_results: azure.mgmt.recoveryservicesbackup.operations.ProtectedItemOperationResultsOperations + :ivar recovery_points: RecoveryPointsOperations operations + :vartype recovery_points: azure.mgmt.recoveryservicesbackup.operations.RecoveryPointsOperations + :ivar restores: RestoresOperations operations + :vartype restores: azure.mgmt.recoveryservicesbackup.operations.RestoresOperations + :ivar backup_policies: BackupPoliciesOperations operations + :vartype backup_policies: azure.mgmt.recoveryservicesbackup.operations.BackupPoliciesOperations + :ivar protection_policies: ProtectionPoliciesOperations operations + :vartype protection_policies: azure.mgmt.recoveryservicesbackup.operations.ProtectionPoliciesOperations + :ivar protection_policy_operation_results: ProtectionPolicyOperationResultsOperations operations + :vartype protection_policy_operation_results: azure.mgmt.recoveryservicesbackup.operations.ProtectionPolicyOperationResultsOperations + :ivar backup_jobs: BackupJobsOperations operations + :vartype backup_jobs: azure.mgmt.recoveryservicesbackup.operations.BackupJobsOperations + :ivar job_details: JobDetailsOperations operations + :vartype job_details: azure.mgmt.recoveryservicesbackup.operations.JobDetailsOperations + :ivar job_cancellations: JobCancellationsOperations operations + :vartype job_cancellations: azure.mgmt.recoveryservicesbackup.operations.JobCancellationsOperations + :ivar job_operation_results: JobOperationResultsOperations operations + :vartype job_operation_results: azure.mgmt.recoveryservicesbackup.operations.JobOperationResultsOperations + :ivar export_jobs_operation_results: ExportJobsOperationResultsOperations operations + :vartype export_jobs_operation_results: azure.mgmt.recoveryservicesbackup.operations.ExportJobsOperationResultsOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.recoveryservicesbackup.operations.JobsOperations + :ivar backup_protected_items: BackupProtectedItemsOperations operations + :vartype backup_protected_items: azure.mgmt.recoveryservicesbackup.operations.BackupProtectedItemsOperations + :ivar operation: OperationOperations operations + :vartype operation: azure.mgmt.recoveryservicesbackup.operations.OperationOperations + :ivar backup_engines: BackupEnginesOperations operations + :vartype backup_engines: azure.mgmt.recoveryservicesbackup.operations.BackupEnginesOperations + :ivar protection_container_refresh_operation_results: ProtectionContainerRefreshOperationResultsOperations operations + :vartype protection_container_refresh_operation_results: azure.mgmt.recoveryservicesbackup.operations.ProtectionContainerRefreshOperationResultsOperations + :ivar protectable_containers: ProtectableContainersOperations operations + :vartype protectable_containers: azure.mgmt.recoveryservicesbackup.operations.ProtectableContainersOperations + :ivar protection_containers: ProtectionContainersOperations operations + :vartype protection_containers: azure.mgmt.recoveryservicesbackup.operations.ProtectionContainersOperations + :ivar backup_workload_items: BackupWorkloadItemsOperations operations + :vartype backup_workload_items: azure.mgmt.recoveryservicesbackup.operations.BackupWorkloadItemsOperations + :ivar protection_container_operation_results: ProtectionContainerOperationResultsOperations operations + :vartype protection_container_operation_results: azure.mgmt.recoveryservicesbackup.operations.ProtectionContainerOperationResultsOperations + :ivar backups: BackupsOperations operations + :vartype backups: azure.mgmt.recoveryservicesbackup.operations.BackupsOperations + :ivar protected_item_operation_statuses: ProtectedItemOperationStatusesOperations operations + :vartype protected_item_operation_statuses: azure.mgmt.recoveryservicesbackup.operations.ProtectedItemOperationStatusesOperations + :ivar item_level_recovery_connections: ItemLevelRecoveryConnectionsOperations operations + :vartype item_level_recovery_connections: azure.mgmt.recoveryservicesbackup.operations.ItemLevelRecoveryConnectionsOperations + :ivar backup_operation_results: BackupOperationResultsOperations operations + :vartype backup_operation_results: azure.mgmt.recoveryservicesbackup.operations.BackupOperationResultsOperations + :ivar backup_operation_statuses: BackupOperationStatusesOperations operations + :vartype backup_operation_statuses: azure.mgmt.recoveryservicesbackup.operations.BackupOperationStatusesOperations + :ivar protection_policy_operation_statuses: ProtectionPolicyOperationStatusesOperations operations + :vartype protection_policy_operation_statuses: azure.mgmt.recoveryservicesbackup.operations.ProtectionPolicyOperationStatusesOperations + :ivar backup_protectable_items: BackupProtectableItemsOperations operations + :vartype backup_protectable_items: azure.mgmt.recoveryservicesbackup.operations.BackupProtectableItemsOperations + :ivar backup_protection_containers: BackupProtectionContainersOperations operations + :vartype backup_protection_containers: azure.mgmt.recoveryservicesbackup.operations.BackupProtectionContainersOperations + :ivar security_pins: SecurityPINsOperations operations + :vartype security_pins: azure.mgmt.recoveryservicesbackup.operations.SecurityPINsOperations + :ivar recovery_points_recommended_for_move: RecoveryPointsRecommendedForMoveOperations operations + :vartype recovery_points_recommended_for_move: azure.mgmt.recoveryservicesbackup.operations.RecoveryPointsRecommendedForMoveOperations + :ivar aad_properties: AadPropertiesOperations operations + :vartype aad_properties: azure.mgmt.recoveryservicesbackup.operations.AadPropertiesOperations + :ivar cross_region_restore: CrossRegionRestoreOperations operations + :vartype cross_region_restore: azure.mgmt.recoveryservicesbackup.operations.CrossRegionRestoreOperations + :ivar backup_crr_job_details: BackupCrrJobDetailsOperations operations + :vartype backup_crr_job_details: azure.mgmt.recoveryservicesbackup.operations.BackupCrrJobDetailsOperations + :ivar backup_crr_jobs: BackupCrrJobsOperations operations + :vartype backup_crr_jobs: azure.mgmt.recoveryservicesbackup.operations.BackupCrrJobsOperations + :ivar crr_operation_results: CrrOperationResultsOperations operations + :vartype crr_operation_results: azure.mgmt.recoveryservicesbackup.operations.CrrOperationResultsOperations + :ivar crr_operation_status: CrrOperationStatusOperations operations + :vartype crr_operation_status: azure.mgmt.recoveryservicesbackup.operations.CrrOperationStatusOperations + :ivar backup_resource_storage_configs: BackupResourceStorageConfigsOperations operations + :vartype backup_resource_storage_configs: azure.mgmt.recoveryservicesbackup.operations.BackupResourceStorageConfigsOperations + :ivar recovery_points_crr: RecoveryPointsCrrOperations operations + :vartype recovery_points_crr: azure.mgmt.recoveryservicesbackup.operations.RecoveryPointsCrrOperations + :ivar backup_protected_items_crr: BackupProtectedItemsCrrOperations operations + :vartype backup_protected_items_crr: azure.mgmt.recoveryservicesbackup.operations.BackupProtectedItemsCrrOperations + :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. + """ + + 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 = RecoveryServicesBackupClientConfiguration(credential, 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.protection_intent = ProtectionIntentOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_status = BackupStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.feature_support = FeatureSupportOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_protection_intent = BackupProtectionIntentOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_usage_summaries = BackupUsageSummariesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_resource_vault_configs = BackupResourceVaultConfigsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_resource_encryption_configs = BackupResourceEncryptionConfigsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connection = PrivateEndpointConnectionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint = PrivateEndpointOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bms_prepare_data_move_operation_result = BMSPrepareDataMoveOperationResultOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protected_items = ProtectedItemsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protected_item_operation_results = ProtectedItemOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.recovery_points = RecoveryPointsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.restores = RestoresOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_policies = BackupPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protection_policies = ProtectionPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protection_policy_operation_results = ProtectionPolicyOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_jobs = BackupJobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job_details = JobDetailsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job_cancellations = JobCancellationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job_operation_results = JobOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.export_jobs_operation_results = ExportJobsOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_protected_items = BackupProtectedItemsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_engines = BackupEnginesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protection_container_refresh_operation_results = ProtectionContainerRefreshOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protectable_containers = ProtectableContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protection_containers = ProtectionContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_workload_items = BackupWorkloadItemsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protection_container_operation_results = ProtectionContainerOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backups = BackupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protected_item_operation_statuses = ProtectedItemOperationStatusesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.item_level_recovery_connections = ItemLevelRecoveryConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_operation_results = BackupOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_operation_statuses = BackupOperationStatusesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protection_policy_operation_statuses = ProtectionPolicyOperationStatusesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_protectable_items = BackupProtectableItemsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_protection_containers = BackupProtectionContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.security_pins = SecurityPINsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.recovery_points_recommended_for_move = RecoveryPointsRecommendedForMoveOperations( + self._client, self._config, self._serialize, self._deserialize) + self.aad_properties = AadPropertiesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.cross_region_restore = CrossRegionRestoreOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_crr_job_details = BackupCrrJobDetailsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_crr_jobs = BackupCrrJobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.crr_operation_results = CrrOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.crr_operation_status = CrrOperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_resource_storage_configs = BackupResourceStorageConfigsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.recovery_points_crr = RecoveryPointsCrrOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_protected_items_crr = BackupProtectedItemsCrrOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, 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. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.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 + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> RecoveryServicesBackupClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_version.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_version.py new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/__init__.py new file mode 100644 index 000000000000..d1e0d338ce58 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/__init__.py @@ -0,0 +1,10 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._recovery_services_backup_client import RecoveryServicesBackupClient +__all__ = ['RecoveryServicesBackupClient'] diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/_configuration.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/_configuration.py new file mode 100644 index 000000000000..5a12c5529e40 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/_configuration.py @@ -0,0 +1,66 @@ +# 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. +# -------------------------------------------------------------------------- + +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 .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class RecoveryServicesBackupClientConfiguration(Configuration): + """Configuration for RecoveryServicesBackupClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :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 + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + 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(RecoveryServicesBackupClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-recoveryservicesbackup/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + 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) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/_recovery_services_backup_client.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/_recovery_services_backup_client.py new file mode 100644 index 000000000000..24a53d076af0 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/_recovery_services_backup_client.py @@ -0,0 +1,333 @@ +# 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. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING + +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import RecoveryServicesBackupClientConfiguration +from .operations import ProtectionIntentOperations +from .operations import BackupStatusOperations +from .operations import FeatureSupportOperations +from .operations import BackupProtectionIntentOperations +from .operations import BackupUsageSummariesOperations +from .operations import Operations +from .operations import BackupResourceVaultConfigsOperations +from .operations import BackupResourceEncryptionConfigsOperations +from .operations import PrivateEndpointConnectionOperations +from .operations import PrivateEndpointOperations +from .operations import RecoveryServicesBackupClientOperationsMixin +from .operations import BMSPrepareDataMoveOperationResultOperations +from .operations import ProtectedItemsOperations +from .operations import ProtectedItemOperationResultsOperations +from .operations import RecoveryPointsOperations +from .operations import RestoresOperations +from .operations import BackupPoliciesOperations +from .operations import ProtectionPoliciesOperations +from .operations import ProtectionPolicyOperationResultsOperations +from .operations import BackupJobsOperations +from .operations import JobDetailsOperations +from .operations import JobCancellationsOperations +from .operations import JobOperationResultsOperations +from .operations import ExportJobsOperationResultsOperations +from .operations import JobsOperations +from .operations import BackupProtectedItemsOperations +from .operations import OperationOperations +from .operations import BackupEnginesOperations +from .operations import ProtectionContainerRefreshOperationResultsOperations +from .operations import ProtectableContainersOperations +from .operations import ProtectionContainersOperations +from .operations import BackupWorkloadItemsOperations +from .operations import ProtectionContainerOperationResultsOperations +from .operations import BackupsOperations +from .operations import ProtectedItemOperationStatusesOperations +from .operations import ItemLevelRecoveryConnectionsOperations +from .operations import BackupOperationResultsOperations +from .operations import BackupOperationStatusesOperations +from .operations import ProtectionPolicyOperationStatusesOperations +from .operations import BackupProtectableItemsOperations +from .operations import BackupProtectionContainersOperations +from .operations import SecurityPINsOperations +from .operations import RecoveryPointsRecommendedForMoveOperations +from .operations import AadPropertiesOperations +from .operations import CrossRegionRestoreOperations +from .operations import BackupCrrJobDetailsOperations +from .operations import BackupCrrJobsOperations +from .operations import CrrOperationResultsOperations +from .operations import CrrOperationStatusOperations +from .operations import BackupResourceStorageConfigsOperations +from .operations import RecoveryPointsCrrOperations +from .operations import BackupProtectedItemsCrrOperations +from .. import models + + +class RecoveryServicesBackupClient(RecoveryServicesBackupClientOperationsMixin): + """Open API 2.0 Specs for Azure RecoveryServices Backup service. + + :ivar protection_intent: ProtectionIntentOperations operations + :vartype protection_intent: azure.mgmt.recoveryservicesbackup.aio.operations.ProtectionIntentOperations + :ivar backup_status: BackupStatusOperations operations + :vartype backup_status: azure.mgmt.recoveryservicesbackup.aio.operations.BackupStatusOperations + :ivar feature_support: FeatureSupportOperations operations + :vartype feature_support: azure.mgmt.recoveryservicesbackup.aio.operations.FeatureSupportOperations + :ivar backup_protection_intent: BackupProtectionIntentOperations operations + :vartype backup_protection_intent: azure.mgmt.recoveryservicesbackup.aio.operations.BackupProtectionIntentOperations + :ivar backup_usage_summaries: BackupUsageSummariesOperations operations + :vartype backup_usage_summaries: azure.mgmt.recoveryservicesbackup.aio.operations.BackupUsageSummariesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.recoveryservicesbackup.aio.operations.Operations + :ivar backup_resource_vault_configs: BackupResourceVaultConfigsOperations operations + :vartype backup_resource_vault_configs: azure.mgmt.recoveryservicesbackup.aio.operations.BackupResourceVaultConfigsOperations + :ivar backup_resource_encryption_configs: BackupResourceEncryptionConfigsOperations operations + :vartype backup_resource_encryption_configs: azure.mgmt.recoveryservicesbackup.aio.operations.BackupResourceEncryptionConfigsOperations + :ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations + :vartype private_endpoint_connection: azure.mgmt.recoveryservicesbackup.aio.operations.PrivateEndpointConnectionOperations + :ivar private_endpoint: PrivateEndpointOperations operations + :vartype private_endpoint: azure.mgmt.recoveryservicesbackup.aio.operations.PrivateEndpointOperations + :ivar bms_prepare_data_move_operation_result: BMSPrepareDataMoveOperationResultOperations operations + :vartype bms_prepare_data_move_operation_result: azure.mgmt.recoveryservicesbackup.aio.operations.BMSPrepareDataMoveOperationResultOperations + :ivar protected_items: ProtectedItemsOperations operations + :vartype protected_items: azure.mgmt.recoveryservicesbackup.aio.operations.ProtectedItemsOperations + :ivar protected_item_operation_results: ProtectedItemOperationResultsOperations operations + :vartype protected_item_operation_results: azure.mgmt.recoveryservicesbackup.aio.operations.ProtectedItemOperationResultsOperations + :ivar recovery_points: RecoveryPointsOperations operations + :vartype recovery_points: azure.mgmt.recoveryservicesbackup.aio.operations.RecoveryPointsOperations + :ivar restores: RestoresOperations operations + :vartype restores: azure.mgmt.recoveryservicesbackup.aio.operations.RestoresOperations + :ivar backup_policies: BackupPoliciesOperations operations + :vartype backup_policies: azure.mgmt.recoveryservicesbackup.aio.operations.BackupPoliciesOperations + :ivar protection_policies: ProtectionPoliciesOperations operations + :vartype protection_policies: azure.mgmt.recoveryservicesbackup.aio.operations.ProtectionPoliciesOperations + :ivar protection_policy_operation_results: ProtectionPolicyOperationResultsOperations operations + :vartype protection_policy_operation_results: azure.mgmt.recoveryservicesbackup.aio.operations.ProtectionPolicyOperationResultsOperations + :ivar backup_jobs: BackupJobsOperations operations + :vartype backup_jobs: azure.mgmt.recoveryservicesbackup.aio.operations.BackupJobsOperations + :ivar job_details: JobDetailsOperations operations + :vartype job_details: azure.mgmt.recoveryservicesbackup.aio.operations.JobDetailsOperations + :ivar job_cancellations: JobCancellationsOperations operations + :vartype job_cancellations: azure.mgmt.recoveryservicesbackup.aio.operations.JobCancellationsOperations + :ivar job_operation_results: JobOperationResultsOperations operations + :vartype job_operation_results: azure.mgmt.recoveryservicesbackup.aio.operations.JobOperationResultsOperations + :ivar export_jobs_operation_results: ExportJobsOperationResultsOperations operations + :vartype export_jobs_operation_results: azure.mgmt.recoveryservicesbackup.aio.operations.ExportJobsOperationResultsOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.recoveryservicesbackup.aio.operations.JobsOperations + :ivar backup_protected_items: BackupProtectedItemsOperations operations + :vartype backup_protected_items: azure.mgmt.recoveryservicesbackup.aio.operations.BackupProtectedItemsOperations + :ivar operation: OperationOperations operations + :vartype operation: azure.mgmt.recoveryservicesbackup.aio.operations.OperationOperations + :ivar backup_engines: BackupEnginesOperations operations + :vartype backup_engines: azure.mgmt.recoveryservicesbackup.aio.operations.BackupEnginesOperations + :ivar protection_container_refresh_operation_results: ProtectionContainerRefreshOperationResultsOperations operations + :vartype protection_container_refresh_operation_results: azure.mgmt.recoveryservicesbackup.aio.operations.ProtectionContainerRefreshOperationResultsOperations + :ivar protectable_containers: ProtectableContainersOperations operations + :vartype protectable_containers: azure.mgmt.recoveryservicesbackup.aio.operations.ProtectableContainersOperations + :ivar protection_containers: ProtectionContainersOperations operations + :vartype protection_containers: azure.mgmt.recoveryservicesbackup.aio.operations.ProtectionContainersOperations + :ivar backup_workload_items: BackupWorkloadItemsOperations operations + :vartype backup_workload_items: azure.mgmt.recoveryservicesbackup.aio.operations.BackupWorkloadItemsOperations + :ivar protection_container_operation_results: ProtectionContainerOperationResultsOperations operations + :vartype protection_container_operation_results: azure.mgmt.recoveryservicesbackup.aio.operations.ProtectionContainerOperationResultsOperations + :ivar backups: BackupsOperations operations + :vartype backups: azure.mgmt.recoveryservicesbackup.aio.operations.BackupsOperations + :ivar protected_item_operation_statuses: ProtectedItemOperationStatusesOperations operations + :vartype protected_item_operation_statuses: azure.mgmt.recoveryservicesbackup.aio.operations.ProtectedItemOperationStatusesOperations + :ivar item_level_recovery_connections: ItemLevelRecoveryConnectionsOperations operations + :vartype item_level_recovery_connections: azure.mgmt.recoveryservicesbackup.aio.operations.ItemLevelRecoveryConnectionsOperations + :ivar backup_operation_results: BackupOperationResultsOperations operations + :vartype backup_operation_results: azure.mgmt.recoveryservicesbackup.aio.operations.BackupOperationResultsOperations + :ivar backup_operation_statuses: BackupOperationStatusesOperations operations + :vartype backup_operation_statuses: azure.mgmt.recoveryservicesbackup.aio.operations.BackupOperationStatusesOperations + :ivar protection_policy_operation_statuses: ProtectionPolicyOperationStatusesOperations operations + :vartype protection_policy_operation_statuses: azure.mgmt.recoveryservicesbackup.aio.operations.ProtectionPolicyOperationStatusesOperations + :ivar backup_protectable_items: BackupProtectableItemsOperations operations + :vartype backup_protectable_items: azure.mgmt.recoveryservicesbackup.aio.operations.BackupProtectableItemsOperations + :ivar backup_protection_containers: BackupProtectionContainersOperations operations + :vartype backup_protection_containers: azure.mgmt.recoveryservicesbackup.aio.operations.BackupProtectionContainersOperations + :ivar security_pins: SecurityPINsOperations operations + :vartype security_pins: azure.mgmt.recoveryservicesbackup.aio.operations.SecurityPINsOperations + :ivar recovery_points_recommended_for_move: RecoveryPointsRecommendedForMoveOperations operations + :vartype recovery_points_recommended_for_move: azure.mgmt.recoveryservicesbackup.aio.operations.RecoveryPointsRecommendedForMoveOperations + :ivar aad_properties: AadPropertiesOperations operations + :vartype aad_properties: azure.mgmt.recoveryservicesbackup.aio.operations.AadPropertiesOperations + :ivar cross_region_restore: CrossRegionRestoreOperations operations + :vartype cross_region_restore: azure.mgmt.recoveryservicesbackup.aio.operations.CrossRegionRestoreOperations + :ivar backup_crr_job_details: BackupCrrJobDetailsOperations operations + :vartype backup_crr_job_details: azure.mgmt.recoveryservicesbackup.aio.operations.BackupCrrJobDetailsOperations + :ivar backup_crr_jobs: BackupCrrJobsOperations operations + :vartype backup_crr_jobs: azure.mgmt.recoveryservicesbackup.aio.operations.BackupCrrJobsOperations + :ivar crr_operation_results: CrrOperationResultsOperations operations + :vartype crr_operation_results: azure.mgmt.recoveryservicesbackup.aio.operations.CrrOperationResultsOperations + :ivar crr_operation_status: CrrOperationStatusOperations operations + :vartype crr_operation_status: azure.mgmt.recoveryservicesbackup.aio.operations.CrrOperationStatusOperations + :ivar backup_resource_storage_configs: BackupResourceStorageConfigsOperations operations + :vartype backup_resource_storage_configs: azure.mgmt.recoveryservicesbackup.aio.operations.BackupResourceStorageConfigsOperations + :ivar recovery_points_crr: RecoveryPointsCrrOperations operations + :vartype recovery_points_crr: azure.mgmt.recoveryservicesbackup.aio.operations.RecoveryPointsCrrOperations + :ivar backup_protected_items_crr: BackupProtectedItemsCrrOperations operations + :vartype backup_protected_items_crr: azure.mgmt.recoveryservicesbackup.aio.operations.BackupProtectedItemsCrrOperations + :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. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = RecoveryServicesBackupClientConfiguration(credential, 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.protection_intent = ProtectionIntentOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_status = BackupStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.feature_support = FeatureSupportOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_protection_intent = BackupProtectionIntentOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_usage_summaries = BackupUsageSummariesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_resource_vault_configs = BackupResourceVaultConfigsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_resource_encryption_configs = BackupResourceEncryptionConfigsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connection = PrivateEndpointConnectionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint = PrivateEndpointOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bms_prepare_data_move_operation_result = BMSPrepareDataMoveOperationResultOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protected_items = ProtectedItemsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protected_item_operation_results = ProtectedItemOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.recovery_points = RecoveryPointsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.restores = RestoresOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_policies = BackupPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protection_policies = ProtectionPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protection_policy_operation_results = ProtectionPolicyOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_jobs = BackupJobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job_details = JobDetailsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job_cancellations = JobCancellationsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job_operation_results = JobOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.export_jobs_operation_results = ExportJobsOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_protected_items = BackupProtectedItemsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_engines = BackupEnginesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protection_container_refresh_operation_results = ProtectionContainerRefreshOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protectable_containers = ProtectableContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protection_containers = ProtectionContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_workload_items = BackupWorkloadItemsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protection_container_operation_results = ProtectionContainerOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backups = BackupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protected_item_operation_statuses = ProtectedItemOperationStatusesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.item_level_recovery_connections = ItemLevelRecoveryConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_operation_results = BackupOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_operation_statuses = BackupOperationStatusesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.protection_policy_operation_statuses = ProtectionPolicyOperationStatusesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_protectable_items = BackupProtectableItemsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_protection_containers = BackupProtectionContainersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.security_pins = SecurityPINsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.recovery_points_recommended_for_move = RecoveryPointsRecommendedForMoveOperations( + self._client, self._config, self._serialize, self._deserialize) + self.aad_properties = AadPropertiesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.cross_region_restore = CrossRegionRestoreOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_crr_job_details = BackupCrrJobDetailsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_crr_jobs = BackupCrrJobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.crr_operation_results = CrrOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.crr_operation_status = CrrOperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_resource_storage_configs = BackupResourceStorageConfigsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.recovery_points_crr = RecoveryPointsCrrOperations( + self._client, self._config, self._serialize, self._deserialize) + self.backup_protected_items_crr = BackupProtectedItemsCrrOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> 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. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.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 + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "RecoveryServicesBackupClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/__init__.py new file mode 100644 index 000000000000..fe527523e1c6 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/__init__.py @@ -0,0 +1,115 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._protection_intent_operations import ProtectionIntentOperations +from ._backup_status_operations import BackupStatusOperations +from ._feature_support_operations import FeatureSupportOperations +from ._backup_protection_intent_operations import BackupProtectionIntentOperations +from ._backup_usage_summaries_operations import BackupUsageSummariesOperations +from ._operations import Operations +from ._backup_resource_vault_configs_operations import BackupResourceVaultConfigsOperations +from ._backup_resource_encryption_configs_operations import BackupResourceEncryptionConfigsOperations +from ._private_endpoint_connection_operations import PrivateEndpointConnectionOperations +from ._private_endpoint_operations import PrivateEndpointOperations +from ._recovery_services_backup_client_operations import RecoveryServicesBackupClientOperationsMixin +from ._bms_prepare_data_move_operation_result_operations import BMSPrepareDataMoveOperationResultOperations +from ._protected_items_operations import ProtectedItemsOperations +from ._protected_item_operation_results_operations import ProtectedItemOperationResultsOperations +from ._recovery_points_operations import RecoveryPointsOperations +from ._restores_operations import RestoresOperations +from ._backup_policies_operations import BackupPoliciesOperations +from ._protection_policies_operations import ProtectionPoliciesOperations +from ._protection_policy_operation_results_operations import ProtectionPolicyOperationResultsOperations +from ._backup_jobs_operations import BackupJobsOperations +from ._job_details_operations import JobDetailsOperations +from ._job_cancellations_operations import JobCancellationsOperations +from ._job_operation_results_operations import JobOperationResultsOperations +from ._export_jobs_operation_results_operations import ExportJobsOperationResultsOperations +from ._jobs_operations import JobsOperations +from ._backup_protected_items_operations import BackupProtectedItemsOperations +from ._operation_operations import OperationOperations +from ._backup_engines_operations import BackupEnginesOperations +from ._protection_container_refresh_operation_results_operations import ProtectionContainerRefreshOperationResultsOperations +from ._protectable_containers_operations import ProtectableContainersOperations +from ._protection_containers_operations import ProtectionContainersOperations +from ._backup_workload_items_operations import BackupWorkloadItemsOperations +from ._protection_container_operation_results_operations import ProtectionContainerOperationResultsOperations +from ._backups_operations import BackupsOperations +from ._protected_item_operation_statuses_operations import ProtectedItemOperationStatusesOperations +from ._item_level_recovery_connections_operations import ItemLevelRecoveryConnectionsOperations +from ._backup_operation_results_operations import BackupOperationResultsOperations +from ._backup_operation_statuses_operations import BackupOperationStatusesOperations +from ._protection_policy_operation_statuses_operations import ProtectionPolicyOperationStatusesOperations +from ._backup_protectable_items_operations import BackupProtectableItemsOperations +from ._backup_protection_containers_operations import BackupProtectionContainersOperations +from ._security_pins_operations import SecurityPINsOperations +from ._recovery_points_recommended_for_move_operations import RecoveryPointsRecommendedForMoveOperations +from ._aad_properties_operations import AadPropertiesOperations +from ._cross_region_restore_operations import CrossRegionRestoreOperations +from ._backup_crr_job_details_operations import BackupCrrJobDetailsOperations +from ._backup_crr_jobs_operations import BackupCrrJobsOperations +from ._crr_operation_results_operations import CrrOperationResultsOperations +from ._crr_operation_status_operations import CrrOperationStatusOperations +from ._backup_resource_storage_configs_operations import BackupResourceStorageConfigsOperations +from ._recovery_points_crr_operations import RecoveryPointsCrrOperations +from ._backup_protected_items_crr_operations import BackupProtectedItemsCrrOperations + +__all__ = [ + 'ProtectionIntentOperations', + 'BackupStatusOperations', + 'FeatureSupportOperations', + 'BackupProtectionIntentOperations', + 'BackupUsageSummariesOperations', + 'Operations', + 'BackupResourceVaultConfigsOperations', + 'BackupResourceEncryptionConfigsOperations', + 'PrivateEndpointConnectionOperations', + 'PrivateEndpointOperations', + 'RecoveryServicesBackupClientOperationsMixin', + 'BMSPrepareDataMoveOperationResultOperations', + 'ProtectedItemsOperations', + 'ProtectedItemOperationResultsOperations', + 'RecoveryPointsOperations', + 'RestoresOperations', + 'BackupPoliciesOperations', + 'ProtectionPoliciesOperations', + 'ProtectionPolicyOperationResultsOperations', + 'BackupJobsOperations', + 'JobDetailsOperations', + 'JobCancellationsOperations', + 'JobOperationResultsOperations', + 'ExportJobsOperationResultsOperations', + 'JobsOperations', + 'BackupProtectedItemsOperations', + 'OperationOperations', + 'BackupEnginesOperations', + 'ProtectionContainerRefreshOperationResultsOperations', + 'ProtectableContainersOperations', + 'ProtectionContainersOperations', + 'BackupWorkloadItemsOperations', + 'ProtectionContainerOperationResultsOperations', + 'BackupsOperations', + 'ProtectedItemOperationStatusesOperations', + 'ItemLevelRecoveryConnectionsOperations', + 'BackupOperationResultsOperations', + 'BackupOperationStatusesOperations', + 'ProtectionPolicyOperationStatusesOperations', + 'BackupProtectableItemsOperations', + 'BackupProtectionContainersOperations', + 'SecurityPINsOperations', + 'RecoveryPointsRecommendedForMoveOperations', + 'AadPropertiesOperations', + 'CrossRegionRestoreOperations', + 'BackupCrrJobDetailsOperations', + 'BackupCrrJobsOperations', + 'CrrOperationResultsOperations', + 'CrrOperationStatusOperations', + 'BackupResourceStorageConfigsOperations', + 'RecoveryPointsCrrOperations', + 'BackupProtectedItemsCrrOperations', +] diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_aad_properties_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_aad_properties_operations.py new file mode 100644 index 000000000000..98b569ad7e3a --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_aad_properties_operations.py @@ -0,0 +1,103 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AadPropertiesOperations: + """AadPropertiesOperations 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.recoveryservicesbackup.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 + + async def get( + self, + azure_region: str, + filter: Optional[str] = None, + **kwargs + ) -> "_models.AADPropertiesResource": + """Fetches the AAD properties from target region BCM stamp. + + Fetches the AAD properties from target region BCM stamp. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param filter: OData filter options. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AADPropertiesResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.AADPropertiesResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AADPropertiesResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, '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') + + # 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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AADPropertiesResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupAadProperties'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_crr_job_details_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_crr_job_details_operations.py new file mode 100644 index 000000000000..33a1fb75dc9c --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_crr_job_details_operations.py @@ -0,0 +1,106 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupCrrJobDetailsOperations: + """BackupCrrJobDetailsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + azure_region: str, + parameters: "_models.CrrJobRequest", + **kwargs + ) -> "_models.JobResource": + """Get CRR job details from target region. + + Get CRR job details from target region. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param parameters: CRR Job request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.CrrJobRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.JobResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CrrJobRequest') + 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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_crr_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_crr_jobs_operations.py new file mode 100644 index 000000000000..32f78ca961cb --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_crr_jobs_operations.py @@ -0,0 +1,136 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupCrrJobsOperations: + """BackupCrrJobsOperations 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.recoveryservicesbackup.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 + + def list( + self, + azure_region: str, + parameters: "_models.CrrJobRequest", + filter: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.JobResourceList"]: + """Gets the list of CRR jobs from the target region. + + Gets the list of CRR jobs from the target region. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param parameters: Backup CRR Job request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.CrrJobRequest + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 JobResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # 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') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, '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') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CrrJobRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CrrJobRequest') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('JobResourceList', 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]: + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJobs'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_engines_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_engines_operations.py new file mode 100644 index 000000000000..1037f961e60b --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_engines_operations.py @@ -0,0 +1,201 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupEnginesOperations: + """BackupEnginesOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name: str, + resource_group_name: str, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.BackupEngineBaseResourceList"]: + """Backup management servers registered to Recovery Services Vault. Returns a pageable list of + servers. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 BackupEngineBaseResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.BackupEngineBaseResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupEngineBaseResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BackupEngineBaseResourceList', 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/{vaultName}/backupEngines'} # type: ignore + + async def get( + self, + vault_name: str, + resource_group_name: str, + backup_engine_name: str, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs + ) -> "_models.BackupEngineBaseResource": + """Returns backup management server registered to Recovery Services Vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param backup_engine_name: Name of the backup management server. + :type backup_engine_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupEngineBaseResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupEngineBaseResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupEngineBaseResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'backupEngineName': self._serialize.url("backup_engine_name", backup_engine_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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # 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 + + 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) + + deserialized = self._deserialize('BackupEngineBaseResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines/{backupEngineName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_jobs_operations.py new file mode 100644 index 000000000000..3b043e292fb9 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_jobs_operations.py @@ -0,0 +1,127 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupJobsOperations: + """BackupJobsOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name: str, + resource_group_name: str, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.JobResourceList"]: + """Provides a pageable list of jobs. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 JobResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('JobResourceList', 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/{vaultName}/backupJobs'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_operation_results_operations.py new file mode 100644 index 000000000000..c82cdffdd3bf --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_operation_results_operations.py @@ -0,0 +1,107 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupOperationResultsOperations: + """BackupOperationResultsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + operation_id: str, + **kwargs + ) -> None: + """Provides the status of the delete operations such as deleting backed up item. Once the + operation has started, the + status code in the response would be Accepted. It will continue to be in this state till it + reaches completion. On + successful completion, the status code will be OK. This method expects OperationID as an + argument. OperationID is + part of the Location header of the operation response. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param operation_id: OperationID which represents the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_operation_statuses_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_operation_statuses_operations.py new file mode 100644 index 000000000000..3fc53c6d015d --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_operation_statuses_operations.py @@ -0,0 +1,108 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupOperationStatusesOperations: + """BackupOperationStatusesOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + operation_id: str, + **kwargs + ) -> "_models.OperationStatus": + """Fetches the status of an operation such as triggering a backup, restore. The status can be in + progress, completed + or failed. You can refer to the OperationStatus enum for all the possible states of an + operation. Some operations + create jobs. This method returns the list of jobs when the operation is complete. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param operation_id: OperationID which represents the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatus, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('OperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_policies_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_policies_operations.py new file mode 100644 index 000000000000..56536cbd9a51 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_policies_operations.py @@ -0,0 +1,124 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupPoliciesOperations: + """BackupPoliciesOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name: str, + resource_group_name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.ProtectionPolicyResourceList"]: + """Lists of backup policies associated with Recovery Services Vault. API provides pagination + parameters to fetch + scoped results. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :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 ProtectionPolicyResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.ProtectionPolicyResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionPolicyResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProtectionPolicyResourceList', 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/{vaultName}/backupPolicies'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protectable_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protectable_items_operations.py new file mode 100644 index 000000000000..8eab7b04369a --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protectable_items_operations.py @@ -0,0 +1,129 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupProtectableItemsOperations: + """BackupProtectableItemsOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name: str, + resource_group_name: str, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.WorkloadProtectableItemResourceList"]: + """Provides a pageable list of protectable objects within your subscription according to the query + filter and the + pagination parameters. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 WorkloadProtectableItemResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.WorkloadProtectableItemResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkloadProtectableItemResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkloadProtectableItemResourceList', 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/{vaultName}/backupProtectableItems'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protected_items_crr_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protected_items_crr_operations.py new file mode 100644 index 000000000000..474209bec04b --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protected_items_crr_operations.py @@ -0,0 +1,128 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupProtectedItemsCrrOperations: + """BackupProtectedItemsCrrOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name: str, + resource_group_name: str, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.ProtectedItemResourceList"]: + """Provides a pageable list of all items that are backed up within a vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 ProtectedItemResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectedItemResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProtectedItemResourceList', 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]: + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems/'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protected_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protected_items_operations.py new file mode 100644 index 000000000000..20d34fc509a2 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protected_items_operations.py @@ -0,0 +1,127 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupProtectedItemsOperations: + """BackupProtectedItemsOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name: str, + resource_group_name: str, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.ProtectedItemResourceList"]: + """Provides a pageable list of all items that are backed up within a vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 ProtectedItemResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectedItemResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProtectedItemResourceList', 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/{vaultName}/backupProtectedItems'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protection_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protection_containers_operations.py new file mode 100644 index 000000000000..5f3dca3effb9 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protection_containers_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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupProtectionContainersOperations: + """BackupProtectionContainersOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name: str, + resource_group_name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.ProtectionContainerResourceList"]: + """Lists the containers registered to Recovery Services Vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :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 ProtectionContainerResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.ProtectionContainerResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProtectionContainerResourceList', 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/{vaultName}/backupProtectionContainers'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protection_intent_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protection_intent_operations.py new file mode 100644 index 000000000000..e428dcaee1af --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_protection_intent_operations.py @@ -0,0 +1,127 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupProtectionIntentOperations: + """BackupProtectionIntentOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name: str, + resource_group_name: str, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.ProtectionIntentResourceList"]: + """Provides a pageable list of all intents that are present within a vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 ProtectionIntentResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.ProtectionIntentResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionIntentResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProtectionIntentResourceList', 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/{vaultName}/backupProtectionIntents'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_resource_encryption_configs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_resource_encryption_configs_operations.py new file mode 100644 index 000000000000..fc387a887669 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_resource_encryption_configs_operations.py @@ -0,0 +1,166 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupResourceEncryptionConfigsOperations: + """BackupResourceEncryptionConfigsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.BackupResourceEncryptionConfigResource": + """Fetches Vault Encryption config. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupResourceEncryptionConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupResourceEncryptionConfigResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupResourceEncryptionConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig'} # type: ignore + + async def update( + self, + vault_name: str, + resource_group_name: str, + parameters: "_models.BackupResourceEncryptionConfigResource", + **kwargs + ) -> None: + """Updates Vault encryption config. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: Vault encryption input config request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackupResourceEncryptionConfigResource') + 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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_resource_storage_configs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_resource_storage_configs_operations.py new file mode 100644 index 000000000000..f41fe9c91aee --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_resource_storage_configs_operations.py @@ -0,0 +1,234 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupResourceStorageConfigsOperations: + """BackupResourceStorageConfigsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.BackupResourceConfigResource": + """Fetches resource storage config. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupResourceConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupResourceConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupResourceConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig'} # type: ignore + + async def update( + self, + vault_name: str, + resource_group_name: str, + parameters: "_models.BackupResourceConfigResource", + **kwargs + ) -> "_models.BackupResourceConfigResource": + """Updates vault storage model type. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: Vault storage config request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupResourceConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupResourceConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackupResourceConfigResource') + 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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupResourceConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig'} # type: ignore + + async def patch( + self, + vault_name: str, + resource_group_name: str, + parameters: "_models.BackupResourceConfigResource", + **kwargs + ) -> None: + """Updates vault storage model type. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: Vault storage config request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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 = "2018-12-20" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.patch.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackupResourceConfigResource') + 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 + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_resource_vault_configs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_resource_vault_configs_operations.py new file mode 100644 index 000000000000..937b985d52aa --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_resource_vault_configs_operations.py @@ -0,0 +1,237 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupResourceVaultConfigsOperations: + """BackupResourceVaultConfigsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.BackupResourceVaultConfigResource": + """Fetches resource vault config. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupResourceVaultConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceVaultConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupResourceVaultConfigResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupResourceVaultConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig'} # type: ignore + + async def update( + self, + vault_name: str, + resource_group_name: str, + parameters: "_models.BackupResourceVaultConfigResource", + **kwargs + ) -> "_models.BackupResourceVaultConfigResource": + """Updates vault security config. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: resource config request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceVaultConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupResourceVaultConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceVaultConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupResourceVaultConfigResource"] + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackupResourceVaultConfigResource') + 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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupResourceVaultConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig'} # type: ignore + + async def put( + self, + vault_name: str, + resource_group_name: str, + parameters: "_models.BackupResourceVaultConfigResource", + **kwargs + ) -> "_models.BackupResourceVaultConfigResource": + """Updates vault security config. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: resource config request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceVaultConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupResourceVaultConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceVaultConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupResourceVaultConfigResource"] + 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.put.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackupResourceVaultConfigResource') + 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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupResourceVaultConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_status_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_status_operations.py new file mode 100644 index 000000000000..c6edc163fa2e --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_status_operations.py @@ -0,0 +1,105 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupStatusOperations: + """BackupStatusOperations 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.recoveryservicesbackup.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 + + async def get( + self, + azure_region: str, + parameters: "_models.BackupStatusRequest", + **kwargs + ) -> "_models.BackupStatusResponse": + """Get the container backup status. + + Get the container backup status. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param parameters: Container Backup Status Request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.BackupStatusRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupStatusResponse, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupStatusResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupStatusResponse"] + 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.get.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackupStatusRequest') + 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 + + 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) + + deserialized = self._deserialize('BackupStatusResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupStatus'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_usage_summaries_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_usage_summaries_operations.py new file mode 100644 index 000000000000..34c39d965161 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_usage_summaries_operations.py @@ -0,0 +1,127 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupUsageSummariesOperations: + """BackupUsageSummariesOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name: str, + resource_group_name: str, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.BackupManagementUsageList"]: + """Fetches the backup management usage summaries of the vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 BackupManagementUsageList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.BackupManagementUsageList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupManagementUsageList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BackupManagementUsageList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return 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/{vaultName}/backupUsageSummaries'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_workload_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_workload_items_operations.py new file mode 100644 index 000000000000..757d390ca06e --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backup_workload_items_operations.py @@ -0,0 +1,137 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupWorkloadItemsOperations: + """BackupWorkloadItemsOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + filter: Optional[str] = None, + skip_token: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.WorkloadItemResourceList"]: + """Provides a pageable list of workload item of a specific container according to the query filter + and the pagination + parameters. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the container. + :type fabric_name: str + :param container_name: Name of the container. + :type container_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 WorkloadItemResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.WorkloadItemResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkloadItemResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", 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 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkloadItemResourceList', 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/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/items'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backups_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backups_operations.py new file mode 100644 index 000000000000..bff8a9108fd1 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_backups_operations.py @@ -0,0 +1,119 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BackupsOperations: + """BackupsOperations 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.recoveryservicesbackup.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 + + async def trigger( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + parameters: "_models.BackupRequestResource", + **kwargs + ) -> None: + """Triggers backup for specified backed up item. This is an asynchronous operation. To know the + status of the + operation, call GetProtectedItemOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backup item. + :type fabric_name: str + :param container_name: Container name associated with the backup item. + :type container_name: str + :param protected_item_name: Backup item for which backup needs to be triggered. + :type protected_item_name: str + :param parameters: resource backup request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.BackupRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.trigger.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackupRequestResource') + 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 + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + trigger.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/backup'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_bms_prepare_data_move_operation_result_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_bms_prepare_data_move_operation_result_operations.py new file mode 100644 index 000000000000..8ee94224dc3e --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_bms_prepare_data_move_operation_result_operations.py @@ -0,0 +1,107 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BMSPrepareDataMoveOperationResultOperations: + """BMSPrepareDataMoveOperationResultOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + operation_id: str, + **kwargs + ) -> Optional["_models.VaultStorageConfigOperationResultResponse"]: + """Fetches Operation Result for Prepare Data Move. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param operation_id: + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VaultStorageConfigOperationResultResponse, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.VaultStorageConfigOperationResultResponse or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VaultStorageConfigOperationResultResponse"]] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VaultStorageConfigOperationResultResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_cross_region_restore_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_cross_region_restore_operations.py new file mode 100644 index 000000000000..8007088cdd56 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_cross_region_restore_operations.py @@ -0,0 +1,158 @@ +# 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. +# -------------------------------------------------------------------------- +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.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CrossRegionRestoreOperations: + """CrossRegionRestoreOperations 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.recoveryservicesbackup.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 + + async def _trigger_initial( + self, + azure_region: str, + parameters: "_models.CrossRegionRestoreRequest", + **kwargs + ) -> 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 = "2018-12-20" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._trigger_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CrossRegionRestoreRequest') + 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 + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _trigger_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore'} # type: ignore + + async def begin_trigger( + self, + azure_region: str, + parameters: "_models.CrossRegionRestoreRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores the specified backed up data in a different region as compared to where the data is backed up. + + Restores the specified backed up data in a different region as compared to where the data is + backed up. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param parameters: resource cross region restore request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.CrossRegionRestoreRequest + :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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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._trigger_initial( + azure_region=azure_region, + parameters=parameters, + 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 = { + 'azureRegion': self._serialize.url("azure_region", azure_region, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **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_trigger.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_crr_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_crr_operation_results_operations.py new file mode 100644 index 000000000000..a270f0c39e85 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_crr_operation_results_operations.py @@ -0,0 +1,97 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CrrOperationResultsOperations: + """CrrOperationResultsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + azure_region: str, + operation_id: str, + **kwargs + ) -> None: + """get. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param operation_id: + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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 = "2018-12-20" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_crr_operation_status_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_crr_operation_status_operations.py new file mode 100644 index 000000000000..414b459a3f90 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_crr_operation_status_operations.py @@ -0,0 +1,100 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CrrOperationStatusOperations: + """CrrOperationStatusOperations 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.recoveryservicesbackup.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 + + async def get( + self, + azure_region: str, + operation_id: str, + **kwargs + ) -> "_models.OperationStatus": + """get. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param operation_id: + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatus, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationsStatus/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_export_jobs_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_export_jobs_operation_results_operations.py new file mode 100644 index 000000000000..5c722f38d9a1 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_export_jobs_operation_results_operations.py @@ -0,0 +1,111 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ExportJobsOperationResultsOperations: + """ExportJobsOperationResultsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + operation_id: str, + **kwargs + ) -> "_models.OperationResultInfoBaseResource": + """Gets the operation result of operation triggered by Export Jobs API. If the operation is + successful, then it also + contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in + JSON serialized format. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param operation_id: OperationID which represents the export job. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationResultInfoBaseResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationResultInfoBaseResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResultInfoBaseResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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 = self._client.get(url, query_parameters, header_parameters) + 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) + + if response.status_code == 200: + deserialized = self._deserialize('OperationResultInfoBaseResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('OperationResultInfoBaseResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/operationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_feature_support_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_feature_support_operations.py new file mode 100644 index 000000000000..ebb8eb2f098b --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_feature_support_operations.py @@ -0,0 +1,105 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class FeatureSupportOperations: + """FeatureSupportOperations 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.recoveryservicesbackup.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 + + async def validate( + self, + azure_region: str, + parameters: "_models.FeatureSupportRequest", + **kwargs + ) -> "_models.AzureVMResourceFeatureSupportResponse": + """It will validate if given feature with resource properties is supported in service. + + It will validate if given feature with resource properties is supported in service. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param parameters: Feature support request object. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.FeatureSupportRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureVMResourceFeatureSupportResponse, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.AzureVMResourceFeatureSupportResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureVMResourceFeatureSupportResponse"] + 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.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'FeatureSupportRequest') + 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 + + 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) + + deserialized = self._deserialize('AzureVMResourceFeatureSupportResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate.metadata = {'url': '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupValidateFeatures'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_item_level_recovery_connections_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_item_level_recovery_connections_operations.py new file mode 100644 index 000000000000..a1ff74c63227 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_item_level_recovery_connections_operations.py @@ -0,0 +1,203 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ItemLevelRecoveryConnectionsOperations: + """ItemLevelRecoveryConnectionsOperations 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.recoveryservicesbackup.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 + + async def provision( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + recovery_point_id: str, + parameters: "_models.ILRRequestResource", + **kwargs + ) -> None: + """Provisions a script which invokes an iSCSI connection to the backup data. Executing this script + opens a file + explorer displaying all the recoverable files and folders. This is an asynchronous operation. + To know the status of + provisioning, call GetProtectedItemOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up items. + :type fabric_name: str + :param container_name: Container name associated with the backed up items. + :type container_name: str + :param protected_item_name: Backed up item name whose files/folders are to be restored. + :type protected_item_name: str + :param recovery_point_id: Recovery point ID which represents backed up data. iSCSI connection + will be provisioned + for this backed up data. + :type recovery_point_id: str + :param parameters: resource ILR request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.ILRRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.provision.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ILRRequestResource') + 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 + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + provision.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/provisionInstantItemRecovery'} # type: ignore + + async def revoke( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + recovery_point_id: str, + **kwargs + ) -> None: + """Revokes an iSCSI connection which can be used to download a script. Executing this script opens + a file explorer + displaying all recoverable files and folders. This is an asynchronous operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up items. + :type fabric_name: str + :param container_name: Container name associated with the backed up items. + :type container_name: str + :param protected_item_name: Backed up item name whose files/folders are to be restored. + :type protected_item_name: str + :param recovery_point_id: Recovery point ID which represents backed up data. iSCSI connection + will be revoked for + this backed up data. + :type recovery_point_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.revoke.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + revoke.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/revokeInstantItemRecovery'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_job_cancellations_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_job_cancellations_operations.py new file mode 100644 index 000000000000..b10fd985fb02 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_job_cancellations_operations.py @@ -0,0 +1,102 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobCancellationsOperations: + """JobCancellationsOperations 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.recoveryservicesbackup.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 + + async def trigger( + self, + vault_name: str, + resource_group_name: str, + job_name: str, + **kwargs + ) -> None: + """Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call + GetCancelOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param job_name: Name of the job to cancel. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.trigger.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + trigger.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/cancel'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_job_details_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_job_details_operations.py new file mode 100644 index 000000000000..e8104a3f3313 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_job_details_operations.py @@ -0,0 +1,104 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobDetailsOperations: + """JobDetailsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + job_name: str, + **kwargs + ) -> "_models.JobResource": + """Gets extended information associated with the job. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param job_name: Name of the job whose details are to be fetched. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.JobResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_job_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_job_operation_results_operations.py new file mode 100644 index 000000000000..00e21162648a --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_job_operation_results_operations.py @@ -0,0 +1,105 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobOperationResultsOperations: + """JobOperationResultsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + job_name: str, + operation_id: str, + **kwargs + ) -> None: + """Fetches the result of any operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param job_name: Job name whose operation result has to be fetched. + :type job_name: str + :param operation_id: OperationID which represents the operation whose result has to be fetched. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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'), + '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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/operationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_jobs_operations.py new file mode 100644 index 000000000000..6cb6849a0461 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_jobs_operations.py @@ -0,0 +1,102 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobsOperations: + """JobsOperations 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.recoveryservicesbackup.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 + + async def export( + self, + vault_name: str, + resource_group_name: str, + filter: Optional[str] = None, + **kwargs + ) -> None: + """Triggers export of jobs specified by filters and returns an OperationID to track. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.export.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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 + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + export.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobsExport'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_operation_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_operation_operations.py new file mode 100644 index 000000000000..f7d1e342a900 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_operation_operations.py @@ -0,0 +1,108 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations: + """OperationOperations 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.recoveryservicesbackup.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 + + async def validate( + self, + vault_name: str, + resource_group_name: str, + parameters: "_models.ValidateOperationRequest", + **kwargs + ) -> "_models.ValidateOperationsResponse": + """Validate operation for specified backed up item. This is a synchronous operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: resource validate operation request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.ValidateOperationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidateOperationsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ValidateOperationsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateOperationsResponse"] + 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.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ValidateOperationRequest') + 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 + + 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) + + deserialized = self._deserialize('ValidateOperationsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperation'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_operations.py new file mode 100644 index 000000000000..fadebb6fd054 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_operations.py @@ -0,0 +1,104 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations 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.recoveryservicesbackup.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 + + def list( + self, + **kwargs + ) -> AsyncIterable["_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.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.ClientDiscoveryResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClientDiscoveryResponse"] + error_map = { + 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 = 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) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ClientDiscoveryResponse', 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': '/providers/Microsoft.RecoveryServices/operations'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_private_endpoint_connection_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_private_endpoint_connection_operations.py new file mode 100644 index 000000000000..626f3d4e8de0 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_private_endpoint_connection_operations.py @@ -0,0 +1,359 @@ +# 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. +# -------------------------------------------------------------------------- +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.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionOperations: + """PrivateEndpointConnectionOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> "_models.PrivateEndpointConnectionResource": + """Get Private Endpoint Connection. This call is made by Backup Admin. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.PrivateEndpointConnectionResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _put_initial( + self, + vault_name: str, + resource_group_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnectionResource", + **kwargs + ) -> "_models.PrivateEndpointConnectionResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + 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._put_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateEndpointConnectionResource') + 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 + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _put_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_put( + self, + vault_name: str, + resource_group_name: str, + private_endpoint_connection_name: str, + parameters: "_models.PrivateEndpointConnectionResource", + **kwargs + ) -> AsyncLROPoller["_models.PrivateEndpointConnectionResource"]: + """Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: Request body for operation. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.PrivateEndpointConnectionResource + :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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or 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 PrivateEndpointConnectionResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.recoveryservicesbackup.models.PrivateEndpointConnectionResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + 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._put_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + private_endpoint_connection_name=private_endpoint_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_initial( + self, + vault_name: str, + resource_group_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> 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-03-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete( + self, + vault_name: str, + resource_group_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Delete Private Endpoint requests. This call is made by Backup Admin. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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._delete_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + private_endpoint_connection_name=private_endpoint_connection_name, + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_private_endpoint_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_private_endpoint_operations.py new file mode 100644 index 000000000000..302714319f0f --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_private_endpoint_operations.py @@ -0,0 +1,111 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointOperations: + """PrivateEndpointOperations 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.recoveryservicesbackup.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 + + async def get_operation_status( + self, + vault_name: str, + resource_group_name: str, + private_endpoint_connection_name: str, + operation_id: str, + **kwargs + ) -> "_models.OperationStatus": + """Gets the operation status for a private endpoint connection. + + Gets the operation status for a private endpoint connection. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param operation_id: Operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatus, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}/operationsStatus/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protectable_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protectable_containers_operations.py new file mode 100644 index 000000000000..9acd5c8a715f --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protectable_containers_operations.py @@ -0,0 +1,126 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProtectableContainersOperations: + """ProtectableContainersOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.ProtectableContainerResourceList"]: + """Lists the containers that can be registered to Recovery Services Vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: + :type fabric_name: str + :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 ProtectableContainerResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.ProtectableContainerResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectableContainerResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_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') + + 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) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProtectableContainerResourceList', 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/{vaultName}/backupFabrics/{fabricName}/protectableContainers'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protected_item_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protected_item_operation_results_operations.py new file mode 100644 index 000000000000..cdbd25206232 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protected_item_operation_results_operations.py @@ -0,0 +1,119 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProtectedItemOperationResultsOperations: + """ProtectedItemOperationResultsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + operation_id: str, + **kwargs + ) -> Optional["_models.ProtectedItemResource"]: + """Fetches the result of any operation on the backup item. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backup item. + :type fabric_name: str + :param container_name: Container name associated with the backup item. + :type container_name: str + :param protected_item_name: Backup item name whose details are to be fetched. + :type protected_item_name: str + :param operation_id: OperationID which represents the operation whose result needs to be + fetched. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectedItemResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResource or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectedItemResource"]] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + 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('ProtectedItemResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protected_item_operation_statuses_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protected_item_operation_statuses_operations.py new file mode 100644 index 000000000000..aa2f8b5c8d47 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protected_item_operation_statuses_operations.py @@ -0,0 +1,120 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProtectedItemOperationStatusesOperations: + """ProtectedItemOperationStatusesOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + operation_id: str, + **kwargs + ) -> "_models.OperationStatus": + """Fetches the status of an operation such as triggering a backup, restore. The status can be in + progress, completed + or failed. You can refer to the OperationStatus enum for all the possible states of the + operation. Some operations + create jobs. This method returns the list of jobs associated with the operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backup item. + :type fabric_name: str + :param container_name: Container name associated with the backup item. + :type container_name: str + :param protected_item_name: Backup item name whose details are to be fetched. + :type protected_item_name: str + :param operation_id: OperationID represents the operation whose status needs to be fetched. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatus, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('OperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationsStatus/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protected_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protected_items_operations.py new file mode 100644 index 000000000000..9e5d27407965 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protected_items_operations.py @@ -0,0 +1,273 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProtectedItemsOperations: + """ProtectedItemsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + filter: Optional[str] = None, + **kwargs + ) -> "_models.ProtectedItemResource": + """Provides the details of the backed up item. This is an asynchronous operation. To know the + status of the operation, + call the GetItemOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up item. + :type fabric_name: str + :param container_name: Container name associated with the backed up item. + :type container_name: str + :param protected_item_name: Backed up item name whose details are to be fetched. + :type protected_item_name: str + :param filter: OData filter options. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectedItemResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectedItemResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", 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') + 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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('ProtectedItemResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}'} # type: ignore + + async def create_or_update( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + parameters: "_models.ProtectedItemResource", + **kwargs + ) -> Optional["_models.ProtectedItemResource"]: + """Enables backup of an item or to modifies the backup policy information of an already backed up + item. This is an + asynchronous operation. To know the status of the operation, call the GetItemOperationResult + API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backup item. + :type fabric_name: str + :param container_name: Container name associated with the backup item. + :type container_name: str + :param protected_item_name: Item name to be backed up. + :type protected_item_name: str + :param parameters: resource backed up item. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectedItemResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResource or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectedItemResource"]] + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ProtectedItemResource') + 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 + + 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('ProtectedItemResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}'} # type: ignore + + async def delete( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + **kwargs + ) -> None: + """Used to disable backup of an item within a container. This is an asynchronous operation. To + know the status of the + request, call the GetItemOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up item. + :type fabric_name: str + :param container_name: Container name associated with the backed up item. + :type container_name: str + :param protected_item_name: Backed up item to be deleted. + :type protected_item_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_container_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_container_operation_results_operations.py new file mode 100644 index 000000000000..47f2a85441d6 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_container_operation_results_operations.py @@ -0,0 +1,115 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProtectionContainerOperationResultsOperations: + """ProtectionContainerOperationResultsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + operation_id: str, + **kwargs + ) -> Optional["_models.ProtectionContainerResource"]: + """Fetches the result of any operation on the container. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the container. + :type fabric_name: str + :param container_name: Container name whose information should be fetched. + :type container_name: str + :param operation_id: Operation ID which represents the operation whose result needs to be + fetched. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionContainerResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionContainerResource or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectionContainerResource"]] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + 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('ProtectionContainerResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/operationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_container_refresh_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_container_refresh_operation_results_operations.py new file mode 100644 index 000000000000..d8a0f8dd1395 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_container_refresh_operation_results_operations.py @@ -0,0 +1,106 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProtectionContainerRefreshOperationResultsOperations: + """ProtectionContainerRefreshOperationResultsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + operation_id: str, + **kwargs + ) -> None: + """Provides the result of the refresh operation triggered by the BeginRefresh operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the container. + :type fabric_name: str + :param operation_id: Operation ID associated with the operation whose result needs to be + fetched. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/operationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_containers_operations.py new file mode 100644 index 000000000000..b9bc12f9cdf8 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_containers_operations.py @@ -0,0 +1,396 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProtectionContainersOperations: + """ProtectionContainersOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + **kwargs + ) -> "_models.ProtectionContainerResource": + """Gets details of the specific container registered to your Recovery Services Vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Name of the fabric where the container belongs. + :type fabric_name: str + :param container_name: Name of the container whose details need to be fetched. + :type container_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionContainerResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionContainerResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", 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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('ProtectionContainerResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}'} # type: ignore + + async def register( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + parameters: "_models.ProtectionContainerResource", + **kwargs + ) -> Optional["_models.ProtectionContainerResource"]: + """Registers the container with Recovery Services vault. + This is an asynchronous operation. To track the operation status, use location header to call + get latest status of + the operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the container. + :type fabric_name: str + :param container_name: Name of the container to be registered. + :type container_name: str + :param parameters: Request body for operation. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.ProtectionContainerResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionContainerResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionContainerResource or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectionContainerResource"]] + 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.register.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ProtectionContainerResource') + 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 + + 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('ProtectionContainerResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + register.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}'} # type: ignore + + async def unregister( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + **kwargs + ) -> None: + """Unregisters the given container from your Recovery Services Vault. This is an asynchronous + operation. To determine + whether the backend service has finished processing the request, call Get Container Operation + Result API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Name of the fabric where the container belongs. + :type fabric_name: str + :param container_name: Name of the container which needs to be unregistered from the Recovery + Services Vault. + :type container_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.unregister.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + unregister.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}'} # type: ignore + + async def inquire( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + filter: Optional[str] = None, + **kwargs + ) -> None: + """Inquires all the protectable items under the given container. + + This is an async operation and the results should be tracked using location header or + Azure-async-url. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric Name associated with the container. + :type fabric_name: str + :param container_name: Name of the container in which inquiry needs to be triggered. + :type container_name: str + :param filter: OData filter options. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.inquire.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + 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 + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + inquire.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/inquire'} # type: ignore + + async def refresh( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + filter: Optional[str] = None, + **kwargs + ) -> None: + """Discovers all the containers in the subscription that can be backed up to Recovery Services + Vault. This is an + asynchronous operation. To know the status of the operation, call GetRefreshOperationResult + API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated the container. + :type fabric_name: str + :param filter: OData filter options. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.refresh.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + refresh.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/refreshContainers'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_intent_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_intent_operations.py new file mode 100644 index 000000000000..9ae57a614d6e --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_intent_operations.py @@ -0,0 +1,321 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProtectionIntentOperations: + """ProtectionIntentOperations 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.recoveryservicesbackup.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 + + async def validate( + self, + azure_region: str, + parameters: "_models.PreValidateEnableBackupRequest", + **kwargs + ) -> "_models.PreValidateEnableBackupResponse": + """It will validate followings + + + #. Vault capacity + #. VM is already protected + #. Any VM related configuration passed in properties. + + It will validate followings + + + #. Vault capacity + #. VM is already protected + #. Any VM related configuration passed in properties. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param parameters: Enable backup validation request on Virtual Machine. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.PreValidateEnableBackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PreValidateEnableBackupResponse, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.PreValidateEnableBackupResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PreValidateEnableBackupResponse"] + 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.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PreValidateEnableBackupRequest') + 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 + + 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) + + deserialized = self._deserialize('PreValidateEnableBackupResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate.metadata = {'url': '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupPreValidateProtection'} # type: ignore + + async def get( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + intent_object_name: str, + **kwargs + ) -> "_models.ProtectionIntentResource": + """Provides the details of the protection intent up item. This is an asynchronous operation. To + know the status of the operation, + call the GetItemOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up item. + :type fabric_name: str + :param intent_object_name: Backed up item name whose details are to be fetched. + :type intent_object_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionIntentResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionIntentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionIntentResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, '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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('ProtectionIntentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}'} # type: ignore + + async def create_or_update( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + intent_object_name: str, + parameters: "_models.ProtectionIntentResource", + **kwargs + ) -> "_models.ProtectionIntentResource": + """Create Intent for Enabling backup of an item. This is a synchronous operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backup item. + :type fabric_name: str + :param intent_object_name: Intent object name. + :type intent_object_name: str + :param parameters: resource backed up item. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.ProtectionIntentResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionIntentResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionIntentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionIntentResource"] + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ProtectionIntentResource') + 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 + + 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) + + deserialized = self._deserialize('ProtectionIntentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}'} # type: ignore + + async def delete( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + intent_object_name: str, + **kwargs + ) -> None: + """Used to remove intent from an item. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the intent. + :type fabric_name: str + :param intent_object_name: Intent to be deleted. + :type intent_object_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, '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] + + 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 + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_policies_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_policies_operations.py new file mode 100644 index 000000000000..4c5cdc0bdfde --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_policies_operations.py @@ -0,0 +1,301 @@ +# 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. +# -------------------------------------------------------------------------- +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.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProtectionPoliciesOperations: + """ProtectionPoliciesOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + policy_name: str, + **kwargs + ) -> "_models.ProtectionPolicyResource": + """Provides the details of the backup policies associated to Recovery Services Vault. This is an + asynchronous + operation. Status of the operation can be fetched using GetPolicyOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param policy_name: Backup policy information to be fetched. + :type policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionPolicyResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionPolicyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionPolicyResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('ProtectionPolicyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}'} # type: ignore + + async def create_or_update( + self, + vault_name: str, + resource_group_name: str, + policy_name: str, + parameters: "_models.ProtectionPolicyResource", + **kwargs + ) -> Optional["_models.ProtectionPolicyResource"]: + """Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation + can be fetched + using GetPolicyOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param policy_name: Backup policy to be created. + :type policy_name: str + :param parameters: resource backup policy. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.ProtectionPolicyResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionPolicyResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionPolicyResource or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectionPolicyResource"]] + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ProtectionPolicyResource') + 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 + + 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('ProtectionPolicyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}'} # type: ignore + + async def _delete_initial( + self, + vault_name: str, + resource_group_name: str, + policy_name: str, + **kwargs + ) -> 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-03-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}'} # type: ignore + + async def begin_delete( + self, + vault_name: str, + resource_group_name: str, + policy_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous + operation. Status of the + operation can be fetched using GetProtectionPolicyOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param policy_name: Backup policy to be deleted. + :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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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._delete_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + policy_name=policy_name, + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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) + 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_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_policy_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_policy_operation_results_operations.py new file mode 100644 index 000000000000..7d2fcb2f8650 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_policy_operation_results_operations.py @@ -0,0 +1,109 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProtectionPolicyOperationResultsOperations: + """ProtectionPolicyOperationResultsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + policy_name: str, + operation_id: str, + **kwargs + ) -> "_models.ProtectionPolicyResource": + """Provides the result of an operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param policy_name: Backup policy name whose operation's result needs to be fetched. + :type policy_name: str + :param operation_id: Operation ID which represents the operation whose result needs to be + fetched. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionPolicyResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionPolicyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionPolicyResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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'), + '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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('ProtectionPolicyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_policy_operation_statuses_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_policy_operation_statuses_operations.py new file mode 100644 index 000000000000..e339b2e30676 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_protection_policy_operation_statuses_operations.py @@ -0,0 +1,113 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProtectionPolicyOperationStatusesOperations: + """ProtectionPolicyOperationStatusesOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + policy_name: str, + operation_id: str, + **kwargs + ) -> "_models.OperationStatus": + """Provides the status of the asynchronous operations like backup, restore. The status can be in + progress, completed + or failed. You can refer to the Operation Status enum for all the possible states of an + operation. Some operations + create jobs. This method returns the list of jobs associated with operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param policy_name: Backup policy name whose operation's status needs to be fetched. + :type policy_name: str + :param operation_id: Operation ID which represents an operation whose status needs to be + fetched. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatus, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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'), + '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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('OperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_recovery_points_crr_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_recovery_points_crr_operations.py new file mode 100644 index 000000000000..97b4c1fa9e6d --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_recovery_points_crr_operations.py @@ -0,0 +1,135 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RecoveryPointsCrrOperations: + """RecoveryPointsCrrOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.RecoveryPointResourceList"]: + """Lists the backup copies for the backed up item. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up item. + :type fabric_name: str + :param container_name: Container name associated with the backed up item. + :type container_name: str + :param protected_item_name: Backed up item whose backup copies are to be fetched. + :type protected_item_name: str + :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 RecoveryPointResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPointResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", 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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + 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) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecoveryPointResourceList', 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]: + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_recovery_points_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_recovery_points_operations.py new file mode 100644 index 000000000000..7fe126e377a5 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_recovery_points_operations.py @@ -0,0 +1,299 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RecoveryPointsOperations: + """RecoveryPointsOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.RecoveryPointResourceList"]: + """Lists the backup copies for the backed up item. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up item. + :type fabric_name: str + :param container_name: Container name associated with the backed up item. + :type container_name: str + :param protected_item_name: Backed up item whose backup copies are to be fetched. + :type protected_item_name: str + :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 RecoveryPointResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPointResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", 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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + 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) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecoveryPointResourceList', 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/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints'} # type: ignore + + async def get( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + recovery_point_id: str, + **kwargs + ) -> "_models.RecoveryPointResource": + """Provides the information of the backed up data identified using RecoveryPointID. This is an + asynchronous operation. + To know the status of the operation, call the GetProtectedItemOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with backed up item. + :type fabric_name: str + :param container_name: Container name associated with backed up item. + :type container_name: str + :param protected_item_name: Backed up item name whose backup data needs to be fetched. + :type protected_item_name: str + :param recovery_point_id: RecoveryPointID represents the backed up data to be fetched. + :type recovery_point_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecoveryPointResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPointResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('RecoveryPointResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}'} # type: ignore + + async def get_access_token( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + recovery_point_id: str, + parameters: "_models.AADPropertiesResource", + **kwargs + ) -> Optional["_models.CrrAccessTokenResource"]: + """Returns the Access token for communication between BMS and Protection service. + + Returns the Access token for communication between BMS and Protection service. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the container. + :type fabric_name: str + :param container_name: Name of the container. + :type container_name: str + :param protected_item_name: Name of the Protected Item. + :type protected_item_name: str + :param recovery_point_id: Recovery Point Id. + :type recovery_point_id: str + :param parameters: Get Access Token request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.AADPropertiesResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CrrAccessTokenResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.CrrAccessTokenResource or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CrrAccessTokenResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.get_access_token.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AADPropertiesResource') + 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 + + if response.status_code not in [200, 400]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CrrAccessTokenResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_recovery_points_recommended_for_move_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_recovery_points_recommended_for_move_operations.py new file mode 100644 index 000000000000..0286305403fb --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_recovery_points_recommended_for_move_operations.py @@ -0,0 +1,140 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RecoveryPointsRecommendedForMoveOperations: + """RecoveryPointsRecommendedForMoveOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + parameters: "_models.ListRecoveryPointsRecommendedForMoveRequest", + **kwargs + ) -> AsyncIterable["_models.RecoveryPointResourceList"]: + """Lists the recovery points recommended for move to another tier. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: + :type fabric_name: str + :param container_name: + :type container_name: str + :param protected_item_name: + :type protected_item_name: str + :param parameters: List Recovery points Recommended for Move Request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.ListRecoveryPointsRecommendedForMoveRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecoveryPointResourceList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPointResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # 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') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", 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') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ListRecoveryPointsRecommendedForMoveRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ListRecoveryPointsRecommendedForMoveRequest') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RecoveryPointResourceList', 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/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPointsRecommendedForMove'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_recovery_services_backup_client_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_recovery_services_backup_client_operations.py new file mode 100644 index 000000000000..5df667113740 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_recovery_services_backup_client_operations.py @@ -0,0 +1,476 @@ +# 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. +# -------------------------------------------------------------------------- +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.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RecoveryServicesBackupClientOperationsMixin: + + async def get_operation_status( + self, + vault_name: str, + resource_group_name: str, + operation_id: str, + **kwargs + ) -> "_models.OperationStatus": + """Fetches operation status for data move operation on vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param operation_id: + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatus, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationStatus/{operationId}'} # type: ignore + + async def _bms_prepare_data_move_initial( + self, + vault_name: str, + resource_group_name: str, + parameters: "_models.PrepareDataMoveRequest", + **kwargs + ) -> 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-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._bms_prepare_data_move_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrepareDataMoveRequest') + 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 + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _bms_prepare_data_move_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/prepareDataMove'} # type: ignore + + async def begin_bms_prepare_data_move( + self, + vault_name: str, + resource_group_name: str, + parameters: "_models.PrepareDataMoveRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Prepares source vault for Data Move operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: Prepare data move request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.PrepareDataMoveRequest + :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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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._bms_prepare_data_move_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + parameters=parameters, + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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) + 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_bms_prepare_data_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/prepareDataMove'} # type: ignore + + async def _bms_trigger_data_move_initial( + self, + vault_name: str, + resource_group_name: str, + parameters: "_models.TriggerDataMoveRequest", + **kwargs + ) -> 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-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._bms_trigger_data_move_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TriggerDataMoveRequest') + 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 + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _bms_trigger_data_move_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove'} # type: ignore + + async def begin_bms_trigger_data_move( + self, + vault_name: str, + resource_group_name: str, + parameters: "_models.TriggerDataMoveRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Triggers Data Move Operation on target vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: Trigger data move request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.TriggerDataMoveRequest + :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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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._bms_trigger_data_move_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + parameters=parameters, + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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) + 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_bms_trigger_data_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove'} # type: ignore + + async def _move_recovery_point_initial( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + recovery_point_id: str, + parameters: "_models.MoveRPAcrossTiersRequest", + **kwargs + ) -> 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-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._move_recovery_point_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'MoveRPAcrossTiersRequest') + 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 + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _move_recovery_point_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/move'} # type: ignore + + async def begin_move_recovery_point( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + recovery_point_id: str, + parameters: "_models.MoveRPAcrossTiersRequest", + **kwargs + ) -> AsyncLROPoller[None]: + """Move recovery point from one datastore to another store. + + Move recovery point from one datastore to another store. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: + :type fabric_name: str + :param container_name: + :type container_name: str + :param protected_item_name: + :type protected_item_name: str + :param recovery_point_id: + :type recovery_point_id: str + :param parameters: Move Resource Across Tiers Request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.MoveRPAcrossTiersRequest + :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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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._move_recovery_point_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + fabric_name=fabric_name, + container_name=container_name, + protected_item_name=protected_item_name, + recovery_point_id=recovery_point_id, + parameters=parameters, + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_move_recovery_point.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/move'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_restores_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_restores_operations.py new file mode 100644 index 000000000000..a5f144bb8595 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_restores_operations.py @@ -0,0 +1,192 @@ +# 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. +# -------------------------------------------------------------------------- +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.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class RestoresOperations: + """RestoresOperations 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.recoveryservicesbackup.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 + + async def _trigger_initial( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + recovery_point_id: str, + parameters: "_models.RestoreRequestResource", + **kwargs + ) -> 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-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._trigger_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RestoreRequestResource') + 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 + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _trigger_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore'} # type: ignore + + async def begin_trigger( + self, + vault_name: str, + resource_group_name: str, + fabric_name: str, + container_name: str, + protected_item_name: str, + recovery_point_id: str, + parameters: "_models.RestoreRequestResource", + **kwargs + ) -> AsyncLROPoller[None]: + """Restores the specified backed up data. This is an asynchronous operation. To know the status of + this API call, use + GetProtectedItemOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up items. + :type fabric_name: str + :param container_name: Container name associated with the backed up items. + :type container_name: str + :param protected_item_name: Backed up item to be restored. + :type protected_item_name: str + :param recovery_point_id: Recovery point ID which represents the backed up data to be restored. + :type recovery_point_id: str + :param parameters: resource restore request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.RestoreRequestResource + :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: Pass in True if you'd like the AsyncARMPolling polling method, + False for no polling, or 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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._trigger_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + fabric_name=fabric_name, + container_name=container_name, + protected_item_name=protected_item_name, + recovery_point_id=recovery_point_id, + parameters=parameters, + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_trigger.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_security_pins_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_security_pins_operations.py new file mode 100644 index 000000000000..108b0f988d48 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/aio/operations/_security_pins_operations.py @@ -0,0 +1,100 @@ +# 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. +# -------------------------------------------------------------------------- +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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SecurityPINsOperations: + """SecurityPINsOperations 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.recoveryservicesbackup.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 + + async def get( + self, + vault_name: str, + resource_group_name: str, + **kwargs + ) -> "_models.TokenInformation": + """Get the security PIN. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TokenInformation, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.TokenInformation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TokenInformation"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.post(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('TokenInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupSecurityPIN'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/__init__.py new file mode 100644 index 000000000000..5f0fedd0818f --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/__init__.py @@ -0,0 +1,1021 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AADProperties + from ._models_py3 import AADPropertiesResource + from ._models_py3 import AzureBackupGoalFeatureSupportRequest + from ._models_py3 import AzureBackupServerContainer + from ._models_py3 import AzureBackupServerEngine + from ._models_py3 import AzureFileShareBackupRequest + from ._models_py3 import AzureFileShareProtectableItem + from ._models_py3 import AzureFileShareProtectionPolicy + from ._models_py3 import AzureFileShareProvisionILRRequest + from ._models_py3 import AzureFileShareRecoveryPoint + from ._models_py3 import AzureFileShareRecoveryPointAutoGenerated + from ._models_py3 import AzureFileShareRestoreRequest + from ._models_py3 import AzureFileshareProtectedItem + from ._models_py3 import AzureFileshareProtectedItemAutoGenerated + from ._models_py3 import AzureFileshareProtectedItemExtendedInfo + from ._models_py3 import AzureIaaSClassicComputeVMContainer + from ._models_py3 import AzureIaaSClassicComputeVMProtectableItem + from ._models_py3 import AzureIaaSClassicComputeVMProtectedItem + from ._models_py3 import AzureIaaSComputeVMContainer + from ._models_py3 import AzureIaaSComputeVMProtectableItem + from ._models_py3 import AzureIaaSComputeVMProtectedItem + from ._models_py3 import AzureIaaSVMErrorInfo + from ._models_py3 import AzureIaaSVMHealthDetails + from ._models_py3 import AzureIaaSVMJob + from ._models_py3 import AzureIaaSVMJobExtendedInfo + from ._models_py3 import AzureIaaSVMJobTaskDetails + from ._models_py3 import AzureIaaSVMProtectedItem + from ._models_py3 import AzureIaaSVMProtectedItemExtendedInfo + from ._models_py3 import AzureIaaSVMProtectionPolicy + from ._models_py3 import AzureRecoveryServiceVaultProtectionIntent + from ._models_py3 import AzureResourceProtectionIntent + from ._models_py3 import AzureSQLAGWorkloadContainerProtectionContainer + from ._models_py3 import AzureSqlContainer + from ._models_py3 import AzureSqlProtectedItem + from ._models_py3 import AzureSqlProtectedItemExtendedInfo + from ._models_py3 import AzureSqlProtectionPolicy + from ._models_py3 import AzureStorageContainer + from ._models_py3 import AzureStorageErrorInfo + from ._models_py3 import AzureStorageJob + from ._models_py3 import AzureStorageJobExtendedInfo + from ._models_py3 import AzureStorageJobTaskDetails + from ._models_py3 import AzureStorageProtectableContainer + from ._models_py3 import AzureVMAppContainerProtectableContainer + from ._models_py3 import AzureVMAppContainerProtectionContainer + from ._models_py3 import AzureVMResourceFeatureSupportRequest + from ._models_py3 import AzureVMResourceFeatureSupportResponse + from ._models_py3 import AzureVmWorkloadItem + from ._models_py3 import AzureVmWorkloadProtectableItem + from ._models_py3 import AzureVmWorkloadProtectedItem + from ._models_py3 import AzureVmWorkloadProtectedItemExtendedInfo + from ._models_py3 import AzureVmWorkloadProtectionPolicy + from ._models_py3 import AzureVmWorkloadSAPAseDatabaseProtectedItem + from ._models_py3 import AzureVmWorkloadSAPAseDatabaseWorkloadItem + from ._models_py3 import AzureVmWorkloadSAPAseSystemProtectableItem + from ._models_py3 import AzureVmWorkloadSAPAseSystemWorkloadItem + from ._models_py3 import AzureVmWorkloadSAPHanaDatabaseProtectableItem + from ._models_py3 import AzureVmWorkloadSAPHanaDatabaseProtectedItem + from ._models_py3 import AzureVmWorkloadSAPHanaDatabaseWorkloadItem + from ._models_py3 import AzureVmWorkloadSAPHanaSystemProtectableItem + from ._models_py3 import AzureVmWorkloadSAPHanaSystemWorkloadItem + from ._models_py3 import AzureVmWorkloadSQLAvailabilityGroupProtectableItem + from ._models_py3 import AzureVmWorkloadSQLDatabaseProtectableItem + from ._models_py3 import AzureVmWorkloadSQLDatabaseProtectedItem + from ._models_py3 import AzureVmWorkloadSQLDatabaseWorkloadItem + from ._models_py3 import AzureVmWorkloadSQLInstanceProtectableItem + from ._models_py3 import AzureVmWorkloadSQLInstanceWorkloadItem + from ._models_py3 import AzureWorkloadAutoProtectionIntent + from ._models_py3 import AzureWorkloadBackupRequest + from ._models_py3 import AzureWorkloadContainer + from ._models_py3 import AzureWorkloadContainerExtendedInfo + from ._models_py3 import AzureWorkloadErrorInfo + from ._models_py3 import AzureWorkloadJob + from ._models_py3 import AzureWorkloadJobExtendedInfo + from ._models_py3 import AzureWorkloadJobTaskDetails + from ._models_py3 import AzureWorkloadPointInTimeRecoveryPoint + from ._models_py3 import AzureWorkloadPointInTimeRecoveryPointAutoGenerated + from ._models_py3 import AzureWorkloadPointInTimeRestoreRequest + from ._models_py3 import AzureWorkloadRecoveryPoint + from ._models_py3 import AzureWorkloadRecoveryPointAutoGenerated + from ._models_py3 import AzureWorkloadRestoreRequest + from ._models_py3 import AzureWorkloadSAPHanaPointInTimeRecoveryPoint + from ._models_py3 import AzureWorkloadSAPHanaPointInTimeRecoveryPointAutoGenerated + from ._models_py3 import AzureWorkloadSAPHanaPointInTimeRestoreRequest + from ._models_py3 import AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest + from ._models_py3 import AzureWorkloadSAPHanaRecoveryPoint + from ._models_py3 import AzureWorkloadSAPHanaRecoveryPointAutoGenerated + from ._models_py3 import AzureWorkloadSAPHanaRestoreRequest + from ._models_py3 import AzureWorkloadSAPHanaRestoreWithRehydrateRequest + from ._models_py3 import AzureWorkloadSQLAutoProtectionIntent + from ._models_py3 import AzureWorkloadSQLPointInTimeRecoveryPoint + from ._models_py3 import AzureWorkloadSQLPointInTimeRecoveryPointAutoGenerated + from ._models_py3 import AzureWorkloadSQLPointInTimeRestoreRequest + from ._models_py3 import AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest + from ._models_py3 import AzureWorkloadSQLRecoveryPoint + from ._models_py3 import AzureWorkloadSQLRecoveryPointAutoGenerated + from ._models_py3 import AzureWorkloadSQLRecoveryPointExtendedInfo + from ._models_py3 import AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated + from ._models_py3 import AzureWorkloadSQLRestoreRequest + from ._models_py3 import AzureWorkloadSQLRestoreWithRehydrateRequest + from ._models_py3 import BEKDetails + from ._models_py3 import BMSAADPropertiesQueryObject + from ._models_py3 import BMSBackupEngineQueryObject + from ._models_py3 import BMSBackupEnginesQueryObject + from ._models_py3 import BMSBackupSummariesQueryObject + from ._models_py3 import BMSContainerQueryObject + from ._models_py3 import BMSContainersInquiryQueryObject + from ._models_py3 import BMSPOQueryObject + from ._models_py3 import BMSRPQueryObject + from ._models_py3 import BMSRefreshContainersQueryObject + from ._models_py3 import BMSWorkloadItemQueryObject + from ._models_py3 import BackupEngineBase + from ._models_py3 import BackupEngineBaseResource + from ._models_py3 import BackupEngineBaseResourceList + from ._models_py3 import BackupEngineExtendedInfo + from ._models_py3 import BackupManagementUsage + from ._models_py3 import BackupManagementUsageList + from ._models_py3 import BackupRequest + from ._models_py3 import BackupRequestResource + from ._models_py3 import BackupResourceConfig + from ._models_py3 import BackupResourceConfigResource + from ._models_py3 import BackupResourceEncryptionConfig + from ._models_py3 import BackupResourceEncryptionConfigResource + from ._models_py3 import BackupResourceVaultConfig + from ._models_py3 import BackupResourceVaultConfigResource + from ._models_py3 import BackupStatusRequest + from ._models_py3 import BackupStatusResponse + 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 ClientScriptForConnect + from ._models_py3 import CloudErrorBody + from ._models_py3 import ContainerIdentityInfo + from ._models_py3 import CrossRegionRestoreRequest + from ._models_py3 import CrossRegionRestoreRequestResource + from ._models_py3 import CrrAccessToken + from ._models_py3 import CrrAccessTokenResource + from ._models_py3 import CrrJobRequest + from ._models_py3 import CrrJobRequestResource + from ._models_py3 import DPMContainerExtendedInfo + from ._models_py3 import DPMProtectedItem + from ._models_py3 import DPMProtectedItemExtendedInfo + from ._models_py3 import DailyRetentionFormat + from ._models_py3 import DailyRetentionSchedule + from ._models_py3 import Day + from ._models_py3 import DiskExclusionProperties + from ._models_py3 import DiskInformation + from ._models_py3 import DistributedNodesInfo + from ._models_py3 import DpmBackupEngine + from ._models_py3 import DpmContainer + from ._models_py3 import DpmErrorInfo + from ._models_py3 import DpmJob + from ._models_py3 import DpmJobExtendedInfo + from ._models_py3 import DpmJobTaskDetails + from ._models_py3 import EncryptionDetails + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ExportJobsOperationResultInfo + from ._models_py3 import ExtendedProperties + from ._models_py3 import FeatureSupportRequest + from ._models_py3 import GenericContainer + from ._models_py3 import GenericContainerExtendedInfo + from ._models_py3 import GenericProtectedItem + from ._models_py3 import GenericProtectionPolicy + from ._models_py3 import GenericRecoveryPoint + from ._models_py3 import GetProtectedItemQueryObject + from ._models_py3 import ILRRequest + from ._models_py3 import ILRRequestResource + from ._models_py3 import IaaSVMContainer + from ._models_py3 import IaaSVMProtectableItem + from ._models_py3 import IaasVMBackupRequest + from ._models_py3 import IaasVMILRRegistrationRequest + from ._models_py3 import IaasVMRecoveryPoint + from ._models_py3 import IaasVMRecoveryPointAutoGenerated + from ._models_py3 import IaasVMRestoreRequest + from ._models_py3 import IaasVMRestoreWithRehydrationRequest + from ._models_py3 import InquiryInfo + from ._models_py3 import InquiryValidation + from ._models_py3 import InstantItemRecoveryTarget + from ._models_py3 import InstantRPAdditionalDetails + from ._models_py3 import Job + from ._models_py3 import JobQueryObject + from ._models_py3 import JobResource + from ._models_py3 import JobResourceList + from ._models_py3 import KEKDetails + from ._models_py3 import KPIResourceHealthDetails + from ._models_py3 import KeyAndSecretDetails + from ._models_py3 import ListRecoveryPointsRecommendedForMoveRequest + from ._models_py3 import LogSchedulePolicy + from ._models_py3 import LongTermRetentionPolicy + from ._models_py3 import LongTermSchedulePolicy + from ._models_py3 import MABContainerHealthDetails + from ._models_py3 import MabContainer + from ._models_py3 import MabContainerExtendedInfo + from ._models_py3 import MabErrorInfo + from ._models_py3 import MabFileFolderProtectedItem + from ._models_py3 import MabFileFolderProtectedItemExtendedInfo + from ._models_py3 import MabJob + from ._models_py3 import MabJobExtendedInfo + from ._models_py3 import MabJobTaskDetails + from ._models_py3 import MabProtectionPolicy + from ._models_py3 import MonthlyRetentionSchedule + from ._models_py3 import MoveRPAcrossTiersRequest + from ._models_py3 import NameInfo + from ._models_py3 import NewErrorResponse + from ._models_py3 import NewErrorResponseAutoGenerated + from ._models_py3 import NewErrorResponseError + from ._models_py3 import NewErrorResponseErrorAutoGenerated + from ._models_py3 import OperationResultInfo + from ._models_py3 import OperationResultInfoBase + from ._models_py3 import OperationResultInfoBaseResource + from ._models_py3 import OperationStatus + from ._models_py3 import OperationStatusError + from ._models_py3 import OperationStatusExtendedInfo + from ._models_py3 import OperationStatusJobExtendedInfo + from ._models_py3 import OperationStatusJobsExtendedInfo + from ._models_py3 import OperationStatusProvisionILRExtendedInfo + from ._models_py3 import OperationStatusRecoveryPointExtendedInfo + from ._models_py3 import OperationWorkerResponse + from ._models_py3 import PointInTimeRange + from ._models_py3 import PreBackupValidation + from ._models_py3 import PreValidateEnableBackupRequest + from ._models_py3 import PreValidateEnableBackupResponse + from ._models_py3 import PrepareDataMoveRequest + from ._models_py3 import PrepareDataMoveResponse + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionResource + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import ProtectableContainer + from ._models_py3 import ProtectableContainerResource + from ._models_py3 import ProtectableContainerResourceList + from ._models_py3 import ProtectedItem + from ._models_py3 import ProtectedItemQueryObject + from ._models_py3 import ProtectedItemResource + from ._models_py3 import ProtectedItemResourceList + from ._models_py3 import ProtectionContainer + from ._models_py3 import ProtectionContainerResource + from ._models_py3 import ProtectionContainerResourceList + from ._models_py3 import ProtectionIntent + from ._models_py3 import ProtectionIntentQueryObject + from ._models_py3 import ProtectionIntentResource + from ._models_py3 import ProtectionIntentResourceList + from ._models_py3 import ProtectionPolicy + from ._models_py3 import ProtectionPolicyQueryObject + from ._models_py3 import ProtectionPolicyResource + from ._models_py3 import ProtectionPolicyResourceList + from ._models_py3 import RecoveryPoint + from ._models_py3 import RecoveryPointDiskConfiguration + from ._models_py3 import RecoveryPointMoveReadinessInfo + from ._models_py3 import RecoveryPointRehydrationInfo + from ._models_py3 import RecoveryPointResource + from ._models_py3 import RecoveryPointResourceList + from ._models_py3 import RecoveryPointTierInformation + from ._models_py3 import Resource + from ._models_py3 import ResourceHealthDetails + from ._models_py3 import ResourceList + from ._models_py3 import RestoreFileSpecs + from ._models_py3 import RestoreRequest + from ._models_py3 import RestoreRequestResource + from ._models_py3 import RetentionDuration + from ._models_py3 import RetentionPolicy + from ._models_py3 import SQLDataDirectory + from ._models_py3 import SQLDataDirectoryMapping + from ._models_py3 import SchedulePolicy + from ._models_py3 import Settings + from ._models_py3 import SimpleRetentionPolicy + from ._models_py3 import SimpleSchedulePolicy + from ._models_py3 import SubProtectionPolicy + from ._models_py3 import TargetAFSRestoreInfo + from ._models_py3 import TargetRestoreInfo + from ._models_py3 import TokenInformation + from ._models_py3 import TriggerDataMoveRequest + from ._models_py3 import ValidateIaasVMRestoreOperationRequest + from ._models_py3 import ValidateOperationRequest + from ._models_py3 import ValidateOperationResponse + from ._models_py3 import ValidateOperationsResponse + from ._models_py3 import ValidateRestoreOperationRequest + from ._models_py3 import VaultJob + from ._models_py3 import VaultJobErrorInfo + from ._models_py3 import VaultJobExtendedInfo + from ._models_py3 import VaultStorageConfigOperationResultResponse + from ._models_py3 import WeeklyRetentionFormat + from ._models_py3 import WeeklyRetentionSchedule + from ._models_py3 import WorkloadCrrAccessToken + from ._models_py3 import WorkloadInquiryDetails + from ._models_py3 import WorkloadItem + from ._models_py3 import WorkloadItemResource + from ._models_py3 import WorkloadItemResourceList + from ._models_py3 import WorkloadProtectableItem + from ._models_py3 import WorkloadProtectableItemResource + from ._models_py3 import WorkloadProtectableItemResourceList + from ._models_py3 import YearlyRetentionSchedule +except (SyntaxError, ImportError): + from ._models import AADProperties # type: ignore + from ._models import AADPropertiesResource # type: ignore + from ._models import AzureBackupGoalFeatureSupportRequest # type: ignore + from ._models import AzureBackupServerContainer # type: ignore + from ._models import AzureBackupServerEngine # type: ignore + from ._models import AzureFileShareBackupRequest # type: ignore + from ._models import AzureFileShareProtectableItem # type: ignore + from ._models import AzureFileShareProtectionPolicy # type: ignore + from ._models import AzureFileShareProvisionILRRequest # type: ignore + from ._models import AzureFileShareRecoveryPoint # type: ignore + from ._models import AzureFileShareRecoveryPointAutoGenerated # type: ignore + from ._models import AzureFileShareRestoreRequest # type: ignore + from ._models import AzureFileshareProtectedItem # type: ignore + from ._models import AzureFileshareProtectedItemAutoGenerated # type: ignore + from ._models import AzureFileshareProtectedItemExtendedInfo # type: ignore + from ._models import AzureIaaSClassicComputeVMContainer # type: ignore + from ._models import AzureIaaSClassicComputeVMProtectableItem # type: ignore + from ._models import AzureIaaSClassicComputeVMProtectedItem # type: ignore + from ._models import AzureIaaSComputeVMContainer # type: ignore + from ._models import AzureIaaSComputeVMProtectableItem # type: ignore + from ._models import AzureIaaSComputeVMProtectedItem # type: ignore + from ._models import AzureIaaSVMErrorInfo # type: ignore + from ._models import AzureIaaSVMHealthDetails # type: ignore + from ._models import AzureIaaSVMJob # type: ignore + from ._models import AzureIaaSVMJobExtendedInfo # type: ignore + from ._models import AzureIaaSVMJobTaskDetails # type: ignore + from ._models import AzureIaaSVMProtectedItem # type: ignore + from ._models import AzureIaaSVMProtectedItemExtendedInfo # type: ignore + from ._models import AzureIaaSVMProtectionPolicy # type: ignore + from ._models import AzureRecoveryServiceVaultProtectionIntent # type: ignore + from ._models import AzureResourceProtectionIntent # type: ignore + from ._models import AzureSQLAGWorkloadContainerProtectionContainer # type: ignore + from ._models import AzureSqlContainer # type: ignore + from ._models import AzureSqlProtectedItem # type: ignore + from ._models import AzureSqlProtectedItemExtendedInfo # type: ignore + from ._models import AzureSqlProtectionPolicy # type: ignore + from ._models import AzureStorageContainer # type: ignore + from ._models import AzureStorageErrorInfo # type: ignore + from ._models import AzureStorageJob # type: ignore + from ._models import AzureStorageJobExtendedInfo # type: ignore + from ._models import AzureStorageJobTaskDetails # type: ignore + from ._models import AzureStorageProtectableContainer # type: ignore + from ._models import AzureVMAppContainerProtectableContainer # type: ignore + from ._models import AzureVMAppContainerProtectionContainer # type: ignore + from ._models import AzureVMResourceFeatureSupportRequest # type: ignore + from ._models import AzureVMResourceFeatureSupportResponse # type: ignore + from ._models import AzureVmWorkloadItem # type: ignore + from ._models import AzureVmWorkloadProtectableItem # type: ignore + from ._models import AzureVmWorkloadProtectedItem # type: ignore + from ._models import AzureVmWorkloadProtectedItemExtendedInfo # type: ignore + from ._models import AzureVmWorkloadProtectionPolicy # type: ignore + from ._models import AzureVmWorkloadSAPAseDatabaseProtectedItem # type: ignore + from ._models import AzureVmWorkloadSAPAseDatabaseWorkloadItem # type: ignore + from ._models import AzureVmWorkloadSAPAseSystemProtectableItem # type: ignore + from ._models import AzureVmWorkloadSAPAseSystemWorkloadItem # type: ignore + from ._models import AzureVmWorkloadSAPHanaDatabaseProtectableItem # type: ignore + from ._models import AzureVmWorkloadSAPHanaDatabaseProtectedItem # type: ignore + from ._models import AzureVmWorkloadSAPHanaDatabaseWorkloadItem # type: ignore + from ._models import AzureVmWorkloadSAPHanaSystemProtectableItem # type: ignore + from ._models import AzureVmWorkloadSAPHanaSystemWorkloadItem # type: ignore + from ._models import AzureVmWorkloadSQLAvailabilityGroupProtectableItem # type: ignore + from ._models import AzureVmWorkloadSQLDatabaseProtectableItem # type: ignore + from ._models import AzureVmWorkloadSQLDatabaseProtectedItem # type: ignore + from ._models import AzureVmWorkloadSQLDatabaseWorkloadItem # type: ignore + from ._models import AzureVmWorkloadSQLInstanceProtectableItem # type: ignore + from ._models import AzureVmWorkloadSQLInstanceWorkloadItem # type: ignore + from ._models import AzureWorkloadAutoProtectionIntent # type: ignore + from ._models import AzureWorkloadBackupRequest # type: ignore + from ._models import AzureWorkloadContainer # type: ignore + from ._models import AzureWorkloadContainerExtendedInfo # type: ignore + from ._models import AzureWorkloadErrorInfo # type: ignore + from ._models import AzureWorkloadJob # type: ignore + from ._models import AzureWorkloadJobExtendedInfo # type: ignore + from ._models import AzureWorkloadJobTaskDetails # type: ignore + from ._models import AzureWorkloadPointInTimeRecoveryPoint # type: ignore + from ._models import AzureWorkloadPointInTimeRecoveryPointAutoGenerated # type: ignore + from ._models import AzureWorkloadPointInTimeRestoreRequest # type: ignore + from ._models import AzureWorkloadRecoveryPoint # type: ignore + from ._models import AzureWorkloadRecoveryPointAutoGenerated # type: ignore + from ._models import AzureWorkloadRestoreRequest # type: ignore + from ._models import AzureWorkloadSAPHanaPointInTimeRecoveryPoint # type: ignore + from ._models import AzureWorkloadSAPHanaPointInTimeRecoveryPointAutoGenerated # type: ignore + from ._models import AzureWorkloadSAPHanaPointInTimeRestoreRequest # type: ignore + from ._models import AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest # type: ignore + from ._models import AzureWorkloadSAPHanaRecoveryPoint # type: ignore + from ._models import AzureWorkloadSAPHanaRecoveryPointAutoGenerated # type: ignore + from ._models import AzureWorkloadSAPHanaRestoreRequest # type: ignore + from ._models import AzureWorkloadSAPHanaRestoreWithRehydrateRequest # type: ignore + from ._models import AzureWorkloadSQLAutoProtectionIntent # type: ignore + from ._models import AzureWorkloadSQLPointInTimeRecoveryPoint # type: ignore + from ._models import AzureWorkloadSQLPointInTimeRecoveryPointAutoGenerated # type: ignore + from ._models import AzureWorkloadSQLPointInTimeRestoreRequest # type: ignore + from ._models import AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest # type: ignore + from ._models import AzureWorkloadSQLRecoveryPoint # type: ignore + from ._models import AzureWorkloadSQLRecoveryPointAutoGenerated # type: ignore + from ._models import AzureWorkloadSQLRecoveryPointExtendedInfo # type: ignore + from ._models import AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated # type: ignore + from ._models import AzureWorkloadSQLRestoreRequest # type: ignore + from ._models import AzureWorkloadSQLRestoreWithRehydrateRequest # type: ignore + from ._models import BEKDetails # type: ignore + from ._models import BMSAADPropertiesQueryObject # type: ignore + from ._models import BMSBackupEngineQueryObject # type: ignore + from ._models import BMSBackupEnginesQueryObject # type: ignore + from ._models import BMSBackupSummariesQueryObject # type: ignore + from ._models import BMSContainerQueryObject # type: ignore + from ._models import BMSContainersInquiryQueryObject # type: ignore + from ._models import BMSPOQueryObject # type: ignore + from ._models import BMSRPQueryObject # type: ignore + from ._models import BMSRefreshContainersQueryObject # type: ignore + from ._models import BMSWorkloadItemQueryObject # type: ignore + from ._models import BackupEngineBase # type: ignore + from ._models import BackupEngineBaseResource # type: ignore + from ._models import BackupEngineBaseResourceList # type: ignore + from ._models import BackupEngineExtendedInfo # type: ignore + from ._models import BackupManagementUsage # type: ignore + from ._models import BackupManagementUsageList # type: ignore + from ._models import BackupRequest # type: ignore + from ._models import BackupRequestResource # type: ignore + from ._models import BackupResourceConfig # type: ignore + from ._models import BackupResourceConfigResource # type: ignore + from ._models import BackupResourceEncryptionConfig # type: ignore + from ._models import BackupResourceEncryptionConfigResource # type: ignore + from ._models import BackupResourceVaultConfig # type: ignore + from ._models import BackupResourceVaultConfigResource # type: ignore + from ._models import BackupStatusRequest # type: ignore + from ._models import BackupStatusResponse # 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 ClientScriptForConnect # type: ignore + from ._models import CloudErrorBody # type: ignore + from ._models import ContainerIdentityInfo # type: ignore + from ._models import CrossRegionRestoreRequest # type: ignore + from ._models import CrossRegionRestoreRequestResource # type: ignore + from ._models import CrrAccessToken # type: ignore + from ._models import CrrAccessTokenResource # type: ignore + from ._models import CrrJobRequest # type: ignore + from ._models import CrrJobRequestResource # type: ignore + from ._models import DPMContainerExtendedInfo # type: ignore + from ._models import DPMProtectedItem # type: ignore + from ._models import DPMProtectedItemExtendedInfo # type: ignore + from ._models import DailyRetentionFormat # type: ignore + from ._models import DailyRetentionSchedule # type: ignore + from ._models import Day # type: ignore + from ._models import DiskExclusionProperties # type: ignore + from ._models import DiskInformation # type: ignore + from ._models import DistributedNodesInfo # type: ignore + from ._models import DpmBackupEngine # type: ignore + from ._models import DpmContainer # type: ignore + from ._models import DpmErrorInfo # type: ignore + from ._models import DpmJob # type: ignore + from ._models import DpmJobExtendedInfo # type: ignore + from ._models import DpmJobTaskDetails # type: ignore + from ._models import EncryptionDetails # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ExportJobsOperationResultInfo # type: ignore + from ._models import ExtendedProperties # type: ignore + from ._models import FeatureSupportRequest # type: ignore + from ._models import GenericContainer # type: ignore + from ._models import GenericContainerExtendedInfo # type: ignore + from ._models import GenericProtectedItem # type: ignore + from ._models import GenericProtectionPolicy # type: ignore + from ._models import GenericRecoveryPoint # type: ignore + from ._models import GetProtectedItemQueryObject # type: ignore + from ._models import ILRRequest # type: ignore + from ._models import ILRRequestResource # type: ignore + from ._models import IaaSVMContainer # type: ignore + from ._models import IaaSVMProtectableItem # type: ignore + from ._models import IaasVMBackupRequest # type: ignore + from ._models import IaasVMILRRegistrationRequest # type: ignore + from ._models import IaasVMRecoveryPoint # type: ignore + from ._models import IaasVMRecoveryPointAutoGenerated # type: ignore + from ._models import IaasVMRestoreRequest # type: ignore + from ._models import IaasVMRestoreWithRehydrationRequest # type: ignore + from ._models import InquiryInfo # type: ignore + from ._models import InquiryValidation # type: ignore + from ._models import InstantItemRecoveryTarget # type: ignore + from ._models import InstantRPAdditionalDetails # type: ignore + from ._models import Job # type: ignore + from ._models import JobQueryObject # type: ignore + from ._models import JobResource # type: ignore + from ._models import JobResourceList # type: ignore + from ._models import KEKDetails # type: ignore + from ._models import KPIResourceHealthDetails # type: ignore + from ._models import KeyAndSecretDetails # type: ignore + from ._models import ListRecoveryPointsRecommendedForMoveRequest # type: ignore + from ._models import LogSchedulePolicy # type: ignore + from ._models import LongTermRetentionPolicy # type: ignore + from ._models import LongTermSchedulePolicy # type: ignore + from ._models import MABContainerHealthDetails # type: ignore + from ._models import MabContainer # type: ignore + from ._models import MabContainerExtendedInfo # type: ignore + from ._models import MabErrorInfo # type: ignore + from ._models import MabFileFolderProtectedItem # type: ignore + from ._models import MabFileFolderProtectedItemExtendedInfo # type: ignore + from ._models import MabJob # type: ignore + from ._models import MabJobExtendedInfo # type: ignore + from ._models import MabJobTaskDetails # type: ignore + from ._models import MabProtectionPolicy # type: ignore + from ._models import MonthlyRetentionSchedule # type: ignore + from ._models import MoveRPAcrossTiersRequest # type: ignore + from ._models import NameInfo # type: ignore + from ._models import NewErrorResponse # type: ignore + from ._models import NewErrorResponseAutoGenerated # type: ignore + from ._models import NewErrorResponseError # type: ignore + from ._models import NewErrorResponseErrorAutoGenerated # type: ignore + from ._models import OperationResultInfo # type: ignore + from ._models import OperationResultInfoBase # type: ignore + from ._models import OperationResultInfoBaseResource # type: ignore + from ._models import OperationStatus # type: ignore + from ._models import OperationStatusError # type: ignore + from ._models import OperationStatusExtendedInfo # type: ignore + from ._models import OperationStatusJobExtendedInfo # type: ignore + from ._models import OperationStatusJobsExtendedInfo # type: ignore + from ._models import OperationStatusProvisionILRExtendedInfo # type: ignore + from ._models import OperationStatusRecoveryPointExtendedInfo # type: ignore + from ._models import OperationWorkerResponse # type: ignore + from ._models import PointInTimeRange # type: ignore + from ._models import PreBackupValidation # type: ignore + from ._models import PreValidateEnableBackupRequest # type: ignore + from ._models import PreValidateEnableBackupResponse # type: ignore + from ._models import PrepareDataMoveRequest # type: ignore + from ._models import PrepareDataMoveResponse # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionResource # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import ProtectableContainer # type: ignore + from ._models import ProtectableContainerResource # type: ignore + from ._models import ProtectableContainerResourceList # type: ignore + from ._models import ProtectedItem # type: ignore + from ._models import ProtectedItemQueryObject # type: ignore + from ._models import ProtectedItemResource # type: ignore + from ._models import ProtectedItemResourceList # type: ignore + from ._models import ProtectionContainer # type: ignore + from ._models import ProtectionContainerResource # type: ignore + from ._models import ProtectionContainerResourceList # type: ignore + from ._models import ProtectionIntent # type: ignore + from ._models import ProtectionIntentQueryObject # type: ignore + from ._models import ProtectionIntentResource # type: ignore + from ._models import ProtectionIntentResourceList # type: ignore + from ._models import ProtectionPolicy # type: ignore + from ._models import ProtectionPolicyQueryObject # type: ignore + from ._models import ProtectionPolicyResource # type: ignore + from ._models import ProtectionPolicyResourceList # type: ignore + from ._models import RecoveryPoint # type: ignore + from ._models import RecoveryPointDiskConfiguration # type: ignore + from ._models import RecoveryPointMoveReadinessInfo # type: ignore + from ._models import RecoveryPointRehydrationInfo # type: ignore + from ._models import RecoveryPointResource # type: ignore + from ._models import RecoveryPointResourceList # type: ignore + from ._models import RecoveryPointTierInformation # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceHealthDetails # type: ignore + from ._models import ResourceList # type: ignore + from ._models import RestoreFileSpecs # type: ignore + from ._models import RestoreRequest # type: ignore + from ._models import RestoreRequestResource # type: ignore + from ._models import RetentionDuration # type: ignore + from ._models import RetentionPolicy # type: ignore + from ._models import SQLDataDirectory # type: ignore + from ._models import SQLDataDirectoryMapping # type: ignore + from ._models import SchedulePolicy # type: ignore + from ._models import Settings # type: ignore + from ._models import SimpleRetentionPolicy # type: ignore + from ._models import SimpleSchedulePolicy # type: ignore + from ._models import SubProtectionPolicy # type: ignore + from ._models import TargetAFSRestoreInfo # type: ignore + from ._models import TargetRestoreInfo # type: ignore + from ._models import TokenInformation # type: ignore + from ._models import TriggerDataMoveRequest # type: ignore + from ._models import ValidateIaasVMRestoreOperationRequest # type: ignore + from ._models import ValidateOperationRequest # type: ignore + from ._models import ValidateOperationResponse # type: ignore + from ._models import ValidateOperationsResponse # type: ignore + from ._models import ValidateRestoreOperationRequest # type: ignore + from ._models import VaultJob # type: ignore + from ._models import VaultJobErrorInfo # type: ignore + from ._models import VaultJobExtendedInfo # type: ignore + from ._models import VaultStorageConfigOperationResultResponse # type: ignore + from ._models import WeeklyRetentionFormat # type: ignore + from ._models import WeeklyRetentionSchedule # type: ignore + from ._models import WorkloadCrrAccessToken # type: ignore + from ._models import WorkloadInquiryDetails # type: ignore + from ._models import WorkloadItem # type: ignore + from ._models import WorkloadItemResource # type: ignore + from ._models import WorkloadItemResourceList # type: ignore + from ._models import WorkloadProtectableItem # type: ignore + from ._models import WorkloadProtectableItemResource # type: ignore + from ._models import WorkloadProtectableItemResourceList # type: ignore + from ._models import YearlyRetentionSchedule # type: ignore + +from ._recovery_services_backup_client_enums import ( + AzureFileShareType, + BackupEngineType, + BackupItemType, + BackupManagementType, + BackupType, + ContainerType, + CopyOptions, + CreateMode, + DataMoveLevel, + DataSourceType, + DayOfWeek, + EncryptionAtRestType, + EnhancedSecurityState, + FabricName, + HealthState, + HealthStatus, + HttpStatusCode, + InfrastructureEncryptionState, + InquiryStatus, + IntentItemType, + JobOperationType, + JobStatus, + JobSupportedAction, + LastBackupStatus, + LastUpdateStatus, + MabServerType, + MonthOfYear, + OperationStatusValues, + OperationType, + OverwriteOptions, + PolicyType, + PrivateEndpointConnectionStatus, + ProtectedItemHealthStatus, + ProtectedItemState, + ProtectionState, + ProtectionStatus, + ProvisioningState, + RecoveryMode, + RecoveryPointTierStatus, + RecoveryPointTierType, + RecoveryType, + RehydrationPriority, + ResourceHealthStatus, + RestorePointQueryType, + RestorePointType, + RestoreRequestType, + RetentionDurationType, + RetentionScheduleFormat, + SQLDataDirectoryType, + ScheduleRunType, + SoftDeleteFeatureState, + StorageType, + StorageTypeState, + SupportStatus, + Type, + UsagesUnit, + ValidationStatus, + WeekOfMonth, + WorkloadItemType, + WorkloadType, +) + +__all__ = [ + 'AADProperties', + 'AADPropertiesResource', + 'AzureBackupGoalFeatureSupportRequest', + 'AzureBackupServerContainer', + 'AzureBackupServerEngine', + 'AzureFileShareBackupRequest', + 'AzureFileShareProtectableItem', + 'AzureFileShareProtectionPolicy', + 'AzureFileShareProvisionILRRequest', + 'AzureFileShareRecoveryPoint', + 'AzureFileShareRecoveryPointAutoGenerated', + 'AzureFileShareRestoreRequest', + 'AzureFileshareProtectedItem', + 'AzureFileshareProtectedItemAutoGenerated', + 'AzureFileshareProtectedItemExtendedInfo', + 'AzureIaaSClassicComputeVMContainer', + 'AzureIaaSClassicComputeVMProtectableItem', + 'AzureIaaSClassicComputeVMProtectedItem', + 'AzureIaaSComputeVMContainer', + 'AzureIaaSComputeVMProtectableItem', + 'AzureIaaSComputeVMProtectedItem', + 'AzureIaaSVMErrorInfo', + 'AzureIaaSVMHealthDetails', + 'AzureIaaSVMJob', + 'AzureIaaSVMJobExtendedInfo', + 'AzureIaaSVMJobTaskDetails', + 'AzureIaaSVMProtectedItem', + 'AzureIaaSVMProtectedItemExtendedInfo', + 'AzureIaaSVMProtectionPolicy', + 'AzureRecoveryServiceVaultProtectionIntent', + 'AzureResourceProtectionIntent', + 'AzureSQLAGWorkloadContainerProtectionContainer', + 'AzureSqlContainer', + 'AzureSqlProtectedItem', + 'AzureSqlProtectedItemExtendedInfo', + 'AzureSqlProtectionPolicy', + 'AzureStorageContainer', + 'AzureStorageErrorInfo', + 'AzureStorageJob', + 'AzureStorageJobExtendedInfo', + 'AzureStorageJobTaskDetails', + 'AzureStorageProtectableContainer', + 'AzureVMAppContainerProtectableContainer', + 'AzureVMAppContainerProtectionContainer', + 'AzureVMResourceFeatureSupportRequest', + 'AzureVMResourceFeatureSupportResponse', + 'AzureVmWorkloadItem', + 'AzureVmWorkloadProtectableItem', + 'AzureVmWorkloadProtectedItem', + 'AzureVmWorkloadProtectedItemExtendedInfo', + 'AzureVmWorkloadProtectionPolicy', + 'AzureVmWorkloadSAPAseDatabaseProtectedItem', + 'AzureVmWorkloadSAPAseDatabaseWorkloadItem', + 'AzureVmWorkloadSAPAseSystemProtectableItem', + 'AzureVmWorkloadSAPAseSystemWorkloadItem', + 'AzureVmWorkloadSAPHanaDatabaseProtectableItem', + 'AzureVmWorkloadSAPHanaDatabaseProtectedItem', + 'AzureVmWorkloadSAPHanaDatabaseWorkloadItem', + 'AzureVmWorkloadSAPHanaSystemProtectableItem', + 'AzureVmWorkloadSAPHanaSystemWorkloadItem', + 'AzureVmWorkloadSQLAvailabilityGroupProtectableItem', + 'AzureVmWorkloadSQLDatabaseProtectableItem', + 'AzureVmWorkloadSQLDatabaseProtectedItem', + 'AzureVmWorkloadSQLDatabaseWorkloadItem', + 'AzureVmWorkloadSQLInstanceProtectableItem', + 'AzureVmWorkloadSQLInstanceWorkloadItem', + 'AzureWorkloadAutoProtectionIntent', + 'AzureWorkloadBackupRequest', + 'AzureWorkloadContainer', + 'AzureWorkloadContainerExtendedInfo', + 'AzureWorkloadErrorInfo', + 'AzureWorkloadJob', + 'AzureWorkloadJobExtendedInfo', + 'AzureWorkloadJobTaskDetails', + 'AzureWorkloadPointInTimeRecoveryPoint', + 'AzureWorkloadPointInTimeRecoveryPointAutoGenerated', + 'AzureWorkloadPointInTimeRestoreRequest', + 'AzureWorkloadRecoveryPoint', + 'AzureWorkloadRecoveryPointAutoGenerated', + 'AzureWorkloadRestoreRequest', + 'AzureWorkloadSAPHanaPointInTimeRecoveryPoint', + 'AzureWorkloadSAPHanaPointInTimeRecoveryPointAutoGenerated', + 'AzureWorkloadSAPHanaPointInTimeRestoreRequest', + 'AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest', + 'AzureWorkloadSAPHanaRecoveryPoint', + 'AzureWorkloadSAPHanaRecoveryPointAutoGenerated', + 'AzureWorkloadSAPHanaRestoreRequest', + 'AzureWorkloadSAPHanaRestoreWithRehydrateRequest', + 'AzureWorkloadSQLAutoProtectionIntent', + 'AzureWorkloadSQLPointInTimeRecoveryPoint', + 'AzureWorkloadSQLPointInTimeRecoveryPointAutoGenerated', + 'AzureWorkloadSQLPointInTimeRestoreRequest', + 'AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest', + 'AzureWorkloadSQLRecoveryPoint', + 'AzureWorkloadSQLRecoveryPointAutoGenerated', + 'AzureWorkloadSQLRecoveryPointExtendedInfo', + 'AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated', + 'AzureWorkloadSQLRestoreRequest', + 'AzureWorkloadSQLRestoreWithRehydrateRequest', + 'BEKDetails', + 'BMSAADPropertiesQueryObject', + 'BMSBackupEngineQueryObject', + 'BMSBackupEnginesQueryObject', + 'BMSBackupSummariesQueryObject', + 'BMSContainerQueryObject', + 'BMSContainersInquiryQueryObject', + 'BMSPOQueryObject', + 'BMSRPQueryObject', + 'BMSRefreshContainersQueryObject', + 'BMSWorkloadItemQueryObject', + 'BackupEngineBase', + 'BackupEngineBaseResource', + 'BackupEngineBaseResourceList', + 'BackupEngineExtendedInfo', + 'BackupManagementUsage', + 'BackupManagementUsageList', + 'BackupRequest', + 'BackupRequestResource', + 'BackupResourceConfig', + 'BackupResourceConfigResource', + 'BackupResourceEncryptionConfig', + 'BackupResourceEncryptionConfigResource', + 'BackupResourceVaultConfig', + 'BackupResourceVaultConfigResource', + 'BackupStatusRequest', + 'BackupStatusResponse', + 'ClientDiscoveryDisplay', + 'ClientDiscoveryForLogSpecification', + 'ClientDiscoveryForProperties', + 'ClientDiscoveryForServiceSpecification', + 'ClientDiscoveryResponse', + 'ClientDiscoveryValueForSingleApi', + 'ClientScriptForConnect', + 'CloudErrorBody', + 'ContainerIdentityInfo', + 'CrossRegionRestoreRequest', + 'CrossRegionRestoreRequestResource', + 'CrrAccessToken', + 'CrrAccessTokenResource', + 'CrrJobRequest', + 'CrrJobRequestResource', + 'DPMContainerExtendedInfo', + 'DPMProtectedItem', + 'DPMProtectedItemExtendedInfo', + 'DailyRetentionFormat', + 'DailyRetentionSchedule', + 'Day', + 'DiskExclusionProperties', + 'DiskInformation', + 'DistributedNodesInfo', + 'DpmBackupEngine', + 'DpmContainer', + 'DpmErrorInfo', + 'DpmJob', + 'DpmJobExtendedInfo', + 'DpmJobTaskDetails', + 'EncryptionDetails', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ExportJobsOperationResultInfo', + 'ExtendedProperties', + 'FeatureSupportRequest', + 'GenericContainer', + 'GenericContainerExtendedInfo', + 'GenericProtectedItem', + 'GenericProtectionPolicy', + 'GenericRecoveryPoint', + 'GetProtectedItemQueryObject', + 'ILRRequest', + 'ILRRequestResource', + 'IaaSVMContainer', + 'IaaSVMProtectableItem', + 'IaasVMBackupRequest', + 'IaasVMILRRegistrationRequest', + 'IaasVMRecoveryPoint', + 'IaasVMRecoveryPointAutoGenerated', + 'IaasVMRestoreRequest', + 'IaasVMRestoreWithRehydrationRequest', + 'InquiryInfo', + 'InquiryValidation', + 'InstantItemRecoveryTarget', + 'InstantRPAdditionalDetails', + 'Job', + 'JobQueryObject', + 'JobResource', + 'JobResourceList', + 'KEKDetails', + 'KPIResourceHealthDetails', + 'KeyAndSecretDetails', + 'ListRecoveryPointsRecommendedForMoveRequest', + 'LogSchedulePolicy', + 'LongTermRetentionPolicy', + 'LongTermSchedulePolicy', + 'MABContainerHealthDetails', + 'MabContainer', + 'MabContainerExtendedInfo', + 'MabErrorInfo', + 'MabFileFolderProtectedItem', + 'MabFileFolderProtectedItemExtendedInfo', + 'MabJob', + 'MabJobExtendedInfo', + 'MabJobTaskDetails', + 'MabProtectionPolicy', + 'MonthlyRetentionSchedule', + 'MoveRPAcrossTiersRequest', + 'NameInfo', + 'NewErrorResponse', + 'NewErrorResponseAutoGenerated', + 'NewErrorResponseError', + 'NewErrorResponseErrorAutoGenerated', + 'OperationResultInfo', + 'OperationResultInfoBase', + 'OperationResultInfoBaseResource', + 'OperationStatus', + 'OperationStatusError', + 'OperationStatusExtendedInfo', + 'OperationStatusJobExtendedInfo', + 'OperationStatusJobsExtendedInfo', + 'OperationStatusProvisionILRExtendedInfo', + 'OperationStatusRecoveryPointExtendedInfo', + 'OperationWorkerResponse', + 'PointInTimeRange', + 'PreBackupValidation', + 'PreValidateEnableBackupRequest', + 'PreValidateEnableBackupResponse', + 'PrepareDataMoveRequest', + 'PrepareDataMoveResponse', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionResource', + 'PrivateLinkServiceConnectionState', + 'ProtectableContainer', + 'ProtectableContainerResource', + 'ProtectableContainerResourceList', + 'ProtectedItem', + 'ProtectedItemQueryObject', + 'ProtectedItemResource', + 'ProtectedItemResourceList', + 'ProtectionContainer', + 'ProtectionContainerResource', + 'ProtectionContainerResourceList', + 'ProtectionIntent', + 'ProtectionIntentQueryObject', + 'ProtectionIntentResource', + 'ProtectionIntentResourceList', + 'ProtectionPolicy', + 'ProtectionPolicyQueryObject', + 'ProtectionPolicyResource', + 'ProtectionPolicyResourceList', + 'RecoveryPoint', + 'RecoveryPointDiskConfiguration', + 'RecoveryPointMoveReadinessInfo', + 'RecoveryPointRehydrationInfo', + 'RecoveryPointResource', + 'RecoveryPointResourceList', + 'RecoveryPointTierInformation', + 'Resource', + 'ResourceHealthDetails', + 'ResourceList', + 'RestoreFileSpecs', + 'RestoreRequest', + 'RestoreRequestResource', + 'RetentionDuration', + 'RetentionPolicy', + 'SQLDataDirectory', + 'SQLDataDirectoryMapping', + 'SchedulePolicy', + 'Settings', + 'SimpleRetentionPolicy', + 'SimpleSchedulePolicy', + 'SubProtectionPolicy', + 'TargetAFSRestoreInfo', + 'TargetRestoreInfo', + 'TokenInformation', + 'TriggerDataMoveRequest', + 'ValidateIaasVMRestoreOperationRequest', + 'ValidateOperationRequest', + 'ValidateOperationResponse', + 'ValidateOperationsResponse', + 'ValidateRestoreOperationRequest', + 'VaultJob', + 'VaultJobErrorInfo', + 'VaultJobExtendedInfo', + 'VaultStorageConfigOperationResultResponse', + 'WeeklyRetentionFormat', + 'WeeklyRetentionSchedule', + 'WorkloadCrrAccessToken', + 'WorkloadInquiryDetails', + 'WorkloadItem', + 'WorkloadItemResource', + 'WorkloadItemResourceList', + 'WorkloadProtectableItem', + 'WorkloadProtectableItemResource', + 'WorkloadProtectableItemResourceList', + 'YearlyRetentionSchedule', + 'AzureFileShareType', + 'BackupEngineType', + 'BackupItemType', + 'BackupManagementType', + 'BackupType', + 'ContainerType', + 'CopyOptions', + 'CreateMode', + 'DataMoveLevel', + 'DataSourceType', + 'DayOfWeek', + 'EncryptionAtRestType', + 'EnhancedSecurityState', + 'FabricName', + 'HealthState', + 'HealthStatus', + 'HttpStatusCode', + 'InfrastructureEncryptionState', + 'InquiryStatus', + 'IntentItemType', + 'JobOperationType', + 'JobStatus', + 'JobSupportedAction', + 'LastBackupStatus', + 'LastUpdateStatus', + 'MabServerType', + 'MonthOfYear', + 'OperationStatusValues', + 'OperationType', + 'OverwriteOptions', + 'PolicyType', + 'PrivateEndpointConnectionStatus', + 'ProtectedItemHealthStatus', + 'ProtectedItemState', + 'ProtectionState', + 'ProtectionStatus', + 'ProvisioningState', + 'RecoveryMode', + 'RecoveryPointTierStatus', + 'RecoveryPointTierType', + 'RecoveryType', + 'RehydrationPriority', + 'ResourceHealthStatus', + 'RestorePointQueryType', + 'RestorePointType', + 'RestoreRequestType', + 'RetentionDurationType', + 'RetentionScheduleFormat', + 'SQLDataDirectoryType', + 'ScheduleRunType', + 'SoftDeleteFeatureState', + 'StorageType', + 'StorageTypeState', + 'SupportStatus', + 'Type', + 'UsagesUnit', + 'ValidationStatus', + 'WeekOfMonth', + 'WorkloadItemType', + 'WorkloadType', +] diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_models.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_models.py new file mode 100644 index 000000000000..73543e13e240 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_models.py @@ -0,0 +1,13415 @@ +# 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. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AADProperties(msrest.serialization.Model): + """AADProperties. + + :param service_principal_client_id: + :type service_principal_client_id: str + :param tenant_id: + :type tenant_id: str + :param authority: + :type authority: str + :param audience: + :type audience: str + :param service_principal_object_id: + :type service_principal_object_id: str + """ + + _attribute_map = { + 'service_principal_client_id': {'key': 'servicePrincipalClientId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'authority': {'key': 'authority', 'type': 'str'}, + 'audience': {'key': 'audience', 'type': 'str'}, + 'service_principal_object_id': {'key': 'servicePrincipalObjectId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AADProperties, self).__init__(**kwargs) + self.service_principal_client_id = kwargs.get('service_principal_client_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.authority = kwargs.get('authority', None) + self.audience = kwargs.get('audience', None) + self.service_principal_object_id = kwargs.get('service_principal_object_id', 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', '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) + self.tags = kwargs.get('tags', None) + self.e_tag = kwargs.get('e_tag', None) + + +class AADPropertiesResource(Resource): + """AADPropertiesResource. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: AADPropertiesResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.AADProperties + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'AADProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(AADPropertiesResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class FeatureSupportRequest(msrest.serialization.Model): + """Base class for feature request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupGoalFeatureSupportRequest, AzureVMResourceFeatureSupportRequest. + + All required parameters must be populated in order to send to Azure. + + :param feature_type: Required. backup support feature type.Constant filled by server. + :type feature_type: str + """ + + _validation = { + 'feature_type': {'required': True}, + } + + _attribute_map = { + 'feature_type': {'key': 'featureType', 'type': 'str'}, + } + + _subtype_map = { + 'feature_type': {'AzureBackupGoals': 'AzureBackupGoalFeatureSupportRequest', 'AzureVMResourceBackup': 'AzureVMResourceFeatureSupportRequest'} + } + + def __init__( + self, + **kwargs + ): + super(FeatureSupportRequest, self).__init__(**kwargs) + self.feature_type = None # type: Optional[str] + + +class AzureBackupGoalFeatureSupportRequest(FeatureSupportRequest): + """Azure backup goal feature specific request. + + All required parameters must be populated in order to send to Azure. + + :param feature_type: Required. backup support feature type.Constant filled by server. + :type feature_type: str + """ + + _validation = { + 'feature_type': {'required': True}, + } + + _attribute_map = { + 'feature_type': {'key': 'featureType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureBackupGoalFeatureSupportRequest, self).__init__(**kwargs) + self.feature_type = 'AzureBackupGoals' # type: str + + +class ProtectionContainer(msrest.serialization.Model): + """Base class for container with backup items. Containers with specific workloads are derived from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureSqlContainer, AzureWorkloadContainer, DpmContainer, GenericContainer, IaaSVMContainer, AzureStorageContainer, MabContainer. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + } + + _subtype_map = { + 'container_type': {'AzureSqlContainer': 'AzureSqlContainer', 'AzureWorkloadContainer': 'AzureWorkloadContainer', 'DPMContainer': 'DpmContainer', 'GenericContainer': 'GenericContainer', 'IaaSVMContainer': 'IaaSVMContainer', 'StorageContainer': 'AzureStorageContainer', 'Windows': 'MabContainer'} + } + + def __init__( + self, + **kwargs + ): + super(ProtectionContainer, self).__init__(**kwargs) + self.friendly_name = kwargs.get('friendly_name', None) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.registration_status = kwargs.get('registration_status', None) + self.health_status = kwargs.get('health_status', None) + self.container_type = None # type: Optional[str] + + +class DpmContainer(ProtectionContainer): + """DPM workload-specific protection container. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupServerContainer. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param can_re_register: Specifies whether the container is re-registrable. + :type can_re_register: bool + :param container_id: ID of container. + :type container_id: str + :param protected_item_count: Number of protected items in the BackupEngine. + :type protected_item_count: long + :param dpm_agent_version: Backup engine Agent version. + :type dpm_agent_version: str + :param dpm_servers: List of BackupEngines protecting the container. + :type dpm_servers: list[str] + :param upgrade_available: To check if upgrade available. + :type upgrade_available: bool + :param protection_status: Protection status of the container. + :type protection_status: str + :param extended_info: Extended Info of the container. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.DPMContainerExtendedInfo + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'can_re_register': {'key': 'canReRegister', 'type': 'bool'}, + 'container_id': {'key': 'containerId', 'type': 'str'}, + 'protected_item_count': {'key': 'protectedItemCount', 'type': 'long'}, + 'dpm_agent_version': {'key': 'dpmAgentVersion', 'type': 'str'}, + 'dpm_servers': {'key': 'dpmServers', 'type': '[str]'}, + 'upgrade_available': {'key': 'upgradeAvailable', 'type': 'bool'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'DPMContainerExtendedInfo'}, + } + + _subtype_map = { + 'container_type': {'AzureBackupServerContainer': 'AzureBackupServerContainer'} + } + + def __init__( + self, + **kwargs + ): + super(DpmContainer, self).__init__(**kwargs) + self.container_type = 'DPMContainer' # type: str + self.can_re_register = kwargs.get('can_re_register', None) + self.container_id = kwargs.get('container_id', None) + self.protected_item_count = kwargs.get('protected_item_count', None) + self.dpm_agent_version = kwargs.get('dpm_agent_version', None) + self.dpm_servers = kwargs.get('dpm_servers', None) + self.upgrade_available = kwargs.get('upgrade_available', None) + self.protection_status = kwargs.get('protection_status', None) + self.extended_info = kwargs.get('extended_info', None) + + +class AzureBackupServerContainer(DpmContainer): + """AzureBackupServer (DPMVenus) workload-specific protection container. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param can_re_register: Specifies whether the container is re-registrable. + :type can_re_register: bool + :param container_id: ID of container. + :type container_id: str + :param protected_item_count: Number of protected items in the BackupEngine. + :type protected_item_count: long + :param dpm_agent_version: Backup engine Agent version. + :type dpm_agent_version: str + :param dpm_servers: List of BackupEngines protecting the container. + :type dpm_servers: list[str] + :param upgrade_available: To check if upgrade available. + :type upgrade_available: bool + :param protection_status: Protection status of the container. + :type protection_status: str + :param extended_info: Extended Info of the container. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.DPMContainerExtendedInfo + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'can_re_register': {'key': 'canReRegister', 'type': 'bool'}, + 'container_id': {'key': 'containerId', 'type': 'str'}, + 'protected_item_count': {'key': 'protectedItemCount', 'type': 'long'}, + 'dpm_agent_version': {'key': 'dpmAgentVersion', 'type': 'str'}, + 'dpm_servers': {'key': 'dpmServers', 'type': '[str]'}, + 'upgrade_available': {'key': 'upgradeAvailable', 'type': 'bool'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'DPMContainerExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureBackupServerContainer, self).__init__(**kwargs) + self.container_type = 'AzureBackupServerContainer' # type: str + + +class BackupEngineBase(msrest.serialization.Model): + """The base backup engine class. All workload specific backup engines derive from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupServerEngine, DpmBackupEngine. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the backup engine. + :type friendly_name: str + :param backup_management_type: Type of backup management for the backup engine. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Registration status of the backup engine with the Recovery Services + Vault. + :type registration_status: str + :param backup_engine_state: Status of the backup engine with the Recovery Services Vault. = + {Active/Deleting/DeleteFailed}. + :type backup_engine_state: str + :param health_status: Backup status of the backup engine. + :type health_status: str + :param backup_engine_type: Required. Type of the backup engine.Constant filled by server. + Possible values include: "Invalid", "DpmBackupEngine", "AzureBackupServerEngine". + :type backup_engine_type: str or ~azure.mgmt.recoveryservicesbackup.models.BackupEngineType + :param can_re_register: Flag indicating if the backup engine be registered, once already + registered. + :type can_re_register: bool + :param backup_engine_id: ID of the backup engine. + :type backup_engine_id: str + :param dpm_version: Backup engine version. + :type dpm_version: str + :param azure_backup_agent_version: Backup agent version. + :type azure_backup_agent_version: str + :param is_azure_backup_agent_upgrade_available: To check if backup agent upgrade available. + :type is_azure_backup_agent_upgrade_available: bool + :param is_dpm_upgrade_available: To check if backup engine upgrade available. + :type is_dpm_upgrade_available: bool + :param extended_info: Extended info of the backupengine. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.BackupEngineExtendedInfo + """ + + _validation = { + 'backup_engine_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'backup_engine_state': {'key': 'backupEngineState', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'backup_engine_type': {'key': 'backupEngineType', 'type': 'str'}, + 'can_re_register': {'key': 'canReRegister', 'type': 'bool'}, + 'backup_engine_id': {'key': 'backupEngineId', 'type': 'str'}, + 'dpm_version': {'key': 'dpmVersion', 'type': 'str'}, + 'azure_backup_agent_version': {'key': 'azureBackupAgentVersion', 'type': 'str'}, + 'is_azure_backup_agent_upgrade_available': {'key': 'isAzureBackupAgentUpgradeAvailable', 'type': 'bool'}, + 'is_dpm_upgrade_available': {'key': 'isDpmUpgradeAvailable', 'type': 'bool'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'BackupEngineExtendedInfo'}, + } + + _subtype_map = { + 'backup_engine_type': {'AzureBackupServerEngine': 'AzureBackupServerEngine', 'DpmBackupEngine': 'DpmBackupEngine'} + } + + def __init__( + self, + **kwargs + ): + super(BackupEngineBase, self).__init__(**kwargs) + self.friendly_name = kwargs.get('friendly_name', None) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.registration_status = kwargs.get('registration_status', None) + self.backup_engine_state = kwargs.get('backup_engine_state', None) + self.health_status = kwargs.get('health_status', None) + self.backup_engine_type = None # type: Optional[str] + self.can_re_register = kwargs.get('can_re_register', None) + self.backup_engine_id = kwargs.get('backup_engine_id', None) + self.dpm_version = kwargs.get('dpm_version', None) + self.azure_backup_agent_version = kwargs.get('azure_backup_agent_version', None) + self.is_azure_backup_agent_upgrade_available = kwargs.get('is_azure_backup_agent_upgrade_available', None) + self.is_dpm_upgrade_available = kwargs.get('is_dpm_upgrade_available', None) + self.extended_info = kwargs.get('extended_info', None) + + +class AzureBackupServerEngine(BackupEngineBase): + """Backup engine type when Azure Backup Server is used to manage the backups. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the backup engine. + :type friendly_name: str + :param backup_management_type: Type of backup management for the backup engine. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Registration status of the backup engine with the Recovery Services + Vault. + :type registration_status: str + :param backup_engine_state: Status of the backup engine with the Recovery Services Vault. = + {Active/Deleting/DeleteFailed}. + :type backup_engine_state: str + :param health_status: Backup status of the backup engine. + :type health_status: str + :param backup_engine_type: Required. Type of the backup engine.Constant filled by server. + Possible values include: "Invalid", "DpmBackupEngine", "AzureBackupServerEngine". + :type backup_engine_type: str or ~azure.mgmt.recoveryservicesbackup.models.BackupEngineType + :param can_re_register: Flag indicating if the backup engine be registered, once already + registered. + :type can_re_register: bool + :param backup_engine_id: ID of the backup engine. + :type backup_engine_id: str + :param dpm_version: Backup engine version. + :type dpm_version: str + :param azure_backup_agent_version: Backup agent version. + :type azure_backup_agent_version: str + :param is_azure_backup_agent_upgrade_available: To check if backup agent upgrade available. + :type is_azure_backup_agent_upgrade_available: bool + :param is_dpm_upgrade_available: To check if backup engine upgrade available. + :type is_dpm_upgrade_available: bool + :param extended_info: Extended info of the backupengine. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.BackupEngineExtendedInfo + """ + + _validation = { + 'backup_engine_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'backup_engine_state': {'key': 'backupEngineState', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'backup_engine_type': {'key': 'backupEngineType', 'type': 'str'}, + 'can_re_register': {'key': 'canReRegister', 'type': 'bool'}, + 'backup_engine_id': {'key': 'backupEngineId', 'type': 'str'}, + 'dpm_version': {'key': 'dpmVersion', 'type': 'str'}, + 'azure_backup_agent_version': {'key': 'azureBackupAgentVersion', 'type': 'str'}, + 'is_azure_backup_agent_upgrade_available': {'key': 'isAzureBackupAgentUpgradeAvailable', 'type': 'bool'}, + 'is_dpm_upgrade_available': {'key': 'isDpmUpgradeAvailable', 'type': 'bool'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'BackupEngineExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureBackupServerEngine, self).__init__(**kwargs) + self.backup_engine_type = 'AzureBackupServerEngine' # type: str + + +class BackupRequest(msrest.serialization.Model): + """Base class for backup request. Workload-specific backup requests are derived from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureFileShareBackupRequest, AzureWorkloadBackupRequest, IaasVMBackupRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureFileShareBackupRequest': 'AzureFileShareBackupRequest', 'AzureWorkloadBackupRequest': 'AzureWorkloadBackupRequest', 'IaasVMBackupRequest': 'IaasVMBackupRequest'} + } + + def __init__( + self, + **kwargs + ): + super(BackupRequest, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class AzureFileShareBackupRequest(BackupRequest): + """AzureFileShare workload-specific backup request. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_expiry_time_in_utc: Backup copy will expire after the time specified + (UTC). + :type recovery_point_expiry_time_in_utc: ~datetime.datetime + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_expiry_time_in_utc': {'key': 'recoveryPointExpiryTimeInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFileShareBackupRequest, self).__init__(**kwargs) + self.object_type = 'AzureFileShareBackupRequest' # type: str + self.recovery_point_expiry_time_in_utc = kwargs.get('recovery_point_expiry_time_in_utc', None) + + +class WorkloadProtectableItem(msrest.serialization.Model): + """Base class for backup item. Workload-specific backup items are derived from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureFileShareProtectableItem, AzureVmWorkloadProtectableItem, IaaSVMProtectableItem. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + } + + _subtype_map = { + 'protectable_item_type': {'AzureFileShare': 'AzureFileShareProtectableItem', 'AzureVmWorkloadProtectableItem': 'AzureVmWorkloadProtectableItem', 'IaaSVMProtectableItem': 'IaaSVMProtectableItem'} + } + + def __init__( + self, + **kwargs + ): + super(WorkloadProtectableItem, self).__init__(**kwargs) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.workload_type = kwargs.get('workload_type', None) + self.protectable_item_type = None # type: Optional[str] + self.friendly_name = kwargs.get('friendly_name', None) + self.protection_state = kwargs.get('protection_state', None) + + +class AzureFileShareProtectableItem(WorkloadProtectableItem): + """Protectable item for Azure Fileshare workloads. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_container_fabric_id: Full Fabric ID of container to which this protectable item + belongs. For example, ARM ID. + :type parent_container_fabric_id: str + :param parent_container_friendly_name: Friendly name of container to which this protectable + item belongs. + :type parent_container_friendly_name: str + :param azure_file_share_type: File Share type XSync or XSMB. Possible values include: + "Invalid", "XSMB", "XSync". + :type azure_file_share_type: str or + ~azure.mgmt.recoveryservicesbackup.models.AzureFileShareType + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_container_fabric_id': {'key': 'parentContainerFabricId', 'type': 'str'}, + 'parent_container_friendly_name': {'key': 'parentContainerFriendlyName', 'type': 'str'}, + 'azure_file_share_type': {'key': 'azureFileShareType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFileShareProtectableItem, self).__init__(**kwargs) + self.protectable_item_type = 'AzureFileShare' # type: str + self.parent_container_fabric_id = kwargs.get('parent_container_fabric_id', None) + self.parent_container_friendly_name = kwargs.get('parent_container_friendly_name', None) + self.azure_file_share_type = kwargs.get('azure_file_share_type', None) + + +class ProtectedItem(msrest.serialization.Model): + """Base class for backup items. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureFileshareProtectedItemAutoGenerated, AzureIaaSVMProtectedItem, AzureVmWorkloadProtectedItem, DPMProtectedItem, GenericProtectedItem, MabFileFolderProtectedItem, AzureSqlProtectedItem. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + } + + _subtype_map = { + 'protected_item_type': {'AzureFileShareProtectedItem': 'AzureFileshareProtectedItemAutoGenerated', 'AzureIaaSVMProtectedItem': 'AzureIaaSVMProtectedItem', 'AzureVmWorkloadProtectedItem': 'AzureVmWorkloadProtectedItem', 'DPMProtectedItem': 'DPMProtectedItem', 'GenericProtectedItem': 'GenericProtectedItem', 'MabFileFolderProtectedItem': 'MabFileFolderProtectedItem', 'Microsoft.Sql/servers/databases': 'AzureSqlProtectedItem'} + } + + def __init__( + self, + **kwargs + ): + super(ProtectedItem, self).__init__(**kwargs) + self.protected_item_type = None # type: Optional[str] + self.backup_management_type = kwargs.get('backup_management_type', None) + self.workload_type = kwargs.get('workload_type', None) + self.container_name = kwargs.get('container_name', None) + self.source_resource_id = kwargs.get('source_resource_id', None) + self.policy_id = kwargs.get('policy_id', None) + self.last_recovery_point = kwargs.get('last_recovery_point', None) + self.backup_set_name = kwargs.get('backup_set_name', None) + self.create_mode = kwargs.get('create_mode', None) + self.deferred_delete_time_in_utc = kwargs.get('deferred_delete_time_in_utc', None) + self.is_scheduled_for_deferred_delete = kwargs.get('is_scheduled_for_deferred_delete', None) + self.deferred_delete_time_remaining = kwargs.get('deferred_delete_time_remaining', None) + self.is_deferred_delete_schedule_upcoming = kwargs.get('is_deferred_delete_schedule_upcoming', None) + self.is_rehydrate = kwargs.get('is_rehydrate', None) + + +class AzureFileshareProtectedItem(ProtectedItem): + """Azure File Share workload-specific backup item. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the fileshare represented by this backup item. + :type friendly_name: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param last_backup_status: Last backup operation status. Possible values: Healthy, Unhealthy. + :type last_backup_status: str + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + :param extended_info: Additional information with this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureFileshareProtectedItemExtendedInfo + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureFileshareProtectedItemExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFileshareProtectedItem, self).__init__(**kwargs) + self.protected_item_type = 'AzureFileShareProtectedItem' # type: str + self.friendly_name = kwargs.get('friendly_name', None) + self.protection_status = kwargs.get('protection_status', None) + self.protection_state = kwargs.get('protection_state', None) + self.last_backup_status = kwargs.get('last_backup_status', None) + self.last_backup_time = kwargs.get('last_backup_time', None) + self.kpis_healths = kwargs.get('kpis_healths', None) + self.extended_info = kwargs.get('extended_info', None) + + +class AzureFileshareProtectedItemAutoGenerated(ProtectedItem): + """Azure File Share workload-specific backup item. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the fileshare represented by this backup item. + :type friendly_name: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param health_status: backups running status for this backup item. Possible values include: + "Passed", "ActionRequired", "ActionSuggested", "Invalid". + :type health_status: str or ~azure.mgmt.recoveryservicesbackup.models.HealthStatus + :param last_backup_status: Last backup operation status. Possible values: Healthy, Unhealthy. + :type last_backup_status: str + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + :param extended_info: Additional information with this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureFileshareProtectedItemExtendedInfo + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureFileshareProtectedItemExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFileshareProtectedItemAutoGenerated, self).__init__(**kwargs) + self.protected_item_type = 'AzureFileShareProtectedItem' # type: str + self.friendly_name = kwargs.get('friendly_name', None) + self.protection_status = kwargs.get('protection_status', None) + self.protection_state = kwargs.get('protection_state', None) + self.health_status = kwargs.get('health_status', None) + self.last_backup_status = kwargs.get('last_backup_status', None) + self.last_backup_time = kwargs.get('last_backup_time', None) + self.kpis_healths = kwargs.get('kpis_healths', None) + self.extended_info = kwargs.get('extended_info', None) + + +class AzureFileshareProtectedItemExtendedInfo(msrest.serialization.Model): + """Additional information about Azure File Share backup item. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param oldest_recovery_point: The oldest backup copy available for this item in the service. + :type oldest_recovery_point: ~datetime.datetime + :param recovery_point_count: Number of available backup copies associated with this backup + item. + :type recovery_point_count: int + :param policy_state: Indicates consistency of policy object and policy applied to this backup + item. + :type policy_state: str + :ivar resource_state: Indicates the state of this resource. Possible values are from enum + ResourceState {Invalid, Active, SoftDeleted, Deleted}. + :vartype resource_state: str + :ivar resource_state_sync_time: The resource state sync time for this backup item. + :vartype resource_state_sync_time: ~datetime.datetime + """ + + _validation = { + 'resource_state': {'readonly': True}, + 'resource_state_sync_time': {'readonly': True}, + } + + _attribute_map = { + 'oldest_recovery_point': {'key': 'oldestRecoveryPoint', 'type': 'iso-8601'}, + 'recovery_point_count': {'key': 'recoveryPointCount', 'type': 'int'}, + 'policy_state': {'key': 'policyState', 'type': 'str'}, + 'resource_state': {'key': 'resourceState', 'type': 'str'}, + 'resource_state_sync_time': {'key': 'resourceStateSyncTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFileshareProtectedItemExtendedInfo, self).__init__(**kwargs) + self.oldest_recovery_point = kwargs.get('oldest_recovery_point', None) + self.recovery_point_count = kwargs.get('recovery_point_count', None) + self.policy_state = kwargs.get('policy_state', None) + self.resource_state = None + self.resource_state_sync_time = None + + +class ProtectionPolicy(msrest.serialization.Model): + """Base class for backup policy. Workload-specific backup policies are derived from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureIaaSVMProtectionPolicy, AzureSqlProtectionPolicy, AzureFileShareProtectionPolicy, AzureVmWorkloadProtectionPolicy, GenericProtectionPolicy, MabProtectionPolicy. + + All required parameters must be populated in order to send to Azure. + + :param protected_items_count: Number of items associated with this policy. + :type protected_items_count: int + :param backup_management_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 backup_management_type: str + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + } + + _subtype_map = { + 'backup_management_type': {'AzureIaasVM': 'AzureIaaSVMProtectionPolicy', 'AzureSql': 'AzureSqlProtectionPolicy', 'AzureStorage': 'AzureFileShareProtectionPolicy', 'AzureWorkload': 'AzureVmWorkloadProtectionPolicy', 'GenericProtectionPolicy': 'GenericProtectionPolicy', 'MAB': 'MabProtectionPolicy'} + } + + def __init__( + self, + **kwargs + ): + super(ProtectionPolicy, self).__init__(**kwargs) + self.protected_items_count = kwargs.get('protected_items_count', None) + self.backup_management_type = None # type: Optional[str] + + +class AzureFileShareProtectionPolicy(ProtectionPolicy): + """AzureStorage backup policy. + + All required parameters must be populated in order to send to Azure. + + :param protected_items_count: Number of items associated with this policy. + :type protected_items_count: int + :param backup_management_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 backup_management_type: str + :param work_load_type: Type of workload for the backup management. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type work_load_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param schedule_policy: Backup schedule specified as part of backup policy. + :type schedule_policy: ~azure.mgmt.recoveryservicesbackup.models.SchedulePolicy + :param retention_policy: Retention policy with the details on backup copy retention ranges. + :type retention_policy: ~azure.mgmt.recoveryservicesbackup.models.RetentionPolicy + :param time_zone: TimeZone optional input as string. For example: TimeZone = "Pacific Standard + Time". + :type time_zone: str + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'work_load_type': {'key': 'workLoadType', 'type': 'str'}, + 'schedule_policy': {'key': 'schedulePolicy', 'type': 'SchedulePolicy'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFileShareProtectionPolicy, self).__init__(**kwargs) + self.backup_management_type = 'AzureStorage' # type: str + self.work_load_type = kwargs.get('work_load_type', None) + self.schedule_policy = kwargs.get('schedule_policy', None) + self.retention_policy = kwargs.get('retention_policy', None) + self.time_zone = kwargs.get('time_zone', None) + + +class ILRRequest(msrest.serialization.Model): + """Parameters to Provision ILR API. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureFileShareProvisionILRRequest, IaasVMILRRegistrationRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureFileShareProvisionILRRequest': 'AzureFileShareProvisionILRRequest', 'IaasVMILRRegistrationRequest': 'IaasVMILRRegistrationRequest'} + } + + def __init__( + self, + **kwargs + ): + super(ILRRequest, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class AzureFileShareProvisionILRRequest(ILRRequest): + """Update snapshot Uri with the correct friendly Name of the source Azure file share. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_id: Recovery point ID. + :type recovery_point_id: str + :param source_resource_id: Source Storage account ARM Id. + :type source_resource_id: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFileShareProvisionILRRequest, self).__init__(**kwargs) + self.object_type = 'AzureFileShareProvisionILRRequest' # type: str + self.recovery_point_id = kwargs.get('recovery_point_id', None) + self.source_resource_id = kwargs.get('source_resource_id', None) + + +class RecoveryPoint(msrest.serialization.Model): + """Base class for backup copies. Workload-specific backup copies are derived from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureFileShareRecoveryPointAutoGenerated, AzureWorkloadRecoveryPointAutoGenerated, GenericRecoveryPoint, IaasVMRecoveryPointAutoGenerated. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureFileShareRecoveryPoint': 'AzureFileShareRecoveryPointAutoGenerated', 'AzureWorkloadRecoveryPoint': 'AzureWorkloadRecoveryPointAutoGenerated', 'GenericRecoveryPoint': 'GenericRecoveryPoint', 'IaasVMRecoveryPoint': 'IaasVMRecoveryPointAutoGenerated'} + } + + def __init__( + self, + **kwargs + ): + super(RecoveryPoint, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class AzureFileShareRecoveryPoint(RecoveryPoint): + """Azure File Share workload specific backup copy. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_type: Type of the backup copy. Specifies whether it is a crash consistent + backup or app consistent. + :type recovery_point_type: str + :param recovery_point_time: Time at which this backup copy was created. + :type recovery_point_time: ~datetime.datetime + :param file_share_snapshot_uri: Contains Url to the snapshot of fileshare, if applicable. + :type file_share_snapshot_uri: str + :param recovery_point_size_in_gb: Contains recovery point size. + :type recovery_point_size_in_gb: int + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, + 'file_share_snapshot_uri': {'key': 'fileShareSnapshotUri', 'type': 'str'}, + 'recovery_point_size_in_gb': {'key': 'recoveryPointSizeInGB', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFileShareRecoveryPoint, self).__init__(**kwargs) + self.object_type = 'AzureFileShareRecoveryPoint' # type: str + self.recovery_point_type = kwargs.get('recovery_point_type', None) + self.recovery_point_time = kwargs.get('recovery_point_time', None) + self.file_share_snapshot_uri = kwargs.get('file_share_snapshot_uri', None) + self.recovery_point_size_in_gb = kwargs.get('recovery_point_size_in_gb', None) + + +class AzureFileShareRecoveryPointAutoGenerated(RecoveryPoint): + """Azure File Share workload specific backup copy. + + 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 object_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 object_type: str + :ivar recovery_point_type: Type of the backup copy. Specifies whether it is a crash consistent + backup or app consistent. + :vartype recovery_point_type: str + :ivar recovery_point_time: Time at which this backup copy was created. + :vartype recovery_point_time: ~datetime.datetime + :ivar file_share_snapshot_uri: Contains Url to the snapshot of fileshare, if applicable. + :vartype file_share_snapshot_uri: str + :ivar recovery_point_size_in_gb: Contains recovery point size. + :vartype recovery_point_size_in_gb: int + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_type': {'readonly': True}, + 'recovery_point_time': {'readonly': True}, + 'file_share_snapshot_uri': {'readonly': True}, + 'recovery_point_size_in_gb': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, + 'file_share_snapshot_uri': {'key': 'fileShareSnapshotUri', 'type': 'str'}, + 'recovery_point_size_in_gb': {'key': 'recoveryPointSizeInGB', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFileShareRecoveryPointAutoGenerated, self).__init__(**kwargs) + self.object_type = 'AzureFileShareRecoveryPoint' # type: str + self.recovery_point_type = None + self.recovery_point_time = None + self.file_share_snapshot_uri = None + self.recovery_point_size_in_gb = None + + +class RestoreRequest(msrest.serialization.Model): + """Base class for restore request. Workload-specific restore requests are derived from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureFileShareRestoreRequest, AzureWorkloadRestoreRequest, IaasVMRestoreRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureFileShareRestoreRequest': 'AzureFileShareRestoreRequest', 'AzureWorkloadRestoreRequest': 'AzureWorkloadRestoreRequest', 'IaasVMRestoreRequest': 'IaasVMRestoreRequest'} + } + + def __init__( + self, + **kwargs + ): + super(RestoreRequest, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class AzureFileShareRestoreRequest(RestoreRequest): + """AzureFileShare Restore Request. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Source storage account ARM Id. + :type source_resource_id: str + :param copy_options: Options to resolve copy conflicts. Possible values include: "Invalid", + "CreateCopy", "Skip", "Overwrite", "FailOnConflict". + :type copy_options: str or ~azure.mgmt.recoveryservicesbackup.models.CopyOptions + :param restore_request_type: Restore Type (FullShareRestore or ItemLevelRestore). Possible + values include: "Invalid", "FullShareRestore", "ItemLevelRestore". + :type restore_request_type: str or ~azure.mgmt.recoveryservicesbackup.models.RestoreRequestType + :param restore_file_specs: List of Source Files/Folders(which need to recover) and + TargetFolderPath details. + :type restore_file_specs: list[~azure.mgmt.recoveryservicesbackup.models.RestoreFileSpecs] + :param target_details: Target File Share Details. + :type target_details: ~azure.mgmt.recoveryservicesbackup.models.TargetAFSRestoreInfo + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'copy_options': {'key': 'copyOptions', 'type': 'str'}, + 'restore_request_type': {'key': 'restoreRequestType', 'type': 'str'}, + 'restore_file_specs': {'key': 'restoreFileSpecs', 'type': '[RestoreFileSpecs]'}, + 'target_details': {'key': 'targetDetails', 'type': 'TargetAFSRestoreInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFileShareRestoreRequest, self).__init__(**kwargs) + self.object_type = 'AzureFileShareRestoreRequest' # type: str + self.recovery_type = kwargs.get('recovery_type', None) + self.source_resource_id = kwargs.get('source_resource_id', None) + self.copy_options = kwargs.get('copy_options', None) + self.restore_request_type = kwargs.get('restore_request_type', None) + self.restore_file_specs = kwargs.get('restore_file_specs', None) + self.target_details = kwargs.get('target_details', None) + + +class IaaSVMContainer(ProtectionContainer): + """IaaS VM workload-specific container. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureIaaSClassicComputeVMContainer, AzureIaaSComputeVMContainer. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param virtual_machine_id: Fully qualified ARM url of the virtual machine represented by this + Azure IaaS VM container. + :type virtual_machine_id: str + :param virtual_machine_version: Specifies whether the container represents a Classic or an + Azure Resource Manager VM. + :type virtual_machine_version: str + :param resource_group: Resource group name of Recovery Services Vault. + :type resource_group: str + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + 'virtual_machine_version': {'key': 'virtualMachineVersion', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + _subtype_map = { + 'container_type': {'Microsoft.ClassicCompute/virtualMachines': 'AzureIaaSClassicComputeVMContainer', 'Microsoft.Compute/virtualMachines': 'AzureIaaSComputeVMContainer'} + } + + def __init__( + self, + **kwargs + ): + super(IaaSVMContainer, self).__init__(**kwargs) + self.container_type = 'IaaSVMContainer' # type: str + self.virtual_machine_id = kwargs.get('virtual_machine_id', None) + self.virtual_machine_version = kwargs.get('virtual_machine_version', None) + self.resource_group = kwargs.get('resource_group', None) + + +class AzureIaaSClassicComputeVMContainer(IaaSVMContainer): + """IaaS VM workload-specific backup item representing a classic virtual machine. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param virtual_machine_id: Fully qualified ARM url of the virtual machine represented by this + Azure IaaS VM container. + :type virtual_machine_id: str + :param virtual_machine_version: Specifies whether the container represents a Classic or an + Azure Resource Manager VM. + :type virtual_machine_version: str + :param resource_group: Resource group name of Recovery Services Vault. + :type resource_group: str + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + 'virtual_machine_version': {'key': 'virtualMachineVersion', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSClassicComputeVMContainer, self).__init__(**kwargs) + self.container_type = 'Microsoft.ClassicCompute/virtualMachines' # type: str + + +class IaaSVMProtectableItem(WorkloadProtectableItem): + """IaaS VM workload-specific backup item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureIaaSClassicComputeVMProtectableItem, AzureIaaSComputeVMProtectableItem. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param virtual_machine_id: Fully qualified ARM ID of the virtual machine. + :type virtual_machine_id: str + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + } + + _subtype_map = { + 'protectable_item_type': {'Microsoft.ClassicCompute/virtualMachines': 'AzureIaaSClassicComputeVMProtectableItem', 'Microsoft.Compute/virtualMachines': 'AzureIaaSComputeVMProtectableItem'} + } + + def __init__( + self, + **kwargs + ): + super(IaaSVMProtectableItem, self).__init__(**kwargs) + self.protectable_item_type = 'IaaSVMProtectableItem' # type: str + self.virtual_machine_id = kwargs.get('virtual_machine_id', None) + + +class AzureIaaSClassicComputeVMProtectableItem(IaaSVMProtectableItem): + """IaaS VM workload-specific backup item representing the Classic Compute VM. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param virtual_machine_id: Fully qualified ARM ID of the virtual machine. + :type virtual_machine_id: str + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSClassicComputeVMProtectableItem, self).__init__(**kwargs) + self.protectable_item_type = 'Microsoft.ClassicCompute/virtualMachines' # type: str + + +class AzureIaaSVMProtectedItem(ProtectedItem): + """IaaS VM workload-specific backup item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureIaaSClassicComputeVMProtectedItem, AzureIaaSComputeVMProtectedItem. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the VM represented by this backup item. + :type friendly_name: str + :param virtual_machine_id: Fully qualified ARM ID of the virtual machine represented by this + item. + :type virtual_machine_id: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param health_status: Health status of protected item. Possible values include: "Passed", + "ActionRequired", "ActionSuggested", "Invalid". + :type health_status: str or ~azure.mgmt.recoveryservicesbackup.models.HealthStatus + :param health_details: Health details on this backup item. + :type health_details: list[~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMHealthDetails] + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + :param last_backup_status: Last backup operation status. + :type last_backup_status: str + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param protected_item_data_id: Data ID of the protected item. + :type protected_item_data_id: str + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMProtectedItemExtendedInfo + :param extended_properties: Extended Properties for Azure IaasVM Backup. + :type extended_properties: ~azure.mgmt.recoveryservicesbackup.models.ExtendedProperties + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'health_details': {'key': 'healthDetails', 'type': '[AzureIaaSVMHealthDetails]'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'protected_item_data_id': {'key': 'protectedItemDataId', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureIaaSVMProtectedItemExtendedInfo'}, + 'extended_properties': {'key': 'extendedProperties', 'type': 'ExtendedProperties'}, + } + + _subtype_map = { + 'protected_item_type': {'Microsoft.ClassicCompute/virtualMachines': 'AzureIaaSClassicComputeVMProtectedItem', 'Microsoft.Compute/virtualMachines': 'AzureIaaSComputeVMProtectedItem'} + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSVMProtectedItem, self).__init__(**kwargs) + self.protected_item_type = 'AzureIaaSVMProtectedItem' # type: str + self.friendly_name = kwargs.get('friendly_name', None) + self.virtual_machine_id = kwargs.get('virtual_machine_id', None) + self.protection_status = kwargs.get('protection_status', None) + self.protection_state = kwargs.get('protection_state', None) + self.health_status = kwargs.get('health_status', None) + self.health_details = kwargs.get('health_details', None) + self.kpis_healths = kwargs.get('kpis_healths', None) + self.last_backup_status = kwargs.get('last_backup_status', None) + self.last_backup_time = kwargs.get('last_backup_time', None) + self.protected_item_data_id = kwargs.get('protected_item_data_id', None) + self.extended_info = kwargs.get('extended_info', None) + self.extended_properties = kwargs.get('extended_properties', None) + + +class AzureIaaSClassicComputeVMProtectedItem(AzureIaaSVMProtectedItem): + """IaaS VM workload-specific backup item representing the Classic Compute VM. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the VM represented by this backup item. + :type friendly_name: str + :param virtual_machine_id: Fully qualified ARM ID of the virtual machine represented by this + item. + :type virtual_machine_id: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param health_status: Health status of protected item. Possible values include: "Passed", + "ActionRequired", "ActionSuggested", "Invalid". + :type health_status: str or ~azure.mgmt.recoveryservicesbackup.models.HealthStatus + :param health_details: Health details on this backup item. + :type health_details: list[~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMHealthDetails] + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + :param last_backup_status: Last backup operation status. + :type last_backup_status: str + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param protected_item_data_id: Data ID of the protected item. + :type protected_item_data_id: str + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMProtectedItemExtendedInfo + :param extended_properties: Extended Properties for Azure IaasVM Backup. + :type extended_properties: ~azure.mgmt.recoveryservicesbackup.models.ExtendedProperties + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'health_details': {'key': 'healthDetails', 'type': '[AzureIaaSVMHealthDetails]'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'protected_item_data_id': {'key': 'protectedItemDataId', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureIaaSVMProtectedItemExtendedInfo'}, + 'extended_properties': {'key': 'extendedProperties', 'type': 'ExtendedProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSClassicComputeVMProtectedItem, self).__init__(**kwargs) + self.protected_item_type = 'Microsoft.ClassicCompute/virtualMachines' # type: str + + +class AzureIaaSComputeVMContainer(IaaSVMContainer): + """IaaS VM workload-specific backup item representing an Azure Resource Manager virtual machine. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param virtual_machine_id: Fully qualified ARM url of the virtual machine represented by this + Azure IaaS VM container. + :type virtual_machine_id: str + :param virtual_machine_version: Specifies whether the container represents a Classic or an + Azure Resource Manager VM. + :type virtual_machine_version: str + :param resource_group: Resource group name of Recovery Services Vault. + :type resource_group: str + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + 'virtual_machine_version': {'key': 'virtualMachineVersion', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSComputeVMContainer, self).__init__(**kwargs) + self.container_type = 'Microsoft.Compute/virtualMachines' # type: str + + +class AzureIaaSComputeVMProtectableItem(IaaSVMProtectableItem): + """IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param virtual_machine_id: Fully qualified ARM ID of the virtual machine. + :type virtual_machine_id: str + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSComputeVMProtectableItem, self).__init__(**kwargs) + self.protectable_item_type = 'Microsoft.Compute/virtualMachines' # type: str + + +class AzureIaaSComputeVMProtectedItem(AzureIaaSVMProtectedItem): + """IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the VM represented by this backup item. + :type friendly_name: str + :param virtual_machine_id: Fully qualified ARM ID of the virtual machine represented by this + item. + :type virtual_machine_id: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param health_status: Health status of protected item. Possible values include: "Passed", + "ActionRequired", "ActionSuggested", "Invalid". + :type health_status: str or ~azure.mgmt.recoveryservicesbackup.models.HealthStatus + :param health_details: Health details on this backup item. + :type health_details: list[~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMHealthDetails] + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + :param last_backup_status: Last backup operation status. + :type last_backup_status: str + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param protected_item_data_id: Data ID of the protected item. + :type protected_item_data_id: str + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMProtectedItemExtendedInfo + :param extended_properties: Extended Properties for Azure IaasVM Backup. + :type extended_properties: ~azure.mgmt.recoveryservicesbackup.models.ExtendedProperties + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'health_details': {'key': 'healthDetails', 'type': '[AzureIaaSVMHealthDetails]'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'protected_item_data_id': {'key': 'protectedItemDataId', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureIaaSVMProtectedItemExtendedInfo'}, + 'extended_properties': {'key': 'extendedProperties', 'type': 'ExtendedProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSComputeVMProtectedItem, self).__init__(**kwargs) + self.protected_item_type = 'Microsoft.Compute/virtualMachines' # type: str + + +class AzureIaaSVMErrorInfo(msrest.serialization.Model): + """Azure IaaS VM workload-specific error information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: Error code. + :vartype error_code: int + :ivar error_title: Title: Typically, the entity that the error pertains to. + :vartype error_title: str + :ivar error_string: Localized error string. + :vartype error_string: str + :ivar recommendations: List of localized recommendations for above error code. + :vartype recommendations: list[str] + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_title': {'readonly': True}, + 'error_string': {'readonly': True}, + 'recommendations': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'error_title': {'key': 'errorTitle', 'type': 'str'}, + 'error_string': {'key': 'errorString', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSVMErrorInfo, self).__init__(**kwargs) + self.error_code = None + self.error_title = None + self.error_string = None + self.recommendations = None + + +class ResourceHealthDetails(msrest.serialization.Model): + """Health Details for backup items. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Health Code. + :vartype code: int + :ivar title: Health Title. + :vartype title: str + :ivar message: Health Message. + :vartype message: str + :ivar recommendations: Health Recommended Actions. + :vartype recommendations: list[str] + """ + + _validation = { + 'code': {'readonly': True}, + 'title': {'readonly': True}, + 'message': {'readonly': True}, + 'recommendations': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'int'}, + 'title': {'key': 'title', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceHealthDetails, self).__init__(**kwargs) + self.code = None + self.title = None + self.message = None + self.recommendations = None + + +class AzureIaaSVMHealthDetails(ResourceHealthDetails): + """Azure IaaS VM workload-specific Health Details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Health Code. + :vartype code: int + :ivar title: Health Title. + :vartype title: str + :ivar message: Health Message. + :vartype message: str + :ivar recommendations: Health Recommended Actions. + :vartype recommendations: list[str] + """ + + _validation = { + 'code': {'readonly': True}, + 'title': {'readonly': True}, + 'message': {'readonly': True}, + 'recommendations': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'int'}, + 'title': {'key': 'title', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSVMHealthDetails, self).__init__(**kwargs) + + +class Job(msrest.serialization.Model): + """Defines workload agnostic properties for a job. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureIaaSVMJob, AzureStorageJob, AzureWorkloadJob, DpmJob, MabJob, VaultJob. + + All required parameters must be populated in order to send to Azure. + + :param entity_friendly_name: Friendly name of the entity on which the current job is executing. + :type entity_friendly_name: str + :param backup_management_type: Backup management type to execute the current job. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: The operation name. + :type operation: str + :param status: Job status. + :type status: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param activity_id: ActivityId of job. + :type activity_id: str + :param job_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 job_type: str + """ + + _validation = { + 'job_type': {'required': True}, + } + + _attribute_map = { + 'entity_friendly_name': {'key': 'entityFriendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + } + + _subtype_map = { + 'job_type': {'AzureIaaSVMJob': 'AzureIaaSVMJob', 'AzureStorageJob': 'AzureStorageJob', 'AzureWorkloadJob': 'AzureWorkloadJob', 'DpmJob': 'DpmJob', 'MabJob': 'MabJob', 'VaultJob': 'VaultJob'} + } + + def __init__( + self, + **kwargs + ): + super(Job, self).__init__(**kwargs) + self.entity_friendly_name = kwargs.get('entity_friendly_name', None) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.operation = kwargs.get('operation', None) + self.status = kwargs.get('status', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.activity_id = kwargs.get('activity_id', None) + self.job_type = None # type: Optional[str] + + +class AzureIaaSVMJob(Job): + """Azure IaaS VM workload-specific job object. + + All required parameters must be populated in order to send to Azure. + + :param entity_friendly_name: Friendly name of the entity on which the current job is executing. + :type entity_friendly_name: str + :param backup_management_type: Backup management type to execute the current job. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: The operation name. + :type operation: str + :param status: Job status. + :type status: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param activity_id: ActivityId of job. + :type activity_id: str + :param job_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 job_type: str + :param duration: Time elapsed during the execution of this job. + :type duration: ~datetime.timedelta + :param actions_info: Gets or sets the state/actions applicable on this job like cancel/retry. + :type actions_info: list[str or ~azure.mgmt.recoveryservicesbackup.models.JobSupportedAction] + :param error_details: Error details on execution of this job. + :type error_details: list[~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMErrorInfo] + :param virtual_machine_version: Specifies whether the backup item is a Classic or an Azure + Resource Manager VM. + :type virtual_machine_version: str + :param extended_info: Additional information for this job. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMJobExtendedInfo + """ + + _validation = { + 'job_type': {'required': True}, + } + + _attribute_map = { + 'entity_friendly_name': {'key': 'entityFriendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'actions_info': {'key': 'actionsInfo', 'type': '[str]'}, + 'error_details': {'key': 'errorDetails', 'type': '[AzureIaaSVMErrorInfo]'}, + 'virtual_machine_version': {'key': 'virtualMachineVersion', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureIaaSVMJobExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSVMJob, self).__init__(**kwargs) + self.job_type = 'AzureIaaSVMJob' # type: str + self.duration = kwargs.get('duration', None) + self.actions_info = kwargs.get('actions_info', None) + self.error_details = kwargs.get('error_details', None) + self.virtual_machine_version = kwargs.get('virtual_machine_version', None) + self.extended_info = kwargs.get('extended_info', None) + + +class AzureIaaSVMJobExtendedInfo(msrest.serialization.Model): + """Azure IaaS VM workload-specific additional information for job. + + :param tasks_list: List of tasks associated with this job. + :type tasks_list: list[~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMJobTaskDetails] + :param property_bag: Job properties. + :type property_bag: dict[str, str] + :param internal_property_bag: Job internal properties. + :type internal_property_bag: dict[str, str] + :param progress_percentage: Indicates progress of the job. Null if it has not started or + completed. + :type progress_percentage: float + :param estimated_remaining_duration: Time remaining for execution of this job. + :type estimated_remaining_duration: str + :param dynamic_error_message: Non localized error message on job execution. + :type dynamic_error_message: str + """ + + _attribute_map = { + 'tasks_list': {'key': 'tasksList', 'type': '[AzureIaaSVMJobTaskDetails]'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'internal_property_bag': {'key': 'internalPropertyBag', 'type': '{str}'}, + 'progress_percentage': {'key': 'progressPercentage', 'type': 'float'}, + 'estimated_remaining_duration': {'key': 'estimatedRemainingDuration', 'type': 'str'}, + 'dynamic_error_message': {'key': 'dynamicErrorMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSVMJobExtendedInfo, self).__init__(**kwargs) + self.tasks_list = kwargs.get('tasks_list', None) + self.property_bag = kwargs.get('property_bag', None) + self.internal_property_bag = kwargs.get('internal_property_bag', None) + self.progress_percentage = kwargs.get('progress_percentage', None) + self.estimated_remaining_duration = kwargs.get('estimated_remaining_duration', None) + self.dynamic_error_message = kwargs.get('dynamic_error_message', None) + + +class AzureIaaSVMJobTaskDetails(msrest.serialization.Model): + """Azure IaaS VM workload-specific job task details. + + :param task_id: The task display name. + :type task_id: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param instance_id: The instanceId. + :type instance_id: str + :param duration: Time elapsed for task. + :type duration: ~datetime.timedelta + :param status: The status. + :type status: str + :param progress_percentage: Progress of the task. + :type progress_percentage: float + :param task_execution_details: Details about execution of the task. + eg: number of bytes transferred etc. + :type task_execution_details: str + """ + + _attribute_map = { + 'task_id': {'key': 'taskId', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'instance_id': {'key': 'instanceId', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'status': {'key': 'status', 'type': 'str'}, + 'progress_percentage': {'key': 'progressPercentage', 'type': 'float'}, + 'task_execution_details': {'key': 'taskExecutionDetails', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSVMJobTaskDetails, self).__init__(**kwargs) + self.task_id = kwargs.get('task_id', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.instance_id = kwargs.get('instance_id', None) + self.duration = kwargs.get('duration', None) + self.status = kwargs.get('status', None) + self.progress_percentage = kwargs.get('progress_percentage', None) + self.task_execution_details = kwargs.get('task_execution_details', None) + + +class AzureIaaSVMProtectedItemExtendedInfo(msrest.serialization.Model): + """Additional information on Azure IaaS VM specific backup item. + + :param oldest_recovery_point: The oldest backup copy available for this backup item. + :type oldest_recovery_point: ~datetime.datetime + :param recovery_point_count: Number of backup copies available for this backup item. + :type recovery_point_count: int + :param policy_inconsistent: Specifies if backup policy associated with the backup item is + inconsistent. + :type policy_inconsistent: bool + """ + + _attribute_map = { + 'oldest_recovery_point': {'key': 'oldestRecoveryPoint', 'type': 'iso-8601'}, + 'recovery_point_count': {'key': 'recoveryPointCount', 'type': 'int'}, + 'policy_inconsistent': {'key': 'policyInconsistent', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSVMProtectedItemExtendedInfo, self).__init__(**kwargs) + self.oldest_recovery_point = kwargs.get('oldest_recovery_point', None) + self.recovery_point_count = kwargs.get('recovery_point_count', None) + self.policy_inconsistent = kwargs.get('policy_inconsistent', None) + + +class AzureIaaSVMProtectionPolicy(ProtectionPolicy): + """IaaS VM workload-specific backup policy. + + All required parameters must be populated in order to send to Azure. + + :param protected_items_count: Number of items associated with this policy. + :type protected_items_count: int + :param backup_management_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 backup_management_type: str + :param instant_rp_details: + :type instant_rp_details: ~azure.mgmt.recoveryservicesbackup.models.InstantRPAdditionalDetails + :param schedule_policy: Backup schedule specified as part of backup policy. + :type schedule_policy: ~azure.mgmt.recoveryservicesbackup.models.SchedulePolicy + :param retention_policy: Retention policy with the details on backup copy retention ranges. + :type retention_policy: ~azure.mgmt.recoveryservicesbackup.models.RetentionPolicy + :param instant_rp_retention_range_in_days: Instant RP retention policy range in days. + :type instant_rp_retention_range_in_days: int + :param time_zone: TimeZone optional input as string. For example: TimeZone = "Pacific Standard + Time". + :type time_zone: str + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'instant_rp_details': {'key': 'instantRPDetails', 'type': 'InstantRPAdditionalDetails'}, + 'schedule_policy': {'key': 'schedulePolicy', 'type': 'SchedulePolicy'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + 'instant_rp_retention_range_in_days': {'key': 'instantRpRetentionRangeInDays', 'type': 'int'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSVMProtectionPolicy, self).__init__(**kwargs) + self.backup_management_type = 'AzureIaasVM' # type: str + self.instant_rp_details = kwargs.get('instant_rp_details', None) + self.schedule_policy = kwargs.get('schedule_policy', None) + self.retention_policy = kwargs.get('retention_policy', None) + self.instant_rp_retention_range_in_days = kwargs.get('instant_rp_retention_range_in_days', None) + self.time_zone = kwargs.get('time_zone', None) + + +class ProtectionIntent(msrest.serialization.Model): + """Base class for backup ProtectionIntent. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureResourceProtectionIntent, AzureRecoveryServiceVaultProtectionIntent. + + All required parameters must be populated in order to send to Azure. + + :param protection_intent_item_type: Required. backup protectionIntent type.Constant filled by + server. + :type protection_intent_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param item_id: ID of the item which is getting protected, In case of Azure Vm , it is + ProtectedItemId. + :type item_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + """ + + _validation = { + 'protection_intent_item_type': {'required': True}, + } + + _attribute_map = { + 'protection_intent_item_type': {'key': 'protectionIntentItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'item_id': {'key': 'itemId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + } + + _subtype_map = { + 'protection_intent_item_type': {'AzureResourceItem': 'AzureResourceProtectionIntent', 'RecoveryServiceVaultItem': 'AzureRecoveryServiceVaultProtectionIntent'} + } + + def __init__( + self, + **kwargs + ): + super(ProtectionIntent, self).__init__(**kwargs) + self.protection_intent_item_type = None # type: Optional[str] + self.backup_management_type = kwargs.get('backup_management_type', None) + self.source_resource_id = kwargs.get('source_resource_id', None) + self.item_id = kwargs.get('item_id', None) + self.policy_id = kwargs.get('policy_id', None) + self.protection_state = kwargs.get('protection_state', None) + + +class AzureRecoveryServiceVaultProtectionIntent(ProtectionIntent): + """Azure Recovery Services Vault specific protection intent item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadAutoProtectionIntent. + + All required parameters must be populated in order to send to Azure. + + :param protection_intent_item_type: Required. backup protectionIntent type.Constant filled by + server. + :type protection_intent_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param item_id: ID of the item which is getting protected, In case of Azure Vm , it is + ProtectedItemId. + :type item_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + """ + + _validation = { + 'protection_intent_item_type': {'required': True}, + } + + _attribute_map = { + 'protection_intent_item_type': {'key': 'protectionIntentItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'item_id': {'key': 'itemId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + } + + _subtype_map = { + 'protection_intent_item_type': {'AzureWorkloadAutoProtectionIntent': 'AzureWorkloadAutoProtectionIntent'} + } + + def __init__( + self, + **kwargs + ): + super(AzureRecoveryServiceVaultProtectionIntent, self).__init__(**kwargs) + self.protection_intent_item_type = 'RecoveryServiceVaultItem' # type: str + + +class AzureResourceProtectionIntent(ProtectionIntent): + """IaaS VM specific backup protection intent item. + + All required parameters must be populated in order to send to Azure. + + :param protection_intent_item_type: Required. backup protectionIntent type.Constant filled by + server. + :type protection_intent_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param item_id: ID of the item which is getting protected, In case of Azure Vm , it is + ProtectedItemId. + :type item_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param friendly_name: Friendly name of the VM represented by this backup item. + :type friendly_name: str + """ + + _validation = { + 'protection_intent_item_type': {'required': True}, + } + + _attribute_map = { + 'protection_intent_item_type': {'key': 'protectionIntentItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'item_id': {'key': 'itemId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureResourceProtectionIntent, self).__init__(**kwargs) + self.protection_intent_item_type = 'AzureResourceItem' # type: str + self.friendly_name = kwargs.get('friendly_name', None) + + +class AzureWorkloadContainer(ProtectionContainer): + """Container for the workloads running inside Azure Compute or Classic Compute. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureSQLAGWorkloadContainerProtectionContainer, AzureVMAppContainerProtectionContainer. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param source_resource_id: ARM ID of the virtual machine represented by this Azure Workload + Container. + :type source_resource_id: str + :param last_updated_time: Time stamp when this container was updated. + :type last_updated_time: ~datetime.datetime + :param extended_info: Additional details of a workload container. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadContainerExtendedInfo + :param workload_type: Workload type for which registration was sent. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param operation_type: Re-Do Operation. Possible values include: "Invalid", "Register", + "Reregister". + :type operation_type: str or ~azure.mgmt.recoveryservicesbackup.models.OperationType + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'last_updated_time': {'key': 'lastUpdatedTime', 'type': 'iso-8601'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadContainerExtendedInfo'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'operation_type': {'key': 'operationType', 'type': 'str'}, + } + + _subtype_map = { + 'container_type': {'SQLAGWorkLoadContainer': 'AzureSQLAGWorkloadContainerProtectionContainer', 'VMAppContainer': 'AzureVMAppContainerProtectionContainer'} + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadContainer, self).__init__(**kwargs) + self.container_type = 'AzureWorkloadContainer' # type: str + self.source_resource_id = kwargs.get('source_resource_id', None) + self.last_updated_time = kwargs.get('last_updated_time', None) + self.extended_info = kwargs.get('extended_info', None) + self.workload_type = kwargs.get('workload_type', None) + self.operation_type = kwargs.get('operation_type', None) + + +class AzureSQLAGWorkloadContainerProtectionContainer(AzureWorkloadContainer): + """Container for SQL workloads under SQL Availability Group. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param source_resource_id: ARM ID of the virtual machine represented by this Azure Workload + Container. + :type source_resource_id: str + :param last_updated_time: Time stamp when this container was updated. + :type last_updated_time: ~datetime.datetime + :param extended_info: Additional details of a workload container. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadContainerExtendedInfo + :param workload_type: Workload type for which registration was sent. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param operation_type: Re-Do Operation. Possible values include: "Invalid", "Register", + "Reregister". + :type operation_type: str or ~azure.mgmt.recoveryservicesbackup.models.OperationType + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'last_updated_time': {'key': 'lastUpdatedTime', 'type': 'iso-8601'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadContainerExtendedInfo'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'operation_type': {'key': 'operationType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureSQLAGWorkloadContainerProtectionContainer, self).__init__(**kwargs) + self.container_type = 'SQLAGWorkLoadContainer' # type: str + + +class AzureSqlContainer(ProtectionContainer): + """Azure Sql workload-specific container. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureSqlContainer, self).__init__(**kwargs) + self.container_type = 'AzureSqlContainer' # type: str + + +class AzureSqlProtectedItem(ProtectedItem): + """Azure SQL workload-specific backup item. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param protected_item_data_id: Internal ID of a backup item. Used by Azure SQL Backup engine to + contact Recovery Services. + :type protected_item_data_id: str + :param protection_state: Backup state of the backed up item. Possible values include: + "Invalid", "IRPending", "Protected", "ProtectionError", "ProtectionStopped", + "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemState + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureSqlProtectedItemExtendedInfo + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'protected_item_data_id': {'key': 'protectedItemDataId', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureSqlProtectedItemExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureSqlProtectedItem, self).__init__(**kwargs) + self.protected_item_type = 'Microsoft.Sql/servers/databases' # type: str + self.protected_item_data_id = kwargs.get('protected_item_data_id', None) + self.protection_state = kwargs.get('protection_state', None) + self.extended_info = kwargs.get('extended_info', None) + + +class AzureSqlProtectedItemExtendedInfo(msrest.serialization.Model): + """Additional information on Azure Sql specific protected item. + + :param oldest_recovery_point: The oldest backup copy available for this item in the service. + :type oldest_recovery_point: ~datetime.datetime + :param recovery_point_count: Number of available backup copies associated with this backup + item. + :type recovery_point_count: int + :param policy_state: State of the backup policy associated with this backup item. + :type policy_state: str + """ + + _attribute_map = { + 'oldest_recovery_point': {'key': 'oldestRecoveryPoint', 'type': 'iso-8601'}, + 'recovery_point_count': {'key': 'recoveryPointCount', 'type': 'int'}, + 'policy_state': {'key': 'policyState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureSqlProtectedItemExtendedInfo, self).__init__(**kwargs) + self.oldest_recovery_point = kwargs.get('oldest_recovery_point', None) + self.recovery_point_count = kwargs.get('recovery_point_count', None) + self.policy_state = kwargs.get('policy_state', None) + + +class AzureSqlProtectionPolicy(ProtectionPolicy): + """Azure SQL workload-specific backup policy. + + All required parameters must be populated in order to send to Azure. + + :param protected_items_count: Number of items associated with this policy. + :type protected_items_count: int + :param backup_management_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 backup_management_type: str + :param retention_policy: Retention policy details. + :type retention_policy: ~azure.mgmt.recoveryservicesbackup.models.RetentionPolicy + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureSqlProtectionPolicy, self).__init__(**kwargs) + self.backup_management_type = 'AzureSql' # type: str + self.retention_policy = kwargs.get('retention_policy', None) + + +class AzureStorageContainer(ProtectionContainer): + """Azure Storage Account workload-specific container. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param source_resource_id: Fully qualified ARM url. + :type source_resource_id: str + :param storage_account_version: Storage account version. + :type storage_account_version: str + :param resource_group: Resource group name of Recovery Services Vault. + :type resource_group: str + :param protected_item_count: Number of items backed up in this container. + :type protected_item_count: long + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'storage_account_version': {'key': 'storageAccountVersion', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'protected_item_count': {'key': 'protectedItemCount', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureStorageContainer, self).__init__(**kwargs) + self.container_type = 'StorageContainer' # type: str + self.source_resource_id = kwargs.get('source_resource_id', None) + self.storage_account_version = kwargs.get('storage_account_version', None) + self.resource_group = kwargs.get('resource_group', None) + self.protected_item_count = kwargs.get('protected_item_count', None) + + +class AzureStorageErrorInfo(msrest.serialization.Model): + """Azure storage specific error information. + + :param error_code: Error code. + :type error_code: int + :param error_string: Localized error string. + :type error_string: str + :param recommendations: List of localized recommendations for above error code. + :type recommendations: list[str] + """ + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'error_string': {'key': 'errorString', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureStorageErrorInfo, self).__init__(**kwargs) + self.error_code = kwargs.get('error_code', None) + self.error_string = kwargs.get('error_string', None) + self.recommendations = kwargs.get('recommendations', None) + + +class AzureStorageJob(Job): + """Azure storage specific job. + + All required parameters must be populated in order to send to Azure. + + :param entity_friendly_name: Friendly name of the entity on which the current job is executing. + :type entity_friendly_name: str + :param backup_management_type: Backup management type to execute the current job. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: The operation name. + :type operation: str + :param status: Job status. + :type status: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param activity_id: ActivityId of job. + :type activity_id: str + :param job_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 job_type: str + :param duration: Time elapsed during the execution of this job. + :type duration: ~datetime.timedelta + :param actions_info: Gets or sets the state/actions applicable on this job like cancel/retry. + :type actions_info: list[str or ~azure.mgmt.recoveryservicesbackup.models.JobSupportedAction] + :param error_details: Error details on execution of this job. + :type error_details: list[~azure.mgmt.recoveryservicesbackup.models.AzureStorageErrorInfo] + :param storage_account_name: Specifies friendly name of the storage account. + :type storage_account_name: str + :param storage_account_version: Specifies whether the Storage account is a Classic or an Azure + Resource Manager Storage account. + :type storage_account_version: str + :param extended_info: Additional information about the job. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.AzureStorageJobExtendedInfo + """ + + _validation = { + 'job_type': {'required': True}, + } + + _attribute_map = { + 'entity_friendly_name': {'key': 'entityFriendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'actions_info': {'key': 'actionsInfo', 'type': '[str]'}, + 'error_details': {'key': 'errorDetails', 'type': '[AzureStorageErrorInfo]'}, + 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, + 'storage_account_version': {'key': 'storageAccountVersion', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureStorageJobExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureStorageJob, self).__init__(**kwargs) + self.job_type = 'AzureStorageJob' # type: str + self.duration = kwargs.get('duration', None) + self.actions_info = kwargs.get('actions_info', None) + self.error_details = kwargs.get('error_details', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.storage_account_version = kwargs.get('storage_account_version', None) + self.extended_info = kwargs.get('extended_info', None) + + +class AzureStorageJobExtendedInfo(msrest.serialization.Model): + """Azure Storage workload-specific additional information for job. + + :param tasks_list: List of tasks for this job. + :type tasks_list: list[~azure.mgmt.recoveryservicesbackup.models.AzureStorageJobTaskDetails] + :param property_bag: Job properties. + :type property_bag: dict[str, str] + :param dynamic_error_message: Non localized error message on job execution. + :type dynamic_error_message: str + """ + + _attribute_map = { + 'tasks_list': {'key': 'tasksList', 'type': '[AzureStorageJobTaskDetails]'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'dynamic_error_message': {'key': 'dynamicErrorMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureStorageJobExtendedInfo, self).__init__(**kwargs) + self.tasks_list = kwargs.get('tasks_list', None) + self.property_bag = kwargs.get('property_bag', None) + self.dynamic_error_message = kwargs.get('dynamic_error_message', None) + + +class AzureStorageJobTaskDetails(msrest.serialization.Model): + """Azure storage workload specific job task details. + + :param task_id: The task display name. + :type task_id: str + :param status: The status. + :type status: str + """ + + _attribute_map = { + 'task_id': {'key': 'taskId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureStorageJobTaskDetails, self).__init__(**kwargs) + self.task_id = kwargs.get('task_id', None) + self.status = kwargs.get('status', None) + + +class ProtectableContainer(msrest.serialization.Model): + """Protectable Container Class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureStorageProtectableContainer, AzureVMAppContainerProtectableContainer. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param protectable_container_type: Required. Type of the container. The value of this property + for + + + #. Compute Azure VM is Microsoft.Compute/virtualMachines + #. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines.Constant filled by + server. Possible values include: "Invalid", "Unknown", "IaasVMContainer", + "IaasVMServiceContainer", "DPMContainer", "AzureBackupServerContainer", "MABContainer", + "Cluster", "AzureSqlContainer", "Windows", "VCenter", "VMAppContainer", + "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type protectable_container_type: str or + ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param health_status: Status of health of the container. + :type health_status: str + :param container_id: Fabric Id of the container such as ARM Id. + :type container_id: str + """ + + _validation = { + 'protectable_container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'protectable_container_type': {'key': 'protectableContainerType', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_id': {'key': 'containerId', 'type': 'str'}, + } + + _subtype_map = { + 'protectable_container_type': {'StorageContainer': 'AzureStorageProtectableContainer', 'VMAppContainer': 'AzureVMAppContainerProtectableContainer'} + } + + def __init__( + self, + **kwargs + ): + super(ProtectableContainer, self).__init__(**kwargs) + self.friendly_name = kwargs.get('friendly_name', None) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.protectable_container_type = None # type: Optional[str] + self.health_status = kwargs.get('health_status', None) + self.container_id = kwargs.get('container_id', None) + + +class AzureStorageProtectableContainer(ProtectableContainer): + """Azure Storage-specific protectable containers. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param protectable_container_type: Required. Type of the container. The value of this property + for + + + #. Compute Azure VM is Microsoft.Compute/virtualMachines + #. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines.Constant filled by + server. Possible values include: "Invalid", "Unknown", "IaasVMContainer", + "IaasVMServiceContainer", "DPMContainer", "AzureBackupServerContainer", "MABContainer", + "Cluster", "AzureSqlContainer", "Windows", "VCenter", "VMAppContainer", + "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type protectable_container_type: str or + ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param health_status: Status of health of the container. + :type health_status: str + :param container_id: Fabric Id of the container such as ARM Id. + :type container_id: str + """ + + _validation = { + 'protectable_container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'protectable_container_type': {'key': 'protectableContainerType', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_id': {'key': 'containerId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureStorageProtectableContainer, self).__init__(**kwargs) + self.protectable_container_type = 'StorageContainer' # type: str + + +class AzureVMAppContainerProtectableContainer(ProtectableContainer): + """Azure workload-specific container. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param protectable_container_type: Required. Type of the container. The value of this property + for + + + #. Compute Azure VM is Microsoft.Compute/virtualMachines + #. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines.Constant filled by + server. Possible values include: "Invalid", "Unknown", "IaasVMContainer", + "IaasVMServiceContainer", "DPMContainer", "AzureBackupServerContainer", "MABContainer", + "Cluster", "AzureSqlContainer", "Windows", "VCenter", "VMAppContainer", + "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type protectable_container_type: str or + ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param health_status: Status of health of the container. + :type health_status: str + :param container_id: Fabric Id of the container such as ARM Id. + :type container_id: str + """ + + _validation = { + 'protectable_container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'protectable_container_type': {'key': 'protectableContainerType', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_id': {'key': 'containerId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVMAppContainerProtectableContainer, self).__init__(**kwargs) + self.protectable_container_type = 'VMAppContainer' # type: str + + +class AzureVMAppContainerProtectionContainer(AzureWorkloadContainer): + """Container for SQL workloads under Azure Virtual Machines. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param source_resource_id: ARM ID of the virtual machine represented by this Azure Workload + Container. + :type source_resource_id: str + :param last_updated_time: Time stamp when this container was updated. + :type last_updated_time: ~datetime.datetime + :param extended_info: Additional details of a workload container. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadContainerExtendedInfo + :param workload_type: Workload type for which registration was sent. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param operation_type: Re-Do Operation. Possible values include: "Invalid", "Register", + "Reregister". + :type operation_type: str or ~azure.mgmt.recoveryservicesbackup.models.OperationType + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'last_updated_time': {'key': 'lastUpdatedTime', 'type': 'iso-8601'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadContainerExtendedInfo'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'operation_type': {'key': 'operationType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVMAppContainerProtectionContainer, self).__init__(**kwargs) + self.container_type = 'VMAppContainer' # type: str + + +class AzureVMResourceFeatureSupportRequest(FeatureSupportRequest): + """AzureResource(IaaS VM) Specific feature support request. + + All required parameters must be populated in order to send to Azure. + + :param feature_type: Required. backup support feature type.Constant filled by server. + :type feature_type: str + :param vm_size: Size of the resource: VM size(A/D series etc) in case of IaasVM. + :type vm_size: str + :param vm_sku: SKUs (Premium/Managed etc) in case of IaasVM. + :type vm_sku: str + """ + + _validation = { + 'feature_type': {'required': True}, + } + + _attribute_map = { + 'feature_type': {'key': 'featureType', 'type': 'str'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'vm_sku': {'key': 'vmSku', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVMResourceFeatureSupportRequest, self).__init__(**kwargs) + self.feature_type = 'AzureVMResourceBackup' # type: str + self.vm_size = kwargs.get('vm_size', None) + self.vm_sku = kwargs.get('vm_sku', None) + + +class AzureVMResourceFeatureSupportResponse(msrest.serialization.Model): + """Response for feature support requests for Azure IaasVm. + + :param support_status: Support status of feature. Possible values include: "Invalid", + "Supported", "DefaultOFF", "DefaultON", "NotSupported". + :type support_status: str or ~azure.mgmt.recoveryservicesbackup.models.SupportStatus + """ + + _attribute_map = { + 'support_status': {'key': 'supportStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVMResourceFeatureSupportResponse, self).__init__(**kwargs) + self.support_status = kwargs.get('support_status', None) + + +class WorkloadItem(msrest.serialization.Model): + """Base class for backup item. Workload-specific backup items are derived from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureVmWorkloadItem. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + } + + _subtype_map = { + 'workload_item_type': {'AzureVmWorkloadItem': 'AzureVmWorkloadItem'} + } + + def __init__( + self, + **kwargs + ): + super(WorkloadItem, self).__init__(**kwargs) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.workload_type = kwargs.get('workload_type', None) + self.workload_item_type = None # type: Optional[str] + self.friendly_name = kwargs.get('friendly_name', None) + self.protection_state = kwargs.get('protection_state', None) + + +class AzureVmWorkloadItem(WorkloadItem): + """Azure VM workload-specific workload item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureVmWorkloadSAPAseDatabaseWorkloadItem, AzureVmWorkloadSAPAseSystemWorkloadItem, AzureVmWorkloadSAPHanaDatabaseWorkloadItem, AzureVmWorkloadSAPHanaSystemWorkloadItem, AzureVmWorkloadSQLDatabaseWorkloadItem, AzureVmWorkloadSQLInstanceWorkloadItem. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if workload item is auto-protectable. + :type is_auto_protectable: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param sub_workload_item_count: For instance or AG, indicates number of DB's to be protected. + :type sub_workload_item_count: int + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'sub_workload_item_count': {'key': 'subWorkloadItemCount', 'type': 'int'}, + } + + _subtype_map = { + 'workload_item_type': {'SAPAseDatabase': 'AzureVmWorkloadSAPAseDatabaseWorkloadItem', 'SAPAseSystem': 'AzureVmWorkloadSAPAseSystemWorkloadItem', 'SAPHanaDatabase': 'AzureVmWorkloadSAPHanaDatabaseWorkloadItem', 'SAPHanaSystem': 'AzureVmWorkloadSAPHanaSystemWorkloadItem', 'SQLDataBase': 'AzureVmWorkloadSQLDatabaseWorkloadItem', 'SQLInstance': 'AzureVmWorkloadSQLInstanceWorkloadItem'} + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadItem, self).__init__(**kwargs) + self.workload_item_type = 'AzureVmWorkloadItem' # type: str + self.parent_name = kwargs.get('parent_name', None) + self.server_name = kwargs.get('server_name', None) + self.is_auto_protectable = kwargs.get('is_auto_protectable', None) + self.subinquireditemcount = kwargs.get('subinquireditemcount', None) + self.sub_workload_item_count = kwargs.get('sub_workload_item_count', None) + + +class AzureVmWorkloadProtectableItem(WorkloadProtectableItem): + """Azure VM workload-specific protectable item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureVmWorkloadSAPAseSystemProtectableItem, AzureVmWorkloadSAPHanaDatabaseProtectableItem, AzureVmWorkloadSAPHanaSystemProtectableItem, AzureVmWorkloadSQLAvailabilityGroupProtectableItem, AzureVmWorkloadSQLDatabaseProtectableItem, AzureVmWorkloadSQLInstanceProtectableItem. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param parent_unique_name: Parent Unique Name is added to provide the service formatted URI + Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + :type parent_unique_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if protectable item is auto-protectable. + :type is_auto_protectable: bool + :param is_auto_protected: Indicates if protectable item is auto-protected. + :type is_auto_protected: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param subprotectableitemcount: For instance or AG, indicates number of DB's to be protected. + :type subprotectableitemcount: int + :param prebackupvalidation: Pre-backup validation for protectable objects. + :type prebackupvalidation: ~azure.mgmt.recoveryservicesbackup.models.PreBackupValidation + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_unique_name': {'key': 'parentUniqueName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'is_auto_protected': {'key': 'isAutoProtected', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'subprotectableitemcount': {'key': 'subprotectableitemcount', 'type': 'int'}, + 'prebackupvalidation': {'key': 'prebackupvalidation', 'type': 'PreBackupValidation'}, + } + + _subtype_map = { + 'protectable_item_type': {'SAPAseSystem': 'AzureVmWorkloadSAPAseSystemProtectableItem', 'SAPHanaDatabase': 'AzureVmWorkloadSAPHanaDatabaseProtectableItem', 'SAPHanaSystem': 'AzureVmWorkloadSAPHanaSystemProtectableItem', 'SQLAvailabilityGroupContainer': 'AzureVmWorkloadSQLAvailabilityGroupProtectableItem', 'SQLDataBase': 'AzureVmWorkloadSQLDatabaseProtectableItem', 'SQLInstance': 'AzureVmWorkloadSQLInstanceProtectableItem'} + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadProtectableItem, self).__init__(**kwargs) + self.protectable_item_type = 'AzureVmWorkloadProtectableItem' # type: str + self.parent_name = kwargs.get('parent_name', None) + self.parent_unique_name = kwargs.get('parent_unique_name', None) + self.server_name = kwargs.get('server_name', None) + self.is_auto_protectable = kwargs.get('is_auto_protectable', None) + self.is_auto_protected = kwargs.get('is_auto_protected', None) + self.subinquireditemcount = kwargs.get('subinquireditemcount', None) + self.subprotectableitemcount = kwargs.get('subprotectableitemcount', None) + self.prebackupvalidation = kwargs.get('prebackupvalidation', None) + + +class AzureVmWorkloadProtectedItem(ProtectedItem): + """Azure VM workload-specific protected item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureVmWorkloadSAPAseDatabaseProtectedItem, AzureVmWorkloadSAPHanaDatabaseProtectedItem, AzureVmWorkloadSQLDatabaseProtectedItem. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the DB represented by this backup item. + :type friendly_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param parent_name: Parent name of the DB such as Instance or Availability Group. + :type parent_name: str + :param parent_type: Parent type of protected item, example: for a DB, standalone server or + distributed. + :type parent_type: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param last_backup_status: Last backup operation status. Possible values: Healthy, Unhealthy. + Possible values include: "Invalid", "Healthy", "Unhealthy", "IRPending". + :type last_backup_status: str or ~azure.mgmt.recoveryservicesbackup.models.LastBackupStatus + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param last_backup_error_detail: Error details in last backup. + :type last_backup_error_detail: ~azure.mgmt.recoveryservicesbackup.models.ErrorDetail + :param protected_item_data_source_id: Data ID of the protected item. + :type protected_item_data_source_id: str + :param protected_item_health_status: Health status of the backup item, evaluated based on last + heartbeat received. Possible values include: "Invalid", "Healthy", "Unhealthy", "NotReachable", + "IRPending". + :type protected_item_health_status: str or + ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemHealthStatus + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureVmWorkloadProtectedItemExtendedInfo + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_type': {'key': 'parentType', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'last_backup_error_detail': {'key': 'lastBackupErrorDetail', 'type': 'ErrorDetail'}, + 'protected_item_data_source_id': {'key': 'protectedItemDataSourceId', 'type': 'str'}, + 'protected_item_health_status': {'key': 'protectedItemHealthStatus', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureVmWorkloadProtectedItemExtendedInfo'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + } + + _subtype_map = { + 'protected_item_type': {'AzureVmWorkloadSAPAseDatabase': 'AzureVmWorkloadSAPAseDatabaseProtectedItem', 'AzureVmWorkloadSAPHanaDatabase': 'AzureVmWorkloadSAPHanaDatabaseProtectedItem', 'AzureVmWorkloadSQLDatabase': 'AzureVmWorkloadSQLDatabaseProtectedItem'} + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadProtectedItem, self).__init__(**kwargs) + self.protected_item_type = 'AzureVmWorkloadProtectedItem' # type: str + self.friendly_name = kwargs.get('friendly_name', None) + self.server_name = kwargs.get('server_name', None) + self.parent_name = kwargs.get('parent_name', None) + self.parent_type = kwargs.get('parent_type', None) + self.protection_status = kwargs.get('protection_status', None) + self.protection_state = kwargs.get('protection_state', None) + self.last_backup_status = kwargs.get('last_backup_status', None) + self.last_backup_time = kwargs.get('last_backup_time', None) + self.last_backup_error_detail = kwargs.get('last_backup_error_detail', None) + self.protected_item_data_source_id = kwargs.get('protected_item_data_source_id', None) + self.protected_item_health_status = kwargs.get('protected_item_health_status', None) + self.extended_info = kwargs.get('extended_info', None) + self.kpis_healths = kwargs.get('kpis_healths', None) + + +class AzureVmWorkloadProtectedItemExtendedInfo(msrest.serialization.Model): + """Additional information on Azure Workload for SQL specific backup item. + + :param oldest_recovery_point: The oldest backup copy available for this backup item. + :type oldest_recovery_point: ~datetime.datetime + :param recovery_point_count: Number of backup copies available for this backup item. + :type recovery_point_count: int + :param policy_state: Indicates consistency of policy object and policy applied to this backup + item. + :type policy_state: str + """ + + _attribute_map = { + 'oldest_recovery_point': {'key': 'oldestRecoveryPoint', 'type': 'iso-8601'}, + 'recovery_point_count': {'key': 'recoveryPointCount', 'type': 'int'}, + 'policy_state': {'key': 'policyState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadProtectedItemExtendedInfo, self).__init__(**kwargs) + self.oldest_recovery_point = kwargs.get('oldest_recovery_point', None) + self.recovery_point_count = kwargs.get('recovery_point_count', None) + self.policy_state = kwargs.get('policy_state', None) + + +class AzureVmWorkloadProtectionPolicy(ProtectionPolicy): + """Azure VM (Mercury) workload-specific backup policy. + + All required parameters must be populated in order to send to Azure. + + :param protected_items_count: Number of items associated with this policy. + :type protected_items_count: int + :param backup_management_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 backup_management_type: str + :param work_load_type: Type of workload for the backup management. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type work_load_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param settings: Common settings for the backup management. + :type settings: ~azure.mgmt.recoveryservicesbackup.models.Settings + :param sub_protection_policy: List of sub-protection policies which includes schedule and + retention. + :type sub_protection_policy: + list[~azure.mgmt.recoveryservicesbackup.models.SubProtectionPolicy] + :param make_policy_consistent: Fix the policy inconsistency. + :type make_policy_consistent: bool + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'work_load_type': {'key': 'workLoadType', 'type': 'str'}, + 'settings': {'key': 'settings', 'type': 'Settings'}, + 'sub_protection_policy': {'key': 'subProtectionPolicy', 'type': '[SubProtectionPolicy]'}, + 'make_policy_consistent': {'key': 'makePolicyConsistent', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadProtectionPolicy, self).__init__(**kwargs) + self.backup_management_type = 'AzureWorkload' # type: str + self.work_load_type = kwargs.get('work_load_type', None) + self.settings = kwargs.get('settings', None) + self.sub_protection_policy = kwargs.get('sub_protection_policy', None) + self.make_policy_consistent = kwargs.get('make_policy_consistent', None) + + +class AzureVmWorkloadSAPAseDatabaseProtectedItem(AzureVmWorkloadProtectedItem): + """Azure VM workload-specific protected item representing SAP ASE Database. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the DB represented by this backup item. + :type friendly_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param parent_name: Parent name of the DB such as Instance or Availability Group. + :type parent_name: str + :param parent_type: Parent type of protected item, example: for a DB, standalone server or + distributed. + :type parent_type: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param last_backup_status: Last backup operation status. Possible values: Healthy, Unhealthy. + Possible values include: "Invalid", "Healthy", "Unhealthy", "IRPending". + :type last_backup_status: str or ~azure.mgmt.recoveryservicesbackup.models.LastBackupStatus + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param last_backup_error_detail: Error details in last backup. + :type last_backup_error_detail: ~azure.mgmt.recoveryservicesbackup.models.ErrorDetail + :param protected_item_data_source_id: Data ID of the protected item. + :type protected_item_data_source_id: str + :param protected_item_health_status: Health status of the backup item, evaluated based on last + heartbeat received. Possible values include: "Invalid", "Healthy", "Unhealthy", "NotReachable", + "IRPending". + :type protected_item_health_status: str or + ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemHealthStatus + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureVmWorkloadProtectedItemExtendedInfo + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_type': {'key': 'parentType', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'last_backup_error_detail': {'key': 'lastBackupErrorDetail', 'type': 'ErrorDetail'}, + 'protected_item_data_source_id': {'key': 'protectedItemDataSourceId', 'type': 'str'}, + 'protected_item_health_status': {'key': 'protectedItemHealthStatus', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureVmWorkloadProtectedItemExtendedInfo'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSAPAseDatabaseProtectedItem, self).__init__(**kwargs) + self.protected_item_type = 'AzureVmWorkloadSAPAseDatabase' # type: str + + +class AzureVmWorkloadSAPAseDatabaseWorkloadItem(AzureVmWorkloadItem): + """Azure VM workload-specific workload item representing SAP ASE Database. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if workload item is auto-protectable. + :type is_auto_protectable: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param sub_workload_item_count: For instance or AG, indicates number of DB's to be protected. + :type sub_workload_item_count: int + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'sub_workload_item_count': {'key': 'subWorkloadItemCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSAPAseDatabaseWorkloadItem, self).__init__(**kwargs) + self.workload_item_type = 'SAPAseDatabase' # type: str + + +class AzureVmWorkloadSAPAseSystemProtectableItem(AzureVmWorkloadProtectableItem): + """Azure VM workload-specific protectable item representing SAP ASE System. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param parent_unique_name: Parent Unique Name is added to provide the service formatted URI + Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + :type parent_unique_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if protectable item is auto-protectable. + :type is_auto_protectable: bool + :param is_auto_protected: Indicates if protectable item is auto-protected. + :type is_auto_protected: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param subprotectableitemcount: For instance or AG, indicates number of DB's to be protected. + :type subprotectableitemcount: int + :param prebackupvalidation: Pre-backup validation for protectable objects. + :type prebackupvalidation: ~azure.mgmt.recoveryservicesbackup.models.PreBackupValidation + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_unique_name': {'key': 'parentUniqueName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'is_auto_protected': {'key': 'isAutoProtected', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'subprotectableitemcount': {'key': 'subprotectableitemcount', 'type': 'int'}, + 'prebackupvalidation': {'key': 'prebackupvalidation', 'type': 'PreBackupValidation'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSAPAseSystemProtectableItem, self).__init__(**kwargs) + self.protectable_item_type = 'SAPAseSystem' # type: str + + +class AzureVmWorkloadSAPAseSystemWorkloadItem(AzureVmWorkloadItem): + """Azure VM workload-specific workload item representing SAP ASE System. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if workload item is auto-protectable. + :type is_auto_protectable: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param sub_workload_item_count: For instance or AG, indicates number of DB's to be protected. + :type sub_workload_item_count: int + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'sub_workload_item_count': {'key': 'subWorkloadItemCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSAPAseSystemWorkloadItem, self).__init__(**kwargs) + self.workload_item_type = 'SAPAseSystem' # type: str + + +class AzureVmWorkloadSAPHanaDatabaseProtectableItem(AzureVmWorkloadProtectableItem): + """Azure VM workload-specific protectable item representing SAP HANA Database. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param parent_unique_name: Parent Unique Name is added to provide the service formatted URI + Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + :type parent_unique_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if protectable item is auto-protectable. + :type is_auto_protectable: bool + :param is_auto_protected: Indicates if protectable item is auto-protected. + :type is_auto_protected: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param subprotectableitemcount: For instance or AG, indicates number of DB's to be protected. + :type subprotectableitemcount: int + :param prebackupvalidation: Pre-backup validation for protectable objects. + :type prebackupvalidation: ~azure.mgmt.recoveryservicesbackup.models.PreBackupValidation + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_unique_name': {'key': 'parentUniqueName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'is_auto_protected': {'key': 'isAutoProtected', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'subprotectableitemcount': {'key': 'subprotectableitemcount', 'type': 'int'}, + 'prebackupvalidation': {'key': 'prebackupvalidation', 'type': 'PreBackupValidation'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSAPHanaDatabaseProtectableItem, self).__init__(**kwargs) + self.protectable_item_type = 'SAPHanaDatabase' # type: str + + +class AzureVmWorkloadSAPHanaDatabaseProtectedItem(AzureVmWorkloadProtectedItem): + """Azure VM workload-specific protected item representing SAP HANA Database. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the DB represented by this backup item. + :type friendly_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param parent_name: Parent name of the DB such as Instance or Availability Group. + :type parent_name: str + :param parent_type: Parent type of protected item, example: for a DB, standalone server or + distributed. + :type parent_type: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param last_backup_status: Last backup operation status. Possible values: Healthy, Unhealthy. + Possible values include: "Invalid", "Healthy", "Unhealthy", "IRPending". + :type last_backup_status: str or ~azure.mgmt.recoveryservicesbackup.models.LastBackupStatus + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param last_backup_error_detail: Error details in last backup. + :type last_backup_error_detail: ~azure.mgmt.recoveryservicesbackup.models.ErrorDetail + :param protected_item_data_source_id: Data ID of the protected item. + :type protected_item_data_source_id: str + :param protected_item_health_status: Health status of the backup item, evaluated based on last + heartbeat received. Possible values include: "Invalid", "Healthy", "Unhealthy", "NotReachable", + "IRPending". + :type protected_item_health_status: str or + ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemHealthStatus + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureVmWorkloadProtectedItemExtendedInfo + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_type': {'key': 'parentType', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'last_backup_error_detail': {'key': 'lastBackupErrorDetail', 'type': 'ErrorDetail'}, + 'protected_item_data_source_id': {'key': 'protectedItemDataSourceId', 'type': 'str'}, + 'protected_item_health_status': {'key': 'protectedItemHealthStatus', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureVmWorkloadProtectedItemExtendedInfo'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSAPHanaDatabaseProtectedItem, self).__init__(**kwargs) + self.protected_item_type = 'AzureVmWorkloadSAPHanaDatabase' # type: str + + +class AzureVmWorkloadSAPHanaDatabaseWorkloadItem(AzureVmWorkloadItem): + """Azure VM workload-specific workload item representing SAP HANA Database. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if workload item is auto-protectable. + :type is_auto_protectable: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param sub_workload_item_count: For instance or AG, indicates number of DB's to be protected. + :type sub_workload_item_count: int + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'sub_workload_item_count': {'key': 'subWorkloadItemCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSAPHanaDatabaseWorkloadItem, self).__init__(**kwargs) + self.workload_item_type = 'SAPHanaDatabase' # type: str + + +class AzureVmWorkloadSAPHanaSystemProtectableItem(AzureVmWorkloadProtectableItem): + """Azure VM workload-specific protectable item representing SAP HANA System. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param parent_unique_name: Parent Unique Name is added to provide the service formatted URI + Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + :type parent_unique_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if protectable item is auto-protectable. + :type is_auto_protectable: bool + :param is_auto_protected: Indicates if protectable item is auto-protected. + :type is_auto_protected: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param subprotectableitemcount: For instance or AG, indicates number of DB's to be protected. + :type subprotectableitemcount: int + :param prebackupvalidation: Pre-backup validation for protectable objects. + :type prebackupvalidation: ~azure.mgmt.recoveryservicesbackup.models.PreBackupValidation + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_unique_name': {'key': 'parentUniqueName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'is_auto_protected': {'key': 'isAutoProtected', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'subprotectableitemcount': {'key': 'subprotectableitemcount', 'type': 'int'}, + 'prebackupvalidation': {'key': 'prebackupvalidation', 'type': 'PreBackupValidation'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSAPHanaSystemProtectableItem, self).__init__(**kwargs) + self.protectable_item_type = 'SAPHanaSystem' # type: str + + +class AzureVmWorkloadSAPHanaSystemWorkloadItem(AzureVmWorkloadItem): + """Azure VM workload-specific workload item representing SAP HANA System. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if workload item is auto-protectable. + :type is_auto_protectable: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param sub_workload_item_count: For instance or AG, indicates number of DB's to be protected. + :type sub_workload_item_count: int + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'sub_workload_item_count': {'key': 'subWorkloadItemCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSAPHanaSystemWorkloadItem, self).__init__(**kwargs) + self.workload_item_type = 'SAPHanaSystem' # type: str + + +class AzureVmWorkloadSQLAvailabilityGroupProtectableItem(AzureVmWorkloadProtectableItem): + """Azure VM workload-specific protectable item representing SQL Availability Group. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param parent_unique_name: Parent Unique Name is added to provide the service formatted URI + Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + :type parent_unique_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if protectable item is auto-protectable. + :type is_auto_protectable: bool + :param is_auto_protected: Indicates if protectable item is auto-protected. + :type is_auto_protected: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param subprotectableitemcount: For instance or AG, indicates number of DB's to be protected. + :type subprotectableitemcount: int + :param prebackupvalidation: Pre-backup validation for protectable objects. + :type prebackupvalidation: ~azure.mgmt.recoveryservicesbackup.models.PreBackupValidation + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_unique_name': {'key': 'parentUniqueName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'is_auto_protected': {'key': 'isAutoProtected', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'subprotectableitemcount': {'key': 'subprotectableitemcount', 'type': 'int'}, + 'prebackupvalidation': {'key': 'prebackupvalidation', 'type': 'PreBackupValidation'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSQLAvailabilityGroupProtectableItem, self).__init__(**kwargs) + self.protectable_item_type = 'SQLAvailabilityGroupContainer' # type: str + + +class AzureVmWorkloadSQLDatabaseProtectableItem(AzureVmWorkloadProtectableItem): + """Azure VM workload-specific protectable item representing SQL Database. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param parent_unique_name: Parent Unique Name is added to provide the service formatted URI + Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + :type parent_unique_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if protectable item is auto-protectable. + :type is_auto_protectable: bool + :param is_auto_protected: Indicates if protectable item is auto-protected. + :type is_auto_protected: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param subprotectableitemcount: For instance or AG, indicates number of DB's to be protected. + :type subprotectableitemcount: int + :param prebackupvalidation: Pre-backup validation for protectable objects. + :type prebackupvalidation: ~azure.mgmt.recoveryservicesbackup.models.PreBackupValidation + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_unique_name': {'key': 'parentUniqueName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'is_auto_protected': {'key': 'isAutoProtected', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'subprotectableitemcount': {'key': 'subprotectableitemcount', 'type': 'int'}, + 'prebackupvalidation': {'key': 'prebackupvalidation', 'type': 'PreBackupValidation'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSQLDatabaseProtectableItem, self).__init__(**kwargs) + self.protectable_item_type = 'SQLDataBase' # type: str + + +class AzureVmWorkloadSQLDatabaseProtectedItem(AzureVmWorkloadProtectedItem): + """Azure VM workload-specific protected item representing SQL Database. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the DB represented by this backup item. + :type friendly_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param parent_name: Parent name of the DB such as Instance or Availability Group. + :type parent_name: str + :param parent_type: Parent type of protected item, example: for a DB, standalone server or + distributed. + :type parent_type: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param last_backup_status: Last backup operation status. Possible values: Healthy, Unhealthy. + Possible values include: "Invalid", "Healthy", "Unhealthy", "IRPending". + :type last_backup_status: str or ~azure.mgmt.recoveryservicesbackup.models.LastBackupStatus + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param last_backup_error_detail: Error details in last backup. + :type last_backup_error_detail: ~azure.mgmt.recoveryservicesbackup.models.ErrorDetail + :param protected_item_data_source_id: Data ID of the protected item. + :type protected_item_data_source_id: str + :param protected_item_health_status: Health status of the backup item, evaluated based on last + heartbeat received. Possible values include: "Invalid", "Healthy", "Unhealthy", "NotReachable", + "IRPending". + :type protected_item_health_status: str or + ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemHealthStatus + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureVmWorkloadProtectedItemExtendedInfo + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_type': {'key': 'parentType', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'last_backup_error_detail': {'key': 'lastBackupErrorDetail', 'type': 'ErrorDetail'}, + 'protected_item_data_source_id': {'key': 'protectedItemDataSourceId', 'type': 'str'}, + 'protected_item_health_status': {'key': 'protectedItemHealthStatus', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureVmWorkloadProtectedItemExtendedInfo'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSQLDatabaseProtectedItem, self).__init__(**kwargs) + self.protected_item_type = 'AzureVmWorkloadSQLDatabase' # type: str + + +class AzureVmWorkloadSQLDatabaseWorkloadItem(AzureVmWorkloadItem): + """Azure VM workload-specific workload item representing SQL Database. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if workload item is auto-protectable. + :type is_auto_protectable: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param sub_workload_item_count: For instance or AG, indicates number of DB's to be protected. + :type sub_workload_item_count: int + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'sub_workload_item_count': {'key': 'subWorkloadItemCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSQLDatabaseWorkloadItem, self).__init__(**kwargs) + self.workload_item_type = 'SQLDataBase' # type: str + + +class AzureVmWorkloadSQLInstanceProtectableItem(AzureVmWorkloadProtectableItem): + """Azure VM workload-specific protectable item representing SQL Instance. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param parent_unique_name: Parent Unique Name is added to provide the service formatted URI + Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + :type parent_unique_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if protectable item is auto-protectable. + :type is_auto_protectable: bool + :param is_auto_protected: Indicates if protectable item is auto-protected. + :type is_auto_protected: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param subprotectableitemcount: For instance or AG, indicates number of DB's to be protected. + :type subprotectableitemcount: int + :param prebackupvalidation: Pre-backup validation for protectable objects. + :type prebackupvalidation: ~azure.mgmt.recoveryservicesbackup.models.PreBackupValidation + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_unique_name': {'key': 'parentUniqueName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'is_auto_protected': {'key': 'isAutoProtected', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'subprotectableitemcount': {'key': 'subprotectableitemcount', 'type': 'int'}, + 'prebackupvalidation': {'key': 'prebackupvalidation', 'type': 'PreBackupValidation'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSQLInstanceProtectableItem, self).__init__(**kwargs) + self.protectable_item_type = 'SQLInstance' # type: str + + +class AzureVmWorkloadSQLInstanceWorkloadItem(AzureVmWorkloadItem): + """Azure VM workload-specific workload item representing SQL Instance. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if workload item is auto-protectable. + :type is_auto_protectable: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param sub_workload_item_count: For instance or AG, indicates number of DB's to be protected. + :type sub_workload_item_count: int + :param data_directory_paths: Data Directory Paths for default directories. + :type data_directory_paths: list[~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectory] + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'sub_workload_item_count': {'key': 'subWorkloadItemCount', 'type': 'int'}, + 'data_directory_paths': {'key': 'dataDirectoryPaths', 'type': '[SQLDataDirectory]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureVmWorkloadSQLInstanceWorkloadItem, self).__init__(**kwargs) + self.workload_item_type = 'SQLInstance' # type: str + self.data_directory_paths = kwargs.get('data_directory_paths', None) + + +class AzureWorkloadAutoProtectionIntent(AzureRecoveryServiceVaultProtectionIntent): + """Azure Recovery Services Vault specific protection intent item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSQLAutoProtectionIntent. + + All required parameters must be populated in order to send to Azure. + + :param protection_intent_item_type: Required. backup protectionIntent type.Constant filled by + server. + :type protection_intent_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param item_id: ID of the item which is getting protected, In case of Azure Vm , it is + ProtectedItemId. + :type item_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + """ + + _validation = { + 'protection_intent_item_type': {'required': True}, + } + + _attribute_map = { + 'protection_intent_item_type': {'key': 'protectionIntentItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'item_id': {'key': 'itemId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + } + + _subtype_map = { + 'protection_intent_item_type': {'AzureWorkloadSQLAutoProtectionIntent': 'AzureWorkloadSQLAutoProtectionIntent'} + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadAutoProtectionIntent, self).__init__(**kwargs) + self.protection_intent_item_type = 'AzureWorkloadAutoProtectionIntent' # type: str + + +class AzureWorkloadBackupRequest(BackupRequest): + """AzureWorkload workload-specific backup request. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param backup_type: Type of backup, viz. Full, Differential, Log or CopyOnlyFull. Possible + values include: "Invalid", "Full", "Differential", "Log", "CopyOnlyFull", "Incremental". + :type backup_type: str or ~azure.mgmt.recoveryservicesbackup.models.BackupType + :param enable_compression: Bool for Compression setting. + :type enable_compression: bool + :param recovery_point_expiry_time_in_utc: Backup copy will expire after the time specified + (UTC). + :type recovery_point_expiry_time_in_utc: ~datetime.datetime + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'backup_type': {'key': 'backupType', 'type': 'str'}, + 'enable_compression': {'key': 'enableCompression', 'type': 'bool'}, + 'recovery_point_expiry_time_in_utc': {'key': 'recoveryPointExpiryTimeInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadBackupRequest, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadBackupRequest' # type: str + self.backup_type = kwargs.get('backup_type', None) + self.enable_compression = kwargs.get('enable_compression', None) + self.recovery_point_expiry_time_in_utc = kwargs.get('recovery_point_expiry_time_in_utc', None) + + +class AzureWorkloadContainerExtendedInfo(msrest.serialization.Model): + """Extended information of the container. + + :param host_server_name: Host Os Name in case of Stand Alone and Cluster Name in case of + distributed container. + :type host_server_name: str + :param inquiry_info: Inquiry Status for the container. + :type inquiry_info: ~azure.mgmt.recoveryservicesbackup.models.InquiryInfo + :param nodes_list: List of the nodes in case of distributed container. + :type nodes_list: list[~azure.mgmt.recoveryservicesbackup.models.DistributedNodesInfo] + """ + + _attribute_map = { + 'host_server_name': {'key': 'hostServerName', 'type': 'str'}, + 'inquiry_info': {'key': 'inquiryInfo', 'type': 'InquiryInfo'}, + 'nodes_list': {'key': 'nodesList', 'type': '[DistributedNodesInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadContainerExtendedInfo, self).__init__(**kwargs) + self.host_server_name = kwargs.get('host_server_name', None) + self.inquiry_info = kwargs.get('inquiry_info', None) + self.nodes_list = kwargs.get('nodes_list', None) + + +class AzureWorkloadErrorInfo(msrest.serialization.Model): + """Azure storage specific error information. + + :param error_code: Error code. + :type error_code: int + :param error_string: Localized error string. + :type error_string: str + :param error_title: Title: Typically, the entity that the error pertains to. + :type error_title: str + :param recommendations: List of localized recommendations for above error code. + :type recommendations: list[str] + :param additional_details: Additional details for above error code. + :type additional_details: str + """ + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'error_string': {'key': 'errorString', 'type': 'str'}, + 'error_title': {'key': 'errorTitle', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + 'additional_details': {'key': 'additionalDetails', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadErrorInfo, self).__init__(**kwargs) + self.error_code = kwargs.get('error_code', None) + self.error_string = kwargs.get('error_string', None) + self.error_title = kwargs.get('error_title', None) + self.recommendations = kwargs.get('recommendations', None) + self.additional_details = kwargs.get('additional_details', None) + + +class AzureWorkloadJob(Job): + """Azure storage specific job. + + All required parameters must be populated in order to send to Azure. + + :param entity_friendly_name: Friendly name of the entity on which the current job is executing. + :type entity_friendly_name: str + :param backup_management_type: Backup management type to execute the current job. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: The operation name. + :type operation: str + :param status: Job status. + :type status: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param activity_id: ActivityId of job. + :type activity_id: str + :param job_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 job_type: str + :param workload_type: Workload type of the job. + :type workload_type: str + :param duration: Time elapsed during the execution of this job. + :type duration: ~datetime.timedelta + :param actions_info: Gets or sets the state/actions applicable on this job like cancel/retry. + :type actions_info: list[str or ~azure.mgmt.recoveryservicesbackup.models.JobSupportedAction] + :param error_details: Error details on execution of this job. + :type error_details: list[~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadErrorInfo] + :param extended_info: Additional information about the job. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadJobExtendedInfo + """ + + _validation = { + 'job_type': {'required': True}, + } + + _attribute_map = { + 'entity_friendly_name': {'key': 'entityFriendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'actions_info': {'key': 'actionsInfo', 'type': '[str]'}, + 'error_details': {'key': 'errorDetails', 'type': '[AzureWorkloadErrorInfo]'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadJobExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadJob, self).__init__(**kwargs) + self.job_type = 'AzureWorkloadJob' # type: str + self.workload_type = kwargs.get('workload_type', None) + self.duration = kwargs.get('duration', None) + self.actions_info = kwargs.get('actions_info', None) + self.error_details = kwargs.get('error_details', None) + self.extended_info = kwargs.get('extended_info', None) + + +class AzureWorkloadJobExtendedInfo(msrest.serialization.Model): + """Azure VM workload-specific additional information for job. + + :param tasks_list: List of tasks for this job. + :type tasks_list: list[~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadJobTaskDetails] + :param property_bag: Job properties. + :type property_bag: dict[str, str] + :param dynamic_error_message: Non localized error message on job execution. + :type dynamic_error_message: str + """ + + _attribute_map = { + 'tasks_list': {'key': 'tasksList', 'type': '[AzureWorkloadJobTaskDetails]'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'dynamic_error_message': {'key': 'dynamicErrorMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadJobExtendedInfo, self).__init__(**kwargs) + self.tasks_list = kwargs.get('tasks_list', None) + self.property_bag = kwargs.get('property_bag', None) + self.dynamic_error_message = kwargs.get('dynamic_error_message', None) + + +class AzureWorkloadJobTaskDetails(msrest.serialization.Model): + """Azure VM workload specific job task details. + + :param task_id: The task display name. + :type task_id: str + :param status: The status. + :type status: str + """ + + _attribute_map = { + 'task_id': {'key': 'taskId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadJobTaskDetails, self).__init__(**kwargs) + self.task_id = kwargs.get('task_id', None) + self.status = kwargs.get('status', None) + + +class AzureWorkloadRecoveryPoint(RecoveryPoint): + """Workload specific recovery point, specifically encapsulates full/diff recovery point. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadPointInTimeRecoveryPoint, AzureWorkloadSAPHanaRecoveryPoint, AzureWorkloadSQLRecoveryPoint. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_time_in_utc: UTC time at which recovery point was created. + :type recovery_point_time_in_utc: ~datetime.datetime + :param type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadPointInTimeRecoveryPoint': 'AzureWorkloadPointInTimeRecoveryPoint', 'AzureWorkloadSAPHanaRecoveryPoint': 'AzureWorkloadSAPHanaRecoveryPoint', 'AzureWorkloadSQLRecoveryPoint': 'AzureWorkloadSQLRecoveryPoint'} + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadRecoveryPoint, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadRecoveryPoint' # type: str + self.recovery_point_time_in_utc = kwargs.get('recovery_point_time_in_utc', None) + self.type = kwargs.get('type', None) + self.recovery_point_tier_details = kwargs.get('recovery_point_tier_details', None) + self.recovery_point_move_readiness_info = kwargs.get('recovery_point_move_readiness_info', None) + + +class AzureWorkloadPointInTimeRecoveryPoint(AzureWorkloadRecoveryPoint): + """Recovery point specific to PointInTime. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSAPHanaPointInTimeRecoveryPoint. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_time_in_utc: UTC time at which recovery point was created. + :type recovery_point_time_in_utc: ~datetime.datetime + :param type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param time_ranges: List of log ranges. + :type time_ranges: list[~azure.mgmt.recoveryservicesbackup.models.PointInTimeRange] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'time_ranges': {'key': 'timeRanges', 'type': '[PointInTimeRange]'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSAPHanaPointInTimeRecoveryPoint': 'AzureWorkloadSAPHanaPointInTimeRecoveryPoint'} + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadPointInTimeRecoveryPoint, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadPointInTimeRecoveryPoint' # type: str + self.time_ranges = kwargs.get('time_ranges', None) + + +class AzureWorkloadRecoveryPointAutoGenerated(RecoveryPoint): + """Workload specific recovery point, specifically encapsulates full/diff recovery point. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadPointInTimeRecoveryPointAutoGenerated, AzureWorkloadSAPHanaRecoveryPointAutoGenerated, AzureWorkloadSQLRecoveryPointAutoGenerated. + + 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 object_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 object_type: str + :ivar recovery_point_time_in_utc: UTC time at which recovery point was created. + :vartype recovery_point_time_in_utc: ~datetime.datetime + :ivar type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :vartype type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_time_in_utc': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadPointInTimeRecoveryPoint': 'AzureWorkloadPointInTimeRecoveryPointAutoGenerated', 'AzureWorkloadSAPHanaRecoveryPoint': 'AzureWorkloadSAPHanaRecoveryPointAutoGenerated', 'AzureWorkloadSQLRecoveryPoint': 'AzureWorkloadSQLRecoveryPointAutoGenerated'} + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadRecoveryPointAutoGenerated, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadRecoveryPoint' # type: str + self.recovery_point_time_in_utc = None + self.type = None + self.recovery_point_tier_details = kwargs.get('recovery_point_tier_details', None) + self.recovery_point_move_readiness_info = kwargs.get('recovery_point_move_readiness_info', None) + + +class AzureWorkloadPointInTimeRecoveryPointAutoGenerated(AzureWorkloadRecoveryPointAutoGenerated): + """Recovery point specific to PointInTime. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSAPHanaPointInTimeRecoveryPointAutoGenerated. + + 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 object_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 object_type: str + :ivar recovery_point_time_in_utc: UTC time at which recovery point was created. + :vartype recovery_point_time_in_utc: ~datetime.datetime + :ivar type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :vartype type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param time_ranges: List of log ranges. + :type time_ranges: list[~azure.mgmt.recoveryservicesbackup.models.PointInTimeRange] + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_time_in_utc': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'time_ranges': {'key': 'timeRanges', 'type': '[PointInTimeRange]'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSAPHanaPointInTimeRecoveryPoint': 'AzureWorkloadSAPHanaPointInTimeRecoveryPointAutoGenerated'} + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadPointInTimeRecoveryPointAutoGenerated, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadPointInTimeRecoveryPoint' # type: str + self.time_ranges = kwargs.get('time_ranges', None) + + +class AzureWorkloadRestoreRequest(RestoreRequest): + """AzureWorkload-specific restore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadPointInTimeRestoreRequest, AzureWorkloadSAPHanaRestoreRequest, AzureWorkloadSQLRestoreRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadPointInTimeRestoreRequest': 'AzureWorkloadPointInTimeRestoreRequest', 'AzureWorkloadSAPHanaRestoreRequest': 'AzureWorkloadSAPHanaRestoreRequest', 'AzureWorkloadSQLRestoreRequest': 'AzureWorkloadSQLRestoreRequest'} + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadRestoreRequest, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadRestoreRequest' # type: str + self.recovery_type = kwargs.get('recovery_type', None) + self.source_resource_id = kwargs.get('source_resource_id', None) + self.property_bag = kwargs.get('property_bag', None) + self.target_info = kwargs.get('target_info', None) + self.recovery_mode = kwargs.get('recovery_mode', None) + self.target_virtual_machine_id = kwargs.get('target_virtual_machine_id', None) + + +class AzureWorkloadPointInTimeRestoreRequest(AzureWorkloadRestoreRequest): + """AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param point_in_time: PointInTime value. + :type point_in_time: ~datetime.datetime + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'point_in_time': {'key': 'pointInTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadPointInTimeRestoreRequest, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadPointInTimeRestoreRequest' # type: str + self.point_in_time = kwargs.get('point_in_time', None) + + +class AzureWorkloadSAPHanaPointInTimeRecoveryPoint(AzureWorkloadPointInTimeRecoveryPoint): + """Recovery point specific to PointInTime in SAPHana. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_time_in_utc: UTC time at which recovery point was created. + :type recovery_point_time_in_utc: ~datetime.datetime + :param type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param time_ranges: List of log ranges. + :type time_ranges: list[~azure.mgmt.recoveryservicesbackup.models.PointInTimeRange] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'time_ranges': {'key': 'timeRanges', 'type': '[PointInTimeRange]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSAPHanaPointInTimeRecoveryPoint, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSAPHanaPointInTimeRecoveryPoint' # type: str + + +class AzureWorkloadSAPHanaPointInTimeRecoveryPointAutoGenerated(AzureWorkloadPointInTimeRecoveryPointAutoGenerated): + """Recovery point specific to PointInTime in SAPHana. + + 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 object_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 object_type: str + :ivar recovery_point_time_in_utc: UTC time at which recovery point was created. + :vartype recovery_point_time_in_utc: ~datetime.datetime + :ivar type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :vartype type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param time_ranges: List of log ranges. + :type time_ranges: list[~azure.mgmt.recoveryservicesbackup.models.PointInTimeRange] + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_time_in_utc': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'time_ranges': {'key': 'timeRanges', 'type': '[PointInTimeRange]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSAPHanaPointInTimeRecoveryPointAutoGenerated, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSAPHanaPointInTimeRecoveryPoint' # type: str + + +class AzureWorkloadSAPHanaRestoreRequest(AzureWorkloadRestoreRequest): + """AzureWorkload SAP Hana-specific restore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSAPHanaPointInTimeRestoreRequest, AzureWorkloadSAPHanaRestoreWithRehydrateRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSAPHanaPointInTimeRestoreRequest': 'AzureWorkloadSAPHanaPointInTimeRestoreRequest', 'AzureWorkloadSAPHanaRestoreWithRehydrateRequest': 'AzureWorkloadSAPHanaRestoreWithRehydrateRequest'} + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSAPHanaRestoreRequest, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSAPHanaRestoreRequest' # type: str + + +class AzureWorkloadSAPHanaPointInTimeRestoreRequest(AzureWorkloadSAPHanaRestoreRequest): + """AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param point_in_time: PointInTime value. + :type point_in_time: ~datetime.datetime + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'point_in_time': {'key': 'pointInTime', 'type': 'iso-8601'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest': 'AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest'} + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSAPHanaPointInTimeRestoreRequest, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSAPHanaPointInTimeRestoreRequest' # type: str + self.point_in_time = kwargs.get('point_in_time', None) + + +class AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest(AzureWorkloadSAPHanaPointInTimeRestoreRequest): + """AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param point_in_time: PointInTime value. + :type point_in_time: ~datetime.datetime + :param recovery_point_rehydration_info: RP Rehydration Info. + :type recovery_point_rehydration_info: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointRehydrationInfo + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'point_in_time': {'key': 'pointInTime', 'type': 'iso-8601'}, + 'recovery_point_rehydration_info': {'key': 'recoveryPointRehydrationInfo', 'type': 'RecoveryPointRehydrationInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest' # type: str + self.recovery_point_rehydration_info = kwargs.get('recovery_point_rehydration_info', None) + + +class AzureWorkloadSAPHanaRecoveryPoint(AzureWorkloadRecoveryPoint): + """SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_time_in_utc: UTC time at which recovery point was created. + :type recovery_point_time_in_utc: ~datetime.datetime + :param type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSAPHanaRecoveryPoint, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSAPHanaRecoveryPoint' # type: str + + +class AzureWorkloadSAPHanaRecoveryPointAutoGenerated(AzureWorkloadRecoveryPointAutoGenerated): + """SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints. + + 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 object_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 object_type: str + :ivar recovery_point_time_in_utc: UTC time at which recovery point was created. + :vartype recovery_point_time_in_utc: ~datetime.datetime + :ivar type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :vartype type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_time_in_utc': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSAPHanaRecoveryPointAutoGenerated, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSAPHanaRecoveryPoint' # type: str + + +class AzureWorkloadSAPHanaRestoreWithRehydrateRequest(AzureWorkloadSAPHanaRestoreRequest): + """AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param recovery_point_rehydration_info: RP Rehydration Info. + :type recovery_point_rehydration_info: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointRehydrationInfo + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'recovery_point_rehydration_info': {'key': 'recoveryPointRehydrationInfo', 'type': 'RecoveryPointRehydrationInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSAPHanaRestoreWithRehydrateRequest, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSAPHanaRestoreWithRehydrateRequest' # type: str + self.recovery_point_rehydration_info = kwargs.get('recovery_point_rehydration_info', None) + + +class AzureWorkloadSQLAutoProtectionIntent(AzureWorkloadAutoProtectionIntent): + """Azure Workload SQL Auto Protection intent item. + + All required parameters must be populated in order to send to Azure. + + :param protection_intent_item_type: Required. backup protectionIntent type.Constant filled by + server. + :type protection_intent_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param item_id: ID of the item which is getting protected, In case of Azure Vm , it is + ProtectedItemId. + :type item_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param workload_item_type: Workload item type of the item for which intent is to be set. + Possible values include: "Invalid", "SQLInstance", "SQLDataBase", "SAPHanaSystem", + "SAPHanaDatabase", "SAPAseSystem", "SAPAseDatabase". + :type workload_item_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadItemType + """ + + _validation = { + 'protection_intent_item_type': {'required': True}, + } + + _attribute_map = { + 'protection_intent_item_type': {'key': 'protectionIntentItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'item_id': {'key': 'itemId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSQLAutoProtectionIntent, self).__init__(**kwargs) + self.protection_intent_item_type = 'AzureWorkloadSQLAutoProtectionIntent' # type: str + self.workload_item_type = kwargs.get('workload_item_type', None) + + +class AzureWorkloadSQLRecoveryPoint(AzureWorkloadRecoveryPoint): + """SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSQLPointInTimeRecoveryPoint. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_time_in_utc: UTC time at which recovery point was created. + :type recovery_point_time_in_utc: ~datetime.datetime + :param type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param extended_info: Extended Info that provides data directory details. Will be populated in + two cases: + When a specific recovery point is accessed using GetRecoveryPoint + Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadSQLRecoveryPointExtendedInfo + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadSQLRecoveryPointExtendedInfo'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSQLPointInTimeRecoveryPoint': 'AzureWorkloadSQLPointInTimeRecoveryPoint'} + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSQLRecoveryPoint, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSQLRecoveryPoint' # type: str + self.extended_info = kwargs.get('extended_info', None) + + +class AzureWorkloadSQLPointInTimeRecoveryPoint(AzureWorkloadSQLRecoveryPoint): + """Recovery point specific to PointInTime. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_time_in_utc: UTC time at which recovery point was created. + :type recovery_point_time_in_utc: ~datetime.datetime + :param type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param extended_info: Extended Info that provides data directory details. Will be populated in + two cases: + When a specific recovery point is accessed using GetRecoveryPoint + Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadSQLRecoveryPointExtendedInfo + :param time_ranges: List of log ranges. + :type time_ranges: list[~azure.mgmt.recoveryservicesbackup.models.PointInTimeRange] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadSQLRecoveryPointExtendedInfo'}, + 'time_ranges': {'key': 'timeRanges', 'type': '[PointInTimeRange]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSQLPointInTimeRecoveryPoint, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSQLPointInTimeRecoveryPoint' # type: str + self.time_ranges = kwargs.get('time_ranges', None) + + +class AzureWorkloadSQLRecoveryPointAutoGenerated(AzureWorkloadRecoveryPointAutoGenerated): + """SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSQLPointInTimeRecoveryPointAutoGenerated. + + 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 object_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 object_type: str + :ivar recovery_point_time_in_utc: UTC time at which recovery point was created. + :vartype recovery_point_time_in_utc: ~datetime.datetime + :ivar type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :vartype type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param extended_info: Extended Info that provides data directory details. Will be populated in + two cases: + When a specific recovery point is accessed using GetRecoveryPoint + Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_time_in_utc': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSQLPointInTimeRecoveryPoint': 'AzureWorkloadSQLPointInTimeRecoveryPointAutoGenerated'} + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSQLRecoveryPointAutoGenerated, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSQLRecoveryPoint' # type: str + self.extended_info = kwargs.get('extended_info', None) + + +class AzureWorkloadSQLPointInTimeRecoveryPointAutoGenerated(AzureWorkloadSQLRecoveryPointAutoGenerated): + """Recovery point specific to PointInTime. + + 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 object_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 object_type: str + :ivar recovery_point_time_in_utc: UTC time at which recovery point was created. + :vartype recovery_point_time_in_utc: ~datetime.datetime + :ivar type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :vartype type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param extended_info: Extended Info that provides data directory details. Will be populated in + two cases: + When a specific recovery point is accessed using GetRecoveryPoint + Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated + :param time_ranges: List of log ranges. + :type time_ranges: list[~azure.mgmt.recoveryservicesbackup.models.PointInTimeRange] + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_time_in_utc': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated'}, + 'time_ranges': {'key': 'timeRanges', 'type': '[PointInTimeRange]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSQLPointInTimeRecoveryPointAutoGenerated, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSQLPointInTimeRecoveryPoint' # type: str + self.time_ranges = kwargs.get('time_ranges', None) + + +class AzureWorkloadSQLRestoreRequest(AzureWorkloadRestoreRequest): + """AzureWorkload SQL -specific restore. Specifically for full/diff restore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSQLPointInTimeRestoreRequest, AzureWorkloadSQLRestoreWithRehydrateRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param should_use_alternate_target_location: Default option set to true. If this is set to + false, alternate data directory must be provided. + :type should_use_alternate_target_location: bool + :param is_non_recoverable: SQL specific property where user can chose to set no-recovery when + restore operation is tried. + :type is_non_recoverable: bool + :param alternate_directory_paths: Data directory details. + :type alternate_directory_paths: + list[~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectoryMapping] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'should_use_alternate_target_location': {'key': 'shouldUseAlternateTargetLocation', 'type': 'bool'}, + 'is_non_recoverable': {'key': 'isNonRecoverable', 'type': 'bool'}, + 'alternate_directory_paths': {'key': 'alternateDirectoryPaths', 'type': '[SQLDataDirectoryMapping]'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSQLPointInTimeRestoreRequest': 'AzureWorkloadSQLPointInTimeRestoreRequest', 'AzureWorkloadSQLRestoreWithRehydrateRequest': 'AzureWorkloadSQLRestoreWithRehydrateRequest'} + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSQLRestoreRequest, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSQLRestoreRequest' # type: str + self.should_use_alternate_target_location = kwargs.get('should_use_alternate_target_location', None) + self.is_non_recoverable = kwargs.get('is_non_recoverable', None) + self.alternate_directory_paths = kwargs.get('alternate_directory_paths', None) + + +class AzureWorkloadSQLPointInTimeRestoreRequest(AzureWorkloadSQLRestoreRequest): + """AzureWorkload SQL -specific restore. Specifically for PointInTime/Log restore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param should_use_alternate_target_location: Default option set to true. If this is set to + false, alternate data directory must be provided. + :type should_use_alternate_target_location: bool + :param is_non_recoverable: SQL specific property where user can chose to set no-recovery when + restore operation is tried. + :type is_non_recoverable: bool + :param alternate_directory_paths: Data directory details. + :type alternate_directory_paths: + list[~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectoryMapping] + :param point_in_time: PointInTime value. + :type point_in_time: ~datetime.datetime + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'should_use_alternate_target_location': {'key': 'shouldUseAlternateTargetLocation', 'type': 'bool'}, + 'is_non_recoverable': {'key': 'isNonRecoverable', 'type': 'bool'}, + 'alternate_directory_paths': {'key': 'alternateDirectoryPaths', 'type': '[SQLDataDirectoryMapping]'}, + 'point_in_time': {'key': 'pointInTime', 'type': 'iso-8601'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest': 'AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest'} + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSQLPointInTimeRestoreRequest, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSQLPointInTimeRestoreRequest' # type: str + self.point_in_time = kwargs.get('point_in_time', None) + + +class AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest(AzureWorkloadSQLPointInTimeRestoreRequest): + """AzureWorkload SQL-specific restore with integrated rehydration of recovery point. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param should_use_alternate_target_location: Default option set to true. If this is set to + false, alternate data directory must be provided. + :type should_use_alternate_target_location: bool + :param is_non_recoverable: SQL specific property where user can chose to set no-recovery when + restore operation is tried. + :type is_non_recoverable: bool + :param alternate_directory_paths: Data directory details. + :type alternate_directory_paths: + list[~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectoryMapping] + :param point_in_time: PointInTime value. + :type point_in_time: ~datetime.datetime + :param recovery_point_rehydration_info: RP Rehydration Info. + :type recovery_point_rehydration_info: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointRehydrationInfo + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'should_use_alternate_target_location': {'key': 'shouldUseAlternateTargetLocation', 'type': 'bool'}, + 'is_non_recoverable': {'key': 'isNonRecoverable', 'type': 'bool'}, + 'alternate_directory_paths': {'key': 'alternateDirectoryPaths', 'type': '[SQLDataDirectoryMapping]'}, + 'point_in_time': {'key': 'pointInTime', 'type': 'iso-8601'}, + 'recovery_point_rehydration_info': {'key': 'recoveryPointRehydrationInfo', 'type': 'RecoveryPointRehydrationInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest' # type: str + self.recovery_point_rehydration_info = kwargs.get('recovery_point_rehydration_info', None) + + +class AzureWorkloadSQLRecoveryPointExtendedInfo(msrest.serialization.Model): + """Extended info class details. + + :param data_directory_time_in_utc: UTC time at which data directory info was captured. + :type data_directory_time_in_utc: ~datetime.datetime + :param data_directory_paths: List of data directory paths during restore operation. + :type data_directory_paths: list[~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectory] + """ + + _attribute_map = { + 'data_directory_time_in_utc': {'key': 'dataDirectoryTimeInUTC', 'type': 'iso-8601'}, + 'data_directory_paths': {'key': 'dataDirectoryPaths', 'type': '[SQLDataDirectory]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSQLRecoveryPointExtendedInfo, self).__init__(**kwargs) + self.data_directory_time_in_utc = kwargs.get('data_directory_time_in_utc', None) + self.data_directory_paths = kwargs.get('data_directory_paths', None) + + +class AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated(msrest.serialization.Model): + """Extended info class details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar data_directory_time_in_utc: UTC time at which data directory info was captured. + :vartype data_directory_time_in_utc: ~datetime.datetime + :ivar data_directory_paths: List of data directory paths during restore operation. + :vartype data_directory_paths: list[~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectory] + """ + + _validation = { + 'data_directory_time_in_utc': {'readonly': True}, + 'data_directory_paths': {'readonly': True}, + } + + _attribute_map = { + 'data_directory_time_in_utc': {'key': 'dataDirectoryTimeInUTC', 'type': 'iso-8601'}, + 'data_directory_paths': {'key': 'dataDirectoryPaths', 'type': '[SQLDataDirectory]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated, self).__init__(**kwargs) + self.data_directory_time_in_utc = None + self.data_directory_paths = None + + +class AzureWorkloadSQLRestoreWithRehydrateRequest(AzureWorkloadSQLRestoreRequest): + """AzureWorkload SQL-specific restore with integrated rehydration of recovery point. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param should_use_alternate_target_location: Default option set to true. If this is set to + false, alternate data directory must be provided. + :type should_use_alternate_target_location: bool + :param is_non_recoverable: SQL specific property where user can chose to set no-recovery when + restore operation is tried. + :type is_non_recoverable: bool + :param alternate_directory_paths: Data directory details. + :type alternate_directory_paths: + list[~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectoryMapping] + :param recovery_point_rehydration_info: RP Rehydration Info. + :type recovery_point_rehydration_info: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointRehydrationInfo + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'should_use_alternate_target_location': {'key': 'shouldUseAlternateTargetLocation', 'type': 'bool'}, + 'is_non_recoverable': {'key': 'isNonRecoverable', 'type': 'bool'}, + 'alternate_directory_paths': {'key': 'alternateDirectoryPaths', 'type': '[SQLDataDirectoryMapping]'}, + 'recovery_point_rehydration_info': {'key': 'recoveryPointRehydrationInfo', 'type': 'RecoveryPointRehydrationInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSQLRestoreWithRehydrateRequest, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadSQLRestoreWithRehydrateRequest' # type: str + self.recovery_point_rehydration_info = kwargs.get('recovery_point_rehydration_info', None) + + +class BackupEngineBaseResource(Resource): + """The base backup engine class. All workload specific backup engines derive from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: BackupEngineBaseResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.BackupEngineBase + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BackupEngineBase'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupEngineBaseResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ResourceList(msrest.serialization.Model): + """Base for all lists of resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + + +class BackupEngineBaseResourceList(ResourceList): + """List of BackupEngineBase resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.BackupEngineBaseResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[BackupEngineBaseResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupEngineBaseResourceList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class BackupEngineExtendedInfo(msrest.serialization.Model): + """Additional information on backup engine. + + :param database_name: Database name of backup engine. + :type database_name: str + :param protected_items_count: Number of protected items in the backup engine. + :type protected_items_count: int + :param protected_servers_count: Number of protected servers in the backup engine. + :type protected_servers_count: int + :param disk_count: Number of disks in the backup engine. + :type disk_count: int + :param used_disk_space: Disk space used in the backup engine. + :type used_disk_space: float + :param available_disk_space: Disk space currently available in the backup engine. + :type available_disk_space: float + :param refreshed_at: Last refresh time in the backup engine. + :type refreshed_at: ~datetime.datetime + :param azure_protected_instances: Protected instances in the backup engine. + :type azure_protected_instances: int + """ + + _attribute_map = { + 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'protected_servers_count': {'key': 'protectedServersCount', 'type': 'int'}, + 'disk_count': {'key': 'diskCount', 'type': 'int'}, + 'used_disk_space': {'key': 'usedDiskSpace', 'type': 'float'}, + 'available_disk_space': {'key': 'availableDiskSpace', 'type': 'float'}, + 'refreshed_at': {'key': 'refreshedAt', 'type': 'iso-8601'}, + 'azure_protected_instances': {'key': 'azureProtectedInstances', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupEngineExtendedInfo, self).__init__(**kwargs) + self.database_name = kwargs.get('database_name', None) + self.protected_items_count = kwargs.get('protected_items_count', None) + self.protected_servers_count = kwargs.get('protected_servers_count', None) + self.disk_count = kwargs.get('disk_count', None) + self.used_disk_space = kwargs.get('used_disk_space', None) + self.available_disk_space = kwargs.get('available_disk_space', None) + self.refreshed_at = kwargs.get('refreshed_at', None) + self.azure_protected_instances = kwargs.get('azure_protected_instances', None) + + +class BackupManagementUsage(msrest.serialization.Model): + """Backup management 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.recoveryservicesbackup.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.recoveryservicesbackup.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(BackupManagementUsage, 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 BackupManagementUsageList(msrest.serialization.Model): + """Backup management usage for vault. + + :param value: The list of backup management usages for the given vault. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.BackupManagementUsage] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BackupManagementUsage]'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupManagementUsageList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class BackupRequestResource(Resource): + """Base class for backup request. Workload-specific backup requests are derived from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: BackupRequestResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.BackupRequest + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BackupRequest'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupRequestResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class BackupResourceConfig(msrest.serialization.Model): + """The resource storage details. + + :param storage_model_type: Storage type. Possible values include: "Invalid", "GeoRedundant", + "LocallyRedundant", "ZoneRedundant", "ReadAccessGeoZoneRedundant". + :type storage_model_type: str or ~azure.mgmt.recoveryservicesbackup.models.StorageType + :param storage_type: Storage type. Possible values include: "Invalid", "GeoRedundant", + "LocallyRedundant", "ZoneRedundant", "ReadAccessGeoZoneRedundant". + :type storage_type: str or ~azure.mgmt.recoveryservicesbackup.models.StorageType + :param storage_type_state: Locked or Unlocked. Once a machine is registered against a resource, + the storageTypeState is always Locked. Possible values include: "Invalid", "Locked", + "Unlocked". + :type storage_type_state: str or ~azure.mgmt.recoveryservicesbackup.models.StorageTypeState + :param cross_region_restore_flag: Opt in details of Cross Region Restore feature. + :type cross_region_restore_flag: bool + """ + + _attribute_map = { + 'storage_model_type': {'key': 'storageModelType', 'type': 'str'}, + 'storage_type': {'key': 'storageType', 'type': 'str'}, + 'storage_type_state': {'key': 'storageTypeState', 'type': 'str'}, + 'cross_region_restore_flag': {'key': 'crossRegionRestoreFlag', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupResourceConfig, self).__init__(**kwargs) + self.storage_model_type = kwargs.get('storage_model_type', None) + self.storage_type = kwargs.get('storage_type', None) + self.storage_type_state = kwargs.get('storage_type_state', None) + self.cross_region_restore_flag = kwargs.get('cross_region_restore_flag', None) + + +class BackupResourceConfigResource(Resource): + """The resource storage details. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: BackupResourceConfigResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceConfig + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BackupResourceConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupResourceConfigResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class BackupResourceEncryptionConfig(msrest.serialization.Model): + """BackupResourceEncryptionConfig. + + :param encryption_at_rest_type: Encryption At Rest Type. Possible values include: "Invalid", + "MicrosoftManaged", "CustomerManaged". + :type encryption_at_rest_type: str or + ~azure.mgmt.recoveryservicesbackup.models.EncryptionAtRestType + :param key_uri: Key Vault Key URI. + :type key_uri: str + :param subscription_id: Key Vault Subscription Id. + :type subscription_id: str + :param last_update_status: Possible values include: "Invalid", "NotEnabled", + "PartiallySucceeded", "PartiallyFailed", "Failed", "Succeeded". + :type last_update_status: str or ~azure.mgmt.recoveryservicesbackup.models.LastUpdateStatus + :param infrastructure_encryption_state: Possible values include: "Invalid", "Disabled", + "Enabled". + :type infrastructure_encryption_state: str or + ~azure.mgmt.recoveryservicesbackup.models.InfrastructureEncryptionState + """ + + _attribute_map = { + 'encryption_at_rest_type': {'key': 'encryptionAtRestType', 'type': 'str'}, + 'key_uri': {'key': 'keyUri', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'last_update_status': {'key': 'lastUpdateStatus', 'type': 'str'}, + 'infrastructure_encryption_state': {'key': 'infrastructureEncryptionState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupResourceEncryptionConfig, self).__init__(**kwargs) + self.encryption_at_rest_type = kwargs.get('encryption_at_rest_type', None) + self.key_uri = kwargs.get('key_uri', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.last_update_status = kwargs.get('last_update_status', None) + self.infrastructure_encryption_state = kwargs.get('infrastructure_encryption_state', None) + + +class BackupResourceEncryptionConfigResource(Resource): + """BackupResourceEncryptionConfigResource. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: BackupResourceEncryptionConfigResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceEncryptionConfig + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BackupResourceEncryptionConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupResourceEncryptionConfigResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class BackupResourceVaultConfig(msrest.serialization.Model): + """Backup resource vault config details. + + :param storage_model_type: Storage type. Possible values include: "Invalid", "GeoRedundant", + "LocallyRedundant", "ZoneRedundant", "ReadAccessGeoZoneRedundant". + :type storage_model_type: str or ~azure.mgmt.recoveryservicesbackup.models.StorageType + :param storage_type: Storage type. Possible values include: "Invalid", "GeoRedundant", + "LocallyRedundant", "ZoneRedundant", "ReadAccessGeoZoneRedundant". + :type storage_type: str or ~azure.mgmt.recoveryservicesbackup.models.StorageType + :param storage_type_state: Locked or Unlocked. Once a machine is registered against a resource, + the storageTypeState is always Locked. Possible values include: "Invalid", "Locked", + "Unlocked". + :type storage_type_state: str or ~azure.mgmt.recoveryservicesbackup.models.StorageTypeState + :param enhanced_security_state: Enabled or Disabled. Possible values include: "Invalid", + "Enabled", "Disabled". + :type enhanced_security_state: str or + ~azure.mgmt.recoveryservicesbackup.models.EnhancedSecurityState + :param soft_delete_feature_state: Soft Delete feature state. Possible values include: + "Invalid", "Enabled", "Disabled". + :type soft_delete_feature_state: str or + ~azure.mgmt.recoveryservicesbackup.models.SoftDeleteFeatureState + """ + + _attribute_map = { + 'storage_model_type': {'key': 'storageModelType', 'type': 'str'}, + 'storage_type': {'key': 'storageType', 'type': 'str'}, + 'storage_type_state': {'key': 'storageTypeState', 'type': 'str'}, + 'enhanced_security_state': {'key': 'enhancedSecurityState', 'type': 'str'}, + 'soft_delete_feature_state': {'key': 'softDeleteFeatureState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupResourceVaultConfig, self).__init__(**kwargs) + self.storage_model_type = kwargs.get('storage_model_type', None) + self.storage_type = kwargs.get('storage_type', None) + self.storage_type_state = kwargs.get('storage_type_state', None) + self.enhanced_security_state = kwargs.get('enhanced_security_state', None) + self.soft_delete_feature_state = kwargs.get('soft_delete_feature_state', None) + + +class BackupResourceVaultConfigResource(Resource): + """Backup resource vault config details. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: BackupResourceVaultConfigResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceVaultConfig + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BackupResourceVaultConfig'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupResourceVaultConfigResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class BackupStatusRequest(msrest.serialization.Model): + """BackupStatus request. + + :param resource_type: Container Type - VM, SQLPaaS, DPM, AzureFileShare... Possible values + include: "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", + "VMwareVM", "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type resource_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param resource_id: Entire ARM resource id of the resource. + :type resource_id: str + :param po_logical_name: Protectable Item Logical Name. + :type po_logical_name: str + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'po_logical_name': {'key': 'poLogicalName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupStatusRequest, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.resource_id = kwargs.get('resource_id', None) + self.po_logical_name = kwargs.get('po_logical_name', None) + + +class BackupStatusResponse(msrest.serialization.Model): + """BackupStatus response. + + :param protection_status: Specifies whether the container is registered or not. Possible values + include: "Invalid", "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_status: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param vault_id: Specifies the arm resource id of the vault. + :type vault_id: str + :param fabric_name: Specifies the fabric name - Azure or AD. Possible values include: + "Invalid", "Azure". + :type fabric_name: str or ~azure.mgmt.recoveryservicesbackup.models.FabricName + :param container_name: Specifies the product specific container name. E.g. + iaasvmcontainer;iaasvmcontainer;csname;vmname. + :type container_name: str + :param protected_item_name: Specifies the product specific ds name. E.g. + vm;iaasvmcontainer;csname;vmname. + :type protected_item_name: str + :param error_code: ErrorCode in case of intent failed. + :type error_code: str + :param error_message: ErrorMessage in case of intent failed. + :type error_message: str + :param policy_name: Specifies the policy name which is used for protection. + :type policy_name: str + :param registration_status: Container registration status. + :type registration_status: str + """ + + _attribute_map = { + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'vault_id': {'key': 'vaultId', 'type': 'str'}, + 'fabric_name': {'key': 'fabricName', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'protected_item_name': {'key': 'protectedItemName', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupStatusResponse, self).__init__(**kwargs) + self.protection_status = kwargs.get('protection_status', None) + self.vault_id = kwargs.get('vault_id', None) + self.fabric_name = kwargs.get('fabric_name', None) + self.container_name = kwargs.get('container_name', None) + self.protected_item_name = kwargs.get('protected_item_name', None) + self.error_code = kwargs.get('error_code', None) + self.error_message = kwargs.get('error_message', None) + self.policy_name = kwargs.get('policy_name', None) + self.registration_status = kwargs.get('registration_status', None) + + +class BEKDetails(msrest.serialization.Model): + """BEK is bitlocker encryption key. + + :param secret_url: Secret is BEK. + :type secret_url: str + :param secret_vault_id: ID of the Key Vault where this Secret is stored. + :type secret_vault_id: str + :param secret_data: BEK data. + :type secret_data: str + """ + + _attribute_map = { + 'secret_url': {'key': 'secretUrl', 'type': 'str'}, + 'secret_vault_id': {'key': 'secretVaultId', 'type': 'str'}, + 'secret_data': {'key': 'secretData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BEKDetails, self).__init__(**kwargs) + self.secret_url = kwargs.get('secret_url', None) + self.secret_vault_id = kwargs.get('secret_vault_id', None) + self.secret_data = kwargs.get('secret_data', None) + + +class BMSAADPropertiesQueryObject(msrest.serialization.Model): + """Filters to list backup items. + + :param backup_management_type: Backup management type for the backed up item. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BMSAADPropertiesQueryObject, self).__init__(**kwargs) + self.backup_management_type = kwargs.get('backup_management_type', None) + + +class BMSBackupEngineQueryObject(msrest.serialization.Model): + """Query parameters to fetch list of backup engines. + + :param expand: attribute to add extended info. + :type expand: str + """ + + _attribute_map = { + 'expand': {'key': 'expand', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BMSBackupEngineQueryObject, self).__init__(**kwargs) + self.expand = kwargs.get('expand', None) + + +class BMSBackupEnginesQueryObject(msrest.serialization.Model): + """Query parameters to fetch list of backup engines. + + :param backup_management_type: Backup management type for the backup engine. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param friendly_name: Friendly name of the backup engine. + :type friendly_name: str + :param expand: Attribute to add extended info. + :type expand: str + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'expand': {'key': 'expand', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BMSBackupEnginesQueryObject, self).__init__(**kwargs) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.expand = kwargs.get('expand', None) + + +class BMSBackupSummariesQueryObject(msrest.serialization.Model): + """Query parameters to fetch backup summaries. + + :param type: Backup management type for this container. Possible values include: "Invalid", + "BackupProtectedItemCountSummary", "BackupProtectionContainerCountSummary". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.Type + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BMSBackupSummariesQueryObject, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + + +class BMSContainerQueryObject(msrest.serialization.Model): + """The query filters that can be used with the list containers API. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Required. Backup management type for this container. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param container_type: Type of container for filter. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param backup_engine_name: Backup engine name. + :type backup_engine_name: str + :param fabric_name: Fabric name for filter. + :type fabric_name: str + :param status: Status of registration of this container with the Recovery Services Vault. + :type status: str + :param friendly_name: Friendly name of this container. + :type friendly_name: str + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'backup_engine_name': {'key': 'backupEngineName', 'type': 'str'}, + 'fabric_name': {'key': 'fabricName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BMSContainerQueryObject, self).__init__(**kwargs) + self.backup_management_type = kwargs['backup_management_type'] + self.container_type = kwargs.get('container_type', None) + self.backup_engine_name = kwargs.get('backup_engine_name', None) + self.fabric_name = kwargs.get('fabric_name', None) + self.status = kwargs.get('status', None) + self.friendly_name = kwargs.get('friendly_name', None) + + +class BMSContainersInquiryQueryObject(msrest.serialization.Model): + """The query filters that can be used with the inquire container API. + + :param backup_management_type: Backup management type for this container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Workload type for this container. Possible values include: "Invalid", + "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", "SystemState", + "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", "SAPHanaDatabase", + "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BMSContainersInquiryQueryObject, self).__init__(**kwargs) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.workload_type = kwargs.get('workload_type', None) + + +class BMSPOQueryObject(msrest.serialization.Model): + """Filters to list items that can be backed up. + + :param backup_management_type: Backup management type. Possible values include: "Invalid", + "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", "AzureStorage", "AzureWorkload", + "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Workload type. Possible values include: "Invalid", "VM", "FileFolder", + "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", "SystemState", "Client", + "GenericDataSource", "SQLDataBase", "AzureFileShare", "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param container_name: Full name of the container whose Protectable Objects should be returned. + :type container_name: str + :param status: Backup status query parameter. + :type status: str + :param friendly_name: Friendly name. + :type friendly_name: str + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BMSPOQueryObject, self).__init__(**kwargs) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.workload_type = kwargs.get('workload_type', None) + self.container_name = kwargs.get('container_name', None) + self.status = kwargs.get('status', None) + self.friendly_name = kwargs.get('friendly_name', None) + + +class BMSRefreshContainersQueryObject(msrest.serialization.Model): + """The query filters that can be used with the refresh container API. + + :param backup_management_type: Backup management type for this container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BMSRefreshContainersQueryObject, self).__init__(**kwargs) + self.backup_management_type = kwargs.get('backup_management_type', None) + + +class BMSRPQueryObject(msrest.serialization.Model): + """Filters to list backup copies. + + :param start_date: Backup copies created after this time. + :type start_date: ~datetime.datetime + :param end_date: Backup copies created before this time. + :type end_date: ~datetime.datetime + :param restore_point_query_type: RestorePoint type. Possible values include: "Invalid", "Full", + "Log", "Differential", "FullAndDifferential", "All", "Incremental". + :type restore_point_query_type: str or + ~azure.mgmt.recoveryservicesbackup.models.RestorePointQueryType + :param extended_info: In Get Recovery Point, it tells whether extended information about + recovery point is asked. + :type extended_info: bool + :param move_ready_rp_only: Whether the RP can be moved to another tier. + :type move_ready_rp_only: bool + """ + + _attribute_map = { + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'restore_point_query_type': {'key': 'restorePointQueryType', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'bool'}, + 'move_ready_rp_only': {'key': 'moveReadyRPOnly', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(BMSRPQueryObject, self).__init__(**kwargs) + self.start_date = kwargs.get('start_date', None) + self.end_date = kwargs.get('end_date', None) + self.restore_point_query_type = kwargs.get('restore_point_query_type', None) + self.extended_info = kwargs.get('extended_info', None) + self.move_ready_rp_only = kwargs.get('move_ready_rp_only', None) + + +class BMSWorkloadItemQueryObject(msrest.serialization.Model): + """Filters to list items that can be backed up. + + :param backup_management_type: Backup management type. Possible values include: "Invalid", + "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", "AzureStorage", "AzureWorkload", + "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_item_type: Workload Item type. Possible values include: "Invalid", + "SQLInstance", "SQLDataBase", "SAPHanaSystem", "SAPHanaDatabase", "SAPAseSystem", + "SAPAseDatabase". + :type workload_item_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadItemType + :param workload_type: Workload type. Possible values include: "Invalid", "VM", "FileFolder", + "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", "SystemState", "Client", + "GenericDataSource", "SQLDataBase", "AzureFileShare", "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param protection_status: Backup status query parameter. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_status: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BMSWorkloadItemQueryObject, self).__init__(**kwargs) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.workload_item_type = kwargs.get('workload_item_type', None) + self.workload_type = kwargs.get('workload_type', None) + self.protection_status = kwargs.get('protection_status', 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 for shoebox log specification. + :type name: str + :param display_name: Localized display name. + :type display_name: str + :param blob_duration: blob duration of shoebox log specification. + :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.recoveryservicesbackup.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.recoveryservicesbackup.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.recoveryservicesbackup.models.ClientDiscoveryValueForSingleApi] + :param next_link: Link to the next chunk of 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.recoveryservicesbackup.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.recoveryservicesbackup.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 ClientScriptForConnect(msrest.serialization.Model): + """Client script details for file / folder restore. + + :param script_content: File content of the client script for file / folder restore. + :type script_content: str + :param script_extension: File extension of the client script for file / folder restore - .ps1 , + .sh , etc. + :type script_extension: str + :param os_type: OS type - Windows, Linux etc. for which this file / folder restore client + script works. + :type os_type: str + :param url: URL of Executable from where to source the content. If this is not null then + ScriptContent should not be used. + :type url: str + :param script_name_suffix: Mandatory suffix that should be added to the name of script that is + given for download to user. + If its null or empty then , ignore it. + :type script_name_suffix: str + """ + + _attribute_map = { + 'script_content': {'key': 'scriptContent', 'type': 'str'}, + 'script_extension': {'key': 'scriptExtension', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'script_name_suffix': {'key': 'scriptNameSuffix', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClientScriptForConnect, self).__init__(**kwargs) + self.script_content = kwargs.get('script_content', None) + self.script_extension = kwargs.get('script_extension', None) + self.os_type = kwargs.get('os_type', None) + self.url = kwargs.get('url', None) + self.script_name_suffix = kwargs.get('script_name_suffix', None) + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the Container Instance service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user + interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in + error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.recoveryservicesbackup.models.CloudErrorBody] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.recoveryservicesbackup.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ContainerIdentityInfo(msrest.serialization.Model): + """Container identity information. + + :param unique_name: Unique name of the container. + :type unique_name: str + :param aad_tenant_id: Protection container identity - AAD Tenant. + :type aad_tenant_id: str + :param service_principal_client_id: Protection container identity - AAD Service Principal. + :type service_principal_client_id: str + :param audience: Protection container identity - Audience. + :type audience: str + """ + + _attribute_map = { + 'unique_name': {'key': 'uniqueName', 'type': 'str'}, + 'aad_tenant_id': {'key': 'aadTenantId', 'type': 'str'}, + 'service_principal_client_id': {'key': 'servicePrincipalClientId', 'type': 'str'}, + 'audience': {'key': 'audience', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerIdentityInfo, self).__init__(**kwargs) + self.unique_name = kwargs.get('unique_name', None) + self.aad_tenant_id = kwargs.get('aad_tenant_id', None) + self.service_principal_client_id = kwargs.get('service_principal_client_id', None) + self.audience = kwargs.get('audience', None) + + +class CrossRegionRestoreRequest(msrest.serialization.Model): + """CrossRegionRestoreRequest. + + :param cross_region_restore_access_details: Access details for cross region restore. + :type cross_region_restore_access_details: + ~azure.mgmt.recoveryservicesbackup.models.CrrAccessToken + :param restore_request: Request object for triggering restore. + :type restore_request: ~azure.mgmt.recoveryservicesbackup.models.RestoreRequest + """ + + _attribute_map = { + 'cross_region_restore_access_details': {'key': 'crossRegionRestoreAccessDetails', 'type': 'CrrAccessToken'}, + 'restore_request': {'key': 'restoreRequest', 'type': 'RestoreRequest'}, + } + + def __init__( + self, + **kwargs + ): + super(CrossRegionRestoreRequest, self).__init__(**kwargs) + self.cross_region_restore_access_details = kwargs.get('cross_region_restore_access_details', None) + self.restore_request = kwargs.get('restore_request', None) + + +class CrossRegionRestoreRequestResource(Resource): + """CrossRegionRestoreRequestResource. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: CrossRegionRestoreRequestResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.CrossRegionRestoreRequest + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CrossRegionRestoreRequest'}, + } + + def __init__( + self, + **kwargs + ): + super(CrossRegionRestoreRequestResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class CrrAccessToken(msrest.serialization.Model): + """CrrAccessToken. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: WorkloadCrrAccessToken. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Type of the specific object - used for deserializing.Constant + filled by server. + :type object_type: str + :param access_token_string: Access token used for authentication. + :type access_token_string: str + :param subscription_id: Subscription Id of the source vault. + :type subscription_id: str + :param resource_group_name: Resource Group name of the source vault. + :type resource_group_name: str + :param resource_name: Resource Name of the source vault. + :type resource_name: str + :param resource_id: Resource Id of the source vault. + :type resource_id: str + :param protection_container_id: Protected item container id. + :type protection_container_id: long + :param recovery_point_id: Recovery Point Id. + :type recovery_point_id: str + :param recovery_point_time: Recovery Point Time. + :type recovery_point_time: str + :param container_name: Container Unique name. + :type container_name: str + :param container_type: Container Type. + :type container_type: str + :param backup_management_type: Backup Management Type. + :type backup_management_type: str + :param datasource_type: Datasource Type. + :type datasource_type: str + :param datasource_name: Datasource Friendly Name. + :type datasource_name: str + :param datasource_id: Datasource Id. + :type datasource_id: str + :param datasource_container_name: Datasource Container Unique Name. + :type datasource_container_name: str + :param coordinator_service_stamp_id: CoordinatorServiceStampId to be used by BCM in restore + call. + :type coordinator_service_stamp_id: str + :param coordinator_service_stamp_uri: CoordinatorServiceStampUri to be used by BCM in restore + call. + :type coordinator_service_stamp_uri: str + :param protection_service_stamp_id: ProtectionServiceStampId to be used by BCM in restore call. + :type protection_service_stamp_id: str + :param protection_service_stamp_uri: ProtectionServiceStampUri to be used by BCM in restore + call. + :type protection_service_stamp_uri: str + :param token_extended_information: Extended Information about the token like FileSpec etc. + :type token_extended_information: str + :param rp_tier_information: Recovery point Tier Information. + :type rp_tier_information: dict[str, str] + :param rp_original_sa_option: Recovery point information: Original SA option. + :type rp_original_sa_option: bool + :param rp_is_managed_virtual_machine: Recovery point information: Managed virtual machine. + :type rp_is_managed_virtual_machine: bool + :param rp_vm_size_description: Recovery point information: VM size description. + :type rp_vm_size_description: str + :param b_ms_active_region: Active region name of BMS Stamp. + :type b_ms_active_region: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'access_token_string': {'key': 'accessTokenString', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'protection_container_id': {'key': 'protectionContainerId', 'type': 'long'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'datasource_type': {'key': 'datasourceType', 'type': 'str'}, + 'datasource_name': {'key': 'datasourceName', 'type': 'str'}, + 'datasource_id': {'key': 'datasourceId', 'type': 'str'}, + 'datasource_container_name': {'key': 'datasourceContainerName', 'type': 'str'}, + 'coordinator_service_stamp_id': {'key': 'coordinatorServiceStampId', 'type': 'str'}, + 'coordinator_service_stamp_uri': {'key': 'coordinatorServiceStampUri', 'type': 'str'}, + 'protection_service_stamp_id': {'key': 'protectionServiceStampId', 'type': 'str'}, + 'protection_service_stamp_uri': {'key': 'protectionServiceStampUri', 'type': 'str'}, + 'token_extended_information': {'key': 'tokenExtendedInformation', 'type': 'str'}, + 'rp_tier_information': {'key': 'rpTierInformation', 'type': '{str}'}, + 'rp_original_sa_option': {'key': 'rpOriginalSAOption', 'type': 'bool'}, + 'rp_is_managed_virtual_machine': {'key': 'rpIsManagedVirtualMachine', 'type': 'bool'}, + 'rp_vm_size_description': {'key': 'rpVMSizeDescription', 'type': 'str'}, + 'b_ms_active_region': {'key': 'bMSActiveRegion', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'WorkloadCrrAccessToken': 'WorkloadCrrAccessToken'} + } + + def __init__( + self, + **kwargs + ): + super(CrrAccessToken, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + self.access_token_string = kwargs.get('access_token_string', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group_name = kwargs.get('resource_group_name', None) + self.resource_name = kwargs.get('resource_name', None) + self.resource_id = kwargs.get('resource_id', None) + self.protection_container_id = kwargs.get('protection_container_id', None) + self.recovery_point_id = kwargs.get('recovery_point_id', None) + self.recovery_point_time = kwargs.get('recovery_point_time', None) + self.container_name = kwargs.get('container_name', None) + self.container_type = kwargs.get('container_type', None) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.datasource_type = kwargs.get('datasource_type', None) + self.datasource_name = kwargs.get('datasource_name', None) + self.datasource_id = kwargs.get('datasource_id', None) + self.datasource_container_name = kwargs.get('datasource_container_name', None) + self.coordinator_service_stamp_id = kwargs.get('coordinator_service_stamp_id', None) + self.coordinator_service_stamp_uri = kwargs.get('coordinator_service_stamp_uri', None) + self.protection_service_stamp_id = kwargs.get('protection_service_stamp_id', None) + self.protection_service_stamp_uri = kwargs.get('protection_service_stamp_uri', None) + self.token_extended_information = kwargs.get('token_extended_information', None) + self.rp_tier_information = kwargs.get('rp_tier_information', None) + self.rp_original_sa_option = kwargs.get('rp_original_sa_option', None) + self.rp_is_managed_virtual_machine = kwargs.get('rp_is_managed_virtual_machine', None) + self.rp_vm_size_description = kwargs.get('rp_vm_size_description', None) + self.b_ms_active_region = kwargs.get('b_ms_active_region', None) + + +class CrrAccessTokenResource(Resource): + """CrrAccessTokenResource. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: CrrAccessTokenResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.CrrAccessToken + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CrrAccessToken'}, + } + + def __init__( + self, + **kwargs + ): + super(CrrAccessTokenResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class CrrJobRequest(msrest.serialization.Model): + """Request object for fetching CRR jobs. + + :param resource_id: Entire ARM resource id of the resource. + :type resource_id: str + :param job_name: Job Name of the job to be fetched. + :type job_name: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'job_name': {'key': 'jobName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CrrJobRequest, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.job_name = kwargs.get('job_name', None) + + +class CrrJobRequestResource(Resource): + """Request object for fetching CRR jobs. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: CrrJobRequestResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.CrrJobRequest + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CrrJobRequest'}, + } + + def __init__( + self, + **kwargs + ): + super(CrrJobRequestResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class DailyRetentionFormat(msrest.serialization.Model): + """Daily retention format. + + :param days_of_the_month: List of days of the month. + :type days_of_the_month: list[~azure.mgmt.recoveryservicesbackup.models.Day] + """ + + _attribute_map = { + 'days_of_the_month': {'key': 'daysOfTheMonth', 'type': '[Day]'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyRetentionFormat, self).__init__(**kwargs) + self.days_of_the_month = kwargs.get('days_of_the_month', None) + + +class DailyRetentionSchedule(msrest.serialization.Model): + """Daily retention schedule. + + :param retention_times: Retention times of retention policy. + :type retention_times: list[~datetime.datetime] + :param retention_duration: Retention duration of retention Policy. + :type retention_duration: ~azure.mgmt.recoveryservicesbackup.models.RetentionDuration + """ + + _attribute_map = { + 'retention_times': {'key': 'retentionTimes', 'type': '[iso-8601]'}, + 'retention_duration': {'key': 'retentionDuration', 'type': 'RetentionDuration'}, + } + + def __init__( + self, + **kwargs + ): + super(DailyRetentionSchedule, self).__init__(**kwargs) + self.retention_times = kwargs.get('retention_times', None) + self.retention_duration = kwargs.get('retention_duration', None) + + +class Day(msrest.serialization.Model): + """Day of the week. + + :param date: Date of the month. + :type date: int + :param is_last: Whether Date is last date of month. + :type is_last: bool + """ + + _attribute_map = { + 'date': {'key': 'date', 'type': 'int'}, + 'is_last': {'key': 'isLast', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Day, self).__init__(**kwargs) + self.date = kwargs.get('date', None) + self.is_last = kwargs.get('is_last', None) + + +class DiskExclusionProperties(msrest.serialization.Model): + """DiskExclusionProperties. + + :param disk_lun_list: List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + :type disk_lun_list: list[int] + :param is_inclusion_list: Flag to indicate whether DiskLunList is to be included/ excluded from + backup. + :type is_inclusion_list: bool + """ + + _attribute_map = { + 'disk_lun_list': {'key': 'diskLunList', 'type': '[int]'}, + 'is_inclusion_list': {'key': 'isInclusionList', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskExclusionProperties, self).__init__(**kwargs) + self.disk_lun_list = kwargs.get('disk_lun_list', None) + self.is_inclusion_list = kwargs.get('is_inclusion_list', None) + + +class DiskInformation(msrest.serialization.Model): + """Disk information. + + :param lun: + :type lun: int + :param name: + :type name: str + """ + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DiskInformation, self).__init__(**kwargs) + self.lun = kwargs.get('lun', None) + self.name = kwargs.get('name', None) + + +class DistributedNodesInfo(msrest.serialization.Model): + """This is used to represent the various nodes of the distributed container. + + :param node_name: Name of the node under a distributed container. + :type node_name: str + :param status: Status of this Node. + Failed | Succeeded. + :type status: str + :param error_detail: Error Details if the Status is non-success. + :type error_detail: ~azure.mgmt.recoveryservicesbackup.models.ErrorDetail + """ + + _attribute_map = { + 'node_name': {'key': 'nodeName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error_detail': {'key': 'errorDetail', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(DistributedNodesInfo, self).__init__(**kwargs) + self.node_name = kwargs.get('node_name', None) + self.status = kwargs.get('status', None) + self.error_detail = kwargs.get('error_detail', None) + + +class DpmBackupEngine(BackupEngineBase): + """Data Protection Manager (DPM) specific backup engine. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the backup engine. + :type friendly_name: str + :param backup_management_type: Type of backup management for the backup engine. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Registration status of the backup engine with the Recovery Services + Vault. + :type registration_status: str + :param backup_engine_state: Status of the backup engine with the Recovery Services Vault. = + {Active/Deleting/DeleteFailed}. + :type backup_engine_state: str + :param health_status: Backup status of the backup engine. + :type health_status: str + :param backup_engine_type: Required. Type of the backup engine.Constant filled by server. + Possible values include: "Invalid", "DpmBackupEngine", "AzureBackupServerEngine". + :type backup_engine_type: str or ~azure.mgmt.recoveryservicesbackup.models.BackupEngineType + :param can_re_register: Flag indicating if the backup engine be registered, once already + registered. + :type can_re_register: bool + :param backup_engine_id: ID of the backup engine. + :type backup_engine_id: str + :param dpm_version: Backup engine version. + :type dpm_version: str + :param azure_backup_agent_version: Backup agent version. + :type azure_backup_agent_version: str + :param is_azure_backup_agent_upgrade_available: To check if backup agent upgrade available. + :type is_azure_backup_agent_upgrade_available: bool + :param is_dpm_upgrade_available: To check if backup engine upgrade available. + :type is_dpm_upgrade_available: bool + :param extended_info: Extended info of the backupengine. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.BackupEngineExtendedInfo + """ + + _validation = { + 'backup_engine_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'backup_engine_state': {'key': 'backupEngineState', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'backup_engine_type': {'key': 'backupEngineType', 'type': 'str'}, + 'can_re_register': {'key': 'canReRegister', 'type': 'bool'}, + 'backup_engine_id': {'key': 'backupEngineId', 'type': 'str'}, + 'dpm_version': {'key': 'dpmVersion', 'type': 'str'}, + 'azure_backup_agent_version': {'key': 'azureBackupAgentVersion', 'type': 'str'}, + 'is_azure_backup_agent_upgrade_available': {'key': 'isAzureBackupAgentUpgradeAvailable', 'type': 'bool'}, + 'is_dpm_upgrade_available': {'key': 'isDpmUpgradeAvailable', 'type': 'bool'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'BackupEngineExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(DpmBackupEngine, self).__init__(**kwargs) + self.backup_engine_type = 'DpmBackupEngine' # type: str + + +class DPMContainerExtendedInfo(msrest.serialization.Model): + """Additional information of the DPMContainer. + + :param last_refreshed_at: Last refresh time of the DPMContainer. + :type last_refreshed_at: ~datetime.datetime + """ + + _attribute_map = { + 'last_refreshed_at': {'key': 'lastRefreshedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(DPMContainerExtendedInfo, self).__init__(**kwargs) + self.last_refreshed_at = kwargs.get('last_refreshed_at', None) + + +class DpmErrorInfo(msrest.serialization.Model): + """DPM workload-specific error information. + + :param error_string: Localized error string. + :type error_string: str + :param recommendations: List of localized recommendations for above error code. + :type recommendations: list[str] + """ + + _attribute_map = { + 'error_string': {'key': 'errorString', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DpmErrorInfo, self).__init__(**kwargs) + self.error_string = kwargs.get('error_string', None) + self.recommendations = kwargs.get('recommendations', None) + + +class DpmJob(Job): + """DPM workload-specific job object. + + All required parameters must be populated in order to send to Azure. + + :param entity_friendly_name: Friendly name of the entity on which the current job is executing. + :type entity_friendly_name: str + :param backup_management_type: Backup management type to execute the current job. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: The operation name. + :type operation: str + :param status: Job status. + :type status: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param activity_id: ActivityId of job. + :type activity_id: str + :param job_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 job_type: str + :param duration: Time elapsed for job. + :type duration: ~datetime.timedelta + :param dpm_server_name: DPM server name managing the backup item or backup job. + :type dpm_server_name: str + :param container_name: Name of cluster/server protecting current backup item, if any. + :type container_name: str + :param container_type: Type of container. + :type container_type: str + :param workload_type: Type of backup item. + :type workload_type: str + :param actions_info: The state/actions applicable on this job like cancel/retry. + :type actions_info: list[str or ~azure.mgmt.recoveryservicesbackup.models.JobSupportedAction] + :param error_details: The errors. + :type error_details: list[~azure.mgmt.recoveryservicesbackup.models.DpmErrorInfo] + :param extended_info: Additional information for this job. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.DpmJobExtendedInfo + """ + + _validation = { + 'job_type': {'required': True}, + } + + _attribute_map = { + 'entity_friendly_name': {'key': 'entityFriendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'dpm_server_name': {'key': 'dpmServerName', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'actions_info': {'key': 'actionsInfo', 'type': '[str]'}, + 'error_details': {'key': 'errorDetails', 'type': '[DpmErrorInfo]'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'DpmJobExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(DpmJob, self).__init__(**kwargs) + self.job_type = 'DpmJob' # type: str + self.duration = kwargs.get('duration', None) + self.dpm_server_name = kwargs.get('dpm_server_name', None) + self.container_name = kwargs.get('container_name', None) + self.container_type = kwargs.get('container_type', None) + self.workload_type = kwargs.get('workload_type', None) + self.actions_info = kwargs.get('actions_info', None) + self.error_details = kwargs.get('error_details', None) + self.extended_info = kwargs.get('extended_info', None) + + +class DpmJobExtendedInfo(msrest.serialization.Model): + """Additional information on the DPM workload-specific job. + + :param tasks_list: List of tasks associated with this job. + :type tasks_list: list[~azure.mgmt.recoveryservicesbackup.models.DpmJobTaskDetails] + :param property_bag: The job properties. + :type property_bag: dict[str, str] + :param dynamic_error_message: Non localized error message on job execution. + :type dynamic_error_message: str + """ + + _attribute_map = { + 'tasks_list': {'key': 'tasksList', 'type': '[DpmJobTaskDetails]'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'dynamic_error_message': {'key': 'dynamicErrorMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DpmJobExtendedInfo, self).__init__(**kwargs) + self.tasks_list = kwargs.get('tasks_list', None) + self.property_bag = kwargs.get('property_bag', None) + self.dynamic_error_message = kwargs.get('dynamic_error_message', None) + + +class DpmJobTaskDetails(msrest.serialization.Model): + """DPM workload-specific job task details. + + :param task_id: The task display name. + :type task_id: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param duration: Time elapsed for task. + :type duration: ~datetime.timedelta + :param status: The status. + :type status: str + """ + + _attribute_map = { + 'task_id': {'key': 'taskId', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DpmJobTaskDetails, self).__init__(**kwargs) + self.task_id = kwargs.get('task_id', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.duration = kwargs.get('duration', None) + self.status = kwargs.get('status', None) + + +class DPMProtectedItem(ProtectedItem): + """Additional information on Backup engine specific backup item. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the managed item. + :type friendly_name: str + :param backup_engine_name: Backup Management server protecting this backup item. + :type backup_engine_name: str + :param protection_state: Protection state of the backup engine. Possible values include: + "Invalid", "IRPending", "Protected", "ProtectionError", "ProtectionStopped", + "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemState + :param extended_info: Extended info of the backup item. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.DPMProtectedItemExtendedInfo + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_engine_name': {'key': 'backupEngineName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'DPMProtectedItemExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(DPMProtectedItem, self).__init__(**kwargs) + self.protected_item_type = 'DPMProtectedItem' # type: str + self.friendly_name = kwargs.get('friendly_name', None) + self.backup_engine_name = kwargs.get('backup_engine_name', None) + self.protection_state = kwargs.get('protection_state', None) + self.extended_info = kwargs.get('extended_info', None) + + +class DPMProtectedItemExtendedInfo(msrest.serialization.Model): + """Additional information of DPM Protected item. + + :param protectable_object_load_path: Attribute to provide information on various DBs. + :type protectable_object_load_path: dict[str, str] + :param protected: To check if backup item is disk protected. + :type protected: bool + :param is_present_on_cloud: To check if backup item is cloud protected. + :type is_present_on_cloud: bool + :param last_backup_status: Last backup status information on backup item. + :type last_backup_status: str + :param last_refreshed_at: Last refresh time on backup item. + :type last_refreshed_at: ~datetime.datetime + :param oldest_recovery_point: Oldest cloud recovery point time. + :type oldest_recovery_point: ~datetime.datetime + :param recovery_point_count: cloud recovery point count. + :type recovery_point_count: int + :param on_premise_oldest_recovery_point: Oldest disk recovery point time. + :type on_premise_oldest_recovery_point: ~datetime.datetime + :param on_premise_latest_recovery_point: latest disk recovery point time. + :type on_premise_latest_recovery_point: ~datetime.datetime + :param on_premise_recovery_point_count: disk recovery point count. + :type on_premise_recovery_point_count: int + :param is_collocated: To check if backup item is collocated. + :type is_collocated: bool + :param protection_group_name: Protection group name of the backup item. + :type protection_group_name: str + :param disk_storage_used_in_bytes: Used Disk storage in bytes. + :type disk_storage_used_in_bytes: str + :param total_disk_storage_size_in_bytes: total Disk storage in bytes. + :type total_disk_storage_size_in_bytes: str + """ + + _attribute_map = { + 'protectable_object_load_path': {'key': 'protectableObjectLoadPath', 'type': '{str}'}, + 'protected': {'key': 'protected', 'type': 'bool'}, + 'is_present_on_cloud': {'key': 'isPresentOnCloud', 'type': 'bool'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_refreshed_at': {'key': 'lastRefreshedAt', 'type': 'iso-8601'}, + 'oldest_recovery_point': {'key': 'oldestRecoveryPoint', 'type': 'iso-8601'}, + 'recovery_point_count': {'key': 'recoveryPointCount', 'type': 'int'}, + 'on_premise_oldest_recovery_point': {'key': 'onPremiseOldestRecoveryPoint', 'type': 'iso-8601'}, + 'on_premise_latest_recovery_point': {'key': 'onPremiseLatestRecoveryPoint', 'type': 'iso-8601'}, + 'on_premise_recovery_point_count': {'key': 'onPremiseRecoveryPointCount', 'type': 'int'}, + 'is_collocated': {'key': 'isCollocated', 'type': 'bool'}, + 'protection_group_name': {'key': 'protectionGroupName', 'type': 'str'}, + 'disk_storage_used_in_bytes': {'key': 'diskStorageUsedInBytes', 'type': 'str'}, + 'total_disk_storage_size_in_bytes': {'key': 'totalDiskStorageSizeInBytes', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DPMProtectedItemExtendedInfo, self).__init__(**kwargs) + self.protectable_object_load_path = kwargs.get('protectable_object_load_path', None) + self.protected = kwargs.get('protected', None) + self.is_present_on_cloud = kwargs.get('is_present_on_cloud', None) + self.last_backup_status = kwargs.get('last_backup_status', None) + self.last_refreshed_at = kwargs.get('last_refreshed_at', None) + self.oldest_recovery_point = kwargs.get('oldest_recovery_point', None) + self.recovery_point_count = kwargs.get('recovery_point_count', None) + self.on_premise_oldest_recovery_point = kwargs.get('on_premise_oldest_recovery_point', None) + self.on_premise_latest_recovery_point = kwargs.get('on_premise_latest_recovery_point', None) + self.on_premise_recovery_point_count = kwargs.get('on_premise_recovery_point_count', None) + self.is_collocated = kwargs.get('is_collocated', None) + self.protection_group_name = kwargs.get('protection_group_name', None) + self.disk_storage_used_in_bytes = kwargs.get('disk_storage_used_in_bytes', None) + self.total_disk_storage_size_in_bytes = kwargs.get('total_disk_storage_size_in_bytes', None) + + +class EncryptionDetails(msrest.serialization.Model): + """Details needed if the VM was encrypted at the time of backup. + + :param encryption_enabled: Identifies whether this backup copy represents an encrypted VM at + the time of backup. + :type encryption_enabled: bool + :param kek_url: Key Url. + :type kek_url: str + :param secret_key_url: Secret Url. + :type secret_key_url: str + :param kek_vault_id: ID of Key Vault where KEK is stored. + :type kek_vault_id: str + :param secret_key_vault_id: ID of Key Vault where Secret is stored. + :type secret_key_vault_id: str + """ + + _attribute_map = { + 'encryption_enabled': {'key': 'encryptionEnabled', 'type': 'bool'}, + 'kek_url': {'key': 'kekUrl', 'type': 'str'}, + 'secret_key_url': {'key': 'secretKeyUrl', 'type': 'str'}, + 'kek_vault_id': {'key': 'kekVaultId', 'type': 'str'}, + 'secret_key_vault_id': {'key': 'secretKeyVaultId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EncryptionDetails, self).__init__(**kwargs) + self.encryption_enabled = kwargs.get('encryption_enabled', None) + self.kek_url = kwargs.get('kek_url', None) + self.secret_key_url = kwargs.get('secret_key_url', None) + self.kek_vault_id = kwargs.get('kek_vault_id', None) + self.secret_key_vault_id = kwargs.get('secret_key_vault_id', 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 type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: str + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """Error Detail class which encapsulates Code, Message and Recommendations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error Message related to the Code. + :vartype message: str + :ivar recommendations: List of recommendation strings. + :vartype recommendations: list[str] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'recommendations': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.recommendations = None + + +class OperationResultInfoBase(msrest.serialization.Model): + """Base class for operation result info. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ExportJobsOperationResultInfo, OperationResultInfo. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'ExportJobsOperationResultInfo': 'ExportJobsOperationResultInfo', 'OperationResultInfo': 'OperationResultInfo'} + } + + def __init__( + self, + **kwargs + ): + super(OperationResultInfoBase, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class ExportJobsOperationResultInfo(OperationResultInfoBase): + """This class is used to send blob details after exporting jobs. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param blob_url: URL of the blob into which the serialized string of list of jobs is exported. + :type blob_url: str + :param blob_sas_key: SAS key to access the blob. It expires in 15 mins. + :type blob_sas_key: str + :param excel_file_blob_url: URL of the blob into which the ExcelFile is uploaded. + :type excel_file_blob_url: str + :param excel_file_blob_sas_key: SAS key to access the blob. It expires in 15 mins. + :type excel_file_blob_sas_key: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'blob_url': {'key': 'blobUrl', 'type': 'str'}, + 'blob_sas_key': {'key': 'blobSasKey', 'type': 'str'}, + 'excel_file_blob_url': {'key': 'excelFileBlobUrl', 'type': 'str'}, + 'excel_file_blob_sas_key': {'key': 'excelFileBlobSasKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExportJobsOperationResultInfo, self).__init__(**kwargs) + self.object_type = 'ExportJobsOperationResultInfo' # type: str + self.blob_url = kwargs.get('blob_url', None) + self.blob_sas_key = kwargs.get('blob_sas_key', None) + self.excel_file_blob_url = kwargs.get('excel_file_blob_url', None) + self.excel_file_blob_sas_key = kwargs.get('excel_file_blob_sas_key', None) + + +class ExtendedProperties(msrest.serialization.Model): + """Extended Properties for Azure IaasVM Backup. + + :param disk_exclusion_properties: Extended Properties for Disk Exclusion. + :type disk_exclusion_properties: + ~azure.mgmt.recoveryservicesbackup.models.DiskExclusionProperties + """ + + _attribute_map = { + 'disk_exclusion_properties': {'key': 'diskExclusionProperties', 'type': 'DiskExclusionProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtendedProperties, self).__init__(**kwargs) + self.disk_exclusion_properties = kwargs.get('disk_exclusion_properties', None) + + +class GenericContainer(ProtectionContainer): + """Base class for generic container of backup items. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param fabric_name: Name of the container's fabric. + :type fabric_name: str + :param extended_information: Extended information (not returned in List container API calls). + :type extended_information: + ~azure.mgmt.recoveryservicesbackup.models.GenericContainerExtendedInfo + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'fabric_name': {'key': 'fabricName', 'type': 'str'}, + 'extended_information': {'key': 'extendedInformation', 'type': 'GenericContainerExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(GenericContainer, self).__init__(**kwargs) + self.container_type = 'GenericContainer' # type: str + self.fabric_name = kwargs.get('fabric_name', None) + self.extended_information = kwargs.get('extended_information', None) + + +class GenericContainerExtendedInfo(msrest.serialization.Model): + """Container extended information. + + :param raw_cert_data: Public key of container cert. + :type raw_cert_data: str + :param container_identity_info: Container identity information. + :type container_identity_info: ~azure.mgmt.recoveryservicesbackup.models.ContainerIdentityInfo + :param service_endpoints: Azure Backup Service Endpoints for the container. + :type service_endpoints: dict[str, str] + """ + + _attribute_map = { + 'raw_cert_data': {'key': 'rawCertData', 'type': 'str'}, + 'container_identity_info': {'key': 'containerIdentityInfo', 'type': 'ContainerIdentityInfo'}, + 'service_endpoints': {'key': 'serviceEndpoints', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(GenericContainerExtendedInfo, self).__init__(**kwargs) + self.raw_cert_data = kwargs.get('raw_cert_data', None) + self.container_identity_info = kwargs.get('container_identity_info', None) + self.service_endpoints = kwargs.get('service_endpoints', None) + + +class GenericProtectedItem(ProtectedItem): + """Base class for backup items. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param policy_state: Indicates consistency of policy object and policy applied to this backup + item. + :type policy_state: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param protected_item_id: Data Plane Service ID of the protected item. + :type protected_item_id: long + :param source_associations: Loosely coupled (type, value) associations (example - parent of a + protected item). + :type source_associations: dict[str, str] + :param fabric_name: Name of this backup item's fabric. + :type fabric_name: str + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'policy_state': {'key': 'policyState', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'protected_item_id': {'key': 'protectedItemId', 'type': 'long'}, + 'source_associations': {'key': 'sourceAssociations', 'type': '{str}'}, + 'fabric_name': {'key': 'fabricName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GenericProtectedItem, self).__init__(**kwargs) + self.protected_item_type = 'GenericProtectedItem' # type: str + self.friendly_name = kwargs.get('friendly_name', None) + self.policy_state = kwargs.get('policy_state', None) + self.protection_state = kwargs.get('protection_state', None) + self.protected_item_id = kwargs.get('protected_item_id', None) + self.source_associations = kwargs.get('source_associations', None) + self.fabric_name = kwargs.get('fabric_name', None) + + +class GenericProtectionPolicy(ProtectionPolicy): + """Azure VM (Mercury) workload-specific backup policy. + + All required parameters must be populated in order to send to Azure. + + :param protected_items_count: Number of items associated with this policy. + :type protected_items_count: int + :param backup_management_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 backup_management_type: str + :param sub_protection_policy: List of sub-protection policies which includes schedule and + retention. + :type sub_protection_policy: + list[~azure.mgmt.recoveryservicesbackup.models.SubProtectionPolicy] + :param time_zone: TimeZone optional input as string. For example: TimeZone = "Pacific Standard + Time". + :type time_zone: str + :param fabric_name: Name of this policy's fabric. + :type fabric_name: str + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'sub_protection_policy': {'key': 'subProtectionPolicy', 'type': '[SubProtectionPolicy]'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'fabric_name': {'key': 'fabricName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GenericProtectionPolicy, self).__init__(**kwargs) + self.backup_management_type = 'GenericProtectionPolicy' # type: str + self.sub_protection_policy = kwargs.get('sub_protection_policy', None) + self.time_zone = kwargs.get('time_zone', None) + self.fabric_name = kwargs.get('fabric_name', None) + + +class GenericRecoveryPoint(RecoveryPoint): + """Generic backup copy. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param friendly_name: Friendly name of the backup copy. + :type friendly_name: str + :param recovery_point_type: Type of the backup copy. + :type recovery_point_type: str + :param recovery_point_time: Time at which this backup copy was created. + :type recovery_point_time: ~datetime.datetime + :param recovery_point_additional_info: Additional information associated with this backup copy. + :type recovery_point_additional_info: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, + 'recovery_point_additional_info': {'key': 'recoveryPointAdditionalInfo', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GenericRecoveryPoint, self).__init__(**kwargs) + self.object_type = 'GenericRecoveryPoint' # type: str + self.friendly_name = kwargs.get('friendly_name', None) + self.recovery_point_type = kwargs.get('recovery_point_type', None) + self.recovery_point_time = kwargs.get('recovery_point_time', None) + self.recovery_point_additional_info = kwargs.get('recovery_point_additional_info', None) + + +class GetProtectedItemQueryObject(msrest.serialization.Model): + """Filters to list backup items. + + :param expand: Specifies if the additional information should be provided for this item. + :type expand: str + """ + + _attribute_map = { + 'expand': {'key': 'expand', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GetProtectedItemQueryObject, self).__init__(**kwargs) + self.expand = kwargs.get('expand', None) + + +class IaasVMBackupRequest(BackupRequest): + """IaaS VM workload-specific backup request. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_expiry_time_in_utc: Backup copy will expire after the time specified + (UTC). + :type recovery_point_expiry_time_in_utc: ~datetime.datetime + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_expiry_time_in_utc': {'key': 'recoveryPointExpiryTimeInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(IaasVMBackupRequest, self).__init__(**kwargs) + self.object_type = 'IaasVMBackupRequest' # type: str + self.recovery_point_expiry_time_in_utc = kwargs.get('recovery_point_expiry_time_in_utc', None) + + +class IaasVMILRRegistrationRequest(ILRRequest): + """Restore files/folders from a backup copy of IaaS VM. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_id: ID of the IaaS VM backup copy from where the files/folders have to be + restored. + :type recovery_point_id: str + :param virtual_machine_id: Fully qualified ARM ID of the virtual machine whose the files / + folders have to be restored. + :type virtual_machine_id: str + :param initiator_name: iSCSI initiator name. + :type initiator_name: str + :param renew_existing_registration: Whether to renew existing registration with the iSCSI + server. + :type renew_existing_registration: bool + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + 'initiator_name': {'key': 'initiatorName', 'type': 'str'}, + 'renew_existing_registration': {'key': 'renewExistingRegistration', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(IaasVMILRRegistrationRequest, self).__init__(**kwargs) + self.object_type = 'IaasVMILRRegistrationRequest' # type: str + self.recovery_point_id = kwargs.get('recovery_point_id', None) + self.virtual_machine_id = kwargs.get('virtual_machine_id', None) + self.initiator_name = kwargs.get('initiator_name', None) + self.renew_existing_registration = kwargs.get('renew_existing_registration', None) + + +class IaasVMRecoveryPoint(RecoveryPoint): + """IaaS VM workload specific backup copy. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_type: Type of the backup copy. + :type recovery_point_type: str + :param recovery_point_time: Time at which this backup copy was created. + :type recovery_point_time: ~datetime.datetime + :param recovery_point_additional_info: Additional information associated with this backup copy. + :type recovery_point_additional_info: str + :param source_vm_storage_type: Storage type of the VM whose backup copy is created. + :type source_vm_storage_type: str + :param is_source_vm_encrypted: Identifies whether the VM was encrypted when the backup copy is + created. + :type is_source_vm_encrypted: bool + :param key_and_secret: Required details for recovering an encrypted VM. Applicable only when + IsSourceVMEncrypted is true. + :type key_and_secret: ~azure.mgmt.recoveryservicesbackup.models.KeyAndSecretDetails + :param is_instant_ilr_session_active: Is the session to recover items from this backup copy + still active. + :type is_instant_ilr_session_active: bool + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param is_managed_virtual_machine: Whether VM is with Managed Disks. + :type is_managed_virtual_machine: bool + :param virtual_machine_size: Virtual Machine Size. + :type virtual_machine_size: str + :param original_storage_account_option: Original Storage Account Option. + :type original_storage_account_option: bool + :param os_type: OS type. + :type os_type: str + :param recovery_point_disk_configuration: Disk configuration. + :type recovery_point_disk_configuration: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointDiskConfiguration + :param zones: Identifies the zone of the VM at the time of backup. Applicable only for + zone-pinned Vms. + :type zones: list[str] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, + 'recovery_point_additional_info': {'key': 'recoveryPointAdditionalInfo', 'type': 'str'}, + 'source_vm_storage_type': {'key': 'sourceVMStorageType', 'type': 'str'}, + 'is_source_vm_encrypted': {'key': 'isSourceVMEncrypted', 'type': 'bool'}, + 'key_and_secret': {'key': 'keyAndSecret', 'type': 'KeyAndSecretDetails'}, + 'is_instant_ilr_session_active': {'key': 'isInstantIlrSessionActive', 'type': 'bool'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'is_managed_virtual_machine': {'key': 'isManagedVirtualMachine', 'type': 'bool'}, + 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, + 'original_storage_account_option': {'key': 'originalStorageAccountOption', 'type': 'bool'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'recovery_point_disk_configuration': {'key': 'recoveryPointDiskConfiguration', 'type': 'RecoveryPointDiskConfiguration'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + } + + def __init__( + self, + **kwargs + ): + super(IaasVMRecoveryPoint, self).__init__(**kwargs) + self.object_type = 'IaasVMRecoveryPoint' # type: str + self.recovery_point_type = kwargs.get('recovery_point_type', None) + self.recovery_point_time = kwargs.get('recovery_point_time', None) + self.recovery_point_additional_info = kwargs.get('recovery_point_additional_info', None) + self.source_vm_storage_type = kwargs.get('source_vm_storage_type', None) + self.is_source_vm_encrypted = kwargs.get('is_source_vm_encrypted', None) + self.key_and_secret = kwargs.get('key_and_secret', None) + self.is_instant_ilr_session_active = kwargs.get('is_instant_ilr_session_active', None) + self.recovery_point_tier_details = kwargs.get('recovery_point_tier_details', None) + self.is_managed_virtual_machine = kwargs.get('is_managed_virtual_machine', None) + self.virtual_machine_size = kwargs.get('virtual_machine_size', None) + self.original_storage_account_option = kwargs.get('original_storage_account_option', None) + self.os_type = kwargs.get('os_type', None) + self.recovery_point_disk_configuration = kwargs.get('recovery_point_disk_configuration', None) + self.zones = kwargs.get('zones', None) + self.recovery_point_move_readiness_info = kwargs.get('recovery_point_move_readiness_info', None) + + +class IaasVMRecoveryPointAutoGenerated(RecoveryPoint): + """IaaS VM workload specific backup copy. + + 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 object_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 object_type: str + :ivar recovery_point_type: Type of the backup copy. + :vartype recovery_point_type: str + :ivar recovery_point_time: Time at which this backup copy was created. + :vartype recovery_point_time: ~datetime.datetime + :ivar recovery_point_additional_info: Additional information associated with this backup copy. + :vartype recovery_point_additional_info: str + :ivar source_vm_storage_type: Storage type of the VM whose backup copy is created. + :vartype source_vm_storage_type: str + :ivar is_source_vm_encrypted: Identifies whether the VM was encrypted when the backup copy is + created. + :vartype is_source_vm_encrypted: bool + :param key_and_secret: Required details for recovering an encrypted VM. Applicable only when + IsSourceVMEncrypted is true. + :type key_and_secret: ~azure.mgmt.recoveryservicesbackup.models.KeyAndSecretDetails + :param is_instant_ilr_session_active: Is the session to recover items from this backup copy + still active. + :type is_instant_ilr_session_active: bool + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param is_managed_virtual_machine: Whether VM is with Managed Disks. + :type is_managed_virtual_machine: bool + :param virtual_machine_size: Virtual Machine Size. + :type virtual_machine_size: str + :param original_storage_account_option: Original Storage Account Option. + :type original_storage_account_option: bool + :param os_type: OS type. + :type os_type: str + :param recovery_point_disk_configuration: Disk configuration. + :type recovery_point_disk_configuration: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointDiskConfiguration + :param zones: Identifies the zone of the VM at the time of backup. Applicable only for + zone-pinned Vms. + :type zones: list[str] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_type': {'readonly': True}, + 'recovery_point_time': {'readonly': True}, + 'recovery_point_additional_info': {'readonly': True}, + 'source_vm_storage_type': {'readonly': True}, + 'is_source_vm_encrypted': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, + 'recovery_point_additional_info': {'key': 'recoveryPointAdditionalInfo', 'type': 'str'}, + 'source_vm_storage_type': {'key': 'sourceVMStorageType', 'type': 'str'}, + 'is_source_vm_encrypted': {'key': 'isSourceVMEncrypted', 'type': 'bool'}, + 'key_and_secret': {'key': 'keyAndSecret', 'type': 'KeyAndSecretDetails'}, + 'is_instant_ilr_session_active': {'key': 'isInstantIlrSessionActive', 'type': 'bool'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'is_managed_virtual_machine': {'key': 'isManagedVirtualMachine', 'type': 'bool'}, + 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, + 'original_storage_account_option': {'key': 'originalStorageAccountOption', 'type': 'bool'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'recovery_point_disk_configuration': {'key': 'recoveryPointDiskConfiguration', 'type': 'RecoveryPointDiskConfiguration'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + } + + def __init__( + self, + **kwargs + ): + super(IaasVMRecoveryPointAutoGenerated, self).__init__(**kwargs) + self.object_type = 'IaasVMRecoveryPoint' # type: str + self.recovery_point_type = None + self.recovery_point_time = None + self.recovery_point_additional_info = None + self.source_vm_storage_type = None + self.is_source_vm_encrypted = None + self.key_and_secret = kwargs.get('key_and_secret', None) + self.is_instant_ilr_session_active = kwargs.get('is_instant_ilr_session_active', None) + self.recovery_point_tier_details = kwargs.get('recovery_point_tier_details', None) + self.is_managed_virtual_machine = kwargs.get('is_managed_virtual_machine', None) + self.virtual_machine_size = kwargs.get('virtual_machine_size', None) + self.original_storage_account_option = kwargs.get('original_storage_account_option', None) + self.os_type = kwargs.get('os_type', None) + self.recovery_point_disk_configuration = kwargs.get('recovery_point_disk_configuration', None) + self.zones = kwargs.get('zones', None) + self.recovery_point_move_readiness_info = kwargs.get('recovery_point_move_readiness_info', None) + + +class IaasVMRestoreRequest(RestoreRequest): + """IaaS VM workload-specific restore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: IaasVMRestoreWithRehydrationRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_id: ID of the backup copy to be recovered. + :type recovery_point_id: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM which is being recovered. + :type source_resource_id: str + :param target_virtual_machine_id: This is the complete ARM Id of the VM that will be created. + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param target_resource_group_id: This is the ARM Id of the resource group that you want to + create for this Virtual machine and other artifacts. + For e.g. /subscriptions/{subId}/resourcegroups/{rg}. + :type target_resource_group_id: str + :param storage_account_id: Fully qualified ARM ID of the storage account to which the VM has to + be restored. + :type storage_account_id: str + :param virtual_network_id: This is the virtual network Id of the vnet that will be attached to + the virtual machine. + User will be validated for join action permissions in the linked access. + :type virtual_network_id: str + :param subnet_id: Subnet ID, is the subnet ID associated with the to be restored VM. For + Classic VMs it would be + {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource + ID used to represent + the subnet. + :type subnet_id: str + :param target_domain_name_id: Fully qualified ARM ID of the domain name to be associated to the + VM being restored. This applies only to Classic + Virtual Machines. + :type target_domain_name_id: str + :param region: Region in which the virtual machine is restored. + :type region: str + :param affinity_group: Affinity group associated to VM to be restored. Used only for Classic + Compute Virtual Machines. + :type affinity_group: str + :param create_new_cloud_service: Should a new cloud service be created while restoring the VM. + If this is false, VM will be restored to the same + cloud service as it was at the time of backup. + :type create_new_cloud_service: bool + :param original_storage_account_option: Original Storage Account Option. + :type original_storage_account_option: bool + :param encryption_details: Details needed if the VM was encrypted at the time of backup. + :type encryption_details: ~azure.mgmt.recoveryservicesbackup.models.EncryptionDetails + :param restore_disk_lun_list: List of Disk LUNs for partial restore. + :type restore_disk_lun_list: list[int] + :param restore_with_managed_disks: Flag to denote of an Unmanaged disk VM should be restored + with Managed disks. + :type restore_with_managed_disks: bool + :param disk_encryption_set_id: DiskEncryptionSet's ID - needed if the VM needs to be encrypted + at rest during restore with customer managed key. + :type disk_encryption_set_id: str + :param zones: Target zone where the VM and its disks should be restored. + :type zones: list[str] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'target_resource_group_id': {'key': 'targetResourceGroupId', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'virtual_network_id': {'key': 'virtualNetworkId', 'type': 'str'}, + 'subnet_id': {'key': 'subnetId', 'type': 'str'}, + 'target_domain_name_id': {'key': 'targetDomainNameId', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'affinity_group': {'key': 'affinityGroup', 'type': 'str'}, + 'create_new_cloud_service': {'key': 'createNewCloudService', 'type': 'bool'}, + 'original_storage_account_option': {'key': 'originalStorageAccountOption', 'type': 'bool'}, + 'encryption_details': {'key': 'encryptionDetails', 'type': 'EncryptionDetails'}, + 'restore_disk_lun_list': {'key': 'restoreDiskLunList', 'type': '[int]'}, + 'restore_with_managed_disks': {'key': 'restoreWithManagedDisks', 'type': 'bool'}, + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + _subtype_map = { + 'object_type': {'IaasVMRestoreWithRehydrationRequest': 'IaasVMRestoreWithRehydrationRequest'} + } + + def __init__( + self, + **kwargs + ): + super(IaasVMRestoreRequest, self).__init__(**kwargs) + self.object_type = 'IaasVMRestoreRequest' # type: str + self.recovery_point_id = kwargs.get('recovery_point_id', None) + self.recovery_type = kwargs.get('recovery_type', None) + self.source_resource_id = kwargs.get('source_resource_id', None) + self.target_virtual_machine_id = kwargs.get('target_virtual_machine_id', None) + self.target_resource_group_id = kwargs.get('target_resource_group_id', None) + self.storage_account_id = kwargs.get('storage_account_id', None) + self.virtual_network_id = kwargs.get('virtual_network_id', None) + self.subnet_id = kwargs.get('subnet_id', None) + self.target_domain_name_id = kwargs.get('target_domain_name_id', None) + self.region = kwargs.get('region', None) + self.affinity_group = kwargs.get('affinity_group', None) + self.create_new_cloud_service = kwargs.get('create_new_cloud_service', None) + self.original_storage_account_option = kwargs.get('original_storage_account_option', None) + self.encryption_details = kwargs.get('encryption_details', None) + self.restore_disk_lun_list = kwargs.get('restore_disk_lun_list', None) + self.restore_with_managed_disks = kwargs.get('restore_with_managed_disks', None) + self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) + self.zones = kwargs.get('zones', None) + + +class IaasVMRestoreWithRehydrationRequest(IaasVMRestoreRequest): + """IaaS VM workload-specific restore with integrated rehydration of recovery point. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_id: ID of the backup copy to be recovered. + :type recovery_point_id: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM which is being recovered. + :type source_resource_id: str + :param target_virtual_machine_id: This is the complete ARM Id of the VM that will be created. + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param target_resource_group_id: This is the ARM Id of the resource group that you want to + create for this Virtual machine and other artifacts. + For e.g. /subscriptions/{subId}/resourcegroups/{rg}. + :type target_resource_group_id: str + :param storage_account_id: Fully qualified ARM ID of the storage account to which the VM has to + be restored. + :type storage_account_id: str + :param virtual_network_id: This is the virtual network Id of the vnet that will be attached to + the virtual machine. + User will be validated for join action permissions in the linked access. + :type virtual_network_id: str + :param subnet_id: Subnet ID, is the subnet ID associated with the to be restored VM. For + Classic VMs it would be + {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource + ID used to represent + the subnet. + :type subnet_id: str + :param target_domain_name_id: Fully qualified ARM ID of the domain name to be associated to the + VM being restored. This applies only to Classic + Virtual Machines. + :type target_domain_name_id: str + :param region: Region in which the virtual machine is restored. + :type region: str + :param affinity_group: Affinity group associated to VM to be restored. Used only for Classic + Compute Virtual Machines. + :type affinity_group: str + :param create_new_cloud_service: Should a new cloud service be created while restoring the VM. + If this is false, VM will be restored to the same + cloud service as it was at the time of backup. + :type create_new_cloud_service: bool + :param original_storage_account_option: Original Storage Account Option. + :type original_storage_account_option: bool + :param encryption_details: Details needed if the VM was encrypted at the time of backup. + :type encryption_details: ~azure.mgmt.recoveryservicesbackup.models.EncryptionDetails + :param restore_disk_lun_list: List of Disk LUNs for partial restore. + :type restore_disk_lun_list: list[int] + :param restore_with_managed_disks: Flag to denote of an Unmanaged disk VM should be restored + with Managed disks. + :type restore_with_managed_disks: bool + :param disk_encryption_set_id: DiskEncryptionSet's ID - needed if the VM needs to be encrypted + at rest during restore with customer managed key. + :type disk_encryption_set_id: str + :param zones: Target zone where the VM and its disks should be restored. + :type zones: list[str] + :param recovery_point_rehydration_info: RP Rehydration Info. + :type recovery_point_rehydration_info: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointRehydrationInfo + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'target_resource_group_id': {'key': 'targetResourceGroupId', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'virtual_network_id': {'key': 'virtualNetworkId', 'type': 'str'}, + 'subnet_id': {'key': 'subnetId', 'type': 'str'}, + 'target_domain_name_id': {'key': 'targetDomainNameId', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'affinity_group': {'key': 'affinityGroup', 'type': 'str'}, + 'create_new_cloud_service': {'key': 'createNewCloudService', 'type': 'bool'}, + 'original_storage_account_option': {'key': 'originalStorageAccountOption', 'type': 'bool'}, + 'encryption_details': {'key': 'encryptionDetails', 'type': 'EncryptionDetails'}, + 'restore_disk_lun_list': {'key': 'restoreDiskLunList', 'type': '[int]'}, + 'restore_with_managed_disks': {'key': 'restoreWithManagedDisks', 'type': 'bool'}, + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'recovery_point_rehydration_info': {'key': 'recoveryPointRehydrationInfo', 'type': 'RecoveryPointRehydrationInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(IaasVMRestoreWithRehydrationRequest, self).__init__(**kwargs) + self.object_type = 'IaasVMRestoreWithRehydrationRequest' # type: str + self.recovery_point_rehydration_info = kwargs.get('recovery_point_rehydration_info', None) + + +class ILRRequestResource(Resource): + """Parameters to Provision ILR API. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: ILRRequestResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.ILRRequest + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ILRRequest'}, + } + + def __init__( + self, + **kwargs + ): + super(ILRRequestResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class InquiryInfo(msrest.serialization.Model): + """Details about inquired protectable items under a given container. + + :param status: Inquiry Status for this container such as + InProgress | Failed | Succeeded. + :type status: str + :param error_detail: Error Details if the Status is non-success. + :type error_detail: ~azure.mgmt.recoveryservicesbackup.models.ErrorDetail + :param inquiry_details: Inquiry Details which will have workload specific details. + For e.g. - For SQL and oracle this will contain different details. + :type inquiry_details: list[~azure.mgmt.recoveryservicesbackup.models.WorkloadInquiryDetails] + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error_detail': {'key': 'errorDetail', 'type': 'ErrorDetail'}, + 'inquiry_details': {'key': 'inquiryDetails', 'type': '[WorkloadInquiryDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(InquiryInfo, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error_detail = kwargs.get('error_detail', None) + self.inquiry_details = kwargs.get('inquiry_details', None) + + +class InquiryValidation(msrest.serialization.Model): + """Validation for inquired protectable items under a given container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param status: Status for the Inquiry Validation. + :type status: str + :param error_detail: Error Detail in case the status is non-success. + :type error_detail: ~azure.mgmt.recoveryservicesbackup.models.ErrorDetail + :ivar additional_detail: Error Additional Detail in case the status is non-success. + :vartype additional_detail: str + """ + + _validation = { + 'additional_detail': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error_detail': {'key': 'errorDetail', 'type': 'ErrorDetail'}, + 'additional_detail': {'key': 'additionalDetail', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InquiryValidation, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error_detail = kwargs.get('error_detail', None) + self.additional_detail = None + + +class InstantItemRecoveryTarget(msrest.serialization.Model): + """Target details for file / folder restore. + + :param client_scripts: List of client scripts. + :type client_scripts: list[~azure.mgmt.recoveryservicesbackup.models.ClientScriptForConnect] + """ + + _attribute_map = { + 'client_scripts': {'key': 'clientScripts', 'type': '[ClientScriptForConnect]'}, + } + + def __init__( + self, + **kwargs + ): + super(InstantItemRecoveryTarget, self).__init__(**kwargs) + self.client_scripts = kwargs.get('client_scripts', None) + + +class InstantRPAdditionalDetails(msrest.serialization.Model): + """InstantRPAdditionalDetails. + + :param azure_backup_rg_name_prefix: + :type azure_backup_rg_name_prefix: str + :param azure_backup_rg_name_suffix: + :type azure_backup_rg_name_suffix: str + """ + + _attribute_map = { + 'azure_backup_rg_name_prefix': {'key': 'azureBackupRGNamePrefix', 'type': 'str'}, + 'azure_backup_rg_name_suffix': {'key': 'azureBackupRGNameSuffix', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InstantRPAdditionalDetails, self).__init__(**kwargs) + self.azure_backup_rg_name_prefix = kwargs.get('azure_backup_rg_name_prefix', None) + self.azure_backup_rg_name_suffix = kwargs.get('azure_backup_rg_name_suffix', None) + + +class JobQueryObject(msrest.serialization.Model): + """Filters to list the jobs. + + :param status: Status of the job. Possible values include: "Invalid", "InProgress", + "Completed", "Failed", "CompletedWithWarnings", "Cancelled", "Cancelling". + :type status: str or ~azure.mgmt.recoveryservicesbackup.models.JobStatus + :param backup_management_type: Type of backup management for the job. Possible values include: + "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", "AzureStorage", + "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: Type of operation. Possible values include: "Invalid", "Register", + "UnRegister", "ConfigureBackup", "Backup", "Restore", "DisableBackup", "DeleteBackupData", + "CrossRegionRestore", "Undelete", "UpdateCustomerManagedKey". + :type operation: str or ~azure.mgmt.recoveryservicesbackup.models.JobOperationType + :param job_id: JobID represents the job uniquely. + :type job_id: str + :param start_time: Job has started at this time. Value is in UTC. + :type start_time: ~datetime.datetime + :param end_time: Job has ended at this time. Value is in UTC. + :type end_time: ~datetime.datetime + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(JobQueryObject, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.operation = kwargs.get('operation', None) + self.job_id = kwargs.get('job_id', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + + +class JobResource(Resource): + """Defines workload agnostic properties for a job. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: JobResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.Job + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'Job'}, + } + + def __init__( + self, + **kwargs + ): + super(JobResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class JobResourceList(ResourceList): + """List of Job resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.JobResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[JobResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(JobResourceList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class KEKDetails(msrest.serialization.Model): + """KEK is encryption key for BEK. + + :param key_url: Key is KEK. + :type key_url: str + :param key_vault_id: Key Vault ID where this Key is stored. + :type key_vault_id: str + :param key_backup_data: KEK data. + :type key_backup_data: str + """ + + _attribute_map = { + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + 'key_backup_data': {'key': 'keyBackupData', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KEKDetails, self).__init__(**kwargs) + self.key_url = kwargs.get('key_url', None) + self.key_vault_id = kwargs.get('key_vault_id', None) + self.key_backup_data = kwargs.get('key_backup_data', None) + + +class KeyAndSecretDetails(msrest.serialization.Model): + """BEK is bitlocker key. +KEK is encryption key for BEK +If the VM was encrypted then we will store following details : + + +#. Secret(BEK) - Url + Backup Data + vaultId. +#. Key(KEK) - Url + Backup Data + vaultId. +#. EncryptionMechanism + BEK and KEK can potentially have different vault ids. + + :param kek_details: KEK is encryption key for BEK. + :type kek_details: ~azure.mgmt.recoveryservicesbackup.models.KEKDetails + :param bek_details: BEK is bitlocker encryption key. + :type bek_details: ~azure.mgmt.recoveryservicesbackup.models.BEKDetails + :param encryption_mechanism: Encryption mechanism: None/ SinglePass/ DoublePass. + :type encryption_mechanism: str + """ + + _attribute_map = { + 'kek_details': {'key': 'kekDetails', 'type': 'KEKDetails'}, + 'bek_details': {'key': 'bekDetails', 'type': 'BEKDetails'}, + 'encryption_mechanism': {'key': 'encryptionMechanism', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyAndSecretDetails, self).__init__(**kwargs) + self.kek_details = kwargs.get('kek_details', None) + self.bek_details = kwargs.get('bek_details', None) + self.encryption_mechanism = kwargs.get('encryption_mechanism', None) + + +class KPIResourceHealthDetails(msrest.serialization.Model): + """KPI Resource Health Details. + + :param resource_health_status: Resource Health Status. Possible values include: "Healthy", + "TransientDegraded", "PersistentDegraded", "TransientUnhealthy", "PersistentUnhealthy", + "Invalid". + :type resource_health_status: str or + ~azure.mgmt.recoveryservicesbackup.models.ResourceHealthStatus + :param resource_health_details: Resource Health Status. + :type resource_health_details: + list[~azure.mgmt.recoveryservicesbackup.models.ResourceHealthDetails] + """ + + _attribute_map = { + 'resource_health_status': {'key': 'resourceHealthStatus', 'type': 'str'}, + 'resource_health_details': {'key': 'resourceHealthDetails', 'type': '[ResourceHealthDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(KPIResourceHealthDetails, self).__init__(**kwargs) + self.resource_health_status = kwargs.get('resource_health_status', None) + self.resource_health_details = kwargs.get('resource_health_details', None) + + +class ListRecoveryPointsRecommendedForMoveRequest(msrest.serialization.Model): + """ListRecoveryPointsRecommendedForMoveRequest Request. + + :param object_type: Gets the class type. + :type object_type: str + :param excluded_rp_list: List of Recovery Points excluded from Move. + :type excluded_rp_list: list[str] + """ + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'excluded_rp_list': {'key': 'excludedRPList', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListRecoveryPointsRecommendedForMoveRequest, self).__init__(**kwargs) + self.object_type = kwargs.get('object_type', None) + self.excluded_rp_list = kwargs.get('excluded_rp_list', None) + + +class SchedulePolicy(msrest.serialization.Model): + """Base class for backup schedule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: LogSchedulePolicy, LongTermSchedulePolicy, SimpleSchedulePolicy. + + All required parameters must be populated in order to send to Azure. + + :param schedule_policy_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 schedule_policy_type: str + """ + + _validation = { + 'schedule_policy_type': {'required': True}, + } + + _attribute_map = { + 'schedule_policy_type': {'key': 'schedulePolicyType', 'type': 'str'}, + } + + _subtype_map = { + 'schedule_policy_type': {'LogSchedulePolicy': 'LogSchedulePolicy', 'LongTermSchedulePolicy': 'LongTermSchedulePolicy', 'SimpleSchedulePolicy': 'SimpleSchedulePolicy'} + } + + def __init__( + self, + **kwargs + ): + super(SchedulePolicy, self).__init__(**kwargs) + self.schedule_policy_type = None # type: Optional[str] + + +class LogSchedulePolicy(SchedulePolicy): + """Log policy schedule. + + All required parameters must be populated in order to send to Azure. + + :param schedule_policy_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 schedule_policy_type: str + :param schedule_frequency_in_mins: Frequency of the log schedule operation of this policy in + minutes. + :type schedule_frequency_in_mins: int + """ + + _validation = { + 'schedule_policy_type': {'required': True}, + } + + _attribute_map = { + 'schedule_policy_type': {'key': 'schedulePolicyType', 'type': 'str'}, + 'schedule_frequency_in_mins': {'key': 'scheduleFrequencyInMins', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(LogSchedulePolicy, self).__init__(**kwargs) + self.schedule_policy_type = 'LogSchedulePolicy' # type: str + self.schedule_frequency_in_mins = kwargs.get('schedule_frequency_in_mins', None) + + +class RetentionPolicy(msrest.serialization.Model): + """Base class for retention policy. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: LongTermRetentionPolicy, SimpleRetentionPolicy. + + All required parameters must be populated in order to send to Azure. + + :param retention_policy_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 retention_policy_type: str + """ + + _validation = { + 'retention_policy_type': {'required': True}, + } + + _attribute_map = { + 'retention_policy_type': {'key': 'retentionPolicyType', 'type': 'str'}, + } + + _subtype_map = { + 'retention_policy_type': {'LongTermRetentionPolicy': 'LongTermRetentionPolicy', 'SimpleRetentionPolicy': 'SimpleRetentionPolicy'} + } + + def __init__( + self, + **kwargs + ): + super(RetentionPolicy, self).__init__(**kwargs) + self.retention_policy_type = None # type: Optional[str] + + +class LongTermRetentionPolicy(RetentionPolicy): + """Long term retention policy. + + All required parameters must be populated in order to send to Azure. + + :param retention_policy_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 retention_policy_type: str + :param daily_schedule: Daily retention schedule of the protection policy. + :type daily_schedule: ~azure.mgmt.recoveryservicesbackup.models.DailyRetentionSchedule + :param weekly_schedule: Weekly retention schedule of the protection policy. + :type weekly_schedule: ~azure.mgmt.recoveryservicesbackup.models.WeeklyRetentionSchedule + :param monthly_schedule: Monthly retention schedule of the protection policy. + :type monthly_schedule: ~azure.mgmt.recoveryservicesbackup.models.MonthlyRetentionSchedule + :param yearly_schedule: Yearly retention schedule of the protection policy. + :type yearly_schedule: ~azure.mgmt.recoveryservicesbackup.models.YearlyRetentionSchedule + """ + + _validation = { + 'retention_policy_type': {'required': True}, + } + + _attribute_map = { + 'retention_policy_type': {'key': 'retentionPolicyType', 'type': 'str'}, + 'daily_schedule': {'key': 'dailySchedule', 'type': 'DailyRetentionSchedule'}, + 'weekly_schedule': {'key': 'weeklySchedule', 'type': 'WeeklyRetentionSchedule'}, + 'monthly_schedule': {'key': 'monthlySchedule', 'type': 'MonthlyRetentionSchedule'}, + 'yearly_schedule': {'key': 'yearlySchedule', 'type': 'YearlyRetentionSchedule'}, + } + + def __init__( + self, + **kwargs + ): + super(LongTermRetentionPolicy, self).__init__(**kwargs) + self.retention_policy_type = 'LongTermRetentionPolicy' # type: str + self.daily_schedule = kwargs.get('daily_schedule', None) + self.weekly_schedule = kwargs.get('weekly_schedule', None) + self.monthly_schedule = kwargs.get('monthly_schedule', None) + self.yearly_schedule = kwargs.get('yearly_schedule', None) + + +class LongTermSchedulePolicy(SchedulePolicy): + """Long term policy schedule. + + All required parameters must be populated in order to send to Azure. + + :param schedule_policy_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 schedule_policy_type: str + """ + + _validation = { + 'schedule_policy_type': {'required': True}, + } + + _attribute_map = { + 'schedule_policy_type': {'key': 'schedulePolicyType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LongTermSchedulePolicy, self).__init__(**kwargs) + self.schedule_policy_type = 'LongTermSchedulePolicy' # type: str + + +class MabContainer(ProtectionContainer): + """Container with items backed up using MAB backup engine. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param can_re_register: Can the container be registered one more time. + :type can_re_register: bool + :param container_id: ContainerID represents the container. + :type container_id: long + :param protected_item_count: Number of items backed up in this container. + :type protected_item_count: long + :param agent_version: Agent version of this container. + :type agent_version: str + :param extended_info: Additional information for this container. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.MabContainerExtendedInfo + :param mab_container_health_details: Health details on this mab container. + :type mab_container_health_details: + list[~azure.mgmt.recoveryservicesbackup.models.MABContainerHealthDetails] + :param container_health_state: Health state of mab container. + :type container_health_state: str + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'can_re_register': {'key': 'canReRegister', 'type': 'bool'}, + 'container_id': {'key': 'containerId', 'type': 'long'}, + 'protected_item_count': {'key': 'protectedItemCount', 'type': 'long'}, + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'MabContainerExtendedInfo'}, + 'mab_container_health_details': {'key': 'mabContainerHealthDetails', 'type': '[MABContainerHealthDetails]'}, + 'container_health_state': {'key': 'containerHealthState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MabContainer, self).__init__(**kwargs) + self.container_type = 'Windows' # type: str + self.can_re_register = kwargs.get('can_re_register', None) + self.container_id = kwargs.get('container_id', None) + self.protected_item_count = kwargs.get('protected_item_count', None) + self.agent_version = kwargs.get('agent_version', None) + self.extended_info = kwargs.get('extended_info', None) + self.mab_container_health_details = kwargs.get('mab_container_health_details', None) + self.container_health_state = kwargs.get('container_health_state', None) + + +class MabContainerExtendedInfo(msrest.serialization.Model): + """Additional information of the container. + + :param last_refreshed_at: Time stamp when this container was refreshed. + :type last_refreshed_at: ~datetime.datetime + :param backup_item_type: Type of backup items associated with this container. Possible values + include: "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", + "VMwareVM", "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type backup_item_type: str or ~azure.mgmt.recoveryservicesbackup.models.BackupItemType + :param backup_items: List of backup items associated with this container. + :type backup_items: list[str] + :param policy_name: Backup policy associated with this container. + :type policy_name: str + :param last_backup_status: Latest backup status of this container. + :type last_backup_status: str + """ + + _attribute_map = { + 'last_refreshed_at': {'key': 'lastRefreshedAt', 'type': 'iso-8601'}, + 'backup_item_type': {'key': 'backupItemType', 'type': 'str'}, + 'backup_items': {'key': 'backupItems', 'type': '[str]'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MabContainerExtendedInfo, self).__init__(**kwargs) + self.last_refreshed_at = kwargs.get('last_refreshed_at', None) + self.backup_item_type = kwargs.get('backup_item_type', None) + self.backup_items = kwargs.get('backup_items', None) + self.policy_name = kwargs.get('policy_name', None) + self.last_backup_status = kwargs.get('last_backup_status', None) + + +class MABContainerHealthDetails(msrest.serialization.Model): + """MAB workload-specific Health Details. + + :param code: Health Code. + :type code: int + :param title: Health Title. + :type title: str + :param message: Health Message. + :type message: str + :param recommendations: Health Recommended Actions. + :type recommendations: list[str] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'int'}, + 'title': {'key': 'title', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MABContainerHealthDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.title = kwargs.get('title', None) + self.message = kwargs.get('message', None) + self.recommendations = kwargs.get('recommendations', None) + + +class MabErrorInfo(msrest.serialization.Model): + """MAB workload-specific error information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_string: Localized error string. + :vartype error_string: str + :ivar recommendations: List of localized recommendations. + :vartype recommendations: list[str] + """ + + _validation = { + 'error_string': {'readonly': True}, + 'recommendations': {'readonly': True}, + } + + _attribute_map = { + 'error_string': {'key': 'errorString', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MabErrorInfo, self).__init__(**kwargs) + self.error_string = None + self.recommendations = None + + +class MabFileFolderProtectedItem(ProtectedItem): + """MAB workload-specific backup item. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of this backup item. + :type friendly_name: str + :param computer_name: Name of the computer associated with this backup item. + :type computer_name: str + :param last_backup_status: Status of last backup operation. + :type last_backup_status: str + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param protection_state: Protected, ProtectionStopped, IRPending or ProtectionError. + :type protection_state: str + :param deferred_delete_sync_time_in_utc: Sync time for deferred deletion in UTC. + :type deferred_delete_sync_time_in_utc: long + :param extended_info: Additional information with this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.MabFileFolderProtectedItemExtendedInfo + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'deferred_delete_sync_time_in_utc': {'key': 'deferredDeleteSyncTimeInUTC', 'type': 'long'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'MabFileFolderProtectedItemExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(MabFileFolderProtectedItem, self).__init__(**kwargs) + self.protected_item_type = 'MabFileFolderProtectedItem' # type: str + self.friendly_name = kwargs.get('friendly_name', None) + self.computer_name = kwargs.get('computer_name', None) + self.last_backup_status = kwargs.get('last_backup_status', None) + self.last_backup_time = kwargs.get('last_backup_time', None) + self.protection_state = kwargs.get('protection_state', None) + self.deferred_delete_sync_time_in_utc = kwargs.get('deferred_delete_sync_time_in_utc', None) + self.extended_info = kwargs.get('extended_info', None) + + +class MabFileFolderProtectedItemExtendedInfo(msrest.serialization.Model): + """Additional information on the backed up item. + + :param last_refreshed_at: Last time when the agent data synced to service. + :type last_refreshed_at: ~datetime.datetime + :param oldest_recovery_point: The oldest backup copy available. + :type oldest_recovery_point: ~datetime.datetime + :param recovery_point_count: Number of backup copies associated with the backup item. + :type recovery_point_count: int + """ + + _attribute_map = { + 'last_refreshed_at': {'key': 'lastRefreshedAt', 'type': 'iso-8601'}, + 'oldest_recovery_point': {'key': 'oldestRecoveryPoint', 'type': 'iso-8601'}, + 'recovery_point_count': {'key': 'recoveryPointCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(MabFileFolderProtectedItemExtendedInfo, self).__init__(**kwargs) + self.last_refreshed_at = kwargs.get('last_refreshed_at', None) + self.oldest_recovery_point = kwargs.get('oldest_recovery_point', None) + self.recovery_point_count = kwargs.get('recovery_point_count', None) + + +class MabJob(Job): + """MAB workload-specific job. + + All required parameters must be populated in order to send to Azure. + + :param entity_friendly_name: Friendly name of the entity on which the current job is executing. + :type entity_friendly_name: str + :param backup_management_type: Backup management type to execute the current job. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: The operation name. + :type operation: str + :param status: Job status. + :type status: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param activity_id: ActivityId of job. + :type activity_id: str + :param job_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 job_type: str + :param duration: Time taken by job to run. + :type duration: ~datetime.timedelta + :param actions_info: The state/actions applicable on jobs like cancel/retry. + :type actions_info: list[str or ~azure.mgmt.recoveryservicesbackup.models.JobSupportedAction] + :param mab_server_name: Name of server protecting the DS. + :type mab_server_name: str + :param mab_server_type: Server type of MAB container. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type mab_server_type: str or ~azure.mgmt.recoveryservicesbackup.models.MabServerType + :param workload_type: Workload type of backup item. Possible values include: "Invalid", "VM", + "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", "SystemState", + "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", "SAPHanaDatabase", + "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param error_details: The errors. + :type error_details: list[~azure.mgmt.recoveryservicesbackup.models.MabErrorInfo] + :param extended_info: Additional information on the job. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.MabJobExtendedInfo + """ + + _validation = { + 'job_type': {'required': True}, + } + + _attribute_map = { + 'entity_friendly_name': {'key': 'entityFriendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'actions_info': {'key': 'actionsInfo', 'type': '[str]'}, + 'mab_server_name': {'key': 'mabServerName', 'type': 'str'}, + 'mab_server_type': {'key': 'mabServerType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'error_details': {'key': 'errorDetails', 'type': '[MabErrorInfo]'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'MabJobExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(MabJob, self).__init__(**kwargs) + self.job_type = 'MabJob' # type: str + self.duration = kwargs.get('duration', None) + self.actions_info = kwargs.get('actions_info', None) + self.mab_server_name = kwargs.get('mab_server_name', None) + self.mab_server_type = kwargs.get('mab_server_type', None) + self.workload_type = kwargs.get('workload_type', None) + self.error_details = kwargs.get('error_details', None) + self.extended_info = kwargs.get('extended_info', None) + + +class MabJobExtendedInfo(msrest.serialization.Model): + """Additional information for the MAB workload-specific job. + + :param tasks_list: List of tasks for this job. + :type tasks_list: list[~azure.mgmt.recoveryservicesbackup.models.MabJobTaskDetails] + :param property_bag: The job properties. + :type property_bag: dict[str, str] + :param dynamic_error_message: Non localized error message specific to this job. + :type dynamic_error_message: str + """ + + _attribute_map = { + 'tasks_list': {'key': 'tasksList', 'type': '[MabJobTaskDetails]'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'dynamic_error_message': {'key': 'dynamicErrorMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MabJobExtendedInfo, self).__init__(**kwargs) + self.tasks_list = kwargs.get('tasks_list', None) + self.property_bag = kwargs.get('property_bag', None) + self.dynamic_error_message = kwargs.get('dynamic_error_message', None) + + +class MabJobTaskDetails(msrest.serialization.Model): + """MAB workload-specific job task details. + + :param task_id: The task display name. + :type task_id: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param duration: Time elapsed for task. + :type duration: ~datetime.timedelta + :param status: The status. + :type status: str + """ + + _attribute_map = { + 'task_id': {'key': 'taskId', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MabJobTaskDetails, self).__init__(**kwargs) + self.task_id = kwargs.get('task_id', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.duration = kwargs.get('duration', None) + self.status = kwargs.get('status', None) + + +class MabProtectionPolicy(ProtectionPolicy): + """Mab container-specific backup policy. + + All required parameters must be populated in order to send to Azure. + + :param protected_items_count: Number of items associated with this policy. + :type protected_items_count: int + :param backup_management_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 backup_management_type: str + :param schedule_policy: Backup schedule of backup policy. + :type schedule_policy: ~azure.mgmt.recoveryservicesbackup.models.SchedulePolicy + :param retention_policy: Retention policy details. + :type retention_policy: ~azure.mgmt.recoveryservicesbackup.models.RetentionPolicy + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'schedule_policy': {'key': 'schedulePolicy', 'type': 'SchedulePolicy'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(MabProtectionPolicy, self).__init__(**kwargs) + self.backup_management_type = 'MAB' # type: str + self.schedule_policy = kwargs.get('schedule_policy', None) + self.retention_policy = kwargs.get('retention_policy', None) + + +class MonthlyRetentionSchedule(msrest.serialization.Model): + """Monthly retention schedule. + + :param retention_schedule_format_type: Retention schedule format type for monthly retention + policy. Possible values include: "Invalid", "Daily", "Weekly". + :type retention_schedule_format_type: str or + ~azure.mgmt.recoveryservicesbackup.models.RetentionScheduleFormat + :param retention_schedule_daily: Daily retention format for monthly retention policy. + :type retention_schedule_daily: ~azure.mgmt.recoveryservicesbackup.models.DailyRetentionFormat + :param retention_schedule_weekly: Weekly retention format for monthly retention policy. + :type retention_schedule_weekly: + ~azure.mgmt.recoveryservicesbackup.models.WeeklyRetentionFormat + :param retention_times: Retention times of retention policy. + :type retention_times: list[~datetime.datetime] + :param retention_duration: Retention duration of retention Policy. + :type retention_duration: ~azure.mgmt.recoveryservicesbackup.models.RetentionDuration + """ + + _attribute_map = { + 'retention_schedule_format_type': {'key': 'retentionScheduleFormatType', 'type': 'str'}, + 'retention_schedule_daily': {'key': 'retentionScheduleDaily', 'type': 'DailyRetentionFormat'}, + 'retention_schedule_weekly': {'key': 'retentionScheduleWeekly', 'type': 'WeeklyRetentionFormat'}, + 'retention_times': {'key': 'retentionTimes', 'type': '[iso-8601]'}, + 'retention_duration': {'key': 'retentionDuration', 'type': 'RetentionDuration'}, + } + + def __init__( + self, + **kwargs + ): + super(MonthlyRetentionSchedule, self).__init__(**kwargs) + self.retention_schedule_format_type = kwargs.get('retention_schedule_format_type', None) + self.retention_schedule_daily = kwargs.get('retention_schedule_daily', None) + self.retention_schedule_weekly = kwargs.get('retention_schedule_weekly', None) + self.retention_times = kwargs.get('retention_times', None) + self.retention_duration = kwargs.get('retention_duration', None) + + +class MoveRPAcrossTiersRequest(msrest.serialization.Model): + """MoveRPAcrossTiersRequest. + + :param object_type: Gets the class type. + :type object_type: str + :param source_tier_type: Source tier from where RP needs to be moved. Possible values include: + "Invalid", "InstantRP", "HardenedRP", "ArchivedRP". + :type source_tier_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierType + :param target_tier_type: Target tier where RP needs to be moved. Possible values include: + "Invalid", "InstantRP", "HardenedRP", "ArchivedRP". + :type target_tier_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierType + """ + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'source_tier_type': {'key': 'sourceTierType', 'type': 'str'}, + 'target_tier_type': {'key': 'targetTierType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MoveRPAcrossTiersRequest, self).__init__(**kwargs) + self.object_type = kwargs.get('object_type', None) + self.source_tier_type = kwargs.get('source_tier_type', None) + self.target_tier_type = kwargs.get('target_tier_type', 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 NewErrorResponse(msrest.serialization.Model): + """The resource management error response. + + :param error: The error object. + :type error: ~azure.mgmt.recoveryservicesbackup.models.NewErrorResponseError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'NewErrorResponseError'}, + } + + def __init__( + self, + **kwargs + ): + super(NewErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class NewErrorResponseAutoGenerated(msrest.serialization.Model): + """The resource management error response. + + :param error: The error object. + :type error: ~azure.mgmt.recoveryservicesbackup.models.NewErrorResponseErrorAutoGenerated + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'NewErrorResponseErrorAutoGenerated'}, + } + + def __init__( + self, + **kwargs + ): + super(NewErrorResponseAutoGenerated, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class NewErrorResponseError(msrest.serialization.Model): + """The error object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.recoveryservicesbackup.models.NewErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.recoveryservicesbackup.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[NewErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(NewErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class NewErrorResponseErrorAutoGenerated(msrest.serialization.Model): + """The error object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.recoveryservicesbackup.models.NewErrorResponseAutoGenerated] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.recoveryservicesbackup.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[NewErrorResponseAutoGenerated]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(NewErrorResponseErrorAutoGenerated, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class OperationResultInfo(OperationResultInfoBase): + """Operation result info. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param job_list: List of jobs created by this operation. + :type job_list: list[str] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'job_list': {'key': 'jobList', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationResultInfo, self).__init__(**kwargs) + self.object_type = 'OperationResultInfo' # type: str + self.job_list = kwargs.get('job_list', None) + + +class OperationWorkerResponse(msrest.serialization.Model): + """This is the base class for operation result responses. + + :param status_code: HTTP Status Code of the operation. Possible values include: "Continue", + "SwitchingProtocols", "OK", "Created", "Accepted", "NonAuthoritativeInformation", "NoContent", + "ResetContent", "PartialContent", "MultipleChoices", "Ambiguous", "MovedPermanently", "Moved", + "Found", "Redirect", "SeeOther", "RedirectMethod", "NotModified", "UseProxy", "Unused", + "TemporaryRedirect", "RedirectKeepVerb", "BadRequest", "Unauthorized", "PaymentRequired", + "Forbidden", "NotFound", "MethodNotAllowed", "NotAcceptable", "ProxyAuthenticationRequired", + "RequestTimeout", "Conflict", "Gone", "LengthRequired", "PreconditionFailed", + "RequestEntityTooLarge", "RequestUriTooLong", "UnsupportedMediaType", + "RequestedRangeNotSatisfiable", "ExpectationFailed", "UpgradeRequired", "InternalServerError", + "NotImplemented", "BadGateway", "ServiceUnavailable", "GatewayTimeout", + "HttpVersionNotSupported". + :type status_code: str or ~azure.mgmt.recoveryservicesbackup.models.HttpStatusCode + :param headers: HTTP headers associated with this operation. + :type headers: dict[str, list[str]] + """ + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{[str]}'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationWorkerResponse, self).__init__(**kwargs) + self.status_code = kwargs.get('status_code', None) + self.headers = kwargs.get('headers', None) + + +class OperationResultInfoBaseResource(OperationWorkerResponse): + """Base class for operation result info. + + :param status_code: HTTP Status Code of the operation. Possible values include: "Continue", + "SwitchingProtocols", "OK", "Created", "Accepted", "NonAuthoritativeInformation", "NoContent", + "ResetContent", "PartialContent", "MultipleChoices", "Ambiguous", "MovedPermanently", "Moved", + "Found", "Redirect", "SeeOther", "RedirectMethod", "NotModified", "UseProxy", "Unused", + "TemporaryRedirect", "RedirectKeepVerb", "BadRequest", "Unauthorized", "PaymentRequired", + "Forbidden", "NotFound", "MethodNotAllowed", "NotAcceptable", "ProxyAuthenticationRequired", + "RequestTimeout", "Conflict", "Gone", "LengthRequired", "PreconditionFailed", + "RequestEntityTooLarge", "RequestUriTooLong", "UnsupportedMediaType", + "RequestedRangeNotSatisfiable", "ExpectationFailed", "UpgradeRequired", "InternalServerError", + "NotImplemented", "BadGateway", "ServiceUnavailable", "GatewayTimeout", + "HttpVersionNotSupported". + :type status_code: str or ~azure.mgmt.recoveryservicesbackup.models.HttpStatusCode + :param headers: HTTP headers associated with this operation. + :type headers: dict[str, list[str]] + :param operation: OperationResultInfoBaseResource operation. + :type operation: ~azure.mgmt.recoveryservicesbackup.models.OperationResultInfoBase + """ + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{[str]}'}, + 'operation': {'key': 'operation', 'type': 'OperationResultInfoBase'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationResultInfoBaseResource, self).__init__(**kwargs) + self.operation = kwargs.get('operation', None) + + +class OperationStatus(msrest.serialization.Model): + """Operation status. + + :param id: ID of the operation. + :type id: str + :param name: Name of the operation. + :type name: str + :param status: Operation status. Possible values include: "Invalid", "InProgress", "Succeeded", + "Failed", "Canceled". + :type status: str or ~azure.mgmt.recoveryservicesbackup.models.OperationStatusValues + :param start_time: Operation start time. Format: ISO-8601. + :type start_time: ~datetime.datetime + :param end_time: Operation end time. Format: ISO-8601. + :type end_time: ~datetime.datetime + :param error: Error information related to this operation. + :type error: ~azure.mgmt.recoveryservicesbackup.models.OperationStatusError + :param properties: Additional information associated with this operation. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.OperationStatusExtendedInfo + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'OperationStatusError'}, + 'properties': {'key': 'properties', 'type': 'OperationStatusExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationStatus, self).__init__(**kwargs) + 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) + self.end_time = kwargs.get('end_time', None) + self.error = kwargs.get('error', None) + self.properties = kwargs.get('properties', None) + + +class OperationStatusError(msrest.serialization.Model): + """Error information associated with operation status call. + + :param code: Error code of the operation failure. + :type code: str + :param message: Error message displayed if the operation failure. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationStatusError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class OperationStatusExtendedInfo(msrest.serialization.Model): + """Base class for additional information of operation status. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: OperationStatusJobExtendedInfo, OperationStatusJobsExtendedInfo, OperationStatusProvisionILRExtendedInfo, OperationStatusRecoveryPointExtendedInfo. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'OperationStatusJobExtendedInfo': 'OperationStatusJobExtendedInfo', 'OperationStatusJobsExtendedInfo': 'OperationStatusJobsExtendedInfo', 'OperationStatusProvisionILRExtendedInfo': 'OperationStatusProvisionILRExtendedInfo', 'OperationStatusRecoveryPointExtendedInfo': 'OperationStatusRecoveryPointExtendedInfo'} + } + + def __init__( + self, + **kwargs + ): + super(OperationStatusExtendedInfo, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class OperationStatusJobExtendedInfo(OperationStatusExtendedInfo): + """Operation status job extended info. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param job_id: ID of the job created for this protected item. + :type job_id: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationStatusJobExtendedInfo, self).__init__(**kwargs) + self.object_type = 'OperationStatusJobExtendedInfo' # type: str + self.job_id = kwargs.get('job_id', None) + + +class OperationStatusJobsExtendedInfo(OperationStatusExtendedInfo): + """Operation status extended info for list of jobs. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param job_ids: IDs of the jobs created for the protected item. + :type job_ids: list[str] + :param failed_jobs_error: Stores all the failed jobs along with the corresponding error codes. + :type failed_jobs_error: dict[str, str] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'job_ids': {'key': 'jobIds', 'type': '[str]'}, + 'failed_jobs_error': {'key': 'failedJobsError', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationStatusJobsExtendedInfo, self).__init__(**kwargs) + self.object_type = 'OperationStatusJobsExtendedInfo' # type: str + self.job_ids = kwargs.get('job_ids', None) + self.failed_jobs_error = kwargs.get('failed_jobs_error', None) + + +class OperationStatusProvisionILRExtendedInfo(OperationStatusExtendedInfo): + """Operation status extended info for ILR provision action. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_target: Target details for file / folder restore. + :type recovery_target: ~azure.mgmt.recoveryservicesbackup.models.InstantItemRecoveryTarget + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_target': {'key': 'recoveryTarget', 'type': 'InstantItemRecoveryTarget'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationStatusProvisionILRExtendedInfo, self).__init__(**kwargs) + self.object_type = 'OperationStatusProvisionILRExtendedInfo' # type: str + self.recovery_target = kwargs.get('recovery_target', None) + + +class OperationStatusRecoveryPointExtendedInfo(OperationStatusExtendedInfo): + """Operation status extended info for Updated Recovery Point. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param updated_recovery_point: Recovery Point info with updated source snapshot URI. + :type updated_recovery_point: ~azure.mgmt.recoveryservicesbackup.models.RecoveryPoint + :param deleted_backup_item_version: In case the share is in soft-deleted state, populate this + field with deleted backup item. + :type deleted_backup_item_version: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'updated_recovery_point': {'key': 'updatedRecoveryPoint', 'type': 'RecoveryPoint'}, + 'deleted_backup_item_version': {'key': 'deletedBackupItemVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationStatusRecoveryPointExtendedInfo, self).__init__(**kwargs) + self.object_type = 'OperationStatusRecoveryPointExtendedInfo' # type: str + self.updated_recovery_point = kwargs.get('updated_recovery_point', None) + self.deleted_backup_item_version = kwargs.get('deleted_backup_item_version', None) + + +class PointInTimeRange(msrest.serialization.Model): + """Provides details for log ranges. + + :param start_time: Start time of the time range for log recovery. + :type start_time: ~datetime.datetime + :param end_time: End time of the time range for log recovery. + :type end_time: ~datetime.datetime + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(PointInTimeRange, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + + +class PreBackupValidation(msrest.serialization.Model): + """Pre-backup validation for Azure VM Workload provider. + + :param status: Status of protectable item, i.e. InProgress,Succeeded,Failed. Possible values + include: "Invalid", "Success", "Failed". + :type status: str or ~azure.mgmt.recoveryservicesbackup.models.InquiryStatus + :param code: Error code of protectable item. + :type code: str + :param message: Message corresponding to the error code for the protectable item. + :type message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PreBackupValidation, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class PrepareDataMoveRequest(msrest.serialization.Model): + """Prepare DataMove Request. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ARM Id of target vault. + :type target_resource_id: str + :param target_region: Required. Target Region. + :type target_region: str + :param data_move_level: Required. DataMove Level. Possible values include: "Invalid", "Vault", + "Container". + :type data_move_level: str or ~azure.mgmt.recoveryservicesbackup.models.DataMoveLevel + :param source_container_arm_ids: Source Container ArmIds + This needs to be populated only if DataMoveLevel is set to container. + :type source_container_arm_ids: list[str] + :param ignore_moved: Ignore the artifacts which are already moved. + :type ignore_moved: bool + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'target_region': {'required': True}, + 'data_move_level': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'target_region': {'key': 'targetRegion', 'type': 'str'}, + 'data_move_level': {'key': 'dataMoveLevel', 'type': 'str'}, + 'source_container_arm_ids': {'key': 'sourceContainerArmIds', 'type': '[str]'}, + 'ignore_moved': {'key': 'ignoreMoved', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(PrepareDataMoveRequest, self).__init__(**kwargs) + self.target_resource_id = kwargs['target_resource_id'] + self.target_region = kwargs['target_region'] + self.data_move_level = kwargs['data_move_level'] + self.source_container_arm_ids = kwargs.get('source_container_arm_ids', None) + self.ignore_moved = kwargs.get('ignore_moved', None) + + +class VaultStorageConfigOperationResultResponse(msrest.serialization.Model): + """Operation result response for Vault Storage Config. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: PrepareDataMoveResponse. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'PrepareDataMoveResponse': 'PrepareDataMoveResponse'} + } + + def __init__( + self, + **kwargs + ): + super(VaultStorageConfigOperationResultResponse, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class PrepareDataMoveResponse(VaultStorageConfigOperationResultResponse): + """Prepare DataMove Response. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param correlation_id: Co-relationId for move operation. + :type correlation_id: str + :param source_vault_properties: Source Vault Properties. + :type source_vault_properties: dict[str, str] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'source_vault_properties': {'key': 'sourceVaultProperties', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(PrepareDataMoveResponse, self).__init__(**kwargs) + self.object_type = 'PrepareDataMoveResponse' # type: str + self.correlation_id = kwargs.get('correlation_id', None) + self.source_vault_properties = kwargs.get('source_vault_properties', None) + + +class PreValidateEnableBackupRequest(msrest.serialization.Model): + """Contract to validate if backup can be enabled on the given resource in a given vault and given configuration. +It will validate followings + + +#. Vault capacity +#. VM is already protected +#. Any VM related configuration passed in properties. + + :param resource_type: ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc. Possible values + include: "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", + "VMwareVM", "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type resource_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param resource_id: ARM Virtual Machine Id. + :type resource_id: str + :param vault_id: ARM id of the Recovery Services Vault. + :type vault_id: str + :param properties: Configuration of VM if any needs to be validated like OS type etc. + :type properties: str + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'vault_id': {'key': 'vaultId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PreValidateEnableBackupRequest, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.resource_id = kwargs.get('resource_id', None) + self.vault_id = kwargs.get('vault_id', None) + self.properties = kwargs.get('properties', None) + + +class PreValidateEnableBackupResponse(msrest.serialization.Model): + """Response contract for enable backup validation request. + + :param status: Validation Status. Possible values include: "Invalid", "Succeeded", "Failed". + :type status: str or ~azure.mgmt.recoveryservicesbackup.models.ValidationStatus + :param error_code: Response error code. + :type error_code: str + :param error_message: Response error message. + :type error_message: str + :param recommendation: Recommended action for user. + :type recommendation: str + :param container_name: Specifies the product specific container name. E.g. + iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + for portal. + :type container_name: str + :param protected_item_name: Specifies the product specific ds name. E.g. + vm;iaasvmcontainer;rgname;vmname. This is required for portal. + :type protected_item_name: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'recommendation': {'key': 'recommendation', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'protected_item_name': {'key': 'protectedItemName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PreValidateEnableBackupResponse, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error_code = kwargs.get('error_code', None) + self.error_message = kwargs.get('error_message', None) + self.recommendation = kwargs.get('recommendation', None) + self.container_name = kwargs.get('container_name', None) + self.protected_item_name = kwargs.get('protected_item_name', None) + + +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint network resource that is linked to the Private Endpoint connection. + + :param id: Gets or sets id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class PrivateEndpointConnection(msrest.serialization.Model): + """Private Endpoint Connection Response Properties. + + :param provisioning_state: Gets or sets provisioning state of the private endpoint connection. + Possible values include: "Succeeded", "Deleting", "Failed", "Pending". + :type provisioning_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProvisioningState + :param private_endpoint: Gets or sets private endpoint associated with the private endpoint + connection. + :type private_endpoint: ~azure.mgmt.recoveryservicesbackup.models.PrivateEndpoint + :param private_link_service_connection_state: Gets or sets private link service connection + state. + :type private_link_service_connection_state: + ~azure.mgmt.recoveryservicesbackup.models.PrivateLinkServiceConnectionState + """ + + _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 = kwargs.get('provisioning_state', None) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + + +class PrivateEndpointConnectionResource(Resource): + """Private Endpoint Connection Response Properties. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: PrivateEndpointConnectionResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.PrivateEndpointConnection + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnection'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """Private Link Service Connection State. + + :param status: Gets or sets the status. Possible values include: "Pending", "Approved", + "Rejected", "Disconnected". + :type status: str or ~azure.mgmt.recoveryservicesbackup.models.PrivateEndpointConnectionStatus + :param description: Gets or sets description. + :type description: str + :param action_required: Gets or sets actions required. + :type action_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'action_required': {'key': 'actionRequired', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.action_required = kwargs.get('action_required', None) + + +class ProtectableContainerResource(Resource): + """Protectable Container Class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: ProtectableContainerResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.ProtectableContainer + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ProtectableContainer'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtectableContainerResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ProtectableContainerResourceList(ResourceList): + """List of ProtectableContainer resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.ProtectableContainerResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ProtectableContainerResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtectableContainerResourceList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ProtectedItemQueryObject(msrest.serialization.Model): + """Filters to list backup items. + + :param health_state: Health State for the backed up item. Possible values include: "Passed", + "ActionRequired", "ActionSuggested", "Invalid". + :type health_state: str or ~azure.mgmt.recoveryservicesbackup.models.HealthState + :param backup_management_type: Backup management type for the backed up item. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param item_type: Type of workload this item represents. Possible values include: "Invalid", + "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", "SystemState", + "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", "SAPHanaDatabase", + "SAPAseDatabase". + :type item_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param policy_name: Backup policy name associated with the backup item. + :type policy_name: str + :param container_name: Name of the container. + :type container_name: str + :param backup_engine_name: Backup Engine name. + :type backup_engine_name: str + :param friendly_name: Friendly name of protected item. + :type friendly_name: str + :param fabric_name: Name of the fabric. + :type fabric_name: str + :param backup_set_name: Name of the backup set. + :type backup_set_name: str + """ + + _attribute_map = { + 'health_state': {'key': 'healthState', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'item_type': {'key': 'itemType', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'backup_engine_name': {'key': 'backupEngineName', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'fabric_name': {'key': 'fabricName', 'type': 'str'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtectedItemQueryObject, self).__init__(**kwargs) + self.health_state = kwargs.get('health_state', None) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.item_type = kwargs.get('item_type', None) + self.policy_name = kwargs.get('policy_name', None) + self.container_name = kwargs.get('container_name', None) + self.backup_engine_name = kwargs.get('backup_engine_name', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.fabric_name = kwargs.get('fabric_name', None) + self.backup_set_name = kwargs.get('backup_set_name', None) + + +class ProtectedItemResource(Resource): + """Base class for backup items. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: ProtectedItemResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.ProtectedItem + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ProtectedItem'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtectedItemResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ProtectedItemResourceList(ResourceList): + """List of ProtectedItem resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ProtectedItemResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtectedItemResourceList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ProtectionContainerResource(Resource): + """Base class for container with backup items. Containers with specific workloads are derived from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: ProtectionContainerResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.ProtectionContainer + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ProtectionContainer'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtectionContainerResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ProtectionContainerResourceList(ResourceList): + """List of ProtectionContainer resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.ProtectionContainerResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ProtectionContainerResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtectionContainerResourceList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ProtectionIntentQueryObject(msrest.serialization.Model): + """Filters to list protection intent. + + :param backup_management_type: Backup management type for the backed up item. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param item_type: Type of workload this item represents. Possible values include: "Invalid", + "SQLInstance", "SQLAvailabilityGroupContainer". + :type item_type: str or ~azure.mgmt.recoveryservicesbackup.models.IntentItemType + :param parent_name: Parent name of the intent. + :type parent_name: str + :param item_name: Item name of the intent. + :type item_name: str + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'item_type': {'key': 'itemType', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'item_name': {'key': 'itemName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtectionIntentQueryObject, self).__init__(**kwargs) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.item_type = kwargs.get('item_type', None) + self.parent_name = kwargs.get('parent_name', None) + self.item_name = kwargs.get('item_name', None) + + +class ProtectionIntentResource(Resource): + """Base class for backup ProtectionIntent. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: ProtectionIntentResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.ProtectionIntent + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ProtectionIntent'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtectionIntentResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ProtectionIntentResourceList(ResourceList): + """List of ProtectionIntent resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.ProtectionIntentResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ProtectionIntentResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtectionIntentResourceList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ProtectionPolicyQueryObject(msrest.serialization.Model): + """Filters the list backup policies API. + + :param backup_management_type: Backup management type for the backup policy. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param fabric_name: Fabric name for filter. + :type fabric_name: str + :param workload_type: Workload type for the backup policy. Possible values include: "Invalid", + "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", "SystemState", + "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", "SAPHanaDatabase", + "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'fabric_name': {'key': 'fabricName', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtectionPolicyQueryObject, self).__init__(**kwargs) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.fabric_name = kwargs.get('fabric_name', None) + self.workload_type = kwargs.get('workload_type', None) + + +class ProtectionPolicyResource(Resource): + """Base class for backup policy. Workload-specific backup policies are derived from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: ProtectionPolicyResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.ProtectionPolicy + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ProtectionPolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtectionPolicyResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ProtectionPolicyResourceList(ResourceList): + """List of ProtectionPolicy resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.ProtectionPolicyResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ProtectionPolicyResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(ProtectionPolicyResourceList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class RecoveryPointDiskConfiguration(msrest.serialization.Model): + """Disk configuration. + + :param number_of_disks_included_in_backup: Number of disks included in backup. + :type number_of_disks_included_in_backup: int + :param number_of_disks_attached_to_vm: Number of disks attached to the VM. + :type number_of_disks_attached_to_vm: int + :param included_disk_list: Information of disks included in backup. + :type included_disk_list: list[~azure.mgmt.recoveryservicesbackup.models.DiskInformation] + :param excluded_disk_list: Information of disks excluded from backup. + :type excluded_disk_list: list[~azure.mgmt.recoveryservicesbackup.models.DiskInformation] + """ + + _attribute_map = { + 'number_of_disks_included_in_backup': {'key': 'numberOfDisksIncludedInBackup', 'type': 'int'}, + 'number_of_disks_attached_to_vm': {'key': 'numberOfDisksAttachedToVm', 'type': 'int'}, + 'included_disk_list': {'key': 'includedDiskList', 'type': '[DiskInformation]'}, + 'excluded_disk_list': {'key': 'excludedDiskList', 'type': '[DiskInformation]'}, + } + + def __init__( + self, + **kwargs + ): + super(RecoveryPointDiskConfiguration, self).__init__(**kwargs) + self.number_of_disks_included_in_backup = kwargs.get('number_of_disks_included_in_backup', None) + self.number_of_disks_attached_to_vm = kwargs.get('number_of_disks_attached_to_vm', None) + self.included_disk_list = kwargs.get('included_disk_list', None) + self.excluded_disk_list = kwargs.get('excluded_disk_list', None) + + +class RecoveryPointMoveReadinessInfo(msrest.serialization.Model): + """RecoveryPointMoveReadinessInfo. + + :param is_ready_for_move: + :type is_ready_for_move: bool + :param additional_info: + :type additional_info: str + """ + + _attribute_map = { + 'is_ready_for_move': {'key': 'isReadyForMove', 'type': 'bool'}, + 'additional_info': {'key': 'additionalInfo', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RecoveryPointMoveReadinessInfo, self).__init__(**kwargs) + self.is_ready_for_move = kwargs.get('is_ready_for_move', None) + self.additional_info = kwargs.get('additional_info', None) + + +class RecoveryPointRehydrationInfo(msrest.serialization.Model): + """RP Rehydration Info. + + :param rehydration_retention_duration: How long the rehydrated RP should be kept + Should be ISO8601 Duration format e.g. "P7D". + :type rehydration_retention_duration: str + :param rehydration_priority: Rehydration Priority. Possible values include: "Standard", "High". + :type rehydration_priority: str or + ~azure.mgmt.recoveryservicesbackup.models.RehydrationPriority + """ + + _attribute_map = { + 'rehydration_retention_duration': {'key': 'rehydrationRetentionDuration', 'type': 'str'}, + 'rehydration_priority': {'key': 'rehydrationPriority', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RecoveryPointRehydrationInfo, self).__init__(**kwargs) + self.rehydration_retention_duration = kwargs.get('rehydration_retention_duration', None) + self.rehydration_priority = kwargs.get('rehydration_priority', None) + + +class RecoveryPointResource(Resource): + """Base class for backup copies. Workload-specific backup copies are derived from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: RecoveryPointResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.RecoveryPoint + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'RecoveryPoint'}, + } + + def __init__( + self, + **kwargs + ): + super(RecoveryPointResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class RecoveryPointResourceList(ResourceList): + """List of RecoveryPoint resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[RecoveryPointResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(RecoveryPointResourceList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class RecoveryPointTierInformation(msrest.serialization.Model): + """Recovery point tier information. + + :param type: Recovery point tier type. Possible values include: "Invalid", "InstantRP", + "HardenedRP", "ArchivedRP". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierType + :param status: Recovery point tier status. Possible values include: "Invalid", "Valid", + "Disabled", "Deleted", "Rehydrated". + :type status: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierStatus + :param extended_info: Recovery point tier status. + :type extended_info: dict[str, str] + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(RecoveryPointTierInformation, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.status = kwargs.get('status', None) + self.extended_info = kwargs.get('extended_info', None) + + +class RestoreFileSpecs(msrest.serialization.Model): + """Restore file specs like file path, type and target folder path info. + + :param path: Source File/Folder path. + :type path: str + :param file_spec_type: Indicates what the Path variable stands for. + :type file_spec_type: str + :param target_folder_path: Destination folder path in target FileShare. + :type target_folder_path: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'file_spec_type': {'key': 'fileSpecType', 'type': 'str'}, + 'target_folder_path': {'key': 'targetFolderPath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RestoreFileSpecs, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.file_spec_type = kwargs.get('file_spec_type', None) + self.target_folder_path = kwargs.get('target_folder_path', None) + + +class RestoreRequestResource(Resource): + """Base class for restore request. Workload-specific restore requests are derived from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: RestoreRequestResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.RestoreRequest + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'RestoreRequest'}, + } + + def __init__( + self, + **kwargs + ): + super(RestoreRequestResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class RetentionDuration(msrest.serialization.Model): + """Retention duration. + + :param count: Count of duration types. Retention duration is obtained by the counting the + duration type Count times. + For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. + :type count: int + :param duration_type: Retention duration type of retention policy. Possible values include: + "Invalid", "Days", "Weeks", "Months", "Years". + :type duration_type: str or ~azure.mgmt.recoveryservicesbackup.models.RetentionDurationType + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'duration_type': {'key': 'durationType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RetentionDuration, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.duration_type = kwargs.get('duration_type', None) + + +class Settings(msrest.serialization.Model): + """Common settings field for backup management. + + :param time_zone: TimeZone optional input as string. For example: TimeZone = "Pacific Standard + Time". + :type time_zone: str + :param issqlcompression: SQL compression flag. + :type issqlcompression: bool + :param is_compression: Workload compression flag. This has been added so that + 'isSqlCompression' + will be deprecated once clients upgrade to consider this flag. + :type is_compression: bool + """ + + _attribute_map = { + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'issqlcompression': {'key': 'issqlcompression', 'type': 'bool'}, + 'is_compression': {'key': 'isCompression', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Settings, self).__init__(**kwargs) + self.time_zone = kwargs.get('time_zone', None) + self.issqlcompression = kwargs.get('issqlcompression', None) + self.is_compression = kwargs.get('is_compression', None) + + +class SimpleRetentionPolicy(RetentionPolicy): + """Simple policy retention. + + All required parameters must be populated in order to send to Azure. + + :param retention_policy_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 retention_policy_type: str + :param retention_duration: Retention duration of the protection policy. + :type retention_duration: ~azure.mgmt.recoveryservicesbackup.models.RetentionDuration + """ + + _validation = { + 'retention_policy_type': {'required': True}, + } + + _attribute_map = { + 'retention_policy_type': {'key': 'retentionPolicyType', 'type': 'str'}, + 'retention_duration': {'key': 'retentionDuration', 'type': 'RetentionDuration'}, + } + + def __init__( + self, + **kwargs + ): + super(SimpleRetentionPolicy, self).__init__(**kwargs) + self.retention_policy_type = 'SimpleRetentionPolicy' # type: str + self.retention_duration = kwargs.get('retention_duration', None) + + +class SimpleSchedulePolicy(SchedulePolicy): + """Simple policy schedule. + + All required parameters must be populated in order to send to Azure. + + :param schedule_policy_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 schedule_policy_type: str + :param schedule_run_frequency: Frequency of the schedule operation of this policy. Possible + values include: "Invalid", "Daily", "Weekly". + :type schedule_run_frequency: str or ~azure.mgmt.recoveryservicesbackup.models.ScheduleRunType + :param schedule_run_days: List of days of week this schedule has to be run. + :type schedule_run_days: list[str or ~azure.mgmt.recoveryservicesbackup.models.DayOfWeek] + :param schedule_run_times: List of times of day this schedule has to be run. + :type schedule_run_times: list[~datetime.datetime] + :param schedule_weekly_frequency: At every number weeks this schedule has to be run. + :type schedule_weekly_frequency: int + """ + + _validation = { + 'schedule_policy_type': {'required': True}, + } + + _attribute_map = { + 'schedule_policy_type': {'key': 'schedulePolicyType', 'type': 'str'}, + 'schedule_run_frequency': {'key': 'scheduleRunFrequency', 'type': 'str'}, + 'schedule_run_days': {'key': 'scheduleRunDays', 'type': '[str]'}, + 'schedule_run_times': {'key': 'scheduleRunTimes', 'type': '[iso-8601]'}, + 'schedule_weekly_frequency': {'key': 'scheduleWeeklyFrequency', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(SimpleSchedulePolicy, self).__init__(**kwargs) + self.schedule_policy_type = 'SimpleSchedulePolicy' # type: str + self.schedule_run_frequency = kwargs.get('schedule_run_frequency', None) + self.schedule_run_days = kwargs.get('schedule_run_days', None) + self.schedule_run_times = kwargs.get('schedule_run_times', None) + self.schedule_weekly_frequency = kwargs.get('schedule_weekly_frequency', None) + + +class SQLDataDirectory(msrest.serialization.Model): + """SQLDataDirectory info. + + :param type: Type of data directory mapping. Possible values include: "Invalid", "Data", "Log". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectoryType + :param path: File path. + :type path: str + :param logical_name: Logical name of the file. + :type logical_name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'logical_name': {'key': 'logicalName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SQLDataDirectory, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.path = kwargs.get('path', None) + self.logical_name = kwargs.get('logical_name', None) + + +class SQLDataDirectoryMapping(msrest.serialization.Model): + """Encapsulates information regarding data directory. + + :param mapping_type: Type of data directory mapping. Possible values include: "Invalid", + "Data", "Log". + :type mapping_type: str or ~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectoryType + :param source_logical_name: Restore source logical name path. + :type source_logical_name: str + :param source_path: Restore source path. + :type source_path: str + :param target_path: Target path. + :type target_path: str + """ + + _attribute_map = { + 'mapping_type': {'key': 'mappingType', 'type': 'str'}, + 'source_logical_name': {'key': 'sourceLogicalName', 'type': 'str'}, + 'source_path': {'key': 'sourcePath', 'type': 'str'}, + 'target_path': {'key': 'targetPath', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SQLDataDirectoryMapping, self).__init__(**kwargs) + self.mapping_type = kwargs.get('mapping_type', None) + self.source_logical_name = kwargs.get('source_logical_name', None) + self.source_path = kwargs.get('source_path', None) + self.target_path = kwargs.get('target_path', None) + + +class SubProtectionPolicy(msrest.serialization.Model): + """Sub-protection policy which includes schedule and retention. + + :param policy_type: Type of backup policy type. Possible values include: "Invalid", "Full", + "Differential", "Log", "CopyOnlyFull", "Incremental". + :type policy_type: str or ~azure.mgmt.recoveryservicesbackup.models.PolicyType + :param schedule_policy: Backup schedule specified as part of backup policy. + :type schedule_policy: ~azure.mgmt.recoveryservicesbackup.models.SchedulePolicy + :param retention_policy: Retention policy with the details on backup copy retention ranges. + :type retention_policy: ~azure.mgmt.recoveryservicesbackup.models.RetentionPolicy + """ + + _attribute_map = { + 'policy_type': {'key': 'policyType', 'type': 'str'}, + 'schedule_policy': {'key': 'schedulePolicy', 'type': 'SchedulePolicy'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(SubProtectionPolicy, self).__init__(**kwargs) + self.policy_type = kwargs.get('policy_type', None) + self.schedule_policy = kwargs.get('schedule_policy', None) + self.retention_policy = kwargs.get('retention_policy', None) + + +class TargetAFSRestoreInfo(msrest.serialization.Model): + """Target Azure File Share Info. + + :param name: File share name. + :type name: str + :param target_resource_id: Target file share resource ARM ID. + :type target_resource_id: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TargetAFSRestoreInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.target_resource_id = kwargs.get('target_resource_id', None) + + +class TargetRestoreInfo(msrest.serialization.Model): + """Details about target workload during restore operation. + + :param overwrite_option: Can Overwrite if Target DataBase already exists. Possible values + include: "Invalid", "FailOnConflict", "Overwrite". + :type overwrite_option: str or ~azure.mgmt.recoveryservicesbackup.models.OverwriteOptions + :param container_id: Resource Id name of the container in which Target DataBase resides. + :type container_id: str + :param database_name: Database name InstanceName/DataBaseName for SQL or System/DbName for SAP + Hana. + :type database_name: str + :param target_directory_for_file_restore: Target directory location for restore as files. + :type target_directory_for_file_restore: str + """ + + _attribute_map = { + 'overwrite_option': {'key': 'overwriteOption', 'type': 'str'}, + 'container_id': {'key': 'containerId', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'target_directory_for_file_restore': {'key': 'targetDirectoryForFileRestore', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TargetRestoreInfo, self).__init__(**kwargs) + self.overwrite_option = kwargs.get('overwrite_option', None) + self.container_id = kwargs.get('container_id', None) + self.database_name = kwargs.get('database_name', None) + self.target_directory_for_file_restore = kwargs.get('target_directory_for_file_restore', None) + + +class TokenInformation(msrest.serialization.Model): + """The token information details. + + :param token: Token value. + :type token: str + :param expiry_time_in_utc_ticks: Expiry time of token. + :type expiry_time_in_utc_ticks: long + :param security_pin: Security PIN. + :type security_pin: str + """ + + _attribute_map = { + 'token': {'key': 'token', 'type': 'str'}, + 'expiry_time_in_utc_ticks': {'key': 'expiryTimeInUtcTicks', 'type': 'long'}, + 'security_pin': {'key': 'securityPIN', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TokenInformation, self).__init__(**kwargs) + self.token = kwargs.get('token', None) + self.expiry_time_in_utc_ticks = kwargs.get('expiry_time_in_utc_ticks', None) + self.security_pin = kwargs.get('security_pin', None) + + +class TriggerDataMoveRequest(msrest.serialization.Model): + """Trigger DataMove Request. + + All required parameters must be populated in order to send to Azure. + + :param source_resource_id: Required. ARM Id of source vault. + :type source_resource_id: str + :param source_region: Required. Source Region. + :type source_region: str + :param data_move_level: Required. DataMove Level. Possible values include: "Invalid", "Vault", + "Container". + :type data_move_level: str or ~azure.mgmt.recoveryservicesbackup.models.DataMoveLevel + :param correlation_id: Required. Correlation Id. + :type correlation_id: str + :param source_container_arm_ids: Source Container ArmIds. + :type source_container_arm_ids: list[str] + :param pause_gc: Pause GC. + :type pause_gc: bool + """ + + _validation = { + 'source_resource_id': {'required': True}, + 'source_region': {'required': True}, + 'data_move_level': {'required': True}, + 'correlation_id': {'required': True}, + } + + _attribute_map = { + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'source_region': {'key': 'sourceRegion', 'type': 'str'}, + 'data_move_level': {'key': 'dataMoveLevel', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'source_container_arm_ids': {'key': 'sourceContainerArmIds', 'type': '[str]'}, + 'pause_gc': {'key': 'pauseGC', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggerDataMoveRequest, self).__init__(**kwargs) + self.source_resource_id = kwargs['source_resource_id'] + self.source_region = kwargs['source_region'] + self.data_move_level = kwargs['data_move_level'] + self.correlation_id = kwargs['correlation_id'] + self.source_container_arm_ids = kwargs.get('source_container_arm_ids', None) + self.pause_gc = kwargs.get('pause_gc', None) + + +class ValidateOperationRequest(msrest.serialization.Model): + """Base class for validate operation request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ValidateRestoreOperationRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'ValidateRestoreOperationRequest': 'ValidateRestoreOperationRequest'} + } + + def __init__( + self, + **kwargs + ): + super(ValidateOperationRequest, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class ValidateRestoreOperationRequest(ValidateOperationRequest): + """AzureRestoreValidation request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ValidateIaasVMRestoreOperationRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param restore_request: Sets restore request to be validated. + :type restore_request: ~azure.mgmt.recoveryservicesbackup.models.RestoreRequest + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'restore_request': {'key': 'restoreRequest', 'type': 'RestoreRequest'}, + } + + _subtype_map = { + 'object_type': {'ValidateIaasVMRestoreOperationRequest': 'ValidateIaasVMRestoreOperationRequest'} + } + + def __init__( + self, + **kwargs + ): + super(ValidateRestoreOperationRequest, self).__init__(**kwargs) + self.object_type = 'ValidateRestoreOperationRequest' # type: str + self.restore_request = kwargs.get('restore_request', None) + + +class ValidateIaasVMRestoreOperationRequest(ValidateRestoreOperationRequest): + """AzureRestoreValidation request. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param restore_request: Sets restore request to be validated. + :type restore_request: ~azure.mgmt.recoveryservicesbackup.models.RestoreRequest + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'restore_request': {'key': 'restoreRequest', 'type': 'RestoreRequest'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidateIaasVMRestoreOperationRequest, self).__init__(**kwargs) + self.object_type = 'ValidateIaasVMRestoreOperationRequest' # type: str + + +class ValidateOperationResponse(msrest.serialization.Model): + """Base class for validate operation response. + + :param validation_results: Gets the validation result. + :type validation_results: list[~azure.mgmt.recoveryservicesbackup.models.ErrorDetail] + """ + + _attribute_map = { + 'validation_results': {'key': 'validationResults', 'type': '[ErrorDetail]'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidateOperationResponse, self).__init__(**kwargs) + self.validation_results = kwargs.get('validation_results', None) + + +class ValidateOperationsResponse(msrest.serialization.Model): + """ValidateOperationsResponse. + + :param validate_operation_response: Base class for validate operation response. + :type validate_operation_response: + ~azure.mgmt.recoveryservicesbackup.models.ValidateOperationResponse + """ + + _attribute_map = { + 'validate_operation_response': {'key': 'validateOperationResponse', 'type': 'ValidateOperationResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(ValidateOperationsResponse, self).__init__(**kwargs) + self.validate_operation_response = kwargs.get('validate_operation_response', None) + + +class VaultJob(Job): + """Vault level Job. + + All required parameters must be populated in order to send to Azure. + + :param entity_friendly_name: Friendly name of the entity on which the current job is executing. + :type entity_friendly_name: str + :param backup_management_type: Backup management type to execute the current job. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: The operation name. + :type operation: str + :param status: Job status. + :type status: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param activity_id: ActivityId of job. + :type activity_id: str + :param job_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 job_type: str + :param duration: Time elapsed during the execution of this job. + :type duration: ~datetime.timedelta + :param actions_info: Gets or sets the state/actions applicable on this job like cancel/retry. + :type actions_info: list[str or ~azure.mgmt.recoveryservicesbackup.models.JobSupportedAction] + :param error_details: Error details on execution of this job. + :type error_details: list[~azure.mgmt.recoveryservicesbackup.models.VaultJobErrorInfo] + :param extended_info: Additional information about the job. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.VaultJobExtendedInfo + """ + + _validation = { + 'job_type': {'required': True}, + } + + _attribute_map = { + 'entity_friendly_name': {'key': 'entityFriendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'actions_info': {'key': 'actionsInfo', 'type': '[str]'}, + 'error_details': {'key': 'errorDetails', 'type': '[VaultJobErrorInfo]'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'VaultJobExtendedInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(VaultJob, self).__init__(**kwargs) + self.job_type = 'VaultJob' # type: str + self.duration = kwargs.get('duration', None) + self.actions_info = kwargs.get('actions_info', None) + self.error_details = kwargs.get('error_details', None) + self.extended_info = kwargs.get('extended_info', None) + + +class VaultJobErrorInfo(msrest.serialization.Model): + """Vault Job specific error information. + + :param error_code: Error code. + :type error_code: int + :param error_string: Localized error string. + :type error_string: str + :param recommendations: List of localized recommendations for above error code. + :type recommendations: list[str] + """ + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'error_string': {'key': 'errorString', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(VaultJobErrorInfo, self).__init__(**kwargs) + self.error_code = kwargs.get('error_code', None) + self.error_string = kwargs.get('error_string', None) + self.recommendations = kwargs.get('recommendations', None) + + +class VaultJobExtendedInfo(msrest.serialization.Model): + """Vault Job for CMK - has CMK specific info. + + :param property_bag: Job properties. + :type property_bag: dict[str, str] + """ + + _attribute_map = { + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(VaultJobExtendedInfo, self).__init__(**kwargs) + self.property_bag = kwargs.get('property_bag', None) + + +class WeeklyRetentionFormat(msrest.serialization.Model): + """Weekly retention format. + + :param days_of_the_week: List of days of the week. + :type days_of_the_week: list[str or ~azure.mgmt.recoveryservicesbackup.models.DayOfWeek] + :param weeks_of_the_month: List of weeks of month. + :type weeks_of_the_month: list[str or ~azure.mgmt.recoveryservicesbackup.models.WeekOfMonth] + """ + + _attribute_map = { + 'days_of_the_week': {'key': 'daysOfTheWeek', 'type': '[str]'}, + 'weeks_of_the_month': {'key': 'weeksOfTheMonth', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(WeeklyRetentionFormat, self).__init__(**kwargs) + self.days_of_the_week = kwargs.get('days_of_the_week', None) + self.weeks_of_the_month = kwargs.get('weeks_of_the_month', None) + + +class WeeklyRetentionSchedule(msrest.serialization.Model): + """Weekly retention schedule. + + :param days_of_the_week: List of days of week for weekly retention policy. + :type days_of_the_week: list[str or ~azure.mgmt.recoveryservicesbackup.models.DayOfWeek] + :param retention_times: Retention times of retention policy. + :type retention_times: list[~datetime.datetime] + :param retention_duration: Retention duration of retention Policy. + :type retention_duration: ~azure.mgmt.recoveryservicesbackup.models.RetentionDuration + """ + + _attribute_map = { + 'days_of_the_week': {'key': 'daysOfTheWeek', 'type': '[str]'}, + 'retention_times': {'key': 'retentionTimes', 'type': '[iso-8601]'}, + 'retention_duration': {'key': 'retentionDuration', 'type': 'RetentionDuration'}, + } + + def __init__( + self, + **kwargs + ): + super(WeeklyRetentionSchedule, self).__init__(**kwargs) + self.days_of_the_week = kwargs.get('days_of_the_week', None) + self.retention_times = kwargs.get('retention_times', None) + self.retention_duration = kwargs.get('retention_duration', None) + + +class WorkloadCrrAccessToken(CrrAccessToken): + """WorkloadCrrAccessToken. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Type of the specific object - used for deserializing.Constant + filled by server. + :type object_type: str + :param access_token_string: Access token used for authentication. + :type access_token_string: str + :param subscription_id: Subscription Id of the source vault. + :type subscription_id: str + :param resource_group_name: Resource Group name of the source vault. + :type resource_group_name: str + :param resource_name: Resource Name of the source vault. + :type resource_name: str + :param resource_id: Resource Id of the source vault. + :type resource_id: str + :param protection_container_id: Protected item container id. + :type protection_container_id: long + :param recovery_point_id: Recovery Point Id. + :type recovery_point_id: str + :param recovery_point_time: Recovery Point Time. + :type recovery_point_time: str + :param container_name: Container Unique name. + :type container_name: str + :param container_type: Container Type. + :type container_type: str + :param backup_management_type: Backup Management Type. + :type backup_management_type: str + :param datasource_type: Datasource Type. + :type datasource_type: str + :param datasource_name: Datasource Friendly Name. + :type datasource_name: str + :param datasource_id: Datasource Id. + :type datasource_id: str + :param datasource_container_name: Datasource Container Unique Name. + :type datasource_container_name: str + :param coordinator_service_stamp_id: CoordinatorServiceStampId to be used by BCM in restore + call. + :type coordinator_service_stamp_id: str + :param coordinator_service_stamp_uri: CoordinatorServiceStampUri to be used by BCM in restore + call. + :type coordinator_service_stamp_uri: str + :param protection_service_stamp_id: ProtectionServiceStampId to be used by BCM in restore call. + :type protection_service_stamp_id: str + :param protection_service_stamp_uri: ProtectionServiceStampUri to be used by BCM in restore + call. + :type protection_service_stamp_uri: str + :param token_extended_information: Extended Information about the token like FileSpec etc. + :type token_extended_information: str + :param rp_tier_information: Recovery point Tier Information. + :type rp_tier_information: dict[str, str] + :param rp_original_sa_option: Recovery point information: Original SA option. + :type rp_original_sa_option: bool + :param rp_is_managed_virtual_machine: Recovery point information: Managed virtual machine. + :type rp_is_managed_virtual_machine: bool + :param rp_vm_size_description: Recovery point information: VM size description. + :type rp_vm_size_description: str + :param b_ms_active_region: Active region name of BMS Stamp. + :type b_ms_active_region: str + :param protectable_object_unique_name: + :type protectable_object_unique_name: str + :param protectable_object_friendly_name: + :type protectable_object_friendly_name: str + :param protectable_object_workload_type: + :type protectable_object_workload_type: str + :param protectable_object_protection_state: + :type protectable_object_protection_state: str + :param protectable_object_container_host_os_name: + :type protectable_object_container_host_os_name: str + :param protectable_object_parent_logical_container_name: + :type protectable_object_parent_logical_container_name: str + :param container_id: Container Id. + :type container_id: str + :param policy_name: Policy Name. + :type policy_name: str + :param policy_id: Policy Id. + :type policy_id: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'access_token_string': {'key': 'accessTokenString', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'protection_container_id': {'key': 'protectionContainerId', 'type': 'long'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'datasource_type': {'key': 'datasourceType', 'type': 'str'}, + 'datasource_name': {'key': 'datasourceName', 'type': 'str'}, + 'datasource_id': {'key': 'datasourceId', 'type': 'str'}, + 'datasource_container_name': {'key': 'datasourceContainerName', 'type': 'str'}, + 'coordinator_service_stamp_id': {'key': 'coordinatorServiceStampId', 'type': 'str'}, + 'coordinator_service_stamp_uri': {'key': 'coordinatorServiceStampUri', 'type': 'str'}, + 'protection_service_stamp_id': {'key': 'protectionServiceStampId', 'type': 'str'}, + 'protection_service_stamp_uri': {'key': 'protectionServiceStampUri', 'type': 'str'}, + 'token_extended_information': {'key': 'tokenExtendedInformation', 'type': 'str'}, + 'rp_tier_information': {'key': 'rpTierInformation', 'type': '{str}'}, + 'rp_original_sa_option': {'key': 'rpOriginalSAOption', 'type': 'bool'}, + 'rp_is_managed_virtual_machine': {'key': 'rpIsManagedVirtualMachine', 'type': 'bool'}, + 'rp_vm_size_description': {'key': 'rpVMSizeDescription', 'type': 'str'}, + 'b_ms_active_region': {'key': 'bMSActiveRegion', 'type': 'str'}, + 'protectable_object_unique_name': {'key': 'protectableObjectUniqueName', 'type': 'str'}, + 'protectable_object_friendly_name': {'key': 'protectableObjectFriendlyName', 'type': 'str'}, + 'protectable_object_workload_type': {'key': 'protectableObjectWorkloadType', 'type': 'str'}, + 'protectable_object_protection_state': {'key': 'protectableObjectProtectionState', 'type': 'str'}, + 'protectable_object_container_host_os_name': {'key': 'protectableObjectContainerHostOsName', 'type': 'str'}, + 'protectable_object_parent_logical_container_name': {'key': 'protectableObjectParentLogicalContainerName', 'type': 'str'}, + 'container_id': {'key': 'containerId', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkloadCrrAccessToken, self).__init__(**kwargs) + self.object_type = 'WorkloadCrrAccessToken' # type: str + self.protectable_object_unique_name = kwargs.get('protectable_object_unique_name', None) + self.protectable_object_friendly_name = kwargs.get('protectable_object_friendly_name', None) + self.protectable_object_workload_type = kwargs.get('protectable_object_workload_type', None) + self.protectable_object_protection_state = kwargs.get('protectable_object_protection_state', None) + self.protectable_object_container_host_os_name = kwargs.get('protectable_object_container_host_os_name', None) + self.protectable_object_parent_logical_container_name = kwargs.get('protectable_object_parent_logical_container_name', None) + self.container_id = kwargs.get('container_id', None) + self.policy_name = kwargs.get('policy_name', None) + self.policy_id = kwargs.get('policy_id', None) + + +class WorkloadInquiryDetails(msrest.serialization.Model): + """Details of an inquired protectable item. + + :param type: Type of the Workload such as SQL, Oracle etc. + :type type: str + :param item_count: Contains the protectable item Count inside this Container. + :type item_count: long + :param inquiry_validation: Inquiry validation such as permissions and other backup validations. + :type inquiry_validation: ~azure.mgmt.recoveryservicesbackup.models.InquiryValidation + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'item_count': {'key': 'itemCount', 'type': 'long'}, + 'inquiry_validation': {'key': 'inquiryValidation', 'type': 'InquiryValidation'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkloadInquiryDetails, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.item_count = kwargs.get('item_count', None) + self.inquiry_validation = kwargs.get('inquiry_validation', None) + + +class WorkloadItemResource(Resource): + """Base class for backup item. Workload-specific backup items are derived from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: WorkloadItemResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.WorkloadItem + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'WorkloadItem'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkloadItemResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class WorkloadItemResourceList(ResourceList): + """List of WorkloadItem resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.WorkloadItemResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[WorkloadItemResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkloadItemResourceList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class WorkloadProtectableItemResource(Resource): + """Base class for backup item. Workload-specific backup items are derived from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: WorkloadProtectableItemResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.WorkloadProtectableItem + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'WorkloadProtectableItem'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkloadProtectableItemResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class WorkloadProtectableItemResourceList(ResourceList): + """List of WorkloadProtectableItem resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.WorkloadProtectableItemResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[WorkloadProtectableItemResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkloadProtectableItemResourceList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class YearlyRetentionSchedule(msrest.serialization.Model): + """Yearly retention schedule. + + :param retention_schedule_format_type: Retention schedule format for yearly retention policy. + Possible values include: "Invalid", "Daily", "Weekly". + :type retention_schedule_format_type: str or + ~azure.mgmt.recoveryservicesbackup.models.RetentionScheduleFormat + :param months_of_year: List of months of year of yearly retention policy. + :type months_of_year: list[str or ~azure.mgmt.recoveryservicesbackup.models.MonthOfYear] + :param retention_schedule_daily: Daily retention format for yearly retention policy. + :type retention_schedule_daily: ~azure.mgmt.recoveryservicesbackup.models.DailyRetentionFormat + :param retention_schedule_weekly: Weekly retention format for yearly retention policy. + :type retention_schedule_weekly: + ~azure.mgmt.recoveryservicesbackup.models.WeeklyRetentionFormat + :param retention_times: Retention times of retention policy. + :type retention_times: list[~datetime.datetime] + :param retention_duration: Retention duration of retention Policy. + :type retention_duration: ~azure.mgmt.recoveryservicesbackup.models.RetentionDuration + """ + + _attribute_map = { + 'retention_schedule_format_type': {'key': 'retentionScheduleFormatType', 'type': 'str'}, + 'months_of_year': {'key': 'monthsOfYear', 'type': '[str]'}, + 'retention_schedule_daily': {'key': 'retentionScheduleDaily', 'type': 'DailyRetentionFormat'}, + 'retention_schedule_weekly': {'key': 'retentionScheduleWeekly', 'type': 'WeeklyRetentionFormat'}, + 'retention_times': {'key': 'retentionTimes', 'type': '[iso-8601]'}, + 'retention_duration': {'key': 'retentionDuration', 'type': 'RetentionDuration'}, + } + + def __init__( + self, + **kwargs + ): + super(YearlyRetentionSchedule, self).__init__(**kwargs) + self.retention_schedule_format_type = kwargs.get('retention_schedule_format_type', None) + self.months_of_year = kwargs.get('months_of_year', None) + self.retention_schedule_daily = kwargs.get('retention_schedule_daily', None) + self.retention_schedule_weekly = kwargs.get('retention_schedule_weekly', None) + self.retention_times = kwargs.get('retention_times', None) + self.retention_duration = kwargs.get('retention_duration', None) diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_models_py3.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_models_py3.py new file mode 100644 index 000000000000..20cc9905f1c9 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_models_py3.py @@ -0,0 +1,15252 @@ +# 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 datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._recovery_services_backup_client_enums import * + + +class AADProperties(msrest.serialization.Model): + """AADProperties. + + :param service_principal_client_id: + :type service_principal_client_id: str + :param tenant_id: + :type tenant_id: str + :param authority: + :type authority: str + :param audience: + :type audience: str + :param service_principal_object_id: + :type service_principal_object_id: str + """ + + _attribute_map = { + 'service_principal_client_id': {'key': 'servicePrincipalClientId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'authority': {'key': 'authority', 'type': 'str'}, + 'audience': {'key': 'audience', 'type': 'str'}, + 'service_principal_object_id': {'key': 'servicePrincipalObjectId', 'type': 'str'}, + } + + def __init__( + self, + *, + service_principal_client_id: Optional[str] = None, + tenant_id: Optional[str] = None, + authority: Optional[str] = None, + audience: Optional[str] = None, + service_principal_object_id: Optional[str] = None, + **kwargs + ): + super(AADProperties, self).__init__(**kwargs) + self.service_principal_client_id = service_principal_client_id + self.tenant_id = tenant_id + self.authority = authority + self.audience = audience + self.service_principal_object_id = service_principal_object_id + + +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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.e_tag = e_tag + + +class AADPropertiesResource(Resource): + """AADPropertiesResource. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: AADPropertiesResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.AADProperties + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'AADProperties'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["AADProperties"] = None, + **kwargs + ): + super(AADPropertiesResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class FeatureSupportRequest(msrest.serialization.Model): + """Base class for feature request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupGoalFeatureSupportRequest, AzureVMResourceFeatureSupportRequest. + + All required parameters must be populated in order to send to Azure. + + :param feature_type: Required. backup support feature type.Constant filled by server. + :type feature_type: str + """ + + _validation = { + 'feature_type': {'required': True}, + } + + _attribute_map = { + 'feature_type': {'key': 'featureType', 'type': 'str'}, + } + + _subtype_map = { + 'feature_type': {'AzureBackupGoals': 'AzureBackupGoalFeatureSupportRequest', 'AzureVMResourceBackup': 'AzureVMResourceFeatureSupportRequest'} + } + + def __init__( + self, + **kwargs + ): + super(FeatureSupportRequest, self).__init__(**kwargs) + self.feature_type = None # type: Optional[str] + + +class AzureBackupGoalFeatureSupportRequest(FeatureSupportRequest): + """Azure backup goal feature specific request. + + All required parameters must be populated in order to send to Azure. + + :param feature_type: Required. backup support feature type.Constant filled by server. + :type feature_type: str + """ + + _validation = { + 'feature_type': {'required': True}, + } + + _attribute_map = { + 'feature_type': {'key': 'featureType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureBackupGoalFeatureSupportRequest, self).__init__(**kwargs) + self.feature_type = 'AzureBackupGoals' # type: str + + +class ProtectionContainer(msrest.serialization.Model): + """Base class for container with backup items. Containers with specific workloads are derived from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureSqlContainer, AzureWorkloadContainer, DpmContainer, GenericContainer, IaaSVMContainer, AzureStorageContainer, MabContainer. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + } + + _subtype_map = { + 'container_type': {'AzureSqlContainer': 'AzureSqlContainer', 'AzureWorkloadContainer': 'AzureWorkloadContainer', 'DPMContainer': 'DpmContainer', 'GenericContainer': 'GenericContainer', 'IaaSVMContainer': 'IaaSVMContainer', 'StorageContainer': 'AzureStorageContainer', 'Windows': 'MabContainer'} + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + health_status: Optional[str] = None, + **kwargs + ): + super(ProtectionContainer, self).__init__(**kwargs) + self.friendly_name = friendly_name + self.backup_management_type = backup_management_type + self.registration_status = registration_status + self.health_status = health_status + self.container_type = None # type: Optional[str] + + +class DpmContainer(ProtectionContainer): + """DPM workload-specific protection container. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupServerContainer. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param can_re_register: Specifies whether the container is re-registrable. + :type can_re_register: bool + :param container_id: ID of container. + :type container_id: str + :param protected_item_count: Number of protected items in the BackupEngine. + :type protected_item_count: long + :param dpm_agent_version: Backup engine Agent version. + :type dpm_agent_version: str + :param dpm_servers: List of BackupEngines protecting the container. + :type dpm_servers: list[str] + :param upgrade_available: To check if upgrade available. + :type upgrade_available: bool + :param protection_status: Protection status of the container. + :type protection_status: str + :param extended_info: Extended Info of the container. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.DPMContainerExtendedInfo + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'can_re_register': {'key': 'canReRegister', 'type': 'bool'}, + 'container_id': {'key': 'containerId', 'type': 'str'}, + 'protected_item_count': {'key': 'protectedItemCount', 'type': 'long'}, + 'dpm_agent_version': {'key': 'dpmAgentVersion', 'type': 'str'}, + 'dpm_servers': {'key': 'dpmServers', 'type': '[str]'}, + 'upgrade_available': {'key': 'upgradeAvailable', 'type': 'bool'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'DPMContainerExtendedInfo'}, + } + + _subtype_map = { + 'container_type': {'AzureBackupServerContainer': 'AzureBackupServerContainer'} + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + health_status: Optional[str] = None, + can_re_register: Optional[bool] = None, + container_id: Optional[str] = None, + protected_item_count: Optional[int] = None, + dpm_agent_version: Optional[str] = None, + dpm_servers: Optional[List[str]] = None, + upgrade_available: Optional[bool] = None, + protection_status: Optional[str] = None, + extended_info: Optional["DPMContainerExtendedInfo"] = None, + **kwargs + ): + super(DpmContainer, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, registration_status=registration_status, health_status=health_status, **kwargs) + self.container_type = 'DPMContainer' # type: str + self.can_re_register = can_re_register + self.container_id = container_id + self.protected_item_count = protected_item_count + self.dpm_agent_version = dpm_agent_version + self.dpm_servers = dpm_servers + self.upgrade_available = upgrade_available + self.protection_status = protection_status + self.extended_info = extended_info + + +class AzureBackupServerContainer(DpmContainer): + """AzureBackupServer (DPMVenus) workload-specific protection container. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param can_re_register: Specifies whether the container is re-registrable. + :type can_re_register: bool + :param container_id: ID of container. + :type container_id: str + :param protected_item_count: Number of protected items in the BackupEngine. + :type protected_item_count: long + :param dpm_agent_version: Backup engine Agent version. + :type dpm_agent_version: str + :param dpm_servers: List of BackupEngines protecting the container. + :type dpm_servers: list[str] + :param upgrade_available: To check if upgrade available. + :type upgrade_available: bool + :param protection_status: Protection status of the container. + :type protection_status: str + :param extended_info: Extended Info of the container. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.DPMContainerExtendedInfo + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'can_re_register': {'key': 'canReRegister', 'type': 'bool'}, + 'container_id': {'key': 'containerId', 'type': 'str'}, + 'protected_item_count': {'key': 'protectedItemCount', 'type': 'long'}, + 'dpm_agent_version': {'key': 'dpmAgentVersion', 'type': 'str'}, + 'dpm_servers': {'key': 'dpmServers', 'type': '[str]'}, + 'upgrade_available': {'key': 'upgradeAvailable', 'type': 'bool'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'DPMContainerExtendedInfo'}, + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + health_status: Optional[str] = None, + can_re_register: Optional[bool] = None, + container_id: Optional[str] = None, + protected_item_count: Optional[int] = None, + dpm_agent_version: Optional[str] = None, + dpm_servers: Optional[List[str]] = None, + upgrade_available: Optional[bool] = None, + protection_status: Optional[str] = None, + extended_info: Optional["DPMContainerExtendedInfo"] = None, + **kwargs + ): + super(AzureBackupServerContainer, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, registration_status=registration_status, health_status=health_status, can_re_register=can_re_register, container_id=container_id, protected_item_count=protected_item_count, dpm_agent_version=dpm_agent_version, dpm_servers=dpm_servers, upgrade_available=upgrade_available, protection_status=protection_status, extended_info=extended_info, **kwargs) + self.container_type = 'AzureBackupServerContainer' # type: str + + +class BackupEngineBase(msrest.serialization.Model): + """The base backup engine class. All workload specific backup engines derive from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupServerEngine, DpmBackupEngine. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the backup engine. + :type friendly_name: str + :param backup_management_type: Type of backup management for the backup engine. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Registration status of the backup engine with the Recovery Services + Vault. + :type registration_status: str + :param backup_engine_state: Status of the backup engine with the Recovery Services Vault. = + {Active/Deleting/DeleteFailed}. + :type backup_engine_state: str + :param health_status: Backup status of the backup engine. + :type health_status: str + :param backup_engine_type: Required. Type of the backup engine.Constant filled by server. + Possible values include: "Invalid", "DpmBackupEngine", "AzureBackupServerEngine". + :type backup_engine_type: str or ~azure.mgmt.recoveryservicesbackup.models.BackupEngineType + :param can_re_register: Flag indicating if the backup engine be registered, once already + registered. + :type can_re_register: bool + :param backup_engine_id: ID of the backup engine. + :type backup_engine_id: str + :param dpm_version: Backup engine version. + :type dpm_version: str + :param azure_backup_agent_version: Backup agent version. + :type azure_backup_agent_version: str + :param is_azure_backup_agent_upgrade_available: To check if backup agent upgrade available. + :type is_azure_backup_agent_upgrade_available: bool + :param is_dpm_upgrade_available: To check if backup engine upgrade available. + :type is_dpm_upgrade_available: bool + :param extended_info: Extended info of the backupengine. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.BackupEngineExtendedInfo + """ + + _validation = { + 'backup_engine_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'backup_engine_state': {'key': 'backupEngineState', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'backup_engine_type': {'key': 'backupEngineType', 'type': 'str'}, + 'can_re_register': {'key': 'canReRegister', 'type': 'bool'}, + 'backup_engine_id': {'key': 'backupEngineId', 'type': 'str'}, + 'dpm_version': {'key': 'dpmVersion', 'type': 'str'}, + 'azure_backup_agent_version': {'key': 'azureBackupAgentVersion', 'type': 'str'}, + 'is_azure_backup_agent_upgrade_available': {'key': 'isAzureBackupAgentUpgradeAvailable', 'type': 'bool'}, + 'is_dpm_upgrade_available': {'key': 'isDpmUpgradeAvailable', 'type': 'bool'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'BackupEngineExtendedInfo'}, + } + + _subtype_map = { + 'backup_engine_type': {'AzureBackupServerEngine': 'AzureBackupServerEngine', 'DpmBackupEngine': 'DpmBackupEngine'} + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + backup_engine_state: Optional[str] = None, + health_status: Optional[str] = None, + can_re_register: Optional[bool] = None, + backup_engine_id: Optional[str] = None, + dpm_version: Optional[str] = None, + azure_backup_agent_version: Optional[str] = None, + is_azure_backup_agent_upgrade_available: Optional[bool] = None, + is_dpm_upgrade_available: Optional[bool] = None, + extended_info: Optional["BackupEngineExtendedInfo"] = None, + **kwargs + ): + super(BackupEngineBase, self).__init__(**kwargs) + self.friendly_name = friendly_name + self.backup_management_type = backup_management_type + self.registration_status = registration_status + self.backup_engine_state = backup_engine_state + self.health_status = health_status + self.backup_engine_type = None # type: Optional[str] + self.can_re_register = can_re_register + self.backup_engine_id = backup_engine_id + self.dpm_version = dpm_version + self.azure_backup_agent_version = azure_backup_agent_version + self.is_azure_backup_agent_upgrade_available = is_azure_backup_agent_upgrade_available + self.is_dpm_upgrade_available = is_dpm_upgrade_available + self.extended_info = extended_info + + +class AzureBackupServerEngine(BackupEngineBase): + """Backup engine type when Azure Backup Server is used to manage the backups. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the backup engine. + :type friendly_name: str + :param backup_management_type: Type of backup management for the backup engine. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Registration status of the backup engine with the Recovery Services + Vault. + :type registration_status: str + :param backup_engine_state: Status of the backup engine with the Recovery Services Vault. = + {Active/Deleting/DeleteFailed}. + :type backup_engine_state: str + :param health_status: Backup status of the backup engine. + :type health_status: str + :param backup_engine_type: Required. Type of the backup engine.Constant filled by server. + Possible values include: "Invalid", "DpmBackupEngine", "AzureBackupServerEngine". + :type backup_engine_type: str or ~azure.mgmt.recoveryservicesbackup.models.BackupEngineType + :param can_re_register: Flag indicating if the backup engine be registered, once already + registered. + :type can_re_register: bool + :param backup_engine_id: ID of the backup engine. + :type backup_engine_id: str + :param dpm_version: Backup engine version. + :type dpm_version: str + :param azure_backup_agent_version: Backup agent version. + :type azure_backup_agent_version: str + :param is_azure_backup_agent_upgrade_available: To check if backup agent upgrade available. + :type is_azure_backup_agent_upgrade_available: bool + :param is_dpm_upgrade_available: To check if backup engine upgrade available. + :type is_dpm_upgrade_available: bool + :param extended_info: Extended info of the backupengine. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.BackupEngineExtendedInfo + """ + + _validation = { + 'backup_engine_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'backup_engine_state': {'key': 'backupEngineState', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'backup_engine_type': {'key': 'backupEngineType', 'type': 'str'}, + 'can_re_register': {'key': 'canReRegister', 'type': 'bool'}, + 'backup_engine_id': {'key': 'backupEngineId', 'type': 'str'}, + 'dpm_version': {'key': 'dpmVersion', 'type': 'str'}, + 'azure_backup_agent_version': {'key': 'azureBackupAgentVersion', 'type': 'str'}, + 'is_azure_backup_agent_upgrade_available': {'key': 'isAzureBackupAgentUpgradeAvailable', 'type': 'bool'}, + 'is_dpm_upgrade_available': {'key': 'isDpmUpgradeAvailable', 'type': 'bool'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'BackupEngineExtendedInfo'}, + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + backup_engine_state: Optional[str] = None, + health_status: Optional[str] = None, + can_re_register: Optional[bool] = None, + backup_engine_id: Optional[str] = None, + dpm_version: Optional[str] = None, + azure_backup_agent_version: Optional[str] = None, + is_azure_backup_agent_upgrade_available: Optional[bool] = None, + is_dpm_upgrade_available: Optional[bool] = None, + extended_info: Optional["BackupEngineExtendedInfo"] = None, + **kwargs + ): + super(AzureBackupServerEngine, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, registration_status=registration_status, backup_engine_state=backup_engine_state, health_status=health_status, can_re_register=can_re_register, backup_engine_id=backup_engine_id, dpm_version=dpm_version, azure_backup_agent_version=azure_backup_agent_version, is_azure_backup_agent_upgrade_available=is_azure_backup_agent_upgrade_available, is_dpm_upgrade_available=is_dpm_upgrade_available, extended_info=extended_info, **kwargs) + self.backup_engine_type = 'AzureBackupServerEngine' # type: str + + +class BackupRequest(msrest.serialization.Model): + """Base class for backup request. Workload-specific backup requests are derived from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureFileShareBackupRequest, AzureWorkloadBackupRequest, IaasVMBackupRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureFileShareBackupRequest': 'AzureFileShareBackupRequest', 'AzureWorkloadBackupRequest': 'AzureWorkloadBackupRequest', 'IaasVMBackupRequest': 'IaasVMBackupRequest'} + } + + def __init__( + self, + **kwargs + ): + super(BackupRequest, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class AzureFileShareBackupRequest(BackupRequest): + """AzureFileShare workload-specific backup request. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_expiry_time_in_utc: Backup copy will expire after the time specified + (UTC). + :type recovery_point_expiry_time_in_utc: ~datetime.datetime + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_expiry_time_in_utc': {'key': 'recoveryPointExpiryTimeInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + recovery_point_expiry_time_in_utc: Optional[datetime.datetime] = None, + **kwargs + ): + super(AzureFileShareBackupRequest, self).__init__(**kwargs) + self.object_type = 'AzureFileShareBackupRequest' # type: str + self.recovery_point_expiry_time_in_utc = recovery_point_expiry_time_in_utc + + +class WorkloadProtectableItem(msrest.serialization.Model): + """Base class for backup item. Workload-specific backup items are derived from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureFileShareProtectableItem, AzureVmWorkloadProtectableItem, IaaSVMProtectableItem. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + } + + _subtype_map = { + 'protectable_item_type': {'AzureFileShare': 'AzureFileShareProtectableItem', 'AzureVmWorkloadProtectableItem': 'AzureVmWorkloadProtectableItem', 'IaaSVMProtectableItem': 'IaaSVMProtectableItem'} + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + **kwargs + ): + super(WorkloadProtectableItem, self).__init__(**kwargs) + self.backup_management_type = backup_management_type + self.workload_type = workload_type + self.protectable_item_type = None # type: Optional[str] + self.friendly_name = friendly_name + self.protection_state = protection_state + + +class AzureFileShareProtectableItem(WorkloadProtectableItem): + """Protectable item for Azure Fileshare workloads. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_container_fabric_id: Full Fabric ID of container to which this protectable item + belongs. For example, ARM ID. + :type parent_container_fabric_id: str + :param parent_container_friendly_name: Friendly name of container to which this protectable + item belongs. + :type parent_container_friendly_name: str + :param azure_file_share_type: File Share type XSync or XSMB. Possible values include: + "Invalid", "XSMB", "XSync". + :type azure_file_share_type: str or + ~azure.mgmt.recoveryservicesbackup.models.AzureFileShareType + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_container_fabric_id': {'key': 'parentContainerFabricId', 'type': 'str'}, + 'parent_container_friendly_name': {'key': 'parentContainerFriendlyName', 'type': 'str'}, + 'azure_file_share_type': {'key': 'azureFileShareType', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_container_fabric_id: Optional[str] = None, + parent_container_friendly_name: Optional[str] = None, + azure_file_share_type: Optional[Union[str, "AzureFileShareType"]] = None, + **kwargs + ): + super(AzureFileShareProtectableItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, **kwargs) + self.protectable_item_type = 'AzureFileShare' # type: str + self.parent_container_fabric_id = parent_container_fabric_id + self.parent_container_friendly_name = parent_container_friendly_name + self.azure_file_share_type = azure_file_share_type + + +class ProtectedItem(msrest.serialization.Model): + """Base class for backup items. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureFileshareProtectedItemAutoGenerated, AzureIaaSVMProtectedItem, AzureVmWorkloadProtectedItem, DPMProtectedItem, GenericProtectedItem, MabFileFolderProtectedItem, AzureSqlProtectedItem. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + } + + _subtype_map = { + 'protected_item_type': {'AzureFileShareProtectedItem': 'AzureFileshareProtectedItemAutoGenerated', 'AzureIaaSVMProtectedItem': 'AzureIaaSVMProtectedItem', 'AzureVmWorkloadProtectedItem': 'AzureVmWorkloadProtectedItem', 'DPMProtectedItem': 'DPMProtectedItem', 'GenericProtectedItem': 'GenericProtectedItem', 'MabFileFolderProtectedItem': 'MabFileFolderProtectedItem', 'Microsoft.Sql/servers/databases': 'AzureSqlProtectedItem'} + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "DataSourceType"]] = None, + container_name: Optional[str] = None, + source_resource_id: Optional[str] = None, + policy_id: Optional[str] = None, + last_recovery_point: Optional[datetime.datetime] = None, + backup_set_name: Optional[str] = None, + create_mode: Optional[Union[str, "CreateMode"]] = None, + deferred_delete_time_in_utc: Optional[datetime.datetime] = None, + is_scheduled_for_deferred_delete: Optional[bool] = None, + deferred_delete_time_remaining: Optional[str] = None, + is_deferred_delete_schedule_upcoming: Optional[bool] = None, + is_rehydrate: Optional[bool] = None, + **kwargs + ): + super(ProtectedItem, self).__init__(**kwargs) + self.protected_item_type = None # type: Optional[str] + self.backup_management_type = backup_management_type + self.workload_type = workload_type + self.container_name = container_name + self.source_resource_id = source_resource_id + self.policy_id = policy_id + self.last_recovery_point = last_recovery_point + self.backup_set_name = backup_set_name + self.create_mode = create_mode + self.deferred_delete_time_in_utc = deferred_delete_time_in_utc + self.is_scheduled_for_deferred_delete = is_scheduled_for_deferred_delete + self.deferred_delete_time_remaining = deferred_delete_time_remaining + self.is_deferred_delete_schedule_upcoming = is_deferred_delete_schedule_upcoming + self.is_rehydrate = is_rehydrate + + +class AzureFileshareProtectedItem(ProtectedItem): + """Azure File Share workload-specific backup item. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the fileshare represented by this backup item. + :type friendly_name: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param last_backup_status: Last backup operation status. Possible values: Healthy, Unhealthy. + :type last_backup_status: str + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + :param extended_info: Additional information with this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureFileshareProtectedItemExtendedInfo + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureFileshareProtectedItemExtendedInfo'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "DataSourceType"]] = None, + container_name: Optional[str] = None, + source_resource_id: Optional[str] = None, + policy_id: Optional[str] = None, + last_recovery_point: Optional[datetime.datetime] = None, + backup_set_name: Optional[str] = None, + create_mode: Optional[Union[str, "CreateMode"]] = None, + deferred_delete_time_in_utc: Optional[datetime.datetime] = None, + is_scheduled_for_deferred_delete: Optional[bool] = None, + deferred_delete_time_remaining: Optional[str] = None, + is_deferred_delete_schedule_upcoming: Optional[bool] = None, + is_rehydrate: Optional[bool] = None, + friendly_name: Optional[str] = None, + protection_status: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionState"]] = None, + last_backup_status: Optional[str] = None, + last_backup_time: Optional[datetime.datetime] = None, + kpis_healths: Optional[Dict[str, "KPIResourceHealthDetails"]] = None, + extended_info: Optional["AzureFileshareProtectedItemExtendedInfo"] = None, + **kwargs + ): + super(AzureFileshareProtectedItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, container_name=container_name, source_resource_id=source_resource_id, policy_id=policy_id, last_recovery_point=last_recovery_point, backup_set_name=backup_set_name, create_mode=create_mode, deferred_delete_time_in_utc=deferred_delete_time_in_utc, is_scheduled_for_deferred_delete=is_scheduled_for_deferred_delete, deferred_delete_time_remaining=deferred_delete_time_remaining, is_deferred_delete_schedule_upcoming=is_deferred_delete_schedule_upcoming, is_rehydrate=is_rehydrate, **kwargs) + self.protected_item_type = 'AzureFileShareProtectedItem' # type: str + self.friendly_name = friendly_name + self.protection_status = protection_status + self.protection_state = protection_state + self.last_backup_status = last_backup_status + self.last_backup_time = last_backup_time + self.kpis_healths = kpis_healths + self.extended_info = extended_info + + +class AzureFileshareProtectedItemAutoGenerated(ProtectedItem): + """Azure File Share workload-specific backup item. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the fileshare represented by this backup item. + :type friendly_name: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param health_status: backups running status for this backup item. Possible values include: + "Passed", "ActionRequired", "ActionSuggested", "Invalid". + :type health_status: str or ~azure.mgmt.recoveryservicesbackup.models.HealthStatus + :param last_backup_status: Last backup operation status. Possible values: Healthy, Unhealthy. + :type last_backup_status: str + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + :param extended_info: Additional information with this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureFileshareProtectedItemExtendedInfo + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureFileshareProtectedItemExtendedInfo'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "DataSourceType"]] = None, + container_name: Optional[str] = None, + source_resource_id: Optional[str] = None, + policy_id: Optional[str] = None, + last_recovery_point: Optional[datetime.datetime] = None, + backup_set_name: Optional[str] = None, + create_mode: Optional[Union[str, "CreateMode"]] = None, + deferred_delete_time_in_utc: Optional[datetime.datetime] = None, + is_scheduled_for_deferred_delete: Optional[bool] = None, + deferred_delete_time_remaining: Optional[str] = None, + is_deferred_delete_schedule_upcoming: Optional[bool] = None, + is_rehydrate: Optional[bool] = None, + friendly_name: Optional[str] = None, + protection_status: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionState"]] = None, + health_status: Optional[Union[str, "HealthStatus"]] = None, + last_backup_status: Optional[str] = None, + last_backup_time: Optional[datetime.datetime] = None, + kpis_healths: Optional[Dict[str, "KPIResourceHealthDetails"]] = None, + extended_info: Optional["AzureFileshareProtectedItemExtendedInfo"] = None, + **kwargs + ): + super(AzureFileshareProtectedItemAutoGenerated, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, container_name=container_name, source_resource_id=source_resource_id, policy_id=policy_id, last_recovery_point=last_recovery_point, backup_set_name=backup_set_name, create_mode=create_mode, deferred_delete_time_in_utc=deferred_delete_time_in_utc, is_scheduled_for_deferred_delete=is_scheduled_for_deferred_delete, deferred_delete_time_remaining=deferred_delete_time_remaining, is_deferred_delete_schedule_upcoming=is_deferred_delete_schedule_upcoming, is_rehydrate=is_rehydrate, **kwargs) + self.protected_item_type = 'AzureFileShareProtectedItem' # type: str + self.friendly_name = friendly_name + self.protection_status = protection_status + self.protection_state = protection_state + self.health_status = health_status + self.last_backup_status = last_backup_status + self.last_backup_time = last_backup_time + self.kpis_healths = kpis_healths + self.extended_info = extended_info + + +class AzureFileshareProtectedItemExtendedInfo(msrest.serialization.Model): + """Additional information about Azure File Share backup item. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param oldest_recovery_point: The oldest backup copy available for this item in the service. + :type oldest_recovery_point: ~datetime.datetime + :param recovery_point_count: Number of available backup copies associated with this backup + item. + :type recovery_point_count: int + :param policy_state: Indicates consistency of policy object and policy applied to this backup + item. + :type policy_state: str + :ivar resource_state: Indicates the state of this resource. Possible values are from enum + ResourceState {Invalid, Active, SoftDeleted, Deleted}. + :vartype resource_state: str + :ivar resource_state_sync_time: The resource state sync time for this backup item. + :vartype resource_state_sync_time: ~datetime.datetime + """ + + _validation = { + 'resource_state': {'readonly': True}, + 'resource_state_sync_time': {'readonly': True}, + } + + _attribute_map = { + 'oldest_recovery_point': {'key': 'oldestRecoveryPoint', 'type': 'iso-8601'}, + 'recovery_point_count': {'key': 'recoveryPointCount', 'type': 'int'}, + 'policy_state': {'key': 'policyState', 'type': 'str'}, + 'resource_state': {'key': 'resourceState', 'type': 'str'}, + 'resource_state_sync_time': {'key': 'resourceStateSyncTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + oldest_recovery_point: Optional[datetime.datetime] = None, + recovery_point_count: Optional[int] = None, + policy_state: Optional[str] = None, + **kwargs + ): + super(AzureFileshareProtectedItemExtendedInfo, self).__init__(**kwargs) + self.oldest_recovery_point = oldest_recovery_point + self.recovery_point_count = recovery_point_count + self.policy_state = policy_state + self.resource_state = None + self.resource_state_sync_time = None + + +class ProtectionPolicy(msrest.serialization.Model): + """Base class for backup policy. Workload-specific backup policies are derived from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureIaaSVMProtectionPolicy, AzureSqlProtectionPolicy, AzureFileShareProtectionPolicy, AzureVmWorkloadProtectionPolicy, GenericProtectionPolicy, MabProtectionPolicy. + + All required parameters must be populated in order to send to Azure. + + :param protected_items_count: Number of items associated with this policy. + :type protected_items_count: int + :param backup_management_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 backup_management_type: str + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + } + + _subtype_map = { + 'backup_management_type': {'AzureIaasVM': 'AzureIaaSVMProtectionPolicy', 'AzureSql': 'AzureSqlProtectionPolicy', 'AzureStorage': 'AzureFileShareProtectionPolicy', 'AzureWorkload': 'AzureVmWorkloadProtectionPolicy', 'GenericProtectionPolicy': 'GenericProtectionPolicy', 'MAB': 'MabProtectionPolicy'} + } + + def __init__( + self, + *, + protected_items_count: Optional[int] = None, + **kwargs + ): + super(ProtectionPolicy, self).__init__(**kwargs) + self.protected_items_count = protected_items_count + self.backup_management_type = None # type: Optional[str] + + +class AzureFileShareProtectionPolicy(ProtectionPolicy): + """AzureStorage backup policy. + + All required parameters must be populated in order to send to Azure. + + :param protected_items_count: Number of items associated with this policy. + :type protected_items_count: int + :param backup_management_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 backup_management_type: str + :param work_load_type: Type of workload for the backup management. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type work_load_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param schedule_policy: Backup schedule specified as part of backup policy. + :type schedule_policy: ~azure.mgmt.recoveryservicesbackup.models.SchedulePolicy + :param retention_policy: Retention policy with the details on backup copy retention ranges. + :type retention_policy: ~azure.mgmt.recoveryservicesbackup.models.RetentionPolicy + :param time_zone: TimeZone optional input as string. For example: TimeZone = "Pacific Standard + Time". + :type time_zone: str + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'work_load_type': {'key': 'workLoadType', 'type': 'str'}, + 'schedule_policy': {'key': 'schedulePolicy', 'type': 'SchedulePolicy'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + } + + def __init__( + self, + *, + protected_items_count: Optional[int] = None, + work_load_type: Optional[Union[str, "WorkloadType"]] = None, + schedule_policy: Optional["SchedulePolicy"] = None, + retention_policy: Optional["RetentionPolicy"] = None, + time_zone: Optional[str] = None, + **kwargs + ): + super(AzureFileShareProtectionPolicy, self).__init__(protected_items_count=protected_items_count, **kwargs) + self.backup_management_type = 'AzureStorage' # type: str + self.work_load_type = work_load_type + self.schedule_policy = schedule_policy + self.retention_policy = retention_policy + self.time_zone = time_zone + + +class ILRRequest(msrest.serialization.Model): + """Parameters to Provision ILR API. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureFileShareProvisionILRRequest, IaasVMILRRegistrationRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureFileShareProvisionILRRequest': 'AzureFileShareProvisionILRRequest', 'IaasVMILRRegistrationRequest': 'IaasVMILRRegistrationRequest'} + } + + def __init__( + self, + **kwargs + ): + super(ILRRequest, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class AzureFileShareProvisionILRRequest(ILRRequest): + """Update snapshot Uri with the correct friendly Name of the source Azure file share. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_id: Recovery point ID. + :type recovery_point_id: str + :param source_resource_id: Source Storage account ARM Id. + :type source_resource_id: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + recovery_point_id: Optional[str] = None, + source_resource_id: Optional[str] = None, + **kwargs + ): + super(AzureFileShareProvisionILRRequest, self).__init__(**kwargs) + self.object_type = 'AzureFileShareProvisionILRRequest' # type: str + self.recovery_point_id = recovery_point_id + self.source_resource_id = source_resource_id + + +class RecoveryPoint(msrest.serialization.Model): + """Base class for backup copies. Workload-specific backup copies are derived from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureFileShareRecoveryPointAutoGenerated, AzureWorkloadRecoveryPointAutoGenerated, GenericRecoveryPoint, IaasVMRecoveryPointAutoGenerated. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureFileShareRecoveryPoint': 'AzureFileShareRecoveryPointAutoGenerated', 'AzureWorkloadRecoveryPoint': 'AzureWorkloadRecoveryPointAutoGenerated', 'GenericRecoveryPoint': 'GenericRecoveryPoint', 'IaasVMRecoveryPoint': 'IaasVMRecoveryPointAutoGenerated'} + } + + def __init__( + self, + **kwargs + ): + super(RecoveryPoint, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class AzureFileShareRecoveryPoint(RecoveryPoint): + """Azure File Share workload specific backup copy. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_type: Type of the backup copy. Specifies whether it is a crash consistent + backup or app consistent. + :type recovery_point_type: str + :param recovery_point_time: Time at which this backup copy was created. + :type recovery_point_time: ~datetime.datetime + :param file_share_snapshot_uri: Contains Url to the snapshot of fileshare, if applicable. + :type file_share_snapshot_uri: str + :param recovery_point_size_in_gb: Contains recovery point size. + :type recovery_point_size_in_gb: int + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, + 'file_share_snapshot_uri': {'key': 'fileShareSnapshotUri', 'type': 'str'}, + 'recovery_point_size_in_gb': {'key': 'recoveryPointSizeInGB', 'type': 'int'}, + } + + def __init__( + self, + *, + recovery_point_type: Optional[str] = None, + recovery_point_time: Optional[datetime.datetime] = None, + file_share_snapshot_uri: Optional[str] = None, + recovery_point_size_in_gb: Optional[int] = None, + **kwargs + ): + super(AzureFileShareRecoveryPoint, self).__init__(**kwargs) + self.object_type = 'AzureFileShareRecoveryPoint' # type: str + self.recovery_point_type = recovery_point_type + self.recovery_point_time = recovery_point_time + self.file_share_snapshot_uri = file_share_snapshot_uri + self.recovery_point_size_in_gb = recovery_point_size_in_gb + + +class AzureFileShareRecoveryPointAutoGenerated(RecoveryPoint): + """Azure File Share workload specific backup copy. + + 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 object_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 object_type: str + :ivar recovery_point_type: Type of the backup copy. Specifies whether it is a crash consistent + backup or app consistent. + :vartype recovery_point_type: str + :ivar recovery_point_time: Time at which this backup copy was created. + :vartype recovery_point_time: ~datetime.datetime + :ivar file_share_snapshot_uri: Contains Url to the snapshot of fileshare, if applicable. + :vartype file_share_snapshot_uri: str + :ivar recovery_point_size_in_gb: Contains recovery point size. + :vartype recovery_point_size_in_gb: int + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_type': {'readonly': True}, + 'recovery_point_time': {'readonly': True}, + 'file_share_snapshot_uri': {'readonly': True}, + 'recovery_point_size_in_gb': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, + 'file_share_snapshot_uri': {'key': 'fileShareSnapshotUri', 'type': 'str'}, + 'recovery_point_size_in_gb': {'key': 'recoveryPointSizeInGB', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureFileShareRecoveryPointAutoGenerated, self).__init__(**kwargs) + self.object_type = 'AzureFileShareRecoveryPoint' # type: str + self.recovery_point_type = None + self.recovery_point_time = None + self.file_share_snapshot_uri = None + self.recovery_point_size_in_gb = None + + +class RestoreRequest(msrest.serialization.Model): + """Base class for restore request. Workload-specific restore requests are derived from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureFileShareRestoreRequest, AzureWorkloadRestoreRequest, IaasVMRestoreRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureFileShareRestoreRequest': 'AzureFileShareRestoreRequest', 'AzureWorkloadRestoreRequest': 'AzureWorkloadRestoreRequest', 'IaasVMRestoreRequest': 'IaasVMRestoreRequest'} + } + + def __init__( + self, + **kwargs + ): + super(RestoreRequest, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class AzureFileShareRestoreRequest(RestoreRequest): + """AzureFileShare Restore Request. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Source storage account ARM Id. + :type source_resource_id: str + :param copy_options: Options to resolve copy conflicts. Possible values include: "Invalid", + "CreateCopy", "Skip", "Overwrite", "FailOnConflict". + :type copy_options: str or ~azure.mgmt.recoveryservicesbackup.models.CopyOptions + :param restore_request_type: Restore Type (FullShareRestore or ItemLevelRestore). Possible + values include: "Invalid", "FullShareRestore", "ItemLevelRestore". + :type restore_request_type: str or ~azure.mgmt.recoveryservicesbackup.models.RestoreRequestType + :param restore_file_specs: List of Source Files/Folders(which need to recover) and + TargetFolderPath details. + :type restore_file_specs: list[~azure.mgmt.recoveryservicesbackup.models.RestoreFileSpecs] + :param target_details: Target File Share Details. + :type target_details: ~azure.mgmt.recoveryservicesbackup.models.TargetAFSRestoreInfo + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'copy_options': {'key': 'copyOptions', 'type': 'str'}, + 'restore_request_type': {'key': 'restoreRequestType', 'type': 'str'}, + 'restore_file_specs': {'key': 'restoreFileSpecs', 'type': '[RestoreFileSpecs]'}, + 'target_details': {'key': 'targetDetails', 'type': 'TargetAFSRestoreInfo'}, + } + + def __init__( + self, + *, + recovery_type: Optional[Union[str, "RecoveryType"]] = None, + source_resource_id: Optional[str] = None, + copy_options: Optional[Union[str, "CopyOptions"]] = None, + restore_request_type: Optional[Union[str, "RestoreRequestType"]] = None, + restore_file_specs: Optional[List["RestoreFileSpecs"]] = None, + target_details: Optional["TargetAFSRestoreInfo"] = None, + **kwargs + ): + super(AzureFileShareRestoreRequest, self).__init__(**kwargs) + self.object_type = 'AzureFileShareRestoreRequest' # type: str + self.recovery_type = recovery_type + self.source_resource_id = source_resource_id + self.copy_options = copy_options + self.restore_request_type = restore_request_type + self.restore_file_specs = restore_file_specs + self.target_details = target_details + + +class IaaSVMContainer(ProtectionContainer): + """IaaS VM workload-specific container. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureIaaSClassicComputeVMContainer, AzureIaaSComputeVMContainer. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param virtual_machine_id: Fully qualified ARM url of the virtual machine represented by this + Azure IaaS VM container. + :type virtual_machine_id: str + :param virtual_machine_version: Specifies whether the container represents a Classic or an + Azure Resource Manager VM. + :type virtual_machine_version: str + :param resource_group: Resource group name of Recovery Services Vault. + :type resource_group: str + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + 'virtual_machine_version': {'key': 'virtualMachineVersion', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + _subtype_map = { + 'container_type': {'Microsoft.ClassicCompute/virtualMachines': 'AzureIaaSClassicComputeVMContainer', 'Microsoft.Compute/virtualMachines': 'AzureIaaSComputeVMContainer'} + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + health_status: Optional[str] = None, + virtual_machine_id: Optional[str] = None, + virtual_machine_version: Optional[str] = None, + resource_group: Optional[str] = None, + **kwargs + ): + super(IaaSVMContainer, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, registration_status=registration_status, health_status=health_status, **kwargs) + self.container_type = 'IaaSVMContainer' # type: str + self.virtual_machine_id = virtual_machine_id + self.virtual_machine_version = virtual_machine_version + self.resource_group = resource_group + + +class AzureIaaSClassicComputeVMContainer(IaaSVMContainer): + """IaaS VM workload-specific backup item representing a classic virtual machine. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param virtual_machine_id: Fully qualified ARM url of the virtual machine represented by this + Azure IaaS VM container. + :type virtual_machine_id: str + :param virtual_machine_version: Specifies whether the container represents a Classic or an + Azure Resource Manager VM. + :type virtual_machine_version: str + :param resource_group: Resource group name of Recovery Services Vault. + :type resource_group: str + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + 'virtual_machine_version': {'key': 'virtualMachineVersion', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + health_status: Optional[str] = None, + virtual_machine_id: Optional[str] = None, + virtual_machine_version: Optional[str] = None, + resource_group: Optional[str] = None, + **kwargs + ): + super(AzureIaaSClassicComputeVMContainer, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, registration_status=registration_status, health_status=health_status, virtual_machine_id=virtual_machine_id, virtual_machine_version=virtual_machine_version, resource_group=resource_group, **kwargs) + self.container_type = 'Microsoft.ClassicCompute/virtualMachines' # type: str + + +class IaaSVMProtectableItem(WorkloadProtectableItem): + """IaaS VM workload-specific backup item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureIaaSClassicComputeVMProtectableItem, AzureIaaSComputeVMProtectableItem. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param virtual_machine_id: Fully qualified ARM ID of the virtual machine. + :type virtual_machine_id: str + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + } + + _subtype_map = { + 'protectable_item_type': {'Microsoft.ClassicCompute/virtualMachines': 'AzureIaaSClassicComputeVMProtectableItem', 'Microsoft.Compute/virtualMachines': 'AzureIaaSComputeVMProtectableItem'} + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + virtual_machine_id: Optional[str] = None, + **kwargs + ): + super(IaaSVMProtectableItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, **kwargs) + self.protectable_item_type = 'IaaSVMProtectableItem' # type: str + self.virtual_machine_id = virtual_machine_id + + +class AzureIaaSClassicComputeVMProtectableItem(IaaSVMProtectableItem): + """IaaS VM workload-specific backup item representing the Classic Compute VM. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param virtual_machine_id: Fully qualified ARM ID of the virtual machine. + :type virtual_machine_id: str + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + virtual_machine_id: Optional[str] = None, + **kwargs + ): + super(AzureIaaSClassicComputeVMProtectableItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, virtual_machine_id=virtual_machine_id, **kwargs) + self.protectable_item_type = 'Microsoft.ClassicCompute/virtualMachines' # type: str + + +class AzureIaaSVMProtectedItem(ProtectedItem): + """IaaS VM workload-specific backup item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureIaaSClassicComputeVMProtectedItem, AzureIaaSComputeVMProtectedItem. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the VM represented by this backup item. + :type friendly_name: str + :param virtual_machine_id: Fully qualified ARM ID of the virtual machine represented by this + item. + :type virtual_machine_id: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param health_status: Health status of protected item. Possible values include: "Passed", + "ActionRequired", "ActionSuggested", "Invalid". + :type health_status: str or ~azure.mgmt.recoveryservicesbackup.models.HealthStatus + :param health_details: Health details on this backup item. + :type health_details: list[~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMHealthDetails] + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + :param last_backup_status: Last backup operation status. + :type last_backup_status: str + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param protected_item_data_id: Data ID of the protected item. + :type protected_item_data_id: str + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMProtectedItemExtendedInfo + :param extended_properties: Extended Properties for Azure IaasVM Backup. + :type extended_properties: ~azure.mgmt.recoveryservicesbackup.models.ExtendedProperties + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'health_details': {'key': 'healthDetails', 'type': '[AzureIaaSVMHealthDetails]'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'protected_item_data_id': {'key': 'protectedItemDataId', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureIaaSVMProtectedItemExtendedInfo'}, + 'extended_properties': {'key': 'extendedProperties', 'type': 'ExtendedProperties'}, + } + + _subtype_map = { + 'protected_item_type': {'Microsoft.ClassicCompute/virtualMachines': 'AzureIaaSClassicComputeVMProtectedItem', 'Microsoft.Compute/virtualMachines': 'AzureIaaSComputeVMProtectedItem'} + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "DataSourceType"]] = None, + container_name: Optional[str] = None, + source_resource_id: Optional[str] = None, + policy_id: Optional[str] = None, + last_recovery_point: Optional[datetime.datetime] = None, + backup_set_name: Optional[str] = None, + create_mode: Optional[Union[str, "CreateMode"]] = None, + deferred_delete_time_in_utc: Optional[datetime.datetime] = None, + is_scheduled_for_deferred_delete: Optional[bool] = None, + deferred_delete_time_remaining: Optional[str] = None, + is_deferred_delete_schedule_upcoming: Optional[bool] = None, + is_rehydrate: Optional[bool] = None, + friendly_name: Optional[str] = None, + virtual_machine_id: Optional[str] = None, + protection_status: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionState"]] = None, + health_status: Optional[Union[str, "HealthStatus"]] = None, + health_details: Optional[List["AzureIaaSVMHealthDetails"]] = None, + kpis_healths: Optional[Dict[str, "KPIResourceHealthDetails"]] = None, + last_backup_status: Optional[str] = None, + last_backup_time: Optional[datetime.datetime] = None, + protected_item_data_id: Optional[str] = None, + extended_info: Optional["AzureIaaSVMProtectedItemExtendedInfo"] = None, + extended_properties: Optional["ExtendedProperties"] = None, + **kwargs + ): + super(AzureIaaSVMProtectedItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, container_name=container_name, source_resource_id=source_resource_id, policy_id=policy_id, last_recovery_point=last_recovery_point, backup_set_name=backup_set_name, create_mode=create_mode, deferred_delete_time_in_utc=deferred_delete_time_in_utc, is_scheduled_for_deferred_delete=is_scheduled_for_deferred_delete, deferred_delete_time_remaining=deferred_delete_time_remaining, is_deferred_delete_schedule_upcoming=is_deferred_delete_schedule_upcoming, is_rehydrate=is_rehydrate, **kwargs) + self.protected_item_type = 'AzureIaaSVMProtectedItem' # type: str + self.friendly_name = friendly_name + self.virtual_machine_id = virtual_machine_id + self.protection_status = protection_status + self.protection_state = protection_state + self.health_status = health_status + self.health_details = health_details + self.kpis_healths = kpis_healths + self.last_backup_status = last_backup_status + self.last_backup_time = last_backup_time + self.protected_item_data_id = protected_item_data_id + self.extended_info = extended_info + self.extended_properties = extended_properties + + +class AzureIaaSClassicComputeVMProtectedItem(AzureIaaSVMProtectedItem): + """IaaS VM workload-specific backup item representing the Classic Compute VM. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the VM represented by this backup item. + :type friendly_name: str + :param virtual_machine_id: Fully qualified ARM ID of the virtual machine represented by this + item. + :type virtual_machine_id: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param health_status: Health status of protected item. Possible values include: "Passed", + "ActionRequired", "ActionSuggested", "Invalid". + :type health_status: str or ~azure.mgmt.recoveryservicesbackup.models.HealthStatus + :param health_details: Health details on this backup item. + :type health_details: list[~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMHealthDetails] + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + :param last_backup_status: Last backup operation status. + :type last_backup_status: str + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param protected_item_data_id: Data ID of the protected item. + :type protected_item_data_id: str + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMProtectedItemExtendedInfo + :param extended_properties: Extended Properties for Azure IaasVM Backup. + :type extended_properties: ~azure.mgmt.recoveryservicesbackup.models.ExtendedProperties + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'health_details': {'key': 'healthDetails', 'type': '[AzureIaaSVMHealthDetails]'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'protected_item_data_id': {'key': 'protectedItemDataId', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureIaaSVMProtectedItemExtendedInfo'}, + 'extended_properties': {'key': 'extendedProperties', 'type': 'ExtendedProperties'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "DataSourceType"]] = None, + container_name: Optional[str] = None, + source_resource_id: Optional[str] = None, + policy_id: Optional[str] = None, + last_recovery_point: Optional[datetime.datetime] = None, + backup_set_name: Optional[str] = None, + create_mode: Optional[Union[str, "CreateMode"]] = None, + deferred_delete_time_in_utc: Optional[datetime.datetime] = None, + is_scheduled_for_deferred_delete: Optional[bool] = None, + deferred_delete_time_remaining: Optional[str] = None, + is_deferred_delete_schedule_upcoming: Optional[bool] = None, + is_rehydrate: Optional[bool] = None, + friendly_name: Optional[str] = None, + virtual_machine_id: Optional[str] = None, + protection_status: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionState"]] = None, + health_status: Optional[Union[str, "HealthStatus"]] = None, + health_details: Optional[List["AzureIaaSVMHealthDetails"]] = None, + kpis_healths: Optional[Dict[str, "KPIResourceHealthDetails"]] = None, + last_backup_status: Optional[str] = None, + last_backup_time: Optional[datetime.datetime] = None, + protected_item_data_id: Optional[str] = None, + extended_info: Optional["AzureIaaSVMProtectedItemExtendedInfo"] = None, + extended_properties: Optional["ExtendedProperties"] = None, + **kwargs + ): + super(AzureIaaSClassicComputeVMProtectedItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, container_name=container_name, source_resource_id=source_resource_id, policy_id=policy_id, last_recovery_point=last_recovery_point, backup_set_name=backup_set_name, create_mode=create_mode, deferred_delete_time_in_utc=deferred_delete_time_in_utc, is_scheduled_for_deferred_delete=is_scheduled_for_deferred_delete, deferred_delete_time_remaining=deferred_delete_time_remaining, is_deferred_delete_schedule_upcoming=is_deferred_delete_schedule_upcoming, is_rehydrate=is_rehydrate, friendly_name=friendly_name, virtual_machine_id=virtual_machine_id, protection_status=protection_status, protection_state=protection_state, health_status=health_status, health_details=health_details, kpis_healths=kpis_healths, last_backup_status=last_backup_status, last_backup_time=last_backup_time, protected_item_data_id=protected_item_data_id, extended_info=extended_info, extended_properties=extended_properties, **kwargs) + self.protected_item_type = 'Microsoft.ClassicCompute/virtualMachines' # type: str + + +class AzureIaaSComputeVMContainer(IaaSVMContainer): + """IaaS VM workload-specific backup item representing an Azure Resource Manager virtual machine. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param virtual_machine_id: Fully qualified ARM url of the virtual machine represented by this + Azure IaaS VM container. + :type virtual_machine_id: str + :param virtual_machine_version: Specifies whether the container represents a Classic or an + Azure Resource Manager VM. + :type virtual_machine_version: str + :param resource_group: Resource group name of Recovery Services Vault. + :type resource_group: str + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + 'virtual_machine_version': {'key': 'virtualMachineVersion', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + health_status: Optional[str] = None, + virtual_machine_id: Optional[str] = None, + virtual_machine_version: Optional[str] = None, + resource_group: Optional[str] = None, + **kwargs + ): + super(AzureIaaSComputeVMContainer, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, registration_status=registration_status, health_status=health_status, virtual_machine_id=virtual_machine_id, virtual_machine_version=virtual_machine_version, resource_group=resource_group, **kwargs) + self.container_type = 'Microsoft.Compute/virtualMachines' # type: str + + +class AzureIaaSComputeVMProtectableItem(IaaSVMProtectableItem): + """IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param virtual_machine_id: Fully qualified ARM ID of the virtual machine. + :type virtual_machine_id: str + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + virtual_machine_id: Optional[str] = None, + **kwargs + ): + super(AzureIaaSComputeVMProtectableItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, virtual_machine_id=virtual_machine_id, **kwargs) + self.protectable_item_type = 'Microsoft.Compute/virtualMachines' # type: str + + +class AzureIaaSComputeVMProtectedItem(AzureIaaSVMProtectedItem): + """IaaS VM workload-specific backup item representing the Azure Resource Manager VM. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the VM represented by this backup item. + :type friendly_name: str + :param virtual_machine_id: Fully qualified ARM ID of the virtual machine represented by this + item. + :type virtual_machine_id: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param health_status: Health status of protected item. Possible values include: "Passed", + "ActionRequired", "ActionSuggested", "Invalid". + :type health_status: str or ~azure.mgmt.recoveryservicesbackup.models.HealthStatus + :param health_details: Health details on this backup item. + :type health_details: list[~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMHealthDetails] + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + :param last_backup_status: Last backup operation status. + :type last_backup_status: str + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param protected_item_data_id: Data ID of the protected item. + :type protected_item_data_id: str + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMProtectedItemExtendedInfo + :param extended_properties: Extended Properties for Azure IaasVM Backup. + :type extended_properties: ~azure.mgmt.recoveryservicesbackup.models.ExtendedProperties + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'health_details': {'key': 'healthDetails', 'type': '[AzureIaaSVMHealthDetails]'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'protected_item_data_id': {'key': 'protectedItemDataId', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureIaaSVMProtectedItemExtendedInfo'}, + 'extended_properties': {'key': 'extendedProperties', 'type': 'ExtendedProperties'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "DataSourceType"]] = None, + container_name: Optional[str] = None, + source_resource_id: Optional[str] = None, + policy_id: Optional[str] = None, + last_recovery_point: Optional[datetime.datetime] = None, + backup_set_name: Optional[str] = None, + create_mode: Optional[Union[str, "CreateMode"]] = None, + deferred_delete_time_in_utc: Optional[datetime.datetime] = None, + is_scheduled_for_deferred_delete: Optional[bool] = None, + deferred_delete_time_remaining: Optional[str] = None, + is_deferred_delete_schedule_upcoming: Optional[bool] = None, + is_rehydrate: Optional[bool] = None, + friendly_name: Optional[str] = None, + virtual_machine_id: Optional[str] = None, + protection_status: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionState"]] = None, + health_status: Optional[Union[str, "HealthStatus"]] = None, + health_details: Optional[List["AzureIaaSVMHealthDetails"]] = None, + kpis_healths: Optional[Dict[str, "KPIResourceHealthDetails"]] = None, + last_backup_status: Optional[str] = None, + last_backup_time: Optional[datetime.datetime] = None, + protected_item_data_id: Optional[str] = None, + extended_info: Optional["AzureIaaSVMProtectedItemExtendedInfo"] = None, + extended_properties: Optional["ExtendedProperties"] = None, + **kwargs + ): + super(AzureIaaSComputeVMProtectedItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, container_name=container_name, source_resource_id=source_resource_id, policy_id=policy_id, last_recovery_point=last_recovery_point, backup_set_name=backup_set_name, create_mode=create_mode, deferred_delete_time_in_utc=deferred_delete_time_in_utc, is_scheduled_for_deferred_delete=is_scheduled_for_deferred_delete, deferred_delete_time_remaining=deferred_delete_time_remaining, is_deferred_delete_schedule_upcoming=is_deferred_delete_schedule_upcoming, is_rehydrate=is_rehydrate, friendly_name=friendly_name, virtual_machine_id=virtual_machine_id, protection_status=protection_status, protection_state=protection_state, health_status=health_status, health_details=health_details, kpis_healths=kpis_healths, last_backup_status=last_backup_status, last_backup_time=last_backup_time, protected_item_data_id=protected_item_data_id, extended_info=extended_info, extended_properties=extended_properties, **kwargs) + self.protected_item_type = 'Microsoft.Compute/virtualMachines' # type: str + + +class AzureIaaSVMErrorInfo(msrest.serialization.Model): + """Azure IaaS VM workload-specific error information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_code: Error code. + :vartype error_code: int + :ivar error_title: Title: Typically, the entity that the error pertains to. + :vartype error_title: str + :ivar error_string: Localized error string. + :vartype error_string: str + :ivar recommendations: List of localized recommendations for above error code. + :vartype recommendations: list[str] + """ + + _validation = { + 'error_code': {'readonly': True}, + 'error_title': {'readonly': True}, + 'error_string': {'readonly': True}, + 'recommendations': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'error_title': {'key': 'errorTitle', 'type': 'str'}, + 'error_string': {'key': 'errorString', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSVMErrorInfo, self).__init__(**kwargs) + self.error_code = None + self.error_title = None + self.error_string = None + self.recommendations = None + + +class ResourceHealthDetails(msrest.serialization.Model): + """Health Details for backup items. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Health Code. + :vartype code: int + :ivar title: Health Title. + :vartype title: str + :ivar message: Health Message. + :vartype message: str + :ivar recommendations: Health Recommended Actions. + :vartype recommendations: list[str] + """ + + _validation = { + 'code': {'readonly': True}, + 'title': {'readonly': True}, + 'message': {'readonly': True}, + 'recommendations': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'int'}, + 'title': {'key': 'title', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceHealthDetails, self).__init__(**kwargs) + self.code = None + self.title = None + self.message = None + self.recommendations = None + + +class AzureIaaSVMHealthDetails(ResourceHealthDetails): + """Azure IaaS VM workload-specific Health Details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Health Code. + :vartype code: int + :ivar title: Health Title. + :vartype title: str + :ivar message: Health Message. + :vartype message: str + :ivar recommendations: Health Recommended Actions. + :vartype recommendations: list[str] + """ + + _validation = { + 'code': {'readonly': True}, + 'title': {'readonly': True}, + 'message': {'readonly': True}, + 'recommendations': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'int'}, + 'title': {'key': 'title', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureIaaSVMHealthDetails, self).__init__(**kwargs) + + +class Job(msrest.serialization.Model): + """Defines workload agnostic properties for a job. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureIaaSVMJob, AzureStorageJob, AzureWorkloadJob, DpmJob, MabJob, VaultJob. + + All required parameters must be populated in order to send to Azure. + + :param entity_friendly_name: Friendly name of the entity on which the current job is executing. + :type entity_friendly_name: str + :param backup_management_type: Backup management type to execute the current job. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: The operation name. + :type operation: str + :param status: Job status. + :type status: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param activity_id: ActivityId of job. + :type activity_id: str + :param job_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 job_type: str + """ + + _validation = { + 'job_type': {'required': True}, + } + + _attribute_map = { + 'entity_friendly_name': {'key': 'entityFriendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + } + + _subtype_map = { + 'job_type': {'AzureIaaSVMJob': 'AzureIaaSVMJob', 'AzureStorageJob': 'AzureStorageJob', 'AzureWorkloadJob': 'AzureWorkloadJob', 'DpmJob': 'DpmJob', 'MabJob': 'MabJob', 'VaultJob': 'VaultJob'} + } + + def __init__( + self, + *, + entity_friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + operation: Optional[str] = None, + status: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + activity_id: Optional[str] = None, + **kwargs + ): + super(Job, self).__init__(**kwargs) + self.entity_friendly_name = entity_friendly_name + self.backup_management_type = backup_management_type + self.operation = operation + self.status = status + self.start_time = start_time + self.end_time = end_time + self.activity_id = activity_id + self.job_type = None # type: Optional[str] + + +class AzureIaaSVMJob(Job): + """Azure IaaS VM workload-specific job object. + + All required parameters must be populated in order to send to Azure. + + :param entity_friendly_name: Friendly name of the entity on which the current job is executing. + :type entity_friendly_name: str + :param backup_management_type: Backup management type to execute the current job. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: The operation name. + :type operation: str + :param status: Job status. + :type status: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param activity_id: ActivityId of job. + :type activity_id: str + :param job_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 job_type: str + :param duration: Time elapsed during the execution of this job. + :type duration: ~datetime.timedelta + :param actions_info: Gets or sets the state/actions applicable on this job like cancel/retry. + :type actions_info: list[str or ~azure.mgmt.recoveryservicesbackup.models.JobSupportedAction] + :param error_details: Error details on execution of this job. + :type error_details: list[~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMErrorInfo] + :param virtual_machine_version: Specifies whether the backup item is a Classic or an Azure + Resource Manager VM. + :type virtual_machine_version: str + :param extended_info: Additional information for this job. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMJobExtendedInfo + """ + + _validation = { + 'job_type': {'required': True}, + } + + _attribute_map = { + 'entity_friendly_name': {'key': 'entityFriendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'actions_info': {'key': 'actionsInfo', 'type': '[str]'}, + 'error_details': {'key': 'errorDetails', 'type': '[AzureIaaSVMErrorInfo]'}, + 'virtual_machine_version': {'key': 'virtualMachineVersion', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureIaaSVMJobExtendedInfo'}, + } + + def __init__( + self, + *, + entity_friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + operation: Optional[str] = None, + status: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + activity_id: Optional[str] = None, + duration: Optional[datetime.timedelta] = None, + actions_info: Optional[List[Union[str, "JobSupportedAction"]]] = None, + error_details: Optional[List["AzureIaaSVMErrorInfo"]] = None, + virtual_machine_version: Optional[str] = None, + extended_info: Optional["AzureIaaSVMJobExtendedInfo"] = None, + **kwargs + ): + super(AzureIaaSVMJob, self).__init__(entity_friendly_name=entity_friendly_name, backup_management_type=backup_management_type, operation=operation, status=status, start_time=start_time, end_time=end_time, activity_id=activity_id, **kwargs) + self.job_type = 'AzureIaaSVMJob' # type: str + self.duration = duration + self.actions_info = actions_info + self.error_details = error_details + self.virtual_machine_version = virtual_machine_version + self.extended_info = extended_info + + +class AzureIaaSVMJobExtendedInfo(msrest.serialization.Model): + """Azure IaaS VM workload-specific additional information for job. + + :param tasks_list: List of tasks associated with this job. + :type tasks_list: list[~azure.mgmt.recoveryservicesbackup.models.AzureIaaSVMJobTaskDetails] + :param property_bag: Job properties. + :type property_bag: dict[str, str] + :param internal_property_bag: Job internal properties. + :type internal_property_bag: dict[str, str] + :param progress_percentage: Indicates progress of the job. Null if it has not started or + completed. + :type progress_percentage: float + :param estimated_remaining_duration: Time remaining for execution of this job. + :type estimated_remaining_duration: str + :param dynamic_error_message: Non localized error message on job execution. + :type dynamic_error_message: str + """ + + _attribute_map = { + 'tasks_list': {'key': 'tasksList', 'type': '[AzureIaaSVMJobTaskDetails]'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'internal_property_bag': {'key': 'internalPropertyBag', 'type': '{str}'}, + 'progress_percentage': {'key': 'progressPercentage', 'type': 'float'}, + 'estimated_remaining_duration': {'key': 'estimatedRemainingDuration', 'type': 'str'}, + 'dynamic_error_message': {'key': 'dynamicErrorMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + tasks_list: Optional[List["AzureIaaSVMJobTaskDetails"]] = None, + property_bag: Optional[Dict[str, str]] = None, + internal_property_bag: Optional[Dict[str, str]] = None, + progress_percentage: Optional[float] = None, + estimated_remaining_duration: Optional[str] = None, + dynamic_error_message: Optional[str] = None, + **kwargs + ): + super(AzureIaaSVMJobExtendedInfo, self).__init__(**kwargs) + self.tasks_list = tasks_list + self.property_bag = property_bag + self.internal_property_bag = internal_property_bag + self.progress_percentage = progress_percentage + self.estimated_remaining_duration = estimated_remaining_duration + self.dynamic_error_message = dynamic_error_message + + +class AzureIaaSVMJobTaskDetails(msrest.serialization.Model): + """Azure IaaS VM workload-specific job task details. + + :param task_id: The task display name. + :type task_id: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param instance_id: The instanceId. + :type instance_id: str + :param duration: Time elapsed for task. + :type duration: ~datetime.timedelta + :param status: The status. + :type status: str + :param progress_percentage: Progress of the task. + :type progress_percentage: float + :param task_execution_details: Details about execution of the task. + eg: number of bytes transferred etc. + :type task_execution_details: str + """ + + _attribute_map = { + 'task_id': {'key': 'taskId', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'instance_id': {'key': 'instanceId', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'status': {'key': 'status', 'type': 'str'}, + 'progress_percentage': {'key': 'progressPercentage', 'type': 'float'}, + 'task_execution_details': {'key': 'taskExecutionDetails', 'type': 'str'}, + } + + def __init__( + self, + *, + task_id: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + instance_id: Optional[str] = None, + duration: Optional[datetime.timedelta] = None, + status: Optional[str] = None, + progress_percentage: Optional[float] = None, + task_execution_details: Optional[str] = None, + **kwargs + ): + super(AzureIaaSVMJobTaskDetails, self).__init__(**kwargs) + self.task_id = task_id + self.start_time = start_time + self.end_time = end_time + self.instance_id = instance_id + self.duration = duration + self.status = status + self.progress_percentage = progress_percentage + self.task_execution_details = task_execution_details + + +class AzureIaaSVMProtectedItemExtendedInfo(msrest.serialization.Model): + """Additional information on Azure IaaS VM specific backup item. + + :param oldest_recovery_point: The oldest backup copy available for this backup item. + :type oldest_recovery_point: ~datetime.datetime + :param recovery_point_count: Number of backup copies available for this backup item. + :type recovery_point_count: int + :param policy_inconsistent: Specifies if backup policy associated with the backup item is + inconsistent. + :type policy_inconsistent: bool + """ + + _attribute_map = { + 'oldest_recovery_point': {'key': 'oldestRecoveryPoint', 'type': 'iso-8601'}, + 'recovery_point_count': {'key': 'recoveryPointCount', 'type': 'int'}, + 'policy_inconsistent': {'key': 'policyInconsistent', 'type': 'bool'}, + } + + def __init__( + self, + *, + oldest_recovery_point: Optional[datetime.datetime] = None, + recovery_point_count: Optional[int] = None, + policy_inconsistent: Optional[bool] = None, + **kwargs + ): + super(AzureIaaSVMProtectedItemExtendedInfo, self).__init__(**kwargs) + self.oldest_recovery_point = oldest_recovery_point + self.recovery_point_count = recovery_point_count + self.policy_inconsistent = policy_inconsistent + + +class AzureIaaSVMProtectionPolicy(ProtectionPolicy): + """IaaS VM workload-specific backup policy. + + All required parameters must be populated in order to send to Azure. + + :param protected_items_count: Number of items associated with this policy. + :type protected_items_count: int + :param backup_management_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 backup_management_type: str + :param instant_rp_details: + :type instant_rp_details: ~azure.mgmt.recoveryservicesbackup.models.InstantRPAdditionalDetails + :param schedule_policy: Backup schedule specified as part of backup policy. + :type schedule_policy: ~azure.mgmt.recoveryservicesbackup.models.SchedulePolicy + :param retention_policy: Retention policy with the details on backup copy retention ranges. + :type retention_policy: ~azure.mgmt.recoveryservicesbackup.models.RetentionPolicy + :param instant_rp_retention_range_in_days: Instant RP retention policy range in days. + :type instant_rp_retention_range_in_days: int + :param time_zone: TimeZone optional input as string. For example: TimeZone = "Pacific Standard + Time". + :type time_zone: str + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'instant_rp_details': {'key': 'instantRPDetails', 'type': 'InstantRPAdditionalDetails'}, + 'schedule_policy': {'key': 'schedulePolicy', 'type': 'SchedulePolicy'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + 'instant_rp_retention_range_in_days': {'key': 'instantRpRetentionRangeInDays', 'type': 'int'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + } + + def __init__( + self, + *, + protected_items_count: Optional[int] = None, + instant_rp_details: Optional["InstantRPAdditionalDetails"] = None, + schedule_policy: Optional["SchedulePolicy"] = None, + retention_policy: Optional["RetentionPolicy"] = None, + instant_rp_retention_range_in_days: Optional[int] = None, + time_zone: Optional[str] = None, + **kwargs + ): + super(AzureIaaSVMProtectionPolicy, self).__init__(protected_items_count=protected_items_count, **kwargs) + self.backup_management_type = 'AzureIaasVM' # type: str + self.instant_rp_details = instant_rp_details + self.schedule_policy = schedule_policy + self.retention_policy = retention_policy + self.instant_rp_retention_range_in_days = instant_rp_retention_range_in_days + self.time_zone = time_zone + + +class ProtectionIntent(msrest.serialization.Model): + """Base class for backup ProtectionIntent. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureResourceProtectionIntent, AzureRecoveryServiceVaultProtectionIntent. + + All required parameters must be populated in order to send to Azure. + + :param protection_intent_item_type: Required. backup protectionIntent type.Constant filled by + server. + :type protection_intent_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param item_id: ID of the item which is getting protected, In case of Azure Vm , it is + ProtectedItemId. + :type item_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + """ + + _validation = { + 'protection_intent_item_type': {'required': True}, + } + + _attribute_map = { + 'protection_intent_item_type': {'key': 'protectionIntentItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'item_id': {'key': 'itemId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + } + + _subtype_map = { + 'protection_intent_item_type': {'AzureResourceItem': 'AzureResourceProtectionIntent', 'RecoveryServiceVaultItem': 'AzureRecoveryServiceVaultProtectionIntent'} + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + source_resource_id: Optional[str] = None, + item_id: Optional[str] = None, + policy_id: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + **kwargs + ): + super(ProtectionIntent, self).__init__(**kwargs) + self.protection_intent_item_type = None # type: Optional[str] + self.backup_management_type = backup_management_type + self.source_resource_id = source_resource_id + self.item_id = item_id + self.policy_id = policy_id + self.protection_state = protection_state + + +class AzureRecoveryServiceVaultProtectionIntent(ProtectionIntent): + """Azure Recovery Services Vault specific protection intent item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadAutoProtectionIntent. + + All required parameters must be populated in order to send to Azure. + + :param protection_intent_item_type: Required. backup protectionIntent type.Constant filled by + server. + :type protection_intent_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param item_id: ID of the item which is getting protected, In case of Azure Vm , it is + ProtectedItemId. + :type item_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + """ + + _validation = { + 'protection_intent_item_type': {'required': True}, + } + + _attribute_map = { + 'protection_intent_item_type': {'key': 'protectionIntentItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'item_id': {'key': 'itemId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + } + + _subtype_map = { + 'protection_intent_item_type': {'AzureWorkloadAutoProtectionIntent': 'AzureWorkloadAutoProtectionIntent'} + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + source_resource_id: Optional[str] = None, + item_id: Optional[str] = None, + policy_id: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + **kwargs + ): + super(AzureRecoveryServiceVaultProtectionIntent, self).__init__(backup_management_type=backup_management_type, source_resource_id=source_resource_id, item_id=item_id, policy_id=policy_id, protection_state=protection_state, **kwargs) + self.protection_intent_item_type = 'RecoveryServiceVaultItem' # type: str + + +class AzureResourceProtectionIntent(ProtectionIntent): + """IaaS VM specific backup protection intent item. + + All required parameters must be populated in order to send to Azure. + + :param protection_intent_item_type: Required. backup protectionIntent type.Constant filled by + server. + :type protection_intent_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param item_id: ID of the item which is getting protected, In case of Azure Vm , it is + ProtectedItemId. + :type item_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param friendly_name: Friendly name of the VM represented by this backup item. + :type friendly_name: str + """ + + _validation = { + 'protection_intent_item_type': {'required': True}, + } + + _attribute_map = { + 'protection_intent_item_type': {'key': 'protectionIntentItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'item_id': {'key': 'itemId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + source_resource_id: Optional[str] = None, + item_id: Optional[str] = None, + policy_id: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + friendly_name: Optional[str] = None, + **kwargs + ): + super(AzureResourceProtectionIntent, self).__init__(backup_management_type=backup_management_type, source_resource_id=source_resource_id, item_id=item_id, policy_id=policy_id, protection_state=protection_state, **kwargs) + self.protection_intent_item_type = 'AzureResourceItem' # type: str + self.friendly_name = friendly_name + + +class AzureWorkloadContainer(ProtectionContainer): + """Container for the workloads running inside Azure Compute or Classic Compute. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureSQLAGWorkloadContainerProtectionContainer, AzureVMAppContainerProtectionContainer. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param source_resource_id: ARM ID of the virtual machine represented by this Azure Workload + Container. + :type source_resource_id: str + :param last_updated_time: Time stamp when this container was updated. + :type last_updated_time: ~datetime.datetime + :param extended_info: Additional details of a workload container. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadContainerExtendedInfo + :param workload_type: Workload type for which registration was sent. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param operation_type: Re-Do Operation. Possible values include: "Invalid", "Register", + "Reregister". + :type operation_type: str or ~azure.mgmt.recoveryservicesbackup.models.OperationType + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'last_updated_time': {'key': 'lastUpdatedTime', 'type': 'iso-8601'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadContainerExtendedInfo'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'operation_type': {'key': 'operationType', 'type': 'str'}, + } + + _subtype_map = { + 'container_type': {'SQLAGWorkLoadContainer': 'AzureSQLAGWorkloadContainerProtectionContainer', 'VMAppContainer': 'AzureVMAppContainerProtectionContainer'} + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + health_status: Optional[str] = None, + source_resource_id: Optional[str] = None, + last_updated_time: Optional[datetime.datetime] = None, + extended_info: Optional["AzureWorkloadContainerExtendedInfo"] = None, + workload_type: Optional[Union[str, "WorkloadType"]] = None, + operation_type: Optional[Union[str, "OperationType"]] = None, + **kwargs + ): + super(AzureWorkloadContainer, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, registration_status=registration_status, health_status=health_status, **kwargs) + self.container_type = 'AzureWorkloadContainer' # type: str + self.source_resource_id = source_resource_id + self.last_updated_time = last_updated_time + self.extended_info = extended_info + self.workload_type = workload_type + self.operation_type = operation_type + + +class AzureSQLAGWorkloadContainerProtectionContainer(AzureWorkloadContainer): + """Container for SQL workloads under SQL Availability Group. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param source_resource_id: ARM ID of the virtual machine represented by this Azure Workload + Container. + :type source_resource_id: str + :param last_updated_time: Time stamp when this container was updated. + :type last_updated_time: ~datetime.datetime + :param extended_info: Additional details of a workload container. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadContainerExtendedInfo + :param workload_type: Workload type for which registration was sent. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param operation_type: Re-Do Operation. Possible values include: "Invalid", "Register", + "Reregister". + :type operation_type: str or ~azure.mgmt.recoveryservicesbackup.models.OperationType + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'last_updated_time': {'key': 'lastUpdatedTime', 'type': 'iso-8601'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadContainerExtendedInfo'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'operation_type': {'key': 'operationType', 'type': 'str'}, + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + health_status: Optional[str] = None, + source_resource_id: Optional[str] = None, + last_updated_time: Optional[datetime.datetime] = None, + extended_info: Optional["AzureWorkloadContainerExtendedInfo"] = None, + workload_type: Optional[Union[str, "WorkloadType"]] = None, + operation_type: Optional[Union[str, "OperationType"]] = None, + **kwargs + ): + super(AzureSQLAGWorkloadContainerProtectionContainer, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, registration_status=registration_status, health_status=health_status, source_resource_id=source_resource_id, last_updated_time=last_updated_time, extended_info=extended_info, workload_type=workload_type, operation_type=operation_type, **kwargs) + self.container_type = 'SQLAGWorkLoadContainer' # type: str + + +class AzureSqlContainer(ProtectionContainer): + """Azure Sql workload-specific container. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + health_status: Optional[str] = None, + **kwargs + ): + super(AzureSqlContainer, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, registration_status=registration_status, health_status=health_status, **kwargs) + self.container_type = 'AzureSqlContainer' # type: str + + +class AzureSqlProtectedItem(ProtectedItem): + """Azure SQL workload-specific backup item. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param protected_item_data_id: Internal ID of a backup item. Used by Azure SQL Backup engine to + contact Recovery Services. + :type protected_item_data_id: str + :param protection_state: Backup state of the backed up item. Possible values include: + "Invalid", "IRPending", "Protected", "ProtectionError", "ProtectionStopped", + "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemState + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureSqlProtectedItemExtendedInfo + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'protected_item_data_id': {'key': 'protectedItemDataId', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureSqlProtectedItemExtendedInfo'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "DataSourceType"]] = None, + container_name: Optional[str] = None, + source_resource_id: Optional[str] = None, + policy_id: Optional[str] = None, + last_recovery_point: Optional[datetime.datetime] = None, + backup_set_name: Optional[str] = None, + create_mode: Optional[Union[str, "CreateMode"]] = None, + deferred_delete_time_in_utc: Optional[datetime.datetime] = None, + is_scheduled_for_deferred_delete: Optional[bool] = None, + deferred_delete_time_remaining: Optional[str] = None, + is_deferred_delete_schedule_upcoming: Optional[bool] = None, + is_rehydrate: Optional[bool] = None, + protected_item_data_id: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectedItemState"]] = None, + extended_info: Optional["AzureSqlProtectedItemExtendedInfo"] = None, + **kwargs + ): + super(AzureSqlProtectedItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, container_name=container_name, source_resource_id=source_resource_id, policy_id=policy_id, last_recovery_point=last_recovery_point, backup_set_name=backup_set_name, create_mode=create_mode, deferred_delete_time_in_utc=deferred_delete_time_in_utc, is_scheduled_for_deferred_delete=is_scheduled_for_deferred_delete, deferred_delete_time_remaining=deferred_delete_time_remaining, is_deferred_delete_schedule_upcoming=is_deferred_delete_schedule_upcoming, is_rehydrate=is_rehydrate, **kwargs) + self.protected_item_type = 'Microsoft.Sql/servers/databases' # type: str + self.protected_item_data_id = protected_item_data_id + self.protection_state = protection_state + self.extended_info = extended_info + + +class AzureSqlProtectedItemExtendedInfo(msrest.serialization.Model): + """Additional information on Azure Sql specific protected item. + + :param oldest_recovery_point: The oldest backup copy available for this item in the service. + :type oldest_recovery_point: ~datetime.datetime + :param recovery_point_count: Number of available backup copies associated with this backup + item. + :type recovery_point_count: int + :param policy_state: State of the backup policy associated with this backup item. + :type policy_state: str + """ + + _attribute_map = { + 'oldest_recovery_point': {'key': 'oldestRecoveryPoint', 'type': 'iso-8601'}, + 'recovery_point_count': {'key': 'recoveryPointCount', 'type': 'int'}, + 'policy_state': {'key': 'policyState', 'type': 'str'}, + } + + def __init__( + self, + *, + oldest_recovery_point: Optional[datetime.datetime] = None, + recovery_point_count: Optional[int] = None, + policy_state: Optional[str] = None, + **kwargs + ): + super(AzureSqlProtectedItemExtendedInfo, self).__init__(**kwargs) + self.oldest_recovery_point = oldest_recovery_point + self.recovery_point_count = recovery_point_count + self.policy_state = policy_state + + +class AzureSqlProtectionPolicy(ProtectionPolicy): + """Azure SQL workload-specific backup policy. + + All required parameters must be populated in order to send to Azure. + + :param protected_items_count: Number of items associated with this policy. + :type protected_items_count: int + :param backup_management_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 backup_management_type: str + :param retention_policy: Retention policy details. + :type retention_policy: ~azure.mgmt.recoveryservicesbackup.models.RetentionPolicy + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__( + self, + *, + protected_items_count: Optional[int] = None, + retention_policy: Optional["RetentionPolicy"] = None, + **kwargs + ): + super(AzureSqlProtectionPolicy, self).__init__(protected_items_count=protected_items_count, **kwargs) + self.backup_management_type = 'AzureSql' # type: str + self.retention_policy = retention_policy + + +class AzureStorageContainer(ProtectionContainer): + """Azure Storage Account workload-specific container. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param source_resource_id: Fully qualified ARM url. + :type source_resource_id: str + :param storage_account_version: Storage account version. + :type storage_account_version: str + :param resource_group: Resource group name of Recovery Services Vault. + :type resource_group: str + :param protected_item_count: Number of items backed up in this container. + :type protected_item_count: long + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'storage_account_version': {'key': 'storageAccountVersion', 'type': 'str'}, + 'resource_group': {'key': 'resourceGroup', 'type': 'str'}, + 'protected_item_count': {'key': 'protectedItemCount', 'type': 'long'}, + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + health_status: Optional[str] = None, + source_resource_id: Optional[str] = None, + storage_account_version: Optional[str] = None, + resource_group: Optional[str] = None, + protected_item_count: Optional[int] = None, + **kwargs + ): + super(AzureStorageContainer, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, registration_status=registration_status, health_status=health_status, **kwargs) + self.container_type = 'StorageContainer' # type: str + self.source_resource_id = source_resource_id + self.storage_account_version = storage_account_version + self.resource_group = resource_group + self.protected_item_count = protected_item_count + + +class AzureStorageErrorInfo(msrest.serialization.Model): + """Azure storage specific error information. + + :param error_code: Error code. + :type error_code: int + :param error_string: Localized error string. + :type error_string: str + :param recommendations: List of localized recommendations for above error code. + :type recommendations: list[str] + """ + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'error_string': {'key': 'errorString', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + *, + error_code: Optional[int] = None, + error_string: Optional[str] = None, + recommendations: Optional[List[str]] = None, + **kwargs + ): + super(AzureStorageErrorInfo, self).__init__(**kwargs) + self.error_code = error_code + self.error_string = error_string + self.recommendations = recommendations + + +class AzureStorageJob(Job): + """Azure storage specific job. + + All required parameters must be populated in order to send to Azure. + + :param entity_friendly_name: Friendly name of the entity on which the current job is executing. + :type entity_friendly_name: str + :param backup_management_type: Backup management type to execute the current job. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: The operation name. + :type operation: str + :param status: Job status. + :type status: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param activity_id: ActivityId of job. + :type activity_id: str + :param job_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 job_type: str + :param duration: Time elapsed during the execution of this job. + :type duration: ~datetime.timedelta + :param actions_info: Gets or sets the state/actions applicable on this job like cancel/retry. + :type actions_info: list[str or ~azure.mgmt.recoveryservicesbackup.models.JobSupportedAction] + :param error_details: Error details on execution of this job. + :type error_details: list[~azure.mgmt.recoveryservicesbackup.models.AzureStorageErrorInfo] + :param storage_account_name: Specifies friendly name of the storage account. + :type storage_account_name: str + :param storage_account_version: Specifies whether the Storage account is a Classic or an Azure + Resource Manager Storage account. + :type storage_account_version: str + :param extended_info: Additional information about the job. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.AzureStorageJobExtendedInfo + """ + + _validation = { + 'job_type': {'required': True}, + } + + _attribute_map = { + 'entity_friendly_name': {'key': 'entityFriendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'actions_info': {'key': 'actionsInfo', 'type': '[str]'}, + 'error_details': {'key': 'errorDetails', 'type': '[AzureStorageErrorInfo]'}, + 'storage_account_name': {'key': 'storageAccountName', 'type': 'str'}, + 'storage_account_version': {'key': 'storageAccountVersion', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureStorageJobExtendedInfo'}, + } + + def __init__( + self, + *, + entity_friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + operation: Optional[str] = None, + status: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + activity_id: Optional[str] = None, + duration: Optional[datetime.timedelta] = None, + actions_info: Optional[List[Union[str, "JobSupportedAction"]]] = None, + error_details: Optional[List["AzureStorageErrorInfo"]] = None, + storage_account_name: Optional[str] = None, + storage_account_version: Optional[str] = None, + extended_info: Optional["AzureStorageJobExtendedInfo"] = None, + **kwargs + ): + super(AzureStorageJob, self).__init__(entity_friendly_name=entity_friendly_name, backup_management_type=backup_management_type, operation=operation, status=status, start_time=start_time, end_time=end_time, activity_id=activity_id, **kwargs) + self.job_type = 'AzureStorageJob' # type: str + self.duration = duration + self.actions_info = actions_info + self.error_details = error_details + self.storage_account_name = storage_account_name + self.storage_account_version = storage_account_version + self.extended_info = extended_info + + +class AzureStorageJobExtendedInfo(msrest.serialization.Model): + """Azure Storage workload-specific additional information for job. + + :param tasks_list: List of tasks for this job. + :type tasks_list: list[~azure.mgmt.recoveryservicesbackup.models.AzureStorageJobTaskDetails] + :param property_bag: Job properties. + :type property_bag: dict[str, str] + :param dynamic_error_message: Non localized error message on job execution. + :type dynamic_error_message: str + """ + + _attribute_map = { + 'tasks_list': {'key': 'tasksList', 'type': '[AzureStorageJobTaskDetails]'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'dynamic_error_message': {'key': 'dynamicErrorMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + tasks_list: Optional[List["AzureStorageJobTaskDetails"]] = None, + property_bag: Optional[Dict[str, str]] = None, + dynamic_error_message: Optional[str] = None, + **kwargs + ): + super(AzureStorageJobExtendedInfo, self).__init__(**kwargs) + self.tasks_list = tasks_list + self.property_bag = property_bag + self.dynamic_error_message = dynamic_error_message + + +class AzureStorageJobTaskDetails(msrest.serialization.Model): + """Azure storage workload specific job task details. + + :param task_id: The task display name. + :type task_id: str + :param status: The status. + :type status: str + """ + + _attribute_map = { + 'task_id': {'key': 'taskId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + task_id: Optional[str] = None, + status: Optional[str] = None, + **kwargs + ): + super(AzureStorageJobTaskDetails, self).__init__(**kwargs) + self.task_id = task_id + self.status = status + + +class ProtectableContainer(msrest.serialization.Model): + """Protectable Container Class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureStorageProtectableContainer, AzureVMAppContainerProtectableContainer. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param protectable_container_type: Required. Type of the container. The value of this property + for + + + #. Compute Azure VM is Microsoft.Compute/virtualMachines + #. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines.Constant filled by + server. Possible values include: "Invalid", "Unknown", "IaasVMContainer", + "IaasVMServiceContainer", "DPMContainer", "AzureBackupServerContainer", "MABContainer", + "Cluster", "AzureSqlContainer", "Windows", "VCenter", "VMAppContainer", + "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type protectable_container_type: str or + ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param health_status: Status of health of the container. + :type health_status: str + :param container_id: Fabric Id of the container such as ARM Id. + :type container_id: str + """ + + _validation = { + 'protectable_container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'protectable_container_type': {'key': 'protectableContainerType', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_id': {'key': 'containerId', 'type': 'str'}, + } + + _subtype_map = { + 'protectable_container_type': {'StorageContainer': 'AzureStorageProtectableContainer', 'VMAppContainer': 'AzureVMAppContainerProtectableContainer'} + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + health_status: Optional[str] = None, + container_id: Optional[str] = None, + **kwargs + ): + super(ProtectableContainer, self).__init__(**kwargs) + self.friendly_name = friendly_name + self.backup_management_type = backup_management_type + self.protectable_container_type = None # type: Optional[str] + self.health_status = health_status + self.container_id = container_id + + +class AzureStorageProtectableContainer(ProtectableContainer): + """Azure Storage-specific protectable containers. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param protectable_container_type: Required. Type of the container. The value of this property + for + + + #. Compute Azure VM is Microsoft.Compute/virtualMachines + #. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines.Constant filled by + server. Possible values include: "Invalid", "Unknown", "IaasVMContainer", + "IaasVMServiceContainer", "DPMContainer", "AzureBackupServerContainer", "MABContainer", + "Cluster", "AzureSqlContainer", "Windows", "VCenter", "VMAppContainer", + "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type protectable_container_type: str or + ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param health_status: Status of health of the container. + :type health_status: str + :param container_id: Fabric Id of the container such as ARM Id. + :type container_id: str + """ + + _validation = { + 'protectable_container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'protectable_container_type': {'key': 'protectableContainerType', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_id': {'key': 'containerId', 'type': 'str'}, + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + health_status: Optional[str] = None, + container_id: Optional[str] = None, + **kwargs + ): + super(AzureStorageProtectableContainer, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, health_status=health_status, container_id=container_id, **kwargs) + self.protectable_container_type = 'StorageContainer' # type: str + + +class AzureVMAppContainerProtectableContainer(ProtectableContainer): + """Azure workload-specific container. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param protectable_container_type: Required. Type of the container. The value of this property + for + + + #. Compute Azure VM is Microsoft.Compute/virtualMachines + #. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines.Constant filled by + server. Possible values include: "Invalid", "Unknown", "IaasVMContainer", + "IaasVMServiceContainer", "DPMContainer", "AzureBackupServerContainer", "MABContainer", + "Cluster", "AzureSqlContainer", "Windows", "VCenter", "VMAppContainer", + "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type protectable_container_type: str or + ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param health_status: Status of health of the container. + :type health_status: str + :param container_id: Fabric Id of the container such as ARM Id. + :type container_id: str + """ + + _validation = { + 'protectable_container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'protectable_container_type': {'key': 'protectableContainerType', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_id': {'key': 'containerId', 'type': 'str'}, + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + health_status: Optional[str] = None, + container_id: Optional[str] = None, + **kwargs + ): + super(AzureVMAppContainerProtectableContainer, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, health_status=health_status, container_id=container_id, **kwargs) + self.protectable_container_type = 'VMAppContainer' # type: str + + +class AzureVMAppContainerProtectionContainer(AzureWorkloadContainer): + """Container for SQL workloads under Azure Virtual Machines. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param source_resource_id: ARM ID of the virtual machine represented by this Azure Workload + Container. + :type source_resource_id: str + :param last_updated_time: Time stamp when this container was updated. + :type last_updated_time: ~datetime.datetime + :param extended_info: Additional details of a workload container. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadContainerExtendedInfo + :param workload_type: Workload type for which registration was sent. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param operation_type: Re-Do Operation. Possible values include: "Invalid", "Register", + "Reregister". + :type operation_type: str or ~azure.mgmt.recoveryservicesbackup.models.OperationType + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'last_updated_time': {'key': 'lastUpdatedTime', 'type': 'iso-8601'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadContainerExtendedInfo'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'operation_type': {'key': 'operationType', 'type': 'str'}, + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + health_status: Optional[str] = None, + source_resource_id: Optional[str] = None, + last_updated_time: Optional[datetime.datetime] = None, + extended_info: Optional["AzureWorkloadContainerExtendedInfo"] = None, + workload_type: Optional[Union[str, "WorkloadType"]] = None, + operation_type: Optional[Union[str, "OperationType"]] = None, + **kwargs + ): + super(AzureVMAppContainerProtectionContainer, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, registration_status=registration_status, health_status=health_status, source_resource_id=source_resource_id, last_updated_time=last_updated_time, extended_info=extended_info, workload_type=workload_type, operation_type=operation_type, **kwargs) + self.container_type = 'VMAppContainer' # type: str + + +class AzureVMResourceFeatureSupportRequest(FeatureSupportRequest): + """AzureResource(IaaS VM) Specific feature support request. + + All required parameters must be populated in order to send to Azure. + + :param feature_type: Required. backup support feature type.Constant filled by server. + :type feature_type: str + :param vm_size: Size of the resource: VM size(A/D series etc) in case of IaasVM. + :type vm_size: str + :param vm_sku: SKUs (Premium/Managed etc) in case of IaasVM. + :type vm_sku: str + """ + + _validation = { + 'feature_type': {'required': True}, + } + + _attribute_map = { + 'feature_type': {'key': 'featureType', 'type': 'str'}, + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'vm_sku': {'key': 'vmSku', 'type': 'str'}, + } + + def __init__( + self, + *, + vm_size: Optional[str] = None, + vm_sku: Optional[str] = None, + **kwargs + ): + super(AzureVMResourceFeatureSupportRequest, self).__init__(**kwargs) + self.feature_type = 'AzureVMResourceBackup' # type: str + self.vm_size = vm_size + self.vm_sku = vm_sku + + +class AzureVMResourceFeatureSupportResponse(msrest.serialization.Model): + """Response for feature support requests for Azure IaasVm. + + :param support_status: Support status of feature. Possible values include: "Invalid", + "Supported", "DefaultOFF", "DefaultON", "NotSupported". + :type support_status: str or ~azure.mgmt.recoveryservicesbackup.models.SupportStatus + """ + + _attribute_map = { + 'support_status': {'key': 'supportStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + support_status: Optional[Union[str, "SupportStatus"]] = None, + **kwargs + ): + super(AzureVMResourceFeatureSupportResponse, self).__init__(**kwargs) + self.support_status = support_status + + +class WorkloadItem(msrest.serialization.Model): + """Base class for backup item. Workload-specific backup items are derived from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureVmWorkloadItem. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + } + + _subtype_map = { + 'workload_item_type': {'AzureVmWorkloadItem': 'AzureVmWorkloadItem'} + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + **kwargs + ): + super(WorkloadItem, self).__init__(**kwargs) + self.backup_management_type = backup_management_type + self.workload_type = workload_type + self.workload_item_type = None # type: Optional[str] + self.friendly_name = friendly_name + self.protection_state = protection_state + + +class AzureVmWorkloadItem(WorkloadItem): + """Azure VM workload-specific workload item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureVmWorkloadSAPAseDatabaseWorkloadItem, AzureVmWorkloadSAPAseSystemWorkloadItem, AzureVmWorkloadSAPHanaDatabaseWorkloadItem, AzureVmWorkloadSAPHanaSystemWorkloadItem, AzureVmWorkloadSQLDatabaseWorkloadItem, AzureVmWorkloadSQLInstanceWorkloadItem. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if workload item is auto-protectable. + :type is_auto_protectable: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param sub_workload_item_count: For instance or AG, indicates number of DB's to be protected. + :type sub_workload_item_count: int + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'sub_workload_item_count': {'key': 'subWorkloadItemCount', 'type': 'int'}, + } + + _subtype_map = { + 'workload_item_type': {'SAPAseDatabase': 'AzureVmWorkloadSAPAseDatabaseWorkloadItem', 'SAPAseSystem': 'AzureVmWorkloadSAPAseSystemWorkloadItem', 'SAPHanaDatabase': 'AzureVmWorkloadSAPHanaDatabaseWorkloadItem', 'SAPHanaSystem': 'AzureVmWorkloadSAPHanaSystemWorkloadItem', 'SQLDataBase': 'AzureVmWorkloadSQLDatabaseWorkloadItem', 'SQLInstance': 'AzureVmWorkloadSQLInstanceWorkloadItem'} + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_name: Optional[str] = None, + server_name: Optional[str] = None, + is_auto_protectable: Optional[bool] = None, + subinquireditemcount: Optional[int] = None, + sub_workload_item_count: Optional[int] = None, + **kwargs + ): + super(AzureVmWorkloadItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, **kwargs) + self.workload_item_type = 'AzureVmWorkloadItem' # type: str + self.parent_name = parent_name + self.server_name = server_name + self.is_auto_protectable = is_auto_protectable + self.subinquireditemcount = subinquireditemcount + self.sub_workload_item_count = sub_workload_item_count + + +class AzureVmWorkloadProtectableItem(WorkloadProtectableItem): + """Azure VM workload-specific protectable item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureVmWorkloadSAPAseSystemProtectableItem, AzureVmWorkloadSAPHanaDatabaseProtectableItem, AzureVmWorkloadSAPHanaSystemProtectableItem, AzureVmWorkloadSQLAvailabilityGroupProtectableItem, AzureVmWorkloadSQLDatabaseProtectableItem, AzureVmWorkloadSQLInstanceProtectableItem. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param parent_unique_name: Parent Unique Name is added to provide the service formatted URI + Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + :type parent_unique_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if protectable item is auto-protectable. + :type is_auto_protectable: bool + :param is_auto_protected: Indicates if protectable item is auto-protected. + :type is_auto_protected: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param subprotectableitemcount: For instance or AG, indicates number of DB's to be protected. + :type subprotectableitemcount: int + :param prebackupvalidation: Pre-backup validation for protectable objects. + :type prebackupvalidation: ~azure.mgmt.recoveryservicesbackup.models.PreBackupValidation + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_unique_name': {'key': 'parentUniqueName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'is_auto_protected': {'key': 'isAutoProtected', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'subprotectableitemcount': {'key': 'subprotectableitemcount', 'type': 'int'}, + 'prebackupvalidation': {'key': 'prebackupvalidation', 'type': 'PreBackupValidation'}, + } + + _subtype_map = { + 'protectable_item_type': {'SAPAseSystem': 'AzureVmWorkloadSAPAseSystemProtectableItem', 'SAPHanaDatabase': 'AzureVmWorkloadSAPHanaDatabaseProtectableItem', 'SAPHanaSystem': 'AzureVmWorkloadSAPHanaSystemProtectableItem', 'SQLAvailabilityGroupContainer': 'AzureVmWorkloadSQLAvailabilityGroupProtectableItem', 'SQLDataBase': 'AzureVmWorkloadSQLDatabaseProtectableItem', 'SQLInstance': 'AzureVmWorkloadSQLInstanceProtectableItem'} + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_name: Optional[str] = None, + parent_unique_name: Optional[str] = None, + server_name: Optional[str] = None, + is_auto_protectable: Optional[bool] = None, + is_auto_protected: Optional[bool] = None, + subinquireditemcount: Optional[int] = None, + subprotectableitemcount: Optional[int] = None, + prebackupvalidation: Optional["PreBackupValidation"] = None, + **kwargs + ): + super(AzureVmWorkloadProtectableItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, **kwargs) + self.protectable_item_type = 'AzureVmWorkloadProtectableItem' # type: str + self.parent_name = parent_name + self.parent_unique_name = parent_unique_name + self.server_name = server_name + self.is_auto_protectable = is_auto_protectable + self.is_auto_protected = is_auto_protected + self.subinquireditemcount = subinquireditemcount + self.subprotectableitemcount = subprotectableitemcount + self.prebackupvalidation = prebackupvalidation + + +class AzureVmWorkloadProtectedItem(ProtectedItem): + """Azure VM workload-specific protected item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureVmWorkloadSAPAseDatabaseProtectedItem, AzureVmWorkloadSAPHanaDatabaseProtectedItem, AzureVmWorkloadSQLDatabaseProtectedItem. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the DB represented by this backup item. + :type friendly_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param parent_name: Parent name of the DB such as Instance or Availability Group. + :type parent_name: str + :param parent_type: Parent type of protected item, example: for a DB, standalone server or + distributed. + :type parent_type: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param last_backup_status: Last backup operation status. Possible values: Healthy, Unhealthy. + Possible values include: "Invalid", "Healthy", "Unhealthy", "IRPending". + :type last_backup_status: str or ~azure.mgmt.recoveryservicesbackup.models.LastBackupStatus + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param last_backup_error_detail: Error details in last backup. + :type last_backup_error_detail: ~azure.mgmt.recoveryservicesbackup.models.ErrorDetail + :param protected_item_data_source_id: Data ID of the protected item. + :type protected_item_data_source_id: str + :param protected_item_health_status: Health status of the backup item, evaluated based on last + heartbeat received. Possible values include: "Invalid", "Healthy", "Unhealthy", "NotReachable", + "IRPending". + :type protected_item_health_status: str or + ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemHealthStatus + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureVmWorkloadProtectedItemExtendedInfo + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_type': {'key': 'parentType', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'last_backup_error_detail': {'key': 'lastBackupErrorDetail', 'type': 'ErrorDetail'}, + 'protected_item_data_source_id': {'key': 'protectedItemDataSourceId', 'type': 'str'}, + 'protected_item_health_status': {'key': 'protectedItemHealthStatus', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureVmWorkloadProtectedItemExtendedInfo'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + } + + _subtype_map = { + 'protected_item_type': {'AzureVmWorkloadSAPAseDatabase': 'AzureVmWorkloadSAPAseDatabaseProtectedItem', 'AzureVmWorkloadSAPHanaDatabase': 'AzureVmWorkloadSAPHanaDatabaseProtectedItem', 'AzureVmWorkloadSQLDatabase': 'AzureVmWorkloadSQLDatabaseProtectedItem'} + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "DataSourceType"]] = None, + container_name: Optional[str] = None, + source_resource_id: Optional[str] = None, + policy_id: Optional[str] = None, + last_recovery_point: Optional[datetime.datetime] = None, + backup_set_name: Optional[str] = None, + create_mode: Optional[Union[str, "CreateMode"]] = None, + deferred_delete_time_in_utc: Optional[datetime.datetime] = None, + is_scheduled_for_deferred_delete: Optional[bool] = None, + deferred_delete_time_remaining: Optional[str] = None, + is_deferred_delete_schedule_upcoming: Optional[bool] = None, + is_rehydrate: Optional[bool] = None, + friendly_name: Optional[str] = None, + server_name: Optional[str] = None, + parent_name: Optional[str] = None, + parent_type: Optional[str] = None, + protection_status: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionState"]] = None, + last_backup_status: Optional[Union[str, "LastBackupStatus"]] = None, + last_backup_time: Optional[datetime.datetime] = None, + last_backup_error_detail: Optional["ErrorDetail"] = None, + protected_item_data_source_id: Optional[str] = None, + protected_item_health_status: Optional[Union[str, "ProtectedItemHealthStatus"]] = None, + extended_info: Optional["AzureVmWorkloadProtectedItemExtendedInfo"] = None, + kpis_healths: Optional[Dict[str, "KPIResourceHealthDetails"]] = None, + **kwargs + ): + super(AzureVmWorkloadProtectedItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, container_name=container_name, source_resource_id=source_resource_id, policy_id=policy_id, last_recovery_point=last_recovery_point, backup_set_name=backup_set_name, create_mode=create_mode, deferred_delete_time_in_utc=deferred_delete_time_in_utc, is_scheduled_for_deferred_delete=is_scheduled_for_deferred_delete, deferred_delete_time_remaining=deferred_delete_time_remaining, is_deferred_delete_schedule_upcoming=is_deferred_delete_schedule_upcoming, is_rehydrate=is_rehydrate, **kwargs) + self.protected_item_type = 'AzureVmWorkloadProtectedItem' # type: str + self.friendly_name = friendly_name + self.server_name = server_name + self.parent_name = parent_name + self.parent_type = parent_type + self.protection_status = protection_status + self.protection_state = protection_state + self.last_backup_status = last_backup_status + self.last_backup_time = last_backup_time + self.last_backup_error_detail = last_backup_error_detail + self.protected_item_data_source_id = protected_item_data_source_id + self.protected_item_health_status = protected_item_health_status + self.extended_info = extended_info + self.kpis_healths = kpis_healths + + +class AzureVmWorkloadProtectedItemExtendedInfo(msrest.serialization.Model): + """Additional information on Azure Workload for SQL specific backup item. + + :param oldest_recovery_point: The oldest backup copy available for this backup item. + :type oldest_recovery_point: ~datetime.datetime + :param recovery_point_count: Number of backup copies available for this backup item. + :type recovery_point_count: int + :param policy_state: Indicates consistency of policy object and policy applied to this backup + item. + :type policy_state: str + """ + + _attribute_map = { + 'oldest_recovery_point': {'key': 'oldestRecoveryPoint', 'type': 'iso-8601'}, + 'recovery_point_count': {'key': 'recoveryPointCount', 'type': 'int'}, + 'policy_state': {'key': 'policyState', 'type': 'str'}, + } + + def __init__( + self, + *, + oldest_recovery_point: Optional[datetime.datetime] = None, + recovery_point_count: Optional[int] = None, + policy_state: Optional[str] = None, + **kwargs + ): + super(AzureVmWorkloadProtectedItemExtendedInfo, self).__init__(**kwargs) + self.oldest_recovery_point = oldest_recovery_point + self.recovery_point_count = recovery_point_count + self.policy_state = policy_state + + +class AzureVmWorkloadProtectionPolicy(ProtectionPolicy): + """Azure VM (Mercury) workload-specific backup policy. + + All required parameters must be populated in order to send to Azure. + + :param protected_items_count: Number of items associated with this policy. + :type protected_items_count: int + :param backup_management_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 backup_management_type: str + :param work_load_type: Type of workload for the backup management. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type work_load_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param settings: Common settings for the backup management. + :type settings: ~azure.mgmt.recoveryservicesbackup.models.Settings + :param sub_protection_policy: List of sub-protection policies which includes schedule and + retention. + :type sub_protection_policy: + list[~azure.mgmt.recoveryservicesbackup.models.SubProtectionPolicy] + :param make_policy_consistent: Fix the policy inconsistency. + :type make_policy_consistent: bool + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'work_load_type': {'key': 'workLoadType', 'type': 'str'}, + 'settings': {'key': 'settings', 'type': 'Settings'}, + 'sub_protection_policy': {'key': 'subProtectionPolicy', 'type': '[SubProtectionPolicy]'}, + 'make_policy_consistent': {'key': 'makePolicyConsistent', 'type': 'bool'}, + } + + def __init__( + self, + *, + protected_items_count: Optional[int] = None, + work_load_type: Optional[Union[str, "WorkloadType"]] = None, + settings: Optional["Settings"] = None, + sub_protection_policy: Optional[List["SubProtectionPolicy"]] = None, + make_policy_consistent: Optional[bool] = None, + **kwargs + ): + super(AzureVmWorkloadProtectionPolicy, self).__init__(protected_items_count=protected_items_count, **kwargs) + self.backup_management_type = 'AzureWorkload' # type: str + self.work_load_type = work_load_type + self.settings = settings + self.sub_protection_policy = sub_protection_policy + self.make_policy_consistent = make_policy_consistent + + +class AzureVmWorkloadSAPAseDatabaseProtectedItem(AzureVmWorkloadProtectedItem): + """Azure VM workload-specific protected item representing SAP ASE Database. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the DB represented by this backup item. + :type friendly_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param parent_name: Parent name of the DB such as Instance or Availability Group. + :type parent_name: str + :param parent_type: Parent type of protected item, example: for a DB, standalone server or + distributed. + :type parent_type: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param last_backup_status: Last backup operation status. Possible values: Healthy, Unhealthy. + Possible values include: "Invalid", "Healthy", "Unhealthy", "IRPending". + :type last_backup_status: str or ~azure.mgmt.recoveryservicesbackup.models.LastBackupStatus + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param last_backup_error_detail: Error details in last backup. + :type last_backup_error_detail: ~azure.mgmt.recoveryservicesbackup.models.ErrorDetail + :param protected_item_data_source_id: Data ID of the protected item. + :type protected_item_data_source_id: str + :param protected_item_health_status: Health status of the backup item, evaluated based on last + heartbeat received. Possible values include: "Invalid", "Healthy", "Unhealthy", "NotReachable", + "IRPending". + :type protected_item_health_status: str or + ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemHealthStatus + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureVmWorkloadProtectedItemExtendedInfo + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_type': {'key': 'parentType', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'last_backup_error_detail': {'key': 'lastBackupErrorDetail', 'type': 'ErrorDetail'}, + 'protected_item_data_source_id': {'key': 'protectedItemDataSourceId', 'type': 'str'}, + 'protected_item_health_status': {'key': 'protectedItemHealthStatus', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureVmWorkloadProtectedItemExtendedInfo'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "DataSourceType"]] = None, + container_name: Optional[str] = None, + source_resource_id: Optional[str] = None, + policy_id: Optional[str] = None, + last_recovery_point: Optional[datetime.datetime] = None, + backup_set_name: Optional[str] = None, + create_mode: Optional[Union[str, "CreateMode"]] = None, + deferred_delete_time_in_utc: Optional[datetime.datetime] = None, + is_scheduled_for_deferred_delete: Optional[bool] = None, + deferred_delete_time_remaining: Optional[str] = None, + is_deferred_delete_schedule_upcoming: Optional[bool] = None, + is_rehydrate: Optional[bool] = None, + friendly_name: Optional[str] = None, + server_name: Optional[str] = None, + parent_name: Optional[str] = None, + parent_type: Optional[str] = None, + protection_status: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionState"]] = None, + last_backup_status: Optional[Union[str, "LastBackupStatus"]] = None, + last_backup_time: Optional[datetime.datetime] = None, + last_backup_error_detail: Optional["ErrorDetail"] = None, + protected_item_data_source_id: Optional[str] = None, + protected_item_health_status: Optional[Union[str, "ProtectedItemHealthStatus"]] = None, + extended_info: Optional["AzureVmWorkloadProtectedItemExtendedInfo"] = None, + kpis_healths: Optional[Dict[str, "KPIResourceHealthDetails"]] = None, + **kwargs + ): + super(AzureVmWorkloadSAPAseDatabaseProtectedItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, container_name=container_name, source_resource_id=source_resource_id, policy_id=policy_id, last_recovery_point=last_recovery_point, backup_set_name=backup_set_name, create_mode=create_mode, deferred_delete_time_in_utc=deferred_delete_time_in_utc, is_scheduled_for_deferred_delete=is_scheduled_for_deferred_delete, deferred_delete_time_remaining=deferred_delete_time_remaining, is_deferred_delete_schedule_upcoming=is_deferred_delete_schedule_upcoming, is_rehydrate=is_rehydrate, friendly_name=friendly_name, server_name=server_name, parent_name=parent_name, parent_type=parent_type, protection_status=protection_status, protection_state=protection_state, last_backup_status=last_backup_status, last_backup_time=last_backup_time, last_backup_error_detail=last_backup_error_detail, protected_item_data_source_id=protected_item_data_source_id, protected_item_health_status=protected_item_health_status, extended_info=extended_info, kpis_healths=kpis_healths, **kwargs) + self.protected_item_type = 'AzureVmWorkloadSAPAseDatabase' # type: str + + +class AzureVmWorkloadSAPAseDatabaseWorkloadItem(AzureVmWorkloadItem): + """Azure VM workload-specific workload item representing SAP ASE Database. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if workload item is auto-protectable. + :type is_auto_protectable: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param sub_workload_item_count: For instance or AG, indicates number of DB's to be protected. + :type sub_workload_item_count: int + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'sub_workload_item_count': {'key': 'subWorkloadItemCount', 'type': 'int'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_name: Optional[str] = None, + server_name: Optional[str] = None, + is_auto_protectable: Optional[bool] = None, + subinquireditemcount: Optional[int] = None, + sub_workload_item_count: Optional[int] = None, + **kwargs + ): + super(AzureVmWorkloadSAPAseDatabaseWorkloadItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, parent_name=parent_name, server_name=server_name, is_auto_protectable=is_auto_protectable, subinquireditemcount=subinquireditemcount, sub_workload_item_count=sub_workload_item_count, **kwargs) + self.workload_item_type = 'SAPAseDatabase' # type: str + + +class AzureVmWorkloadSAPAseSystemProtectableItem(AzureVmWorkloadProtectableItem): + """Azure VM workload-specific protectable item representing SAP ASE System. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param parent_unique_name: Parent Unique Name is added to provide the service formatted URI + Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + :type parent_unique_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if protectable item is auto-protectable. + :type is_auto_protectable: bool + :param is_auto_protected: Indicates if protectable item is auto-protected. + :type is_auto_protected: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param subprotectableitemcount: For instance or AG, indicates number of DB's to be protected. + :type subprotectableitemcount: int + :param prebackupvalidation: Pre-backup validation for protectable objects. + :type prebackupvalidation: ~azure.mgmt.recoveryservicesbackup.models.PreBackupValidation + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_unique_name': {'key': 'parentUniqueName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'is_auto_protected': {'key': 'isAutoProtected', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'subprotectableitemcount': {'key': 'subprotectableitemcount', 'type': 'int'}, + 'prebackupvalidation': {'key': 'prebackupvalidation', 'type': 'PreBackupValidation'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_name: Optional[str] = None, + parent_unique_name: Optional[str] = None, + server_name: Optional[str] = None, + is_auto_protectable: Optional[bool] = None, + is_auto_protected: Optional[bool] = None, + subinquireditemcount: Optional[int] = None, + subprotectableitemcount: Optional[int] = None, + prebackupvalidation: Optional["PreBackupValidation"] = None, + **kwargs + ): + super(AzureVmWorkloadSAPAseSystemProtectableItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, parent_name=parent_name, parent_unique_name=parent_unique_name, server_name=server_name, is_auto_protectable=is_auto_protectable, is_auto_protected=is_auto_protected, subinquireditemcount=subinquireditemcount, subprotectableitemcount=subprotectableitemcount, prebackupvalidation=prebackupvalidation, **kwargs) + self.protectable_item_type = 'SAPAseSystem' # type: str + + +class AzureVmWorkloadSAPAseSystemWorkloadItem(AzureVmWorkloadItem): + """Azure VM workload-specific workload item representing SAP ASE System. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if workload item is auto-protectable. + :type is_auto_protectable: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param sub_workload_item_count: For instance or AG, indicates number of DB's to be protected. + :type sub_workload_item_count: int + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'sub_workload_item_count': {'key': 'subWorkloadItemCount', 'type': 'int'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_name: Optional[str] = None, + server_name: Optional[str] = None, + is_auto_protectable: Optional[bool] = None, + subinquireditemcount: Optional[int] = None, + sub_workload_item_count: Optional[int] = None, + **kwargs + ): + super(AzureVmWorkloadSAPAseSystemWorkloadItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, parent_name=parent_name, server_name=server_name, is_auto_protectable=is_auto_protectable, subinquireditemcount=subinquireditemcount, sub_workload_item_count=sub_workload_item_count, **kwargs) + self.workload_item_type = 'SAPAseSystem' # type: str + + +class AzureVmWorkloadSAPHanaDatabaseProtectableItem(AzureVmWorkloadProtectableItem): + """Azure VM workload-specific protectable item representing SAP HANA Database. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param parent_unique_name: Parent Unique Name is added to provide the service formatted URI + Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + :type parent_unique_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if protectable item is auto-protectable. + :type is_auto_protectable: bool + :param is_auto_protected: Indicates if protectable item is auto-protected. + :type is_auto_protected: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param subprotectableitemcount: For instance or AG, indicates number of DB's to be protected. + :type subprotectableitemcount: int + :param prebackupvalidation: Pre-backup validation for protectable objects. + :type prebackupvalidation: ~azure.mgmt.recoveryservicesbackup.models.PreBackupValidation + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_unique_name': {'key': 'parentUniqueName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'is_auto_protected': {'key': 'isAutoProtected', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'subprotectableitemcount': {'key': 'subprotectableitemcount', 'type': 'int'}, + 'prebackupvalidation': {'key': 'prebackupvalidation', 'type': 'PreBackupValidation'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_name: Optional[str] = None, + parent_unique_name: Optional[str] = None, + server_name: Optional[str] = None, + is_auto_protectable: Optional[bool] = None, + is_auto_protected: Optional[bool] = None, + subinquireditemcount: Optional[int] = None, + subprotectableitemcount: Optional[int] = None, + prebackupvalidation: Optional["PreBackupValidation"] = None, + **kwargs + ): + super(AzureVmWorkloadSAPHanaDatabaseProtectableItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, parent_name=parent_name, parent_unique_name=parent_unique_name, server_name=server_name, is_auto_protectable=is_auto_protectable, is_auto_protected=is_auto_protected, subinquireditemcount=subinquireditemcount, subprotectableitemcount=subprotectableitemcount, prebackupvalidation=prebackupvalidation, **kwargs) + self.protectable_item_type = 'SAPHanaDatabase' # type: str + + +class AzureVmWorkloadSAPHanaDatabaseProtectedItem(AzureVmWorkloadProtectedItem): + """Azure VM workload-specific protected item representing SAP HANA Database. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the DB represented by this backup item. + :type friendly_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param parent_name: Parent name of the DB such as Instance or Availability Group. + :type parent_name: str + :param parent_type: Parent type of protected item, example: for a DB, standalone server or + distributed. + :type parent_type: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param last_backup_status: Last backup operation status. Possible values: Healthy, Unhealthy. + Possible values include: "Invalid", "Healthy", "Unhealthy", "IRPending". + :type last_backup_status: str or ~azure.mgmt.recoveryservicesbackup.models.LastBackupStatus + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param last_backup_error_detail: Error details in last backup. + :type last_backup_error_detail: ~azure.mgmt.recoveryservicesbackup.models.ErrorDetail + :param protected_item_data_source_id: Data ID of the protected item. + :type protected_item_data_source_id: str + :param protected_item_health_status: Health status of the backup item, evaluated based on last + heartbeat received. Possible values include: "Invalid", "Healthy", "Unhealthy", "NotReachable", + "IRPending". + :type protected_item_health_status: str or + ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemHealthStatus + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureVmWorkloadProtectedItemExtendedInfo + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_type': {'key': 'parentType', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'last_backup_error_detail': {'key': 'lastBackupErrorDetail', 'type': 'ErrorDetail'}, + 'protected_item_data_source_id': {'key': 'protectedItemDataSourceId', 'type': 'str'}, + 'protected_item_health_status': {'key': 'protectedItemHealthStatus', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureVmWorkloadProtectedItemExtendedInfo'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "DataSourceType"]] = None, + container_name: Optional[str] = None, + source_resource_id: Optional[str] = None, + policy_id: Optional[str] = None, + last_recovery_point: Optional[datetime.datetime] = None, + backup_set_name: Optional[str] = None, + create_mode: Optional[Union[str, "CreateMode"]] = None, + deferred_delete_time_in_utc: Optional[datetime.datetime] = None, + is_scheduled_for_deferred_delete: Optional[bool] = None, + deferred_delete_time_remaining: Optional[str] = None, + is_deferred_delete_schedule_upcoming: Optional[bool] = None, + is_rehydrate: Optional[bool] = None, + friendly_name: Optional[str] = None, + server_name: Optional[str] = None, + parent_name: Optional[str] = None, + parent_type: Optional[str] = None, + protection_status: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionState"]] = None, + last_backup_status: Optional[Union[str, "LastBackupStatus"]] = None, + last_backup_time: Optional[datetime.datetime] = None, + last_backup_error_detail: Optional["ErrorDetail"] = None, + protected_item_data_source_id: Optional[str] = None, + protected_item_health_status: Optional[Union[str, "ProtectedItemHealthStatus"]] = None, + extended_info: Optional["AzureVmWorkloadProtectedItemExtendedInfo"] = None, + kpis_healths: Optional[Dict[str, "KPIResourceHealthDetails"]] = None, + **kwargs + ): + super(AzureVmWorkloadSAPHanaDatabaseProtectedItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, container_name=container_name, source_resource_id=source_resource_id, policy_id=policy_id, last_recovery_point=last_recovery_point, backup_set_name=backup_set_name, create_mode=create_mode, deferred_delete_time_in_utc=deferred_delete_time_in_utc, is_scheduled_for_deferred_delete=is_scheduled_for_deferred_delete, deferred_delete_time_remaining=deferred_delete_time_remaining, is_deferred_delete_schedule_upcoming=is_deferred_delete_schedule_upcoming, is_rehydrate=is_rehydrate, friendly_name=friendly_name, server_name=server_name, parent_name=parent_name, parent_type=parent_type, protection_status=protection_status, protection_state=protection_state, last_backup_status=last_backup_status, last_backup_time=last_backup_time, last_backup_error_detail=last_backup_error_detail, protected_item_data_source_id=protected_item_data_source_id, protected_item_health_status=protected_item_health_status, extended_info=extended_info, kpis_healths=kpis_healths, **kwargs) + self.protected_item_type = 'AzureVmWorkloadSAPHanaDatabase' # type: str + + +class AzureVmWorkloadSAPHanaDatabaseWorkloadItem(AzureVmWorkloadItem): + """Azure VM workload-specific workload item representing SAP HANA Database. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if workload item is auto-protectable. + :type is_auto_protectable: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param sub_workload_item_count: For instance or AG, indicates number of DB's to be protected. + :type sub_workload_item_count: int + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'sub_workload_item_count': {'key': 'subWorkloadItemCount', 'type': 'int'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_name: Optional[str] = None, + server_name: Optional[str] = None, + is_auto_protectable: Optional[bool] = None, + subinquireditemcount: Optional[int] = None, + sub_workload_item_count: Optional[int] = None, + **kwargs + ): + super(AzureVmWorkloadSAPHanaDatabaseWorkloadItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, parent_name=parent_name, server_name=server_name, is_auto_protectable=is_auto_protectable, subinquireditemcount=subinquireditemcount, sub_workload_item_count=sub_workload_item_count, **kwargs) + self.workload_item_type = 'SAPHanaDatabase' # type: str + + +class AzureVmWorkloadSAPHanaSystemProtectableItem(AzureVmWorkloadProtectableItem): + """Azure VM workload-specific protectable item representing SAP HANA System. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param parent_unique_name: Parent Unique Name is added to provide the service formatted URI + Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + :type parent_unique_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if protectable item is auto-protectable. + :type is_auto_protectable: bool + :param is_auto_protected: Indicates if protectable item is auto-protected. + :type is_auto_protected: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param subprotectableitemcount: For instance or AG, indicates number of DB's to be protected. + :type subprotectableitemcount: int + :param prebackupvalidation: Pre-backup validation for protectable objects. + :type prebackupvalidation: ~azure.mgmt.recoveryservicesbackup.models.PreBackupValidation + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_unique_name': {'key': 'parentUniqueName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'is_auto_protected': {'key': 'isAutoProtected', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'subprotectableitemcount': {'key': 'subprotectableitemcount', 'type': 'int'}, + 'prebackupvalidation': {'key': 'prebackupvalidation', 'type': 'PreBackupValidation'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_name: Optional[str] = None, + parent_unique_name: Optional[str] = None, + server_name: Optional[str] = None, + is_auto_protectable: Optional[bool] = None, + is_auto_protected: Optional[bool] = None, + subinquireditemcount: Optional[int] = None, + subprotectableitemcount: Optional[int] = None, + prebackupvalidation: Optional["PreBackupValidation"] = None, + **kwargs + ): + super(AzureVmWorkloadSAPHanaSystemProtectableItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, parent_name=parent_name, parent_unique_name=parent_unique_name, server_name=server_name, is_auto_protectable=is_auto_protectable, is_auto_protected=is_auto_protected, subinquireditemcount=subinquireditemcount, subprotectableitemcount=subprotectableitemcount, prebackupvalidation=prebackupvalidation, **kwargs) + self.protectable_item_type = 'SAPHanaSystem' # type: str + + +class AzureVmWorkloadSAPHanaSystemWorkloadItem(AzureVmWorkloadItem): + """Azure VM workload-specific workload item representing SAP HANA System. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if workload item is auto-protectable. + :type is_auto_protectable: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param sub_workload_item_count: For instance or AG, indicates number of DB's to be protected. + :type sub_workload_item_count: int + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'sub_workload_item_count': {'key': 'subWorkloadItemCount', 'type': 'int'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_name: Optional[str] = None, + server_name: Optional[str] = None, + is_auto_protectable: Optional[bool] = None, + subinquireditemcount: Optional[int] = None, + sub_workload_item_count: Optional[int] = None, + **kwargs + ): + super(AzureVmWorkloadSAPHanaSystemWorkloadItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, parent_name=parent_name, server_name=server_name, is_auto_protectable=is_auto_protectable, subinquireditemcount=subinquireditemcount, sub_workload_item_count=sub_workload_item_count, **kwargs) + self.workload_item_type = 'SAPHanaSystem' # type: str + + +class AzureVmWorkloadSQLAvailabilityGroupProtectableItem(AzureVmWorkloadProtectableItem): + """Azure VM workload-specific protectable item representing SQL Availability Group. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param parent_unique_name: Parent Unique Name is added to provide the service formatted URI + Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + :type parent_unique_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if protectable item is auto-protectable. + :type is_auto_protectable: bool + :param is_auto_protected: Indicates if protectable item is auto-protected. + :type is_auto_protected: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param subprotectableitemcount: For instance or AG, indicates number of DB's to be protected. + :type subprotectableitemcount: int + :param prebackupvalidation: Pre-backup validation for protectable objects. + :type prebackupvalidation: ~azure.mgmt.recoveryservicesbackup.models.PreBackupValidation + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_unique_name': {'key': 'parentUniqueName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'is_auto_protected': {'key': 'isAutoProtected', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'subprotectableitemcount': {'key': 'subprotectableitemcount', 'type': 'int'}, + 'prebackupvalidation': {'key': 'prebackupvalidation', 'type': 'PreBackupValidation'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_name: Optional[str] = None, + parent_unique_name: Optional[str] = None, + server_name: Optional[str] = None, + is_auto_protectable: Optional[bool] = None, + is_auto_protected: Optional[bool] = None, + subinquireditemcount: Optional[int] = None, + subprotectableitemcount: Optional[int] = None, + prebackupvalidation: Optional["PreBackupValidation"] = None, + **kwargs + ): + super(AzureVmWorkloadSQLAvailabilityGroupProtectableItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, parent_name=parent_name, parent_unique_name=parent_unique_name, server_name=server_name, is_auto_protectable=is_auto_protectable, is_auto_protected=is_auto_protected, subinquireditemcount=subinquireditemcount, subprotectableitemcount=subprotectableitemcount, prebackupvalidation=prebackupvalidation, **kwargs) + self.protectable_item_type = 'SQLAvailabilityGroupContainer' # type: str + + +class AzureVmWorkloadSQLDatabaseProtectableItem(AzureVmWorkloadProtectableItem): + """Azure VM workload-specific protectable item representing SQL Database. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param parent_unique_name: Parent Unique Name is added to provide the service formatted URI + Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + :type parent_unique_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if protectable item is auto-protectable. + :type is_auto_protectable: bool + :param is_auto_protected: Indicates if protectable item is auto-protected. + :type is_auto_protected: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param subprotectableitemcount: For instance or AG, indicates number of DB's to be protected. + :type subprotectableitemcount: int + :param prebackupvalidation: Pre-backup validation for protectable objects. + :type prebackupvalidation: ~azure.mgmt.recoveryservicesbackup.models.PreBackupValidation + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_unique_name': {'key': 'parentUniqueName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'is_auto_protected': {'key': 'isAutoProtected', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'subprotectableitemcount': {'key': 'subprotectableitemcount', 'type': 'int'}, + 'prebackupvalidation': {'key': 'prebackupvalidation', 'type': 'PreBackupValidation'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_name: Optional[str] = None, + parent_unique_name: Optional[str] = None, + server_name: Optional[str] = None, + is_auto_protectable: Optional[bool] = None, + is_auto_protected: Optional[bool] = None, + subinquireditemcount: Optional[int] = None, + subprotectableitemcount: Optional[int] = None, + prebackupvalidation: Optional["PreBackupValidation"] = None, + **kwargs + ): + super(AzureVmWorkloadSQLDatabaseProtectableItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, parent_name=parent_name, parent_unique_name=parent_unique_name, server_name=server_name, is_auto_protectable=is_auto_protectable, is_auto_protected=is_auto_protected, subinquireditemcount=subinquireditemcount, subprotectableitemcount=subprotectableitemcount, prebackupvalidation=prebackupvalidation, **kwargs) + self.protectable_item_type = 'SQLDataBase' # type: str + + +class AzureVmWorkloadSQLDatabaseProtectedItem(AzureVmWorkloadProtectedItem): + """Azure VM workload-specific protected item representing SQL Database. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the DB represented by this backup item. + :type friendly_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param parent_name: Parent name of the DB such as Instance or Availability Group. + :type parent_name: str + :param parent_type: Parent type of protected item, example: for a DB, standalone server or + distributed. + :type parent_type: str + :param protection_status: Backup status of this backup item. + :type protection_status: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param last_backup_status: Last backup operation status. Possible values: Healthy, Unhealthy. + Possible values include: "Invalid", "Healthy", "Unhealthy", "IRPending". + :type last_backup_status: str or ~azure.mgmt.recoveryservicesbackup.models.LastBackupStatus + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param last_backup_error_detail: Error details in last backup. + :type last_backup_error_detail: ~azure.mgmt.recoveryservicesbackup.models.ErrorDetail + :param protected_item_data_source_id: Data ID of the protected item. + :type protected_item_data_source_id: str + :param protected_item_health_status: Health status of the backup item, evaluated based on last + heartbeat received. Possible values include: "Invalid", "Healthy", "Unhealthy", "NotReachable", + "IRPending". + :type protected_item_health_status: str or + ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemHealthStatus + :param extended_info: Additional information for this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureVmWorkloadProtectedItemExtendedInfo + :param kpis_healths: Health details of different KPIs. + :type kpis_healths: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.KPIResourceHealthDetails] + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_type': {'key': 'parentType', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'last_backup_error_detail': {'key': 'lastBackupErrorDetail', 'type': 'ErrorDetail'}, + 'protected_item_data_source_id': {'key': 'protectedItemDataSourceId', 'type': 'str'}, + 'protected_item_health_status': {'key': 'protectedItemHealthStatus', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureVmWorkloadProtectedItemExtendedInfo'}, + 'kpis_healths': {'key': 'kpisHealths', 'type': '{KPIResourceHealthDetails}'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "DataSourceType"]] = None, + container_name: Optional[str] = None, + source_resource_id: Optional[str] = None, + policy_id: Optional[str] = None, + last_recovery_point: Optional[datetime.datetime] = None, + backup_set_name: Optional[str] = None, + create_mode: Optional[Union[str, "CreateMode"]] = None, + deferred_delete_time_in_utc: Optional[datetime.datetime] = None, + is_scheduled_for_deferred_delete: Optional[bool] = None, + deferred_delete_time_remaining: Optional[str] = None, + is_deferred_delete_schedule_upcoming: Optional[bool] = None, + is_rehydrate: Optional[bool] = None, + friendly_name: Optional[str] = None, + server_name: Optional[str] = None, + parent_name: Optional[str] = None, + parent_type: Optional[str] = None, + protection_status: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionState"]] = None, + last_backup_status: Optional[Union[str, "LastBackupStatus"]] = None, + last_backup_time: Optional[datetime.datetime] = None, + last_backup_error_detail: Optional["ErrorDetail"] = None, + protected_item_data_source_id: Optional[str] = None, + protected_item_health_status: Optional[Union[str, "ProtectedItemHealthStatus"]] = None, + extended_info: Optional["AzureVmWorkloadProtectedItemExtendedInfo"] = None, + kpis_healths: Optional[Dict[str, "KPIResourceHealthDetails"]] = None, + **kwargs + ): + super(AzureVmWorkloadSQLDatabaseProtectedItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, container_name=container_name, source_resource_id=source_resource_id, policy_id=policy_id, last_recovery_point=last_recovery_point, backup_set_name=backup_set_name, create_mode=create_mode, deferred_delete_time_in_utc=deferred_delete_time_in_utc, is_scheduled_for_deferred_delete=is_scheduled_for_deferred_delete, deferred_delete_time_remaining=deferred_delete_time_remaining, is_deferred_delete_schedule_upcoming=is_deferred_delete_schedule_upcoming, is_rehydrate=is_rehydrate, friendly_name=friendly_name, server_name=server_name, parent_name=parent_name, parent_type=parent_type, protection_status=protection_status, protection_state=protection_state, last_backup_status=last_backup_status, last_backup_time=last_backup_time, last_backup_error_detail=last_backup_error_detail, protected_item_data_source_id=protected_item_data_source_id, protected_item_health_status=protected_item_health_status, extended_info=extended_info, kpis_healths=kpis_healths, **kwargs) + self.protected_item_type = 'AzureVmWorkloadSQLDatabase' # type: str + + +class AzureVmWorkloadSQLDatabaseWorkloadItem(AzureVmWorkloadItem): + """Azure VM workload-specific workload item representing SQL Database. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if workload item is auto-protectable. + :type is_auto_protectable: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param sub_workload_item_count: For instance or AG, indicates number of DB's to be protected. + :type sub_workload_item_count: int + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'sub_workload_item_count': {'key': 'subWorkloadItemCount', 'type': 'int'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_name: Optional[str] = None, + server_name: Optional[str] = None, + is_auto_protectable: Optional[bool] = None, + subinquireditemcount: Optional[int] = None, + sub_workload_item_count: Optional[int] = None, + **kwargs + ): + super(AzureVmWorkloadSQLDatabaseWorkloadItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, parent_name=parent_name, server_name=server_name, is_auto_protectable=is_auto_protectable, subinquireditemcount=subinquireditemcount, sub_workload_item_count=sub_workload_item_count, **kwargs) + self.workload_item_type = 'SQLDataBase' # type: str + + +class AzureVmWorkloadSQLInstanceProtectableItem(AzureVmWorkloadProtectableItem): + """Azure VM workload-specific protectable item representing SQL Instance. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param protectable_item_type: Required. Type of the backup item.Constant filled by server. + :type protectable_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param parent_unique_name: Parent Unique Name is added to provide the service formatted URI + Name of the Parent + Only Applicable for data bases where the parent would be either Instance or a SQL AG. + :type parent_unique_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if protectable item is auto-protectable. + :type is_auto_protectable: bool + :param is_auto_protected: Indicates if protectable item is auto-protected. + :type is_auto_protected: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param subprotectableitemcount: For instance or AG, indicates number of DB's to be protected. + :type subprotectableitemcount: int + :param prebackupvalidation: Pre-backup validation for protectable objects. + :type prebackupvalidation: ~azure.mgmt.recoveryservicesbackup.models.PreBackupValidation + """ + + _validation = { + 'protectable_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protectable_item_type': {'key': 'protectableItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'parent_unique_name': {'key': 'parentUniqueName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'is_auto_protected': {'key': 'isAutoProtected', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'subprotectableitemcount': {'key': 'subprotectableitemcount', 'type': 'int'}, + 'prebackupvalidation': {'key': 'prebackupvalidation', 'type': 'PreBackupValidation'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_name: Optional[str] = None, + parent_unique_name: Optional[str] = None, + server_name: Optional[str] = None, + is_auto_protectable: Optional[bool] = None, + is_auto_protected: Optional[bool] = None, + subinquireditemcount: Optional[int] = None, + subprotectableitemcount: Optional[int] = None, + prebackupvalidation: Optional["PreBackupValidation"] = None, + **kwargs + ): + super(AzureVmWorkloadSQLInstanceProtectableItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, parent_name=parent_name, parent_unique_name=parent_unique_name, server_name=server_name, is_auto_protectable=is_auto_protectable, is_auto_protected=is_auto_protected, subinquireditemcount=subinquireditemcount, subprotectableitemcount=subprotectableitemcount, prebackupvalidation=prebackupvalidation, **kwargs) + self.protectable_item_type = 'SQLInstance' # type: str + + +class AzureVmWorkloadSQLInstanceWorkloadItem(AzureVmWorkloadItem): + """Azure VM workload-specific workload item representing SQL Instance. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Type of backup management to backup an item. + :type backup_management_type: str + :param workload_type: Type of workload for the backup management. + :type workload_type: str + :param workload_item_type: Required. Type of the backup item.Constant filled by server. + :type workload_item_type: str + :param friendly_name: Friendly name of the backup item. + :type friendly_name: str + :param protection_state: State of the back up item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param parent_name: Name for instance or AG. + :type parent_name: str + :param server_name: Host/Cluster Name for instance or AG. + :type server_name: str + :param is_auto_protectable: Indicates if workload item is auto-protectable. + :type is_auto_protectable: bool + :param subinquireditemcount: For instance or AG, indicates number of DB's present. + :type subinquireditemcount: int + :param sub_workload_item_count: For instance or AG, indicates number of DB's to be protected. + :type sub_workload_item_count: int + :param data_directory_paths: Data Directory Paths for default directories. + :type data_directory_paths: list[~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectory] + """ + + _validation = { + 'workload_item_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'server_name': {'key': 'serverName', 'type': 'str'}, + 'is_auto_protectable': {'key': 'isAutoProtectable', 'type': 'bool'}, + 'subinquireditemcount': {'key': 'subinquireditemcount', 'type': 'int'}, + 'sub_workload_item_count': {'key': 'subWorkloadItemCount', 'type': 'int'}, + 'data_directory_paths': {'key': 'dataDirectoryPaths', 'type': '[SQLDataDirectory]'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[str] = None, + workload_type: Optional[str] = None, + friendly_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + parent_name: Optional[str] = None, + server_name: Optional[str] = None, + is_auto_protectable: Optional[bool] = None, + subinquireditemcount: Optional[int] = None, + sub_workload_item_count: Optional[int] = None, + data_directory_paths: Optional[List["SQLDataDirectory"]] = None, + **kwargs + ): + super(AzureVmWorkloadSQLInstanceWorkloadItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, friendly_name=friendly_name, protection_state=protection_state, parent_name=parent_name, server_name=server_name, is_auto_protectable=is_auto_protectable, subinquireditemcount=subinquireditemcount, sub_workload_item_count=sub_workload_item_count, **kwargs) + self.workload_item_type = 'SQLInstance' # type: str + self.data_directory_paths = data_directory_paths + + +class AzureWorkloadAutoProtectionIntent(AzureRecoveryServiceVaultProtectionIntent): + """Azure Recovery Services Vault specific protection intent item. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSQLAutoProtectionIntent. + + All required parameters must be populated in order to send to Azure. + + :param protection_intent_item_type: Required. backup protectionIntent type.Constant filled by + server. + :type protection_intent_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param item_id: ID of the item which is getting protected, In case of Azure Vm , it is + ProtectedItemId. + :type item_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + """ + + _validation = { + 'protection_intent_item_type': {'required': True}, + } + + _attribute_map = { + 'protection_intent_item_type': {'key': 'protectionIntentItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'item_id': {'key': 'itemId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + } + + _subtype_map = { + 'protection_intent_item_type': {'AzureWorkloadSQLAutoProtectionIntent': 'AzureWorkloadSQLAutoProtectionIntent'} + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + source_resource_id: Optional[str] = None, + item_id: Optional[str] = None, + policy_id: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + **kwargs + ): + super(AzureWorkloadAutoProtectionIntent, self).__init__(backup_management_type=backup_management_type, source_resource_id=source_resource_id, item_id=item_id, policy_id=policy_id, protection_state=protection_state, **kwargs) + self.protection_intent_item_type = 'AzureWorkloadAutoProtectionIntent' # type: str + + +class AzureWorkloadBackupRequest(BackupRequest): + """AzureWorkload workload-specific backup request. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param backup_type: Type of backup, viz. Full, Differential, Log or CopyOnlyFull. Possible + values include: "Invalid", "Full", "Differential", "Log", "CopyOnlyFull", "Incremental". + :type backup_type: str or ~azure.mgmt.recoveryservicesbackup.models.BackupType + :param enable_compression: Bool for Compression setting. + :type enable_compression: bool + :param recovery_point_expiry_time_in_utc: Backup copy will expire after the time specified + (UTC). + :type recovery_point_expiry_time_in_utc: ~datetime.datetime + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'backup_type': {'key': 'backupType', 'type': 'str'}, + 'enable_compression': {'key': 'enableCompression', 'type': 'bool'}, + 'recovery_point_expiry_time_in_utc': {'key': 'recoveryPointExpiryTimeInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + backup_type: Optional[Union[str, "BackupType"]] = None, + enable_compression: Optional[bool] = None, + recovery_point_expiry_time_in_utc: Optional[datetime.datetime] = None, + **kwargs + ): + super(AzureWorkloadBackupRequest, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadBackupRequest' # type: str + self.backup_type = backup_type + self.enable_compression = enable_compression + self.recovery_point_expiry_time_in_utc = recovery_point_expiry_time_in_utc + + +class AzureWorkloadContainerExtendedInfo(msrest.serialization.Model): + """Extended information of the container. + + :param host_server_name: Host Os Name in case of Stand Alone and Cluster Name in case of + distributed container. + :type host_server_name: str + :param inquiry_info: Inquiry Status for the container. + :type inquiry_info: ~azure.mgmt.recoveryservicesbackup.models.InquiryInfo + :param nodes_list: List of the nodes in case of distributed container. + :type nodes_list: list[~azure.mgmt.recoveryservicesbackup.models.DistributedNodesInfo] + """ + + _attribute_map = { + 'host_server_name': {'key': 'hostServerName', 'type': 'str'}, + 'inquiry_info': {'key': 'inquiryInfo', 'type': 'InquiryInfo'}, + 'nodes_list': {'key': 'nodesList', 'type': '[DistributedNodesInfo]'}, + } + + def __init__( + self, + *, + host_server_name: Optional[str] = None, + inquiry_info: Optional["InquiryInfo"] = None, + nodes_list: Optional[List["DistributedNodesInfo"]] = None, + **kwargs + ): + super(AzureWorkloadContainerExtendedInfo, self).__init__(**kwargs) + self.host_server_name = host_server_name + self.inquiry_info = inquiry_info + self.nodes_list = nodes_list + + +class AzureWorkloadErrorInfo(msrest.serialization.Model): + """Azure storage specific error information. + + :param error_code: Error code. + :type error_code: int + :param error_string: Localized error string. + :type error_string: str + :param error_title: Title: Typically, the entity that the error pertains to. + :type error_title: str + :param recommendations: List of localized recommendations for above error code. + :type recommendations: list[str] + :param additional_details: Additional details for above error code. + :type additional_details: str + """ + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'error_string': {'key': 'errorString', 'type': 'str'}, + 'error_title': {'key': 'errorTitle', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + 'additional_details': {'key': 'additionalDetails', 'type': 'str'}, + } + + def __init__( + self, + *, + error_code: Optional[int] = None, + error_string: Optional[str] = None, + error_title: Optional[str] = None, + recommendations: Optional[List[str]] = None, + additional_details: Optional[str] = None, + **kwargs + ): + super(AzureWorkloadErrorInfo, self).__init__(**kwargs) + self.error_code = error_code + self.error_string = error_string + self.error_title = error_title + self.recommendations = recommendations + self.additional_details = additional_details + + +class AzureWorkloadJob(Job): + """Azure storage specific job. + + All required parameters must be populated in order to send to Azure. + + :param entity_friendly_name: Friendly name of the entity on which the current job is executing. + :type entity_friendly_name: str + :param backup_management_type: Backup management type to execute the current job. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: The operation name. + :type operation: str + :param status: Job status. + :type status: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param activity_id: ActivityId of job. + :type activity_id: str + :param job_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 job_type: str + :param workload_type: Workload type of the job. + :type workload_type: str + :param duration: Time elapsed during the execution of this job. + :type duration: ~datetime.timedelta + :param actions_info: Gets or sets the state/actions applicable on this job like cancel/retry. + :type actions_info: list[str or ~azure.mgmt.recoveryservicesbackup.models.JobSupportedAction] + :param error_details: Error details on execution of this job. + :type error_details: list[~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadErrorInfo] + :param extended_info: Additional information about the job. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadJobExtendedInfo + """ + + _validation = { + 'job_type': {'required': True}, + } + + _attribute_map = { + 'entity_friendly_name': {'key': 'entityFriendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'actions_info': {'key': 'actionsInfo', 'type': '[str]'}, + 'error_details': {'key': 'errorDetails', 'type': '[AzureWorkloadErrorInfo]'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadJobExtendedInfo'}, + } + + def __init__( + self, + *, + entity_friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + operation: Optional[str] = None, + status: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + activity_id: Optional[str] = None, + workload_type: Optional[str] = None, + duration: Optional[datetime.timedelta] = None, + actions_info: Optional[List[Union[str, "JobSupportedAction"]]] = None, + error_details: Optional[List["AzureWorkloadErrorInfo"]] = None, + extended_info: Optional["AzureWorkloadJobExtendedInfo"] = None, + **kwargs + ): + super(AzureWorkloadJob, self).__init__(entity_friendly_name=entity_friendly_name, backup_management_type=backup_management_type, operation=operation, status=status, start_time=start_time, end_time=end_time, activity_id=activity_id, **kwargs) + self.job_type = 'AzureWorkloadJob' # type: str + self.workload_type = workload_type + self.duration = duration + self.actions_info = actions_info + self.error_details = error_details + self.extended_info = extended_info + + +class AzureWorkloadJobExtendedInfo(msrest.serialization.Model): + """Azure VM workload-specific additional information for job. + + :param tasks_list: List of tasks for this job. + :type tasks_list: list[~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadJobTaskDetails] + :param property_bag: Job properties. + :type property_bag: dict[str, str] + :param dynamic_error_message: Non localized error message on job execution. + :type dynamic_error_message: str + """ + + _attribute_map = { + 'tasks_list': {'key': 'tasksList', 'type': '[AzureWorkloadJobTaskDetails]'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'dynamic_error_message': {'key': 'dynamicErrorMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + tasks_list: Optional[List["AzureWorkloadJobTaskDetails"]] = None, + property_bag: Optional[Dict[str, str]] = None, + dynamic_error_message: Optional[str] = None, + **kwargs + ): + super(AzureWorkloadJobExtendedInfo, self).__init__(**kwargs) + self.tasks_list = tasks_list + self.property_bag = property_bag + self.dynamic_error_message = dynamic_error_message + + +class AzureWorkloadJobTaskDetails(msrest.serialization.Model): + """Azure VM workload specific job task details. + + :param task_id: The task display name. + :type task_id: str + :param status: The status. + :type status: str + """ + + _attribute_map = { + 'task_id': {'key': 'taskId', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + task_id: Optional[str] = None, + status: Optional[str] = None, + **kwargs + ): + super(AzureWorkloadJobTaskDetails, self).__init__(**kwargs) + self.task_id = task_id + self.status = status + + +class AzureWorkloadRecoveryPoint(RecoveryPoint): + """Workload specific recovery point, specifically encapsulates full/diff recovery point. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadPointInTimeRecoveryPoint, AzureWorkloadSAPHanaRecoveryPoint, AzureWorkloadSQLRecoveryPoint. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_time_in_utc: UTC time at which recovery point was created. + :type recovery_point_time_in_utc: ~datetime.datetime + :param type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadPointInTimeRecoveryPoint': 'AzureWorkloadPointInTimeRecoveryPoint', 'AzureWorkloadSAPHanaRecoveryPoint': 'AzureWorkloadSAPHanaRecoveryPoint', 'AzureWorkloadSQLRecoveryPoint': 'AzureWorkloadSQLRecoveryPoint'} + } + + def __init__( + self, + *, + recovery_point_time_in_utc: Optional[datetime.datetime] = None, + type: Optional[Union[str, "RestorePointType"]] = None, + recovery_point_tier_details: Optional[List["RecoveryPointTierInformation"]] = None, + recovery_point_move_readiness_info: Optional[Dict[str, "RecoveryPointMoveReadinessInfo"]] = None, + **kwargs + ): + super(AzureWorkloadRecoveryPoint, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadRecoveryPoint' # type: str + self.recovery_point_time_in_utc = recovery_point_time_in_utc + self.type = type + self.recovery_point_tier_details = recovery_point_tier_details + self.recovery_point_move_readiness_info = recovery_point_move_readiness_info + + +class AzureWorkloadPointInTimeRecoveryPoint(AzureWorkloadRecoveryPoint): + """Recovery point specific to PointInTime. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSAPHanaPointInTimeRecoveryPoint. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_time_in_utc: UTC time at which recovery point was created. + :type recovery_point_time_in_utc: ~datetime.datetime + :param type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param time_ranges: List of log ranges. + :type time_ranges: list[~azure.mgmt.recoveryservicesbackup.models.PointInTimeRange] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'time_ranges': {'key': 'timeRanges', 'type': '[PointInTimeRange]'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSAPHanaPointInTimeRecoveryPoint': 'AzureWorkloadSAPHanaPointInTimeRecoveryPoint'} + } + + def __init__( + self, + *, + recovery_point_time_in_utc: Optional[datetime.datetime] = None, + type: Optional[Union[str, "RestorePointType"]] = None, + recovery_point_tier_details: Optional[List["RecoveryPointTierInformation"]] = None, + recovery_point_move_readiness_info: Optional[Dict[str, "RecoveryPointMoveReadinessInfo"]] = None, + time_ranges: Optional[List["PointInTimeRange"]] = None, + **kwargs + ): + super(AzureWorkloadPointInTimeRecoveryPoint, self).__init__(recovery_point_time_in_utc=recovery_point_time_in_utc, type=type, recovery_point_tier_details=recovery_point_tier_details, recovery_point_move_readiness_info=recovery_point_move_readiness_info, **kwargs) + self.object_type = 'AzureWorkloadPointInTimeRecoveryPoint' # type: str + self.time_ranges = time_ranges + + +class AzureWorkloadRecoveryPointAutoGenerated(RecoveryPoint): + """Workload specific recovery point, specifically encapsulates full/diff recovery point. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadPointInTimeRecoveryPointAutoGenerated, AzureWorkloadSAPHanaRecoveryPointAutoGenerated, AzureWorkloadSQLRecoveryPointAutoGenerated. + + 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 object_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 object_type: str + :ivar recovery_point_time_in_utc: UTC time at which recovery point was created. + :vartype recovery_point_time_in_utc: ~datetime.datetime + :ivar type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :vartype type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_time_in_utc': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadPointInTimeRecoveryPoint': 'AzureWorkloadPointInTimeRecoveryPointAutoGenerated', 'AzureWorkloadSAPHanaRecoveryPoint': 'AzureWorkloadSAPHanaRecoveryPointAutoGenerated', 'AzureWorkloadSQLRecoveryPoint': 'AzureWorkloadSQLRecoveryPointAutoGenerated'} + } + + def __init__( + self, + *, + recovery_point_tier_details: Optional[List["RecoveryPointTierInformation"]] = None, + recovery_point_move_readiness_info: Optional[Dict[str, "RecoveryPointMoveReadinessInfo"]] = None, + **kwargs + ): + super(AzureWorkloadRecoveryPointAutoGenerated, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadRecoveryPoint' # type: str + self.recovery_point_time_in_utc = None + self.type = None + self.recovery_point_tier_details = recovery_point_tier_details + self.recovery_point_move_readiness_info = recovery_point_move_readiness_info + + +class AzureWorkloadPointInTimeRecoveryPointAutoGenerated(AzureWorkloadRecoveryPointAutoGenerated): + """Recovery point specific to PointInTime. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSAPHanaPointInTimeRecoveryPointAutoGenerated. + + 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 object_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 object_type: str + :ivar recovery_point_time_in_utc: UTC time at which recovery point was created. + :vartype recovery_point_time_in_utc: ~datetime.datetime + :ivar type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :vartype type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param time_ranges: List of log ranges. + :type time_ranges: list[~azure.mgmt.recoveryservicesbackup.models.PointInTimeRange] + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_time_in_utc': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'time_ranges': {'key': 'timeRanges', 'type': '[PointInTimeRange]'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSAPHanaPointInTimeRecoveryPoint': 'AzureWorkloadSAPHanaPointInTimeRecoveryPointAutoGenerated'} + } + + def __init__( + self, + *, + recovery_point_tier_details: Optional[List["RecoveryPointTierInformation"]] = None, + recovery_point_move_readiness_info: Optional[Dict[str, "RecoveryPointMoveReadinessInfo"]] = None, + time_ranges: Optional[List["PointInTimeRange"]] = None, + **kwargs + ): + super(AzureWorkloadPointInTimeRecoveryPointAutoGenerated, self).__init__(recovery_point_tier_details=recovery_point_tier_details, recovery_point_move_readiness_info=recovery_point_move_readiness_info, **kwargs) + self.object_type = 'AzureWorkloadPointInTimeRecoveryPoint' # type: str + self.time_ranges = time_ranges + + +class AzureWorkloadRestoreRequest(RestoreRequest): + """AzureWorkload-specific restore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadPointInTimeRestoreRequest, AzureWorkloadSAPHanaRestoreRequest, AzureWorkloadSQLRestoreRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadPointInTimeRestoreRequest': 'AzureWorkloadPointInTimeRestoreRequest', 'AzureWorkloadSAPHanaRestoreRequest': 'AzureWorkloadSAPHanaRestoreRequest', 'AzureWorkloadSQLRestoreRequest': 'AzureWorkloadSQLRestoreRequest'} + } + + def __init__( + self, + *, + recovery_type: Optional[Union[str, "RecoveryType"]] = None, + source_resource_id: Optional[str] = None, + property_bag: Optional[Dict[str, str]] = None, + target_info: Optional["TargetRestoreInfo"] = None, + recovery_mode: Optional[Union[str, "RecoveryMode"]] = None, + target_virtual_machine_id: Optional[str] = None, + **kwargs + ): + super(AzureWorkloadRestoreRequest, self).__init__(**kwargs) + self.object_type = 'AzureWorkloadRestoreRequest' # type: str + self.recovery_type = recovery_type + self.source_resource_id = source_resource_id + self.property_bag = property_bag + self.target_info = target_info + self.recovery_mode = recovery_mode + self.target_virtual_machine_id = target_virtual_machine_id + + +class AzureWorkloadPointInTimeRestoreRequest(AzureWorkloadRestoreRequest): + """AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param point_in_time: PointInTime value. + :type point_in_time: ~datetime.datetime + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'point_in_time': {'key': 'pointInTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + recovery_type: Optional[Union[str, "RecoveryType"]] = None, + source_resource_id: Optional[str] = None, + property_bag: Optional[Dict[str, str]] = None, + target_info: Optional["TargetRestoreInfo"] = None, + recovery_mode: Optional[Union[str, "RecoveryMode"]] = None, + target_virtual_machine_id: Optional[str] = None, + point_in_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(AzureWorkloadPointInTimeRestoreRequest, self).__init__(recovery_type=recovery_type, source_resource_id=source_resource_id, property_bag=property_bag, target_info=target_info, recovery_mode=recovery_mode, target_virtual_machine_id=target_virtual_machine_id, **kwargs) + self.object_type = 'AzureWorkloadPointInTimeRestoreRequest' # type: str + self.point_in_time = point_in_time + + +class AzureWorkloadSAPHanaPointInTimeRecoveryPoint(AzureWorkloadPointInTimeRecoveryPoint): + """Recovery point specific to PointInTime in SAPHana. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_time_in_utc: UTC time at which recovery point was created. + :type recovery_point_time_in_utc: ~datetime.datetime + :param type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param time_ranges: List of log ranges. + :type time_ranges: list[~azure.mgmt.recoveryservicesbackup.models.PointInTimeRange] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'time_ranges': {'key': 'timeRanges', 'type': '[PointInTimeRange]'}, + } + + def __init__( + self, + *, + recovery_point_time_in_utc: Optional[datetime.datetime] = None, + type: Optional[Union[str, "RestorePointType"]] = None, + recovery_point_tier_details: Optional[List["RecoveryPointTierInformation"]] = None, + recovery_point_move_readiness_info: Optional[Dict[str, "RecoveryPointMoveReadinessInfo"]] = None, + time_ranges: Optional[List["PointInTimeRange"]] = None, + **kwargs + ): + super(AzureWorkloadSAPHanaPointInTimeRecoveryPoint, self).__init__(recovery_point_time_in_utc=recovery_point_time_in_utc, type=type, recovery_point_tier_details=recovery_point_tier_details, recovery_point_move_readiness_info=recovery_point_move_readiness_info, time_ranges=time_ranges, **kwargs) + self.object_type = 'AzureWorkloadSAPHanaPointInTimeRecoveryPoint' # type: str + + +class AzureWorkloadSAPHanaPointInTimeRecoveryPointAutoGenerated(AzureWorkloadPointInTimeRecoveryPointAutoGenerated): + """Recovery point specific to PointInTime in SAPHana. + + 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 object_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 object_type: str + :ivar recovery_point_time_in_utc: UTC time at which recovery point was created. + :vartype recovery_point_time_in_utc: ~datetime.datetime + :ivar type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :vartype type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param time_ranges: List of log ranges. + :type time_ranges: list[~azure.mgmt.recoveryservicesbackup.models.PointInTimeRange] + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_time_in_utc': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'time_ranges': {'key': 'timeRanges', 'type': '[PointInTimeRange]'}, + } + + def __init__( + self, + *, + recovery_point_tier_details: Optional[List["RecoveryPointTierInformation"]] = None, + recovery_point_move_readiness_info: Optional[Dict[str, "RecoveryPointMoveReadinessInfo"]] = None, + time_ranges: Optional[List["PointInTimeRange"]] = None, + **kwargs + ): + super(AzureWorkloadSAPHanaPointInTimeRecoveryPointAutoGenerated, self).__init__(recovery_point_tier_details=recovery_point_tier_details, recovery_point_move_readiness_info=recovery_point_move_readiness_info, time_ranges=time_ranges, **kwargs) + self.object_type = 'AzureWorkloadSAPHanaPointInTimeRecoveryPoint' # type: str + + +class AzureWorkloadSAPHanaRestoreRequest(AzureWorkloadRestoreRequest): + """AzureWorkload SAP Hana-specific restore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSAPHanaPointInTimeRestoreRequest, AzureWorkloadSAPHanaRestoreWithRehydrateRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSAPHanaPointInTimeRestoreRequest': 'AzureWorkloadSAPHanaPointInTimeRestoreRequest', 'AzureWorkloadSAPHanaRestoreWithRehydrateRequest': 'AzureWorkloadSAPHanaRestoreWithRehydrateRequest'} + } + + def __init__( + self, + *, + recovery_type: Optional[Union[str, "RecoveryType"]] = None, + source_resource_id: Optional[str] = None, + property_bag: Optional[Dict[str, str]] = None, + target_info: Optional["TargetRestoreInfo"] = None, + recovery_mode: Optional[Union[str, "RecoveryMode"]] = None, + target_virtual_machine_id: Optional[str] = None, + **kwargs + ): + super(AzureWorkloadSAPHanaRestoreRequest, self).__init__(recovery_type=recovery_type, source_resource_id=source_resource_id, property_bag=property_bag, target_info=target_info, recovery_mode=recovery_mode, target_virtual_machine_id=target_virtual_machine_id, **kwargs) + self.object_type = 'AzureWorkloadSAPHanaRestoreRequest' # type: str + + +class AzureWorkloadSAPHanaPointInTimeRestoreRequest(AzureWorkloadSAPHanaRestoreRequest): + """AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param point_in_time: PointInTime value. + :type point_in_time: ~datetime.datetime + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'point_in_time': {'key': 'pointInTime', 'type': 'iso-8601'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest': 'AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest'} + } + + def __init__( + self, + *, + recovery_type: Optional[Union[str, "RecoveryType"]] = None, + source_resource_id: Optional[str] = None, + property_bag: Optional[Dict[str, str]] = None, + target_info: Optional["TargetRestoreInfo"] = None, + recovery_mode: Optional[Union[str, "RecoveryMode"]] = None, + target_virtual_machine_id: Optional[str] = None, + point_in_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(AzureWorkloadSAPHanaPointInTimeRestoreRequest, self).__init__(recovery_type=recovery_type, source_resource_id=source_resource_id, property_bag=property_bag, target_info=target_info, recovery_mode=recovery_mode, target_virtual_machine_id=target_virtual_machine_id, **kwargs) + self.object_type = 'AzureWorkloadSAPHanaPointInTimeRestoreRequest' # type: str + self.point_in_time = point_in_time + + +class AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest(AzureWorkloadSAPHanaPointInTimeRestoreRequest): + """AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param point_in_time: PointInTime value. + :type point_in_time: ~datetime.datetime + :param recovery_point_rehydration_info: RP Rehydration Info. + :type recovery_point_rehydration_info: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointRehydrationInfo + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'point_in_time': {'key': 'pointInTime', 'type': 'iso-8601'}, + 'recovery_point_rehydration_info': {'key': 'recoveryPointRehydrationInfo', 'type': 'RecoveryPointRehydrationInfo'}, + } + + def __init__( + self, + *, + recovery_type: Optional[Union[str, "RecoveryType"]] = None, + source_resource_id: Optional[str] = None, + property_bag: Optional[Dict[str, str]] = None, + target_info: Optional["TargetRestoreInfo"] = None, + recovery_mode: Optional[Union[str, "RecoveryMode"]] = None, + target_virtual_machine_id: Optional[str] = None, + point_in_time: Optional[datetime.datetime] = None, + recovery_point_rehydration_info: Optional["RecoveryPointRehydrationInfo"] = None, + **kwargs + ): + super(AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, self).__init__(recovery_type=recovery_type, source_resource_id=source_resource_id, property_bag=property_bag, target_info=target_info, recovery_mode=recovery_mode, target_virtual_machine_id=target_virtual_machine_id, point_in_time=point_in_time, **kwargs) + self.object_type = 'AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest' # type: str + self.recovery_point_rehydration_info = recovery_point_rehydration_info + + +class AzureWorkloadSAPHanaRecoveryPoint(AzureWorkloadRecoveryPoint): + """SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_time_in_utc: UTC time at which recovery point was created. + :type recovery_point_time_in_utc: ~datetime.datetime + :param type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + } + + def __init__( + self, + *, + recovery_point_time_in_utc: Optional[datetime.datetime] = None, + type: Optional[Union[str, "RestorePointType"]] = None, + recovery_point_tier_details: Optional[List["RecoveryPointTierInformation"]] = None, + recovery_point_move_readiness_info: Optional[Dict[str, "RecoveryPointMoveReadinessInfo"]] = None, + **kwargs + ): + super(AzureWorkloadSAPHanaRecoveryPoint, self).__init__(recovery_point_time_in_utc=recovery_point_time_in_utc, type=type, recovery_point_tier_details=recovery_point_tier_details, recovery_point_move_readiness_info=recovery_point_move_readiness_info, **kwargs) + self.object_type = 'AzureWorkloadSAPHanaRecoveryPoint' # type: str + + +class AzureWorkloadSAPHanaRecoveryPointAutoGenerated(AzureWorkloadRecoveryPointAutoGenerated): + """SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints. + + 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 object_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 object_type: str + :ivar recovery_point_time_in_utc: UTC time at which recovery point was created. + :vartype recovery_point_time_in_utc: ~datetime.datetime + :ivar type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :vartype type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_time_in_utc': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + } + + def __init__( + self, + *, + recovery_point_tier_details: Optional[List["RecoveryPointTierInformation"]] = None, + recovery_point_move_readiness_info: Optional[Dict[str, "RecoveryPointMoveReadinessInfo"]] = None, + **kwargs + ): + super(AzureWorkloadSAPHanaRecoveryPointAutoGenerated, self).__init__(recovery_point_tier_details=recovery_point_tier_details, recovery_point_move_readiness_info=recovery_point_move_readiness_info, **kwargs) + self.object_type = 'AzureWorkloadSAPHanaRecoveryPoint' # type: str + + +class AzureWorkloadSAPHanaRestoreWithRehydrateRequest(AzureWorkloadSAPHanaRestoreRequest): + """AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param recovery_point_rehydration_info: RP Rehydration Info. + :type recovery_point_rehydration_info: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointRehydrationInfo + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'recovery_point_rehydration_info': {'key': 'recoveryPointRehydrationInfo', 'type': 'RecoveryPointRehydrationInfo'}, + } + + def __init__( + self, + *, + recovery_type: Optional[Union[str, "RecoveryType"]] = None, + source_resource_id: Optional[str] = None, + property_bag: Optional[Dict[str, str]] = None, + target_info: Optional["TargetRestoreInfo"] = None, + recovery_mode: Optional[Union[str, "RecoveryMode"]] = None, + target_virtual_machine_id: Optional[str] = None, + recovery_point_rehydration_info: Optional["RecoveryPointRehydrationInfo"] = None, + **kwargs + ): + super(AzureWorkloadSAPHanaRestoreWithRehydrateRequest, self).__init__(recovery_type=recovery_type, source_resource_id=source_resource_id, property_bag=property_bag, target_info=target_info, recovery_mode=recovery_mode, target_virtual_machine_id=target_virtual_machine_id, **kwargs) + self.object_type = 'AzureWorkloadSAPHanaRestoreWithRehydrateRequest' # type: str + self.recovery_point_rehydration_info = recovery_point_rehydration_info + + +class AzureWorkloadSQLAutoProtectionIntent(AzureWorkloadAutoProtectionIntent): + """Azure Workload SQL Auto Protection intent item. + + All required parameters must be populated in order to send to Azure. + + :param protection_intent_item_type: Required. backup protectionIntent type.Constant filled by + server. + :type protection_intent_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param item_id: ID of the item which is getting protected, In case of Azure Vm , it is + ProtectedItemId. + :type item_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param workload_item_type: Workload item type of the item for which intent is to be set. + Possible values include: "Invalid", "SQLInstance", "SQLDataBase", "SAPHanaSystem", + "SAPHanaDatabase", "SAPAseSystem", "SAPAseDatabase". + :type workload_item_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadItemType + """ + + _validation = { + 'protection_intent_item_type': {'required': True}, + } + + _attribute_map = { + 'protection_intent_item_type': {'key': 'protectionIntentItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'item_id': {'key': 'itemId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + source_resource_id: Optional[str] = None, + item_id: Optional[str] = None, + policy_id: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionStatus"]] = None, + workload_item_type: Optional[Union[str, "WorkloadItemType"]] = None, + **kwargs + ): + super(AzureWorkloadSQLAutoProtectionIntent, self).__init__(backup_management_type=backup_management_type, source_resource_id=source_resource_id, item_id=item_id, policy_id=policy_id, protection_state=protection_state, **kwargs) + self.protection_intent_item_type = 'AzureWorkloadSQLAutoProtectionIntent' # type: str + self.workload_item_type = workload_item_type + + +class AzureWorkloadSQLRecoveryPoint(AzureWorkloadRecoveryPoint): + """SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSQLPointInTimeRecoveryPoint. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_time_in_utc: UTC time at which recovery point was created. + :type recovery_point_time_in_utc: ~datetime.datetime + :param type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param extended_info: Extended Info that provides data directory details. Will be populated in + two cases: + When a specific recovery point is accessed using GetRecoveryPoint + Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadSQLRecoveryPointExtendedInfo + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadSQLRecoveryPointExtendedInfo'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSQLPointInTimeRecoveryPoint': 'AzureWorkloadSQLPointInTimeRecoveryPoint'} + } + + def __init__( + self, + *, + recovery_point_time_in_utc: Optional[datetime.datetime] = None, + type: Optional[Union[str, "RestorePointType"]] = None, + recovery_point_tier_details: Optional[List["RecoveryPointTierInformation"]] = None, + recovery_point_move_readiness_info: Optional[Dict[str, "RecoveryPointMoveReadinessInfo"]] = None, + extended_info: Optional["AzureWorkloadSQLRecoveryPointExtendedInfo"] = None, + **kwargs + ): + super(AzureWorkloadSQLRecoveryPoint, self).__init__(recovery_point_time_in_utc=recovery_point_time_in_utc, type=type, recovery_point_tier_details=recovery_point_tier_details, recovery_point_move_readiness_info=recovery_point_move_readiness_info, **kwargs) + self.object_type = 'AzureWorkloadSQLRecoveryPoint' # type: str + self.extended_info = extended_info + + +class AzureWorkloadSQLPointInTimeRecoveryPoint(AzureWorkloadSQLRecoveryPoint): + """Recovery point specific to PointInTime. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_time_in_utc: UTC time at which recovery point was created. + :type recovery_point_time_in_utc: ~datetime.datetime + :param type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param extended_info: Extended Info that provides data directory details. Will be populated in + two cases: + When a specific recovery point is accessed using GetRecoveryPoint + Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadSQLRecoveryPointExtendedInfo + :param time_ranges: List of log ranges. + :type time_ranges: list[~azure.mgmt.recoveryservicesbackup.models.PointInTimeRange] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadSQLRecoveryPointExtendedInfo'}, + 'time_ranges': {'key': 'timeRanges', 'type': '[PointInTimeRange]'}, + } + + def __init__( + self, + *, + recovery_point_time_in_utc: Optional[datetime.datetime] = None, + type: Optional[Union[str, "RestorePointType"]] = None, + recovery_point_tier_details: Optional[List["RecoveryPointTierInformation"]] = None, + recovery_point_move_readiness_info: Optional[Dict[str, "RecoveryPointMoveReadinessInfo"]] = None, + extended_info: Optional["AzureWorkloadSQLRecoveryPointExtendedInfo"] = None, + time_ranges: Optional[List["PointInTimeRange"]] = None, + **kwargs + ): + super(AzureWorkloadSQLPointInTimeRecoveryPoint, self).__init__(recovery_point_time_in_utc=recovery_point_time_in_utc, type=type, recovery_point_tier_details=recovery_point_tier_details, recovery_point_move_readiness_info=recovery_point_move_readiness_info, extended_info=extended_info, **kwargs) + self.object_type = 'AzureWorkloadSQLPointInTimeRecoveryPoint' # type: str + self.time_ranges = time_ranges + + +class AzureWorkloadSQLRecoveryPointAutoGenerated(AzureWorkloadRecoveryPointAutoGenerated): + """SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSQLPointInTimeRecoveryPointAutoGenerated. + + 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 object_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 object_type: str + :ivar recovery_point_time_in_utc: UTC time at which recovery point was created. + :vartype recovery_point_time_in_utc: ~datetime.datetime + :ivar type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :vartype type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param extended_info: Extended Info that provides data directory details. Will be populated in + two cases: + When a specific recovery point is accessed using GetRecoveryPoint + Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_time_in_utc': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSQLPointInTimeRecoveryPoint': 'AzureWorkloadSQLPointInTimeRecoveryPointAutoGenerated'} + } + + def __init__( + self, + *, + recovery_point_tier_details: Optional[List["RecoveryPointTierInformation"]] = None, + recovery_point_move_readiness_info: Optional[Dict[str, "RecoveryPointMoveReadinessInfo"]] = None, + extended_info: Optional["AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated"] = None, + **kwargs + ): + super(AzureWorkloadSQLRecoveryPointAutoGenerated, self).__init__(recovery_point_tier_details=recovery_point_tier_details, recovery_point_move_readiness_info=recovery_point_move_readiness_info, **kwargs) + self.object_type = 'AzureWorkloadSQLRecoveryPoint' # type: str + self.extended_info = extended_info + + +class AzureWorkloadSQLPointInTimeRecoveryPointAutoGenerated(AzureWorkloadSQLRecoveryPointAutoGenerated): + """Recovery point specific to PointInTime. + + 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 object_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 object_type: str + :ivar recovery_point_time_in_utc: UTC time at which recovery point was created. + :vartype recovery_point_time_in_utc: ~datetime.datetime + :ivar type: Type of restore point. Possible values include: "Invalid", "Full", "Log", + "Differential", "Incremental". + :vartype type: str or ~azure.mgmt.recoveryservicesbackup.models.RestorePointType + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + :param extended_info: Extended Info that provides data directory details. Will be populated in + two cases: + When a specific recovery point is accessed using GetRecoveryPoint + Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated + :param time_ranges: List of log ranges. + :type time_ranges: list[~azure.mgmt.recoveryservicesbackup.models.PointInTimeRange] + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_time_in_utc': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time_in_utc': {'key': 'recoveryPointTimeInUTC', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated'}, + 'time_ranges': {'key': 'timeRanges', 'type': '[PointInTimeRange]'}, + } + + def __init__( + self, + *, + recovery_point_tier_details: Optional[List["RecoveryPointTierInformation"]] = None, + recovery_point_move_readiness_info: Optional[Dict[str, "RecoveryPointMoveReadinessInfo"]] = None, + extended_info: Optional["AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated"] = None, + time_ranges: Optional[List["PointInTimeRange"]] = None, + **kwargs + ): + super(AzureWorkloadSQLPointInTimeRecoveryPointAutoGenerated, self).__init__(recovery_point_tier_details=recovery_point_tier_details, recovery_point_move_readiness_info=recovery_point_move_readiness_info, extended_info=extended_info, **kwargs) + self.object_type = 'AzureWorkloadSQLPointInTimeRecoveryPoint' # type: str + self.time_ranges = time_ranges + + +class AzureWorkloadSQLRestoreRequest(AzureWorkloadRestoreRequest): + """AzureWorkload SQL -specific restore. Specifically for full/diff restore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSQLPointInTimeRestoreRequest, AzureWorkloadSQLRestoreWithRehydrateRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param should_use_alternate_target_location: Default option set to true. If this is set to + false, alternate data directory must be provided. + :type should_use_alternate_target_location: bool + :param is_non_recoverable: SQL specific property where user can chose to set no-recovery when + restore operation is tried. + :type is_non_recoverable: bool + :param alternate_directory_paths: Data directory details. + :type alternate_directory_paths: + list[~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectoryMapping] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'should_use_alternate_target_location': {'key': 'shouldUseAlternateTargetLocation', 'type': 'bool'}, + 'is_non_recoverable': {'key': 'isNonRecoverable', 'type': 'bool'}, + 'alternate_directory_paths': {'key': 'alternateDirectoryPaths', 'type': '[SQLDataDirectoryMapping]'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSQLPointInTimeRestoreRequest': 'AzureWorkloadSQLPointInTimeRestoreRequest', 'AzureWorkloadSQLRestoreWithRehydrateRequest': 'AzureWorkloadSQLRestoreWithRehydrateRequest'} + } + + def __init__( + self, + *, + recovery_type: Optional[Union[str, "RecoveryType"]] = None, + source_resource_id: Optional[str] = None, + property_bag: Optional[Dict[str, str]] = None, + target_info: Optional["TargetRestoreInfo"] = None, + recovery_mode: Optional[Union[str, "RecoveryMode"]] = None, + target_virtual_machine_id: Optional[str] = None, + should_use_alternate_target_location: Optional[bool] = None, + is_non_recoverable: Optional[bool] = None, + alternate_directory_paths: Optional[List["SQLDataDirectoryMapping"]] = None, + **kwargs + ): + super(AzureWorkloadSQLRestoreRequest, self).__init__(recovery_type=recovery_type, source_resource_id=source_resource_id, property_bag=property_bag, target_info=target_info, recovery_mode=recovery_mode, target_virtual_machine_id=target_virtual_machine_id, **kwargs) + self.object_type = 'AzureWorkloadSQLRestoreRequest' # type: str + self.should_use_alternate_target_location = should_use_alternate_target_location + self.is_non_recoverable = is_non_recoverable + self.alternate_directory_paths = alternate_directory_paths + + +class AzureWorkloadSQLPointInTimeRestoreRequest(AzureWorkloadSQLRestoreRequest): + """AzureWorkload SQL -specific restore. Specifically for PointInTime/Log restore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param should_use_alternate_target_location: Default option set to true. If this is set to + false, alternate data directory must be provided. + :type should_use_alternate_target_location: bool + :param is_non_recoverable: SQL specific property where user can chose to set no-recovery when + restore operation is tried. + :type is_non_recoverable: bool + :param alternate_directory_paths: Data directory details. + :type alternate_directory_paths: + list[~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectoryMapping] + :param point_in_time: PointInTime value. + :type point_in_time: ~datetime.datetime + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'should_use_alternate_target_location': {'key': 'shouldUseAlternateTargetLocation', 'type': 'bool'}, + 'is_non_recoverable': {'key': 'isNonRecoverable', 'type': 'bool'}, + 'alternate_directory_paths': {'key': 'alternateDirectoryPaths', 'type': '[SQLDataDirectoryMapping]'}, + 'point_in_time': {'key': 'pointInTime', 'type': 'iso-8601'}, + } + + _subtype_map = { + 'object_type': {'AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest': 'AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest'} + } + + def __init__( + self, + *, + recovery_type: Optional[Union[str, "RecoveryType"]] = None, + source_resource_id: Optional[str] = None, + property_bag: Optional[Dict[str, str]] = None, + target_info: Optional["TargetRestoreInfo"] = None, + recovery_mode: Optional[Union[str, "RecoveryMode"]] = None, + target_virtual_machine_id: Optional[str] = None, + should_use_alternate_target_location: Optional[bool] = None, + is_non_recoverable: Optional[bool] = None, + alternate_directory_paths: Optional[List["SQLDataDirectoryMapping"]] = None, + point_in_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(AzureWorkloadSQLPointInTimeRestoreRequest, self).__init__(recovery_type=recovery_type, source_resource_id=source_resource_id, property_bag=property_bag, target_info=target_info, recovery_mode=recovery_mode, target_virtual_machine_id=target_virtual_machine_id, should_use_alternate_target_location=should_use_alternate_target_location, is_non_recoverable=is_non_recoverable, alternate_directory_paths=alternate_directory_paths, **kwargs) + self.object_type = 'AzureWorkloadSQLPointInTimeRestoreRequest' # type: str + self.point_in_time = point_in_time + + +class AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest(AzureWorkloadSQLPointInTimeRestoreRequest): + """AzureWorkload SQL-specific restore with integrated rehydration of recovery point. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param should_use_alternate_target_location: Default option set to true. If this is set to + false, alternate data directory must be provided. + :type should_use_alternate_target_location: bool + :param is_non_recoverable: SQL specific property where user can chose to set no-recovery when + restore operation is tried. + :type is_non_recoverable: bool + :param alternate_directory_paths: Data directory details. + :type alternate_directory_paths: + list[~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectoryMapping] + :param point_in_time: PointInTime value. + :type point_in_time: ~datetime.datetime + :param recovery_point_rehydration_info: RP Rehydration Info. + :type recovery_point_rehydration_info: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointRehydrationInfo + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'should_use_alternate_target_location': {'key': 'shouldUseAlternateTargetLocation', 'type': 'bool'}, + 'is_non_recoverable': {'key': 'isNonRecoverable', 'type': 'bool'}, + 'alternate_directory_paths': {'key': 'alternateDirectoryPaths', 'type': '[SQLDataDirectoryMapping]'}, + 'point_in_time': {'key': 'pointInTime', 'type': 'iso-8601'}, + 'recovery_point_rehydration_info': {'key': 'recoveryPointRehydrationInfo', 'type': 'RecoveryPointRehydrationInfo'}, + } + + def __init__( + self, + *, + recovery_type: Optional[Union[str, "RecoveryType"]] = None, + source_resource_id: Optional[str] = None, + property_bag: Optional[Dict[str, str]] = None, + target_info: Optional["TargetRestoreInfo"] = None, + recovery_mode: Optional[Union[str, "RecoveryMode"]] = None, + target_virtual_machine_id: Optional[str] = None, + should_use_alternate_target_location: Optional[bool] = None, + is_non_recoverable: Optional[bool] = None, + alternate_directory_paths: Optional[List["SQLDataDirectoryMapping"]] = None, + point_in_time: Optional[datetime.datetime] = None, + recovery_point_rehydration_info: Optional["RecoveryPointRehydrationInfo"] = None, + **kwargs + ): + super(AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, self).__init__(recovery_type=recovery_type, source_resource_id=source_resource_id, property_bag=property_bag, target_info=target_info, recovery_mode=recovery_mode, target_virtual_machine_id=target_virtual_machine_id, should_use_alternate_target_location=should_use_alternate_target_location, is_non_recoverable=is_non_recoverable, alternate_directory_paths=alternate_directory_paths, point_in_time=point_in_time, **kwargs) + self.object_type = 'AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest' # type: str + self.recovery_point_rehydration_info = recovery_point_rehydration_info + + +class AzureWorkloadSQLRecoveryPointExtendedInfo(msrest.serialization.Model): + """Extended info class details. + + :param data_directory_time_in_utc: UTC time at which data directory info was captured. + :type data_directory_time_in_utc: ~datetime.datetime + :param data_directory_paths: List of data directory paths during restore operation. + :type data_directory_paths: list[~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectory] + """ + + _attribute_map = { + 'data_directory_time_in_utc': {'key': 'dataDirectoryTimeInUTC', 'type': 'iso-8601'}, + 'data_directory_paths': {'key': 'dataDirectoryPaths', 'type': '[SQLDataDirectory]'}, + } + + def __init__( + self, + *, + data_directory_time_in_utc: Optional[datetime.datetime] = None, + data_directory_paths: Optional[List["SQLDataDirectory"]] = None, + **kwargs + ): + super(AzureWorkloadSQLRecoveryPointExtendedInfo, self).__init__(**kwargs) + self.data_directory_time_in_utc = data_directory_time_in_utc + self.data_directory_paths = data_directory_paths + + +class AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated(msrest.serialization.Model): + """Extended info class details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar data_directory_time_in_utc: UTC time at which data directory info was captured. + :vartype data_directory_time_in_utc: ~datetime.datetime + :ivar data_directory_paths: List of data directory paths during restore operation. + :vartype data_directory_paths: list[~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectory] + """ + + _validation = { + 'data_directory_time_in_utc': {'readonly': True}, + 'data_directory_paths': {'readonly': True}, + } + + _attribute_map = { + 'data_directory_time_in_utc': {'key': 'dataDirectoryTimeInUTC', 'type': 'iso-8601'}, + 'data_directory_paths': {'key': 'dataDirectoryPaths', 'type': '[SQLDataDirectory]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureWorkloadSQLRecoveryPointExtendedInfoAutoGenerated, self).__init__(**kwargs) + self.data_directory_time_in_utc = None + self.data_directory_paths = None + + +class AzureWorkloadSQLRestoreWithRehydrateRequest(AzureWorkloadSQLRestoreRequest): + """AzureWorkload SQL-specific restore with integrated rehydration of recovery point. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM on which workload that was running + is being recovered. + :type source_resource_id: str + :param property_bag: Workload specific property bag. + :type property_bag: dict[str, str] + :param target_info: Details of target database. + :type target_info: ~azure.mgmt.recoveryservicesbackup.models.TargetRestoreInfo + :param recovery_mode: Defines whether the current recovery mode is file restore or database + restore. Possible values include: "Invalid", "FileRecovery", "WorkloadRecovery". + :type recovery_mode: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryMode + :param target_virtual_machine_id: This is the complete ARM Id of the target VM + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param should_use_alternate_target_location: Default option set to true. If this is set to + false, alternate data directory must be provided. + :type should_use_alternate_target_location: bool + :param is_non_recoverable: SQL specific property where user can chose to set no-recovery when + restore operation is tried. + :type is_non_recoverable: bool + :param alternate_directory_paths: Data directory details. + :type alternate_directory_paths: + list[~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectoryMapping] + :param recovery_point_rehydration_info: RP Rehydration Info. + :type recovery_point_rehydration_info: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointRehydrationInfo + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'target_info': {'key': 'targetInfo', 'type': 'TargetRestoreInfo'}, + 'recovery_mode': {'key': 'recoveryMode', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'should_use_alternate_target_location': {'key': 'shouldUseAlternateTargetLocation', 'type': 'bool'}, + 'is_non_recoverable': {'key': 'isNonRecoverable', 'type': 'bool'}, + 'alternate_directory_paths': {'key': 'alternateDirectoryPaths', 'type': '[SQLDataDirectoryMapping]'}, + 'recovery_point_rehydration_info': {'key': 'recoveryPointRehydrationInfo', 'type': 'RecoveryPointRehydrationInfo'}, + } + + def __init__( + self, + *, + recovery_type: Optional[Union[str, "RecoveryType"]] = None, + source_resource_id: Optional[str] = None, + property_bag: Optional[Dict[str, str]] = None, + target_info: Optional["TargetRestoreInfo"] = None, + recovery_mode: Optional[Union[str, "RecoveryMode"]] = None, + target_virtual_machine_id: Optional[str] = None, + should_use_alternate_target_location: Optional[bool] = None, + is_non_recoverable: Optional[bool] = None, + alternate_directory_paths: Optional[List["SQLDataDirectoryMapping"]] = None, + recovery_point_rehydration_info: Optional["RecoveryPointRehydrationInfo"] = None, + **kwargs + ): + super(AzureWorkloadSQLRestoreWithRehydrateRequest, self).__init__(recovery_type=recovery_type, source_resource_id=source_resource_id, property_bag=property_bag, target_info=target_info, recovery_mode=recovery_mode, target_virtual_machine_id=target_virtual_machine_id, should_use_alternate_target_location=should_use_alternate_target_location, is_non_recoverable=is_non_recoverable, alternate_directory_paths=alternate_directory_paths, **kwargs) + self.object_type = 'AzureWorkloadSQLRestoreWithRehydrateRequest' # type: str + self.recovery_point_rehydration_info = recovery_point_rehydration_info + + +class BackupEngineBaseResource(Resource): + """The base backup engine class. All workload specific backup engines derive from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: BackupEngineBaseResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.BackupEngineBase + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BackupEngineBase'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["BackupEngineBase"] = None, + **kwargs + ): + super(BackupEngineBaseResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class ResourceList(msrest.serialization.Model): + """Base for all lists of resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(ResourceList, self).__init__(**kwargs) + self.next_link = next_link + + +class BackupEngineBaseResourceList(ResourceList): + """List of BackupEngineBase resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.BackupEngineBaseResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[BackupEngineBaseResource]'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["BackupEngineBaseResource"]] = None, + **kwargs + ): + super(BackupEngineBaseResourceList, self).__init__(next_link=next_link, **kwargs) + self.value = value + + +class BackupEngineExtendedInfo(msrest.serialization.Model): + """Additional information on backup engine. + + :param database_name: Database name of backup engine. + :type database_name: str + :param protected_items_count: Number of protected items in the backup engine. + :type protected_items_count: int + :param protected_servers_count: Number of protected servers in the backup engine. + :type protected_servers_count: int + :param disk_count: Number of disks in the backup engine. + :type disk_count: int + :param used_disk_space: Disk space used in the backup engine. + :type used_disk_space: float + :param available_disk_space: Disk space currently available in the backup engine. + :type available_disk_space: float + :param refreshed_at: Last refresh time in the backup engine. + :type refreshed_at: ~datetime.datetime + :param azure_protected_instances: Protected instances in the backup engine. + :type azure_protected_instances: int + """ + + _attribute_map = { + 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'protected_servers_count': {'key': 'protectedServersCount', 'type': 'int'}, + 'disk_count': {'key': 'diskCount', 'type': 'int'}, + 'used_disk_space': {'key': 'usedDiskSpace', 'type': 'float'}, + 'available_disk_space': {'key': 'availableDiskSpace', 'type': 'float'}, + 'refreshed_at': {'key': 'refreshedAt', 'type': 'iso-8601'}, + 'azure_protected_instances': {'key': 'azureProtectedInstances', 'type': 'int'}, + } + + def __init__( + self, + *, + database_name: Optional[str] = None, + protected_items_count: Optional[int] = None, + protected_servers_count: Optional[int] = None, + disk_count: Optional[int] = None, + used_disk_space: Optional[float] = None, + available_disk_space: Optional[float] = None, + refreshed_at: Optional[datetime.datetime] = None, + azure_protected_instances: Optional[int] = None, + **kwargs + ): + super(BackupEngineExtendedInfo, self).__init__(**kwargs) + self.database_name = database_name + self.protected_items_count = protected_items_count + self.protected_servers_count = protected_servers_count + self.disk_count = disk_count + self.used_disk_space = used_disk_space + self.available_disk_space = available_disk_space + self.refreshed_at = refreshed_at + self.azure_protected_instances = azure_protected_instances + + +class BackupManagementUsage(msrest.serialization.Model): + """Backup management 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.recoveryservicesbackup.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.recoveryservicesbackup.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, + *, + unit: Optional[Union[str, "UsagesUnit"]] = None, + quota_period: Optional[str] = None, + next_reset_time: Optional[datetime.datetime] = None, + current_value: Optional[int] = None, + limit: Optional[int] = None, + name: Optional["NameInfo"] = None, + **kwargs + ): + super(BackupManagementUsage, self).__init__(**kwargs) + self.unit = unit + self.quota_period = quota_period + self.next_reset_time = next_reset_time + self.current_value = current_value + self.limit = limit + self.name = name + + +class BackupManagementUsageList(msrest.serialization.Model): + """Backup management usage for vault. + + :param value: The list of backup management usages for the given vault. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.BackupManagementUsage] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BackupManagementUsage]'}, + } + + def __init__( + self, + *, + value: Optional[List["BackupManagementUsage"]] = None, + **kwargs + ): + super(BackupManagementUsageList, self).__init__(**kwargs) + self.value = value + + +class BackupRequestResource(Resource): + """Base class for backup request. Workload-specific backup requests are derived from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: BackupRequestResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.BackupRequest + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BackupRequest'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["BackupRequest"] = None, + **kwargs + ): + super(BackupRequestResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class BackupResourceConfig(msrest.serialization.Model): + """The resource storage details. + + :param storage_model_type: Storage type. Possible values include: "Invalid", "GeoRedundant", + "LocallyRedundant", "ZoneRedundant", "ReadAccessGeoZoneRedundant". + :type storage_model_type: str or ~azure.mgmt.recoveryservicesbackup.models.StorageType + :param storage_type: Storage type. Possible values include: "Invalid", "GeoRedundant", + "LocallyRedundant", "ZoneRedundant", "ReadAccessGeoZoneRedundant". + :type storage_type: str or ~azure.mgmt.recoveryservicesbackup.models.StorageType + :param storage_type_state: Locked or Unlocked. Once a machine is registered against a resource, + the storageTypeState is always Locked. Possible values include: "Invalid", "Locked", + "Unlocked". + :type storage_type_state: str or ~azure.mgmt.recoveryservicesbackup.models.StorageTypeState + :param cross_region_restore_flag: Opt in details of Cross Region Restore feature. + :type cross_region_restore_flag: bool + """ + + _attribute_map = { + 'storage_model_type': {'key': 'storageModelType', 'type': 'str'}, + 'storage_type': {'key': 'storageType', 'type': 'str'}, + 'storage_type_state': {'key': 'storageTypeState', 'type': 'str'}, + 'cross_region_restore_flag': {'key': 'crossRegionRestoreFlag', 'type': 'bool'}, + } + + def __init__( + self, + *, + storage_model_type: Optional[Union[str, "StorageType"]] = None, + storage_type: Optional[Union[str, "StorageType"]] = None, + storage_type_state: Optional[Union[str, "StorageTypeState"]] = None, + cross_region_restore_flag: Optional[bool] = None, + **kwargs + ): + super(BackupResourceConfig, self).__init__(**kwargs) + self.storage_model_type = storage_model_type + self.storage_type = storage_type + self.storage_type_state = storage_type_state + self.cross_region_restore_flag = cross_region_restore_flag + + +class BackupResourceConfigResource(Resource): + """The resource storage details. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: BackupResourceConfigResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceConfig + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BackupResourceConfig'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["BackupResourceConfig"] = None, + **kwargs + ): + super(BackupResourceConfigResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class BackupResourceEncryptionConfig(msrest.serialization.Model): + """BackupResourceEncryptionConfig. + + :param encryption_at_rest_type: Encryption At Rest Type. Possible values include: "Invalid", + "MicrosoftManaged", "CustomerManaged". + :type encryption_at_rest_type: str or + ~azure.mgmt.recoveryservicesbackup.models.EncryptionAtRestType + :param key_uri: Key Vault Key URI. + :type key_uri: str + :param subscription_id: Key Vault Subscription Id. + :type subscription_id: str + :param last_update_status: Possible values include: "Invalid", "NotEnabled", + "PartiallySucceeded", "PartiallyFailed", "Failed", "Succeeded". + :type last_update_status: str or ~azure.mgmt.recoveryservicesbackup.models.LastUpdateStatus + :param infrastructure_encryption_state: Possible values include: "Invalid", "Disabled", + "Enabled". + :type infrastructure_encryption_state: str or + ~azure.mgmt.recoveryservicesbackup.models.InfrastructureEncryptionState + """ + + _attribute_map = { + 'encryption_at_rest_type': {'key': 'encryptionAtRestType', 'type': 'str'}, + 'key_uri': {'key': 'keyUri', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'last_update_status': {'key': 'lastUpdateStatus', 'type': 'str'}, + 'infrastructure_encryption_state': {'key': 'infrastructureEncryptionState', 'type': 'str'}, + } + + def __init__( + self, + *, + encryption_at_rest_type: Optional[Union[str, "EncryptionAtRestType"]] = None, + key_uri: Optional[str] = None, + subscription_id: Optional[str] = None, + last_update_status: Optional[Union[str, "LastUpdateStatus"]] = None, + infrastructure_encryption_state: Optional[Union[str, "InfrastructureEncryptionState"]] = None, + **kwargs + ): + super(BackupResourceEncryptionConfig, self).__init__(**kwargs) + self.encryption_at_rest_type = encryption_at_rest_type + self.key_uri = key_uri + self.subscription_id = subscription_id + self.last_update_status = last_update_status + self.infrastructure_encryption_state = infrastructure_encryption_state + + +class BackupResourceEncryptionConfigResource(Resource): + """BackupResourceEncryptionConfigResource. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: BackupResourceEncryptionConfigResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceEncryptionConfig + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BackupResourceEncryptionConfig'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["BackupResourceEncryptionConfig"] = None, + **kwargs + ): + super(BackupResourceEncryptionConfigResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class BackupResourceVaultConfig(msrest.serialization.Model): + """Backup resource vault config details. + + :param storage_model_type: Storage type. Possible values include: "Invalid", "GeoRedundant", + "LocallyRedundant", "ZoneRedundant", "ReadAccessGeoZoneRedundant". + :type storage_model_type: str or ~azure.mgmt.recoveryservicesbackup.models.StorageType + :param storage_type: Storage type. Possible values include: "Invalid", "GeoRedundant", + "LocallyRedundant", "ZoneRedundant", "ReadAccessGeoZoneRedundant". + :type storage_type: str or ~azure.mgmt.recoveryservicesbackup.models.StorageType + :param storage_type_state: Locked or Unlocked. Once a machine is registered against a resource, + the storageTypeState is always Locked. Possible values include: "Invalid", "Locked", + "Unlocked". + :type storage_type_state: str or ~azure.mgmt.recoveryservicesbackup.models.StorageTypeState + :param enhanced_security_state: Enabled or Disabled. Possible values include: "Invalid", + "Enabled", "Disabled". + :type enhanced_security_state: str or + ~azure.mgmt.recoveryservicesbackup.models.EnhancedSecurityState + :param soft_delete_feature_state: Soft Delete feature state. Possible values include: + "Invalid", "Enabled", "Disabled". + :type soft_delete_feature_state: str or + ~azure.mgmt.recoveryservicesbackup.models.SoftDeleteFeatureState + """ + + _attribute_map = { + 'storage_model_type': {'key': 'storageModelType', 'type': 'str'}, + 'storage_type': {'key': 'storageType', 'type': 'str'}, + 'storage_type_state': {'key': 'storageTypeState', 'type': 'str'}, + 'enhanced_security_state': {'key': 'enhancedSecurityState', 'type': 'str'}, + 'soft_delete_feature_state': {'key': 'softDeleteFeatureState', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_model_type: Optional[Union[str, "StorageType"]] = None, + storage_type: Optional[Union[str, "StorageType"]] = None, + storage_type_state: Optional[Union[str, "StorageTypeState"]] = None, + enhanced_security_state: Optional[Union[str, "EnhancedSecurityState"]] = None, + soft_delete_feature_state: Optional[Union[str, "SoftDeleteFeatureState"]] = None, + **kwargs + ): + super(BackupResourceVaultConfig, self).__init__(**kwargs) + self.storage_model_type = storage_model_type + self.storage_type = storage_type + self.storage_type_state = storage_type_state + self.enhanced_security_state = enhanced_security_state + self.soft_delete_feature_state = soft_delete_feature_state + + +class BackupResourceVaultConfigResource(Resource): + """Backup resource vault config details. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: BackupResourceVaultConfigResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceVaultConfig + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BackupResourceVaultConfig'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["BackupResourceVaultConfig"] = None, + **kwargs + ): + super(BackupResourceVaultConfigResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class BackupStatusRequest(msrest.serialization.Model): + """BackupStatus request. + + :param resource_type: Container Type - VM, SQLPaaS, DPM, AzureFileShare... Possible values + include: "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", + "VMwareVM", "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type resource_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param resource_id: Entire ARM resource id of the resource. + :type resource_id: str + :param po_logical_name: Protectable Item Logical Name. + :type po_logical_name: str + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'po_logical_name': {'key': 'poLogicalName', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_type: Optional[Union[str, "DataSourceType"]] = None, + resource_id: Optional[str] = None, + po_logical_name: Optional[str] = None, + **kwargs + ): + super(BackupStatusRequest, self).__init__(**kwargs) + self.resource_type = resource_type + self.resource_id = resource_id + self.po_logical_name = po_logical_name + + +class BackupStatusResponse(msrest.serialization.Model): + """BackupStatus response. + + :param protection_status: Specifies whether the container is registered or not. Possible values + include: "Invalid", "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_status: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + :param vault_id: Specifies the arm resource id of the vault. + :type vault_id: str + :param fabric_name: Specifies the fabric name - Azure or AD. Possible values include: + "Invalid", "Azure". + :type fabric_name: str or ~azure.mgmt.recoveryservicesbackup.models.FabricName + :param container_name: Specifies the product specific container name. E.g. + iaasvmcontainer;iaasvmcontainer;csname;vmname. + :type container_name: str + :param protected_item_name: Specifies the product specific ds name. E.g. + vm;iaasvmcontainer;csname;vmname. + :type protected_item_name: str + :param error_code: ErrorCode in case of intent failed. + :type error_code: str + :param error_message: ErrorMessage in case of intent failed. + :type error_message: str + :param policy_name: Specifies the policy name which is used for protection. + :type policy_name: str + :param registration_status: Container registration status. + :type registration_status: str + """ + + _attribute_map = { + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + 'vault_id': {'key': 'vaultId', 'type': 'str'}, + 'fabric_name': {'key': 'fabricName', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'protected_item_name': {'key': 'protectedItemName', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + protection_status: Optional[Union[str, "ProtectionStatus"]] = None, + vault_id: Optional[str] = None, + fabric_name: Optional[Union[str, "FabricName"]] = None, + container_name: Optional[str] = None, + protected_item_name: Optional[str] = None, + error_code: Optional[str] = None, + error_message: Optional[str] = None, + policy_name: Optional[str] = None, + registration_status: Optional[str] = None, + **kwargs + ): + super(BackupStatusResponse, self).__init__(**kwargs) + self.protection_status = protection_status + self.vault_id = vault_id + self.fabric_name = fabric_name + self.container_name = container_name + self.protected_item_name = protected_item_name + self.error_code = error_code + self.error_message = error_message + self.policy_name = policy_name + self.registration_status = registration_status + + +class BEKDetails(msrest.serialization.Model): + """BEK is bitlocker encryption key. + + :param secret_url: Secret is BEK. + :type secret_url: str + :param secret_vault_id: ID of the Key Vault where this Secret is stored. + :type secret_vault_id: str + :param secret_data: BEK data. + :type secret_data: str + """ + + _attribute_map = { + 'secret_url': {'key': 'secretUrl', 'type': 'str'}, + 'secret_vault_id': {'key': 'secretVaultId', 'type': 'str'}, + 'secret_data': {'key': 'secretData', 'type': 'str'}, + } + + def __init__( + self, + *, + secret_url: Optional[str] = None, + secret_vault_id: Optional[str] = None, + secret_data: Optional[str] = None, + **kwargs + ): + super(BEKDetails, self).__init__(**kwargs) + self.secret_url = secret_url + self.secret_vault_id = secret_vault_id + self.secret_data = secret_data + + +class BMSAADPropertiesQueryObject(msrest.serialization.Model): + """Filters to list backup items. + + :param backup_management_type: Backup management type for the backed up item. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + **kwargs + ): + super(BMSAADPropertiesQueryObject, self).__init__(**kwargs) + self.backup_management_type = backup_management_type + + +class BMSBackupEngineQueryObject(msrest.serialization.Model): + """Query parameters to fetch list of backup engines. + + :param expand: attribute to add extended info. + :type expand: str + """ + + _attribute_map = { + 'expand': {'key': 'expand', 'type': 'str'}, + } + + def __init__( + self, + *, + expand: Optional[str] = None, + **kwargs + ): + super(BMSBackupEngineQueryObject, self).__init__(**kwargs) + self.expand = expand + + +class BMSBackupEnginesQueryObject(msrest.serialization.Model): + """Query parameters to fetch list of backup engines. + + :param backup_management_type: Backup management type for the backup engine. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param friendly_name: Friendly name of the backup engine. + :type friendly_name: str + :param expand: Attribute to add extended info. + :type expand: str + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'expand': {'key': 'expand', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + friendly_name: Optional[str] = None, + expand: Optional[str] = None, + **kwargs + ): + super(BMSBackupEnginesQueryObject, self).__init__(**kwargs) + self.backup_management_type = backup_management_type + self.friendly_name = friendly_name + self.expand = expand + + +class BMSBackupSummariesQueryObject(msrest.serialization.Model): + """Query parameters to fetch backup summaries. + + :param type: Backup management type for this container. Possible values include: "Invalid", + "BackupProtectedItemCountSummary", "BackupProtectionContainerCountSummary". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.Type + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "Type"]] = None, + **kwargs + ): + super(BMSBackupSummariesQueryObject, self).__init__(**kwargs) + self.type = type + + +class BMSContainerQueryObject(msrest.serialization.Model): + """The query filters that can be used with the list containers API. + + All required parameters must be populated in order to send to Azure. + + :param backup_management_type: Required. Backup management type for this container. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param container_type: Type of container for filter. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param backup_engine_name: Backup engine name. + :type backup_engine_name: str + :param fabric_name: Fabric name for filter. + :type fabric_name: str + :param status: Status of registration of this container with the Recovery Services Vault. + :type status: str + :param friendly_name: Friendly name of this container. + :type friendly_name: str + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'backup_engine_name': {'key': 'backupEngineName', 'type': 'str'}, + 'fabric_name': {'key': 'fabricName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Union[str, "BackupManagementType"], + container_type: Optional[Union[str, "ContainerType"]] = None, + backup_engine_name: Optional[str] = None, + fabric_name: Optional[str] = None, + status: Optional[str] = None, + friendly_name: Optional[str] = None, + **kwargs + ): + super(BMSContainerQueryObject, self).__init__(**kwargs) + self.backup_management_type = backup_management_type + self.container_type = container_type + self.backup_engine_name = backup_engine_name + self.fabric_name = fabric_name + self.status = status + self.friendly_name = friendly_name + + +class BMSContainersInquiryQueryObject(msrest.serialization.Model): + """The query filters that can be used with the inquire container API. + + :param backup_management_type: Backup management type for this container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Workload type for this container. Possible values include: "Invalid", + "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", "SystemState", + "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", "SAPHanaDatabase", + "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "WorkloadType"]] = None, + **kwargs + ): + super(BMSContainersInquiryQueryObject, self).__init__(**kwargs) + self.backup_management_type = backup_management_type + self.workload_type = workload_type + + +class BMSPOQueryObject(msrest.serialization.Model): + """Filters to list items that can be backed up. + + :param backup_management_type: Backup management type. Possible values include: "Invalid", + "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", "AzureStorage", "AzureWorkload", + "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Workload type. Possible values include: "Invalid", "VM", "FileFolder", + "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", "SystemState", "Client", + "GenericDataSource", "SQLDataBase", "AzureFileShare", "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param container_name: Full name of the container whose Protectable Objects should be returned. + :type container_name: str + :param status: Backup status query parameter. + :type status: str + :param friendly_name: Friendly name. + :type friendly_name: str + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "WorkloadType"]] = None, + container_name: Optional[str] = None, + status: Optional[str] = None, + friendly_name: Optional[str] = None, + **kwargs + ): + super(BMSPOQueryObject, self).__init__(**kwargs) + self.backup_management_type = backup_management_type + self.workload_type = workload_type + self.container_name = container_name + self.status = status + self.friendly_name = friendly_name + + +class BMSRefreshContainersQueryObject(msrest.serialization.Model): + """The query filters that can be used with the refresh container API. + + :param backup_management_type: Backup management type for this container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + **kwargs + ): + super(BMSRefreshContainersQueryObject, self).__init__(**kwargs) + self.backup_management_type = backup_management_type + + +class BMSRPQueryObject(msrest.serialization.Model): + """Filters to list backup copies. + + :param start_date: Backup copies created after this time. + :type start_date: ~datetime.datetime + :param end_date: Backup copies created before this time. + :type end_date: ~datetime.datetime + :param restore_point_query_type: RestorePoint type. Possible values include: "Invalid", "Full", + "Log", "Differential", "FullAndDifferential", "All", "Incremental". + :type restore_point_query_type: str or + ~azure.mgmt.recoveryservicesbackup.models.RestorePointQueryType + :param extended_info: In Get Recovery Point, it tells whether extended information about + recovery point is asked. + :type extended_info: bool + :param move_ready_rp_only: Whether the RP can be moved to another tier. + :type move_ready_rp_only: bool + """ + + _attribute_map = { + 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, + 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, + 'restore_point_query_type': {'key': 'restorePointQueryType', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'bool'}, + 'move_ready_rp_only': {'key': 'moveReadyRPOnly', 'type': 'bool'}, + } + + def __init__( + self, + *, + start_date: Optional[datetime.datetime] = None, + end_date: Optional[datetime.datetime] = None, + restore_point_query_type: Optional[Union[str, "RestorePointQueryType"]] = None, + extended_info: Optional[bool] = None, + move_ready_rp_only: Optional[bool] = None, + **kwargs + ): + super(BMSRPQueryObject, self).__init__(**kwargs) + self.start_date = start_date + self.end_date = end_date + self.restore_point_query_type = restore_point_query_type + self.extended_info = extended_info + self.move_ready_rp_only = move_ready_rp_only + + +class BMSWorkloadItemQueryObject(msrest.serialization.Model): + """Filters to list items that can be backed up. + + :param backup_management_type: Backup management type. Possible values include: "Invalid", + "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", "AzureStorage", "AzureWorkload", + "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_item_type: Workload Item type. Possible values include: "Invalid", + "SQLInstance", "SQLDataBase", "SAPHanaSystem", "SAPHanaDatabase", "SAPAseSystem", + "SAPAseDatabase". + :type workload_item_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadItemType + :param workload_type: Workload type. Possible values include: "Invalid", "VM", "FileFolder", + "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", "SystemState", "Client", + "GenericDataSource", "SQLDataBase", "AzureFileShare", "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param protection_status: Backup status query parameter. Possible values include: "Invalid", + "NotProtected", "Protecting", "Protected", "ProtectionFailed". + :type protection_status: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionStatus + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_item_type': {'key': 'workloadItemType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_item_type: Optional[Union[str, "WorkloadItemType"]] = None, + workload_type: Optional[Union[str, "WorkloadType"]] = None, + protection_status: Optional[Union[str, "ProtectionStatus"]] = None, + **kwargs + ): + super(BMSWorkloadItemQueryObject, self).__init__(**kwargs) + self.backup_management_type = backup_management_type + self.workload_item_type = workload_item_type + self.workload_type = workload_type + self.protection_status = protection_status + + +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, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(ClientDiscoveryDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ClientDiscoveryForLogSpecification(msrest.serialization.Model): + """Class to represent shoebox log specification in json client discovery. + + :param name: Name for shoebox log specification. + :type name: str + :param display_name: Localized display name. + :type display_name: str + :param blob_duration: blob duration of shoebox log specification. + :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, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + blob_duration: Optional[str] = None, + **kwargs + ): + super(ClientDiscoveryForLogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration + + +class ClientDiscoveryForProperties(msrest.serialization.Model): + """Class to represent shoebox properties in json client discovery. + + :param service_specification: Operation properties. + :type service_specification: + ~azure.mgmt.recoveryservicesbackup.models.ClientDiscoveryForServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ClientDiscoveryForServiceSpecification'}, + } + + def __init__( + self, + *, + service_specification: Optional["ClientDiscoveryForServiceSpecification"] = None, + **kwargs + ): + super(ClientDiscoveryForProperties, self).__init__(**kwargs) + self.service_specification = service_specification + + +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.recoveryservicesbackup.models.ClientDiscoveryForLogSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[ClientDiscoveryForLogSpecification]'}, + } + + def __init__( + self, + *, + log_specifications: Optional[List["ClientDiscoveryForLogSpecification"]] = None, + **kwargs + ): + super(ClientDiscoveryForServiceSpecification, self).__init__(**kwargs) + self.log_specifications = log_specifications + + +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.recoveryservicesbackup.models.ClientDiscoveryValueForSingleApi] + :param next_link: Link to the next chunk of Response. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ClientDiscoveryValueForSingleApi]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ClientDiscoveryValueForSingleApi"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ClientDiscoveryResponse, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +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.recoveryservicesbackup.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.recoveryservicesbackup.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, + *, + name: Optional[str] = None, + display: Optional["ClientDiscoveryDisplay"] = None, + origin: Optional[str] = None, + properties: Optional["ClientDiscoveryForProperties"] = None, + **kwargs + ): + super(ClientDiscoveryValueForSingleApi, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties + + +class ClientScriptForConnect(msrest.serialization.Model): + """Client script details for file / folder restore. + + :param script_content: File content of the client script for file / folder restore. + :type script_content: str + :param script_extension: File extension of the client script for file / folder restore - .ps1 , + .sh , etc. + :type script_extension: str + :param os_type: OS type - Windows, Linux etc. for which this file / folder restore client + script works. + :type os_type: str + :param url: URL of Executable from where to source the content. If this is not null then + ScriptContent should not be used. + :type url: str + :param script_name_suffix: Mandatory suffix that should be added to the name of script that is + given for download to user. + If its null or empty then , ignore it. + :type script_name_suffix: str + """ + + _attribute_map = { + 'script_content': {'key': 'scriptContent', 'type': 'str'}, + 'script_extension': {'key': 'scriptExtension', 'type': 'str'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'script_name_suffix': {'key': 'scriptNameSuffix', 'type': 'str'}, + } + + def __init__( + self, + *, + script_content: Optional[str] = None, + script_extension: Optional[str] = None, + os_type: Optional[str] = None, + url: Optional[str] = None, + script_name_suffix: Optional[str] = None, + **kwargs + ): + super(ClientScriptForConnect, self).__init__(**kwargs) + self.script_content = script_content + self.script_extension = script_extension + self.os_type = os_type + self.url = url + self.script_name_suffix = script_name_suffix + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from the Container Instance service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user + interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in + error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.recoveryservicesbackup.models.CloudErrorBody] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.recoveryservicesbackup.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ContainerIdentityInfo(msrest.serialization.Model): + """Container identity information. + + :param unique_name: Unique name of the container. + :type unique_name: str + :param aad_tenant_id: Protection container identity - AAD Tenant. + :type aad_tenant_id: str + :param service_principal_client_id: Protection container identity - AAD Service Principal. + :type service_principal_client_id: str + :param audience: Protection container identity - Audience. + :type audience: str + """ + + _attribute_map = { + 'unique_name': {'key': 'uniqueName', 'type': 'str'}, + 'aad_tenant_id': {'key': 'aadTenantId', 'type': 'str'}, + 'service_principal_client_id': {'key': 'servicePrincipalClientId', 'type': 'str'}, + 'audience': {'key': 'audience', 'type': 'str'}, + } + + def __init__( + self, + *, + unique_name: Optional[str] = None, + aad_tenant_id: Optional[str] = None, + service_principal_client_id: Optional[str] = None, + audience: Optional[str] = None, + **kwargs + ): + super(ContainerIdentityInfo, self).__init__(**kwargs) + self.unique_name = unique_name + self.aad_tenant_id = aad_tenant_id + self.service_principal_client_id = service_principal_client_id + self.audience = audience + + +class CrossRegionRestoreRequest(msrest.serialization.Model): + """CrossRegionRestoreRequest. + + :param cross_region_restore_access_details: Access details for cross region restore. + :type cross_region_restore_access_details: + ~azure.mgmt.recoveryservicesbackup.models.CrrAccessToken + :param restore_request: Request object for triggering restore. + :type restore_request: ~azure.mgmt.recoveryservicesbackup.models.RestoreRequest + """ + + _attribute_map = { + 'cross_region_restore_access_details': {'key': 'crossRegionRestoreAccessDetails', 'type': 'CrrAccessToken'}, + 'restore_request': {'key': 'restoreRequest', 'type': 'RestoreRequest'}, + } + + def __init__( + self, + *, + cross_region_restore_access_details: Optional["CrrAccessToken"] = None, + restore_request: Optional["RestoreRequest"] = None, + **kwargs + ): + super(CrossRegionRestoreRequest, self).__init__(**kwargs) + self.cross_region_restore_access_details = cross_region_restore_access_details + self.restore_request = restore_request + + +class CrossRegionRestoreRequestResource(Resource): + """CrossRegionRestoreRequestResource. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: CrossRegionRestoreRequestResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.CrossRegionRestoreRequest + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CrossRegionRestoreRequest'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["CrossRegionRestoreRequest"] = None, + **kwargs + ): + super(CrossRegionRestoreRequestResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class CrrAccessToken(msrest.serialization.Model): + """CrrAccessToken. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: WorkloadCrrAccessToken. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Type of the specific object - used for deserializing.Constant + filled by server. + :type object_type: str + :param access_token_string: Access token used for authentication. + :type access_token_string: str + :param subscription_id: Subscription Id of the source vault. + :type subscription_id: str + :param resource_group_name: Resource Group name of the source vault. + :type resource_group_name: str + :param resource_name: Resource Name of the source vault. + :type resource_name: str + :param resource_id: Resource Id of the source vault. + :type resource_id: str + :param protection_container_id: Protected item container id. + :type protection_container_id: long + :param recovery_point_id: Recovery Point Id. + :type recovery_point_id: str + :param recovery_point_time: Recovery Point Time. + :type recovery_point_time: str + :param container_name: Container Unique name. + :type container_name: str + :param container_type: Container Type. + :type container_type: str + :param backup_management_type: Backup Management Type. + :type backup_management_type: str + :param datasource_type: Datasource Type. + :type datasource_type: str + :param datasource_name: Datasource Friendly Name. + :type datasource_name: str + :param datasource_id: Datasource Id. + :type datasource_id: str + :param datasource_container_name: Datasource Container Unique Name. + :type datasource_container_name: str + :param coordinator_service_stamp_id: CoordinatorServiceStampId to be used by BCM in restore + call. + :type coordinator_service_stamp_id: str + :param coordinator_service_stamp_uri: CoordinatorServiceStampUri to be used by BCM in restore + call. + :type coordinator_service_stamp_uri: str + :param protection_service_stamp_id: ProtectionServiceStampId to be used by BCM in restore call. + :type protection_service_stamp_id: str + :param protection_service_stamp_uri: ProtectionServiceStampUri to be used by BCM in restore + call. + :type protection_service_stamp_uri: str + :param token_extended_information: Extended Information about the token like FileSpec etc. + :type token_extended_information: str + :param rp_tier_information: Recovery point Tier Information. + :type rp_tier_information: dict[str, str] + :param rp_original_sa_option: Recovery point information: Original SA option. + :type rp_original_sa_option: bool + :param rp_is_managed_virtual_machine: Recovery point information: Managed virtual machine. + :type rp_is_managed_virtual_machine: bool + :param rp_vm_size_description: Recovery point information: VM size description. + :type rp_vm_size_description: str + :param b_ms_active_region: Active region name of BMS Stamp. + :type b_ms_active_region: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'access_token_string': {'key': 'accessTokenString', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'protection_container_id': {'key': 'protectionContainerId', 'type': 'long'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'datasource_type': {'key': 'datasourceType', 'type': 'str'}, + 'datasource_name': {'key': 'datasourceName', 'type': 'str'}, + 'datasource_id': {'key': 'datasourceId', 'type': 'str'}, + 'datasource_container_name': {'key': 'datasourceContainerName', 'type': 'str'}, + 'coordinator_service_stamp_id': {'key': 'coordinatorServiceStampId', 'type': 'str'}, + 'coordinator_service_stamp_uri': {'key': 'coordinatorServiceStampUri', 'type': 'str'}, + 'protection_service_stamp_id': {'key': 'protectionServiceStampId', 'type': 'str'}, + 'protection_service_stamp_uri': {'key': 'protectionServiceStampUri', 'type': 'str'}, + 'token_extended_information': {'key': 'tokenExtendedInformation', 'type': 'str'}, + 'rp_tier_information': {'key': 'rpTierInformation', 'type': '{str}'}, + 'rp_original_sa_option': {'key': 'rpOriginalSAOption', 'type': 'bool'}, + 'rp_is_managed_virtual_machine': {'key': 'rpIsManagedVirtualMachine', 'type': 'bool'}, + 'rp_vm_size_description': {'key': 'rpVMSizeDescription', 'type': 'str'}, + 'b_ms_active_region': {'key': 'bMSActiveRegion', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'WorkloadCrrAccessToken': 'WorkloadCrrAccessToken'} + } + + def __init__( + self, + *, + access_token_string: Optional[str] = None, + subscription_id: Optional[str] = None, + resource_group_name: Optional[str] = None, + resource_name: Optional[str] = None, + resource_id: Optional[str] = None, + protection_container_id: Optional[int] = None, + recovery_point_id: Optional[str] = None, + recovery_point_time: Optional[str] = None, + container_name: Optional[str] = None, + container_type: Optional[str] = None, + backup_management_type: Optional[str] = None, + datasource_type: Optional[str] = None, + datasource_name: Optional[str] = None, + datasource_id: Optional[str] = None, + datasource_container_name: Optional[str] = None, + coordinator_service_stamp_id: Optional[str] = None, + coordinator_service_stamp_uri: Optional[str] = None, + protection_service_stamp_id: Optional[str] = None, + protection_service_stamp_uri: Optional[str] = None, + token_extended_information: Optional[str] = None, + rp_tier_information: Optional[Dict[str, str]] = None, + rp_original_sa_option: Optional[bool] = None, + rp_is_managed_virtual_machine: Optional[bool] = None, + rp_vm_size_description: Optional[str] = None, + b_ms_active_region: Optional[str] = None, + **kwargs + ): + super(CrrAccessToken, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + self.access_token_string = access_token_string + self.subscription_id = subscription_id + self.resource_group_name = resource_group_name + self.resource_name = resource_name + self.resource_id = resource_id + self.protection_container_id = protection_container_id + self.recovery_point_id = recovery_point_id + self.recovery_point_time = recovery_point_time + self.container_name = container_name + self.container_type = container_type + self.backup_management_type = backup_management_type + self.datasource_type = datasource_type + self.datasource_name = datasource_name + self.datasource_id = datasource_id + self.datasource_container_name = datasource_container_name + self.coordinator_service_stamp_id = coordinator_service_stamp_id + self.coordinator_service_stamp_uri = coordinator_service_stamp_uri + self.protection_service_stamp_id = protection_service_stamp_id + self.protection_service_stamp_uri = protection_service_stamp_uri + self.token_extended_information = token_extended_information + self.rp_tier_information = rp_tier_information + self.rp_original_sa_option = rp_original_sa_option + self.rp_is_managed_virtual_machine = rp_is_managed_virtual_machine + self.rp_vm_size_description = rp_vm_size_description + self.b_ms_active_region = b_ms_active_region + + +class CrrAccessTokenResource(Resource): + """CrrAccessTokenResource. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: CrrAccessTokenResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.CrrAccessToken + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CrrAccessToken'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["CrrAccessToken"] = None, + **kwargs + ): + super(CrrAccessTokenResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class CrrJobRequest(msrest.serialization.Model): + """Request object for fetching CRR jobs. + + :param resource_id: Entire ARM resource id of the resource. + :type resource_id: str + :param job_name: Job Name of the job to be fetched. + :type job_name: str + """ + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'job_name': {'key': 'jobName', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + job_name: Optional[str] = None, + **kwargs + ): + super(CrrJobRequest, self).__init__(**kwargs) + self.resource_id = resource_id + self.job_name = job_name + + +class CrrJobRequestResource(Resource): + """Request object for fetching CRR jobs. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: CrrJobRequestResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.CrrJobRequest + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CrrJobRequest'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["CrrJobRequest"] = None, + **kwargs + ): + super(CrrJobRequestResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class DailyRetentionFormat(msrest.serialization.Model): + """Daily retention format. + + :param days_of_the_month: List of days of the month. + :type days_of_the_month: list[~azure.mgmt.recoveryservicesbackup.models.Day] + """ + + _attribute_map = { + 'days_of_the_month': {'key': 'daysOfTheMonth', 'type': '[Day]'}, + } + + def __init__( + self, + *, + days_of_the_month: Optional[List["Day"]] = None, + **kwargs + ): + super(DailyRetentionFormat, self).__init__(**kwargs) + self.days_of_the_month = days_of_the_month + + +class DailyRetentionSchedule(msrest.serialization.Model): + """Daily retention schedule. + + :param retention_times: Retention times of retention policy. + :type retention_times: list[~datetime.datetime] + :param retention_duration: Retention duration of retention Policy. + :type retention_duration: ~azure.mgmt.recoveryservicesbackup.models.RetentionDuration + """ + + _attribute_map = { + 'retention_times': {'key': 'retentionTimes', 'type': '[iso-8601]'}, + 'retention_duration': {'key': 'retentionDuration', 'type': 'RetentionDuration'}, + } + + def __init__( + self, + *, + retention_times: Optional[List[datetime.datetime]] = None, + retention_duration: Optional["RetentionDuration"] = None, + **kwargs + ): + super(DailyRetentionSchedule, self).__init__(**kwargs) + self.retention_times = retention_times + self.retention_duration = retention_duration + + +class Day(msrest.serialization.Model): + """Day of the week. + + :param date: Date of the month. + :type date: int + :param is_last: Whether Date is last date of month. + :type is_last: bool + """ + + _attribute_map = { + 'date': {'key': 'date', 'type': 'int'}, + 'is_last': {'key': 'isLast', 'type': 'bool'}, + } + + def __init__( + self, + *, + date: Optional[int] = None, + is_last: Optional[bool] = None, + **kwargs + ): + super(Day, self).__init__(**kwargs) + self.date = date + self.is_last = is_last + + +class DiskExclusionProperties(msrest.serialization.Model): + """DiskExclusionProperties. + + :param disk_lun_list: List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. + :type disk_lun_list: list[int] + :param is_inclusion_list: Flag to indicate whether DiskLunList is to be included/ excluded from + backup. + :type is_inclusion_list: bool + """ + + _attribute_map = { + 'disk_lun_list': {'key': 'diskLunList', 'type': '[int]'}, + 'is_inclusion_list': {'key': 'isInclusionList', 'type': 'bool'}, + } + + def __init__( + self, + *, + disk_lun_list: Optional[List[int]] = None, + is_inclusion_list: Optional[bool] = None, + **kwargs + ): + super(DiskExclusionProperties, self).__init__(**kwargs) + self.disk_lun_list = disk_lun_list + self.is_inclusion_list = is_inclusion_list + + +class DiskInformation(msrest.serialization.Model): + """Disk information. + + :param lun: + :type lun: int + :param name: + :type name: str + """ + + _attribute_map = { + 'lun': {'key': 'lun', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + lun: Optional[int] = None, + name: Optional[str] = None, + **kwargs + ): + super(DiskInformation, self).__init__(**kwargs) + self.lun = lun + self.name = name + + +class DistributedNodesInfo(msrest.serialization.Model): + """This is used to represent the various nodes of the distributed container. + + :param node_name: Name of the node under a distributed container. + :type node_name: str + :param status: Status of this Node. + Failed | Succeeded. + :type status: str + :param error_detail: Error Details if the Status is non-success. + :type error_detail: ~azure.mgmt.recoveryservicesbackup.models.ErrorDetail + """ + + _attribute_map = { + 'node_name': {'key': 'nodeName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error_detail': {'key': 'errorDetail', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + node_name: Optional[str] = None, + status: Optional[str] = None, + error_detail: Optional["ErrorDetail"] = None, + **kwargs + ): + super(DistributedNodesInfo, self).__init__(**kwargs) + self.node_name = node_name + self.status = status + self.error_detail = error_detail + + +class DpmBackupEngine(BackupEngineBase): + """Data Protection Manager (DPM) specific backup engine. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the backup engine. + :type friendly_name: str + :param backup_management_type: Type of backup management for the backup engine. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Registration status of the backup engine with the Recovery Services + Vault. + :type registration_status: str + :param backup_engine_state: Status of the backup engine with the Recovery Services Vault. = + {Active/Deleting/DeleteFailed}. + :type backup_engine_state: str + :param health_status: Backup status of the backup engine. + :type health_status: str + :param backup_engine_type: Required. Type of the backup engine.Constant filled by server. + Possible values include: "Invalid", "DpmBackupEngine", "AzureBackupServerEngine". + :type backup_engine_type: str or ~azure.mgmt.recoveryservicesbackup.models.BackupEngineType + :param can_re_register: Flag indicating if the backup engine be registered, once already + registered. + :type can_re_register: bool + :param backup_engine_id: ID of the backup engine. + :type backup_engine_id: str + :param dpm_version: Backup engine version. + :type dpm_version: str + :param azure_backup_agent_version: Backup agent version. + :type azure_backup_agent_version: str + :param is_azure_backup_agent_upgrade_available: To check if backup agent upgrade available. + :type is_azure_backup_agent_upgrade_available: bool + :param is_dpm_upgrade_available: To check if backup engine upgrade available. + :type is_dpm_upgrade_available: bool + :param extended_info: Extended info of the backupengine. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.BackupEngineExtendedInfo + """ + + _validation = { + 'backup_engine_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'backup_engine_state': {'key': 'backupEngineState', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'backup_engine_type': {'key': 'backupEngineType', 'type': 'str'}, + 'can_re_register': {'key': 'canReRegister', 'type': 'bool'}, + 'backup_engine_id': {'key': 'backupEngineId', 'type': 'str'}, + 'dpm_version': {'key': 'dpmVersion', 'type': 'str'}, + 'azure_backup_agent_version': {'key': 'azureBackupAgentVersion', 'type': 'str'}, + 'is_azure_backup_agent_upgrade_available': {'key': 'isAzureBackupAgentUpgradeAvailable', 'type': 'bool'}, + 'is_dpm_upgrade_available': {'key': 'isDpmUpgradeAvailable', 'type': 'bool'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'BackupEngineExtendedInfo'}, + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + backup_engine_state: Optional[str] = None, + health_status: Optional[str] = None, + can_re_register: Optional[bool] = None, + backup_engine_id: Optional[str] = None, + dpm_version: Optional[str] = None, + azure_backup_agent_version: Optional[str] = None, + is_azure_backup_agent_upgrade_available: Optional[bool] = None, + is_dpm_upgrade_available: Optional[bool] = None, + extended_info: Optional["BackupEngineExtendedInfo"] = None, + **kwargs + ): + super(DpmBackupEngine, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, registration_status=registration_status, backup_engine_state=backup_engine_state, health_status=health_status, can_re_register=can_re_register, backup_engine_id=backup_engine_id, dpm_version=dpm_version, azure_backup_agent_version=azure_backup_agent_version, is_azure_backup_agent_upgrade_available=is_azure_backup_agent_upgrade_available, is_dpm_upgrade_available=is_dpm_upgrade_available, extended_info=extended_info, **kwargs) + self.backup_engine_type = 'DpmBackupEngine' # type: str + + +class DPMContainerExtendedInfo(msrest.serialization.Model): + """Additional information of the DPMContainer. + + :param last_refreshed_at: Last refresh time of the DPMContainer. + :type last_refreshed_at: ~datetime.datetime + """ + + _attribute_map = { + 'last_refreshed_at': {'key': 'lastRefreshedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + last_refreshed_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(DPMContainerExtendedInfo, self).__init__(**kwargs) + self.last_refreshed_at = last_refreshed_at + + +class DpmErrorInfo(msrest.serialization.Model): + """DPM workload-specific error information. + + :param error_string: Localized error string. + :type error_string: str + :param recommendations: List of localized recommendations for above error code. + :type recommendations: list[str] + """ + + _attribute_map = { + 'error_string': {'key': 'errorString', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + *, + error_string: Optional[str] = None, + recommendations: Optional[List[str]] = None, + **kwargs + ): + super(DpmErrorInfo, self).__init__(**kwargs) + self.error_string = error_string + self.recommendations = recommendations + + +class DpmJob(Job): + """DPM workload-specific job object. + + All required parameters must be populated in order to send to Azure. + + :param entity_friendly_name: Friendly name of the entity on which the current job is executing. + :type entity_friendly_name: str + :param backup_management_type: Backup management type to execute the current job. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: The operation name. + :type operation: str + :param status: Job status. + :type status: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param activity_id: ActivityId of job. + :type activity_id: str + :param job_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 job_type: str + :param duration: Time elapsed for job. + :type duration: ~datetime.timedelta + :param dpm_server_name: DPM server name managing the backup item or backup job. + :type dpm_server_name: str + :param container_name: Name of cluster/server protecting current backup item, if any. + :type container_name: str + :param container_type: Type of container. + :type container_type: str + :param workload_type: Type of backup item. + :type workload_type: str + :param actions_info: The state/actions applicable on this job like cancel/retry. + :type actions_info: list[str or ~azure.mgmt.recoveryservicesbackup.models.JobSupportedAction] + :param error_details: The errors. + :type error_details: list[~azure.mgmt.recoveryservicesbackup.models.DpmErrorInfo] + :param extended_info: Additional information for this job. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.DpmJobExtendedInfo + """ + + _validation = { + 'job_type': {'required': True}, + } + + _attribute_map = { + 'entity_friendly_name': {'key': 'entityFriendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'dpm_server_name': {'key': 'dpmServerName', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'actions_info': {'key': 'actionsInfo', 'type': '[str]'}, + 'error_details': {'key': 'errorDetails', 'type': '[DpmErrorInfo]'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'DpmJobExtendedInfo'}, + } + + def __init__( + self, + *, + entity_friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + operation: Optional[str] = None, + status: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + activity_id: Optional[str] = None, + duration: Optional[datetime.timedelta] = None, + dpm_server_name: Optional[str] = None, + container_name: Optional[str] = None, + container_type: Optional[str] = None, + workload_type: Optional[str] = None, + actions_info: Optional[List[Union[str, "JobSupportedAction"]]] = None, + error_details: Optional[List["DpmErrorInfo"]] = None, + extended_info: Optional["DpmJobExtendedInfo"] = None, + **kwargs + ): + super(DpmJob, self).__init__(entity_friendly_name=entity_friendly_name, backup_management_type=backup_management_type, operation=operation, status=status, start_time=start_time, end_time=end_time, activity_id=activity_id, **kwargs) + self.job_type = 'DpmJob' # type: str + self.duration = duration + self.dpm_server_name = dpm_server_name + self.container_name = container_name + self.container_type = container_type + self.workload_type = workload_type + self.actions_info = actions_info + self.error_details = error_details + self.extended_info = extended_info + + +class DpmJobExtendedInfo(msrest.serialization.Model): + """Additional information on the DPM workload-specific job. + + :param tasks_list: List of tasks associated with this job. + :type tasks_list: list[~azure.mgmt.recoveryservicesbackup.models.DpmJobTaskDetails] + :param property_bag: The job properties. + :type property_bag: dict[str, str] + :param dynamic_error_message: Non localized error message on job execution. + :type dynamic_error_message: str + """ + + _attribute_map = { + 'tasks_list': {'key': 'tasksList', 'type': '[DpmJobTaskDetails]'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'dynamic_error_message': {'key': 'dynamicErrorMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + tasks_list: Optional[List["DpmJobTaskDetails"]] = None, + property_bag: Optional[Dict[str, str]] = None, + dynamic_error_message: Optional[str] = None, + **kwargs + ): + super(DpmJobExtendedInfo, self).__init__(**kwargs) + self.tasks_list = tasks_list + self.property_bag = property_bag + self.dynamic_error_message = dynamic_error_message + + +class DpmJobTaskDetails(msrest.serialization.Model): + """DPM workload-specific job task details. + + :param task_id: The task display name. + :type task_id: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param duration: Time elapsed for task. + :type duration: ~datetime.timedelta + :param status: The status. + :type status: str + """ + + _attribute_map = { + 'task_id': {'key': 'taskId', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + task_id: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + duration: Optional[datetime.timedelta] = None, + status: Optional[str] = None, + **kwargs + ): + super(DpmJobTaskDetails, self).__init__(**kwargs) + self.task_id = task_id + self.start_time = start_time + self.end_time = end_time + self.duration = duration + self.status = status + + +class DPMProtectedItem(ProtectedItem): + """Additional information on Backup engine specific backup item. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the managed item. + :type friendly_name: str + :param backup_engine_name: Backup Management server protecting this backup item. + :type backup_engine_name: str + :param protection_state: Protection state of the backup engine. Possible values include: + "Invalid", "IRPending", "Protected", "ProtectionError", "ProtectionStopped", + "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemState + :param extended_info: Extended info of the backup item. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.DPMProtectedItemExtendedInfo + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_engine_name': {'key': 'backupEngineName', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'DPMProtectedItemExtendedInfo'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "DataSourceType"]] = None, + container_name: Optional[str] = None, + source_resource_id: Optional[str] = None, + policy_id: Optional[str] = None, + last_recovery_point: Optional[datetime.datetime] = None, + backup_set_name: Optional[str] = None, + create_mode: Optional[Union[str, "CreateMode"]] = None, + deferred_delete_time_in_utc: Optional[datetime.datetime] = None, + is_scheduled_for_deferred_delete: Optional[bool] = None, + deferred_delete_time_remaining: Optional[str] = None, + is_deferred_delete_schedule_upcoming: Optional[bool] = None, + is_rehydrate: Optional[bool] = None, + friendly_name: Optional[str] = None, + backup_engine_name: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectedItemState"]] = None, + extended_info: Optional["DPMProtectedItemExtendedInfo"] = None, + **kwargs + ): + super(DPMProtectedItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, container_name=container_name, source_resource_id=source_resource_id, policy_id=policy_id, last_recovery_point=last_recovery_point, backup_set_name=backup_set_name, create_mode=create_mode, deferred_delete_time_in_utc=deferred_delete_time_in_utc, is_scheduled_for_deferred_delete=is_scheduled_for_deferred_delete, deferred_delete_time_remaining=deferred_delete_time_remaining, is_deferred_delete_schedule_upcoming=is_deferred_delete_schedule_upcoming, is_rehydrate=is_rehydrate, **kwargs) + self.protected_item_type = 'DPMProtectedItem' # type: str + self.friendly_name = friendly_name + self.backup_engine_name = backup_engine_name + self.protection_state = protection_state + self.extended_info = extended_info + + +class DPMProtectedItemExtendedInfo(msrest.serialization.Model): + """Additional information of DPM Protected item. + + :param protectable_object_load_path: Attribute to provide information on various DBs. + :type protectable_object_load_path: dict[str, str] + :param protected: To check if backup item is disk protected. + :type protected: bool + :param is_present_on_cloud: To check if backup item is cloud protected. + :type is_present_on_cloud: bool + :param last_backup_status: Last backup status information on backup item. + :type last_backup_status: str + :param last_refreshed_at: Last refresh time on backup item. + :type last_refreshed_at: ~datetime.datetime + :param oldest_recovery_point: Oldest cloud recovery point time. + :type oldest_recovery_point: ~datetime.datetime + :param recovery_point_count: cloud recovery point count. + :type recovery_point_count: int + :param on_premise_oldest_recovery_point: Oldest disk recovery point time. + :type on_premise_oldest_recovery_point: ~datetime.datetime + :param on_premise_latest_recovery_point: latest disk recovery point time. + :type on_premise_latest_recovery_point: ~datetime.datetime + :param on_premise_recovery_point_count: disk recovery point count. + :type on_premise_recovery_point_count: int + :param is_collocated: To check if backup item is collocated. + :type is_collocated: bool + :param protection_group_name: Protection group name of the backup item. + :type protection_group_name: str + :param disk_storage_used_in_bytes: Used Disk storage in bytes. + :type disk_storage_used_in_bytes: str + :param total_disk_storage_size_in_bytes: total Disk storage in bytes. + :type total_disk_storage_size_in_bytes: str + """ + + _attribute_map = { + 'protectable_object_load_path': {'key': 'protectableObjectLoadPath', 'type': '{str}'}, + 'protected': {'key': 'protected', 'type': 'bool'}, + 'is_present_on_cloud': {'key': 'isPresentOnCloud', 'type': 'bool'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_refreshed_at': {'key': 'lastRefreshedAt', 'type': 'iso-8601'}, + 'oldest_recovery_point': {'key': 'oldestRecoveryPoint', 'type': 'iso-8601'}, + 'recovery_point_count': {'key': 'recoveryPointCount', 'type': 'int'}, + 'on_premise_oldest_recovery_point': {'key': 'onPremiseOldestRecoveryPoint', 'type': 'iso-8601'}, + 'on_premise_latest_recovery_point': {'key': 'onPremiseLatestRecoveryPoint', 'type': 'iso-8601'}, + 'on_premise_recovery_point_count': {'key': 'onPremiseRecoveryPointCount', 'type': 'int'}, + 'is_collocated': {'key': 'isCollocated', 'type': 'bool'}, + 'protection_group_name': {'key': 'protectionGroupName', 'type': 'str'}, + 'disk_storage_used_in_bytes': {'key': 'diskStorageUsedInBytes', 'type': 'str'}, + 'total_disk_storage_size_in_bytes': {'key': 'totalDiskStorageSizeInBytes', 'type': 'str'}, + } + + def __init__( + self, + *, + protectable_object_load_path: Optional[Dict[str, str]] = None, + protected: Optional[bool] = None, + is_present_on_cloud: Optional[bool] = None, + last_backup_status: Optional[str] = None, + last_refreshed_at: Optional[datetime.datetime] = None, + oldest_recovery_point: Optional[datetime.datetime] = None, + recovery_point_count: Optional[int] = None, + on_premise_oldest_recovery_point: Optional[datetime.datetime] = None, + on_premise_latest_recovery_point: Optional[datetime.datetime] = None, + on_premise_recovery_point_count: Optional[int] = None, + is_collocated: Optional[bool] = None, + protection_group_name: Optional[str] = None, + disk_storage_used_in_bytes: Optional[str] = None, + total_disk_storage_size_in_bytes: Optional[str] = None, + **kwargs + ): + super(DPMProtectedItemExtendedInfo, self).__init__(**kwargs) + self.protectable_object_load_path = protectable_object_load_path + self.protected = protected + self.is_present_on_cloud = is_present_on_cloud + self.last_backup_status = last_backup_status + self.last_refreshed_at = last_refreshed_at + self.oldest_recovery_point = oldest_recovery_point + self.recovery_point_count = recovery_point_count + self.on_premise_oldest_recovery_point = on_premise_oldest_recovery_point + self.on_premise_latest_recovery_point = on_premise_latest_recovery_point + self.on_premise_recovery_point_count = on_premise_recovery_point_count + self.is_collocated = is_collocated + self.protection_group_name = protection_group_name + self.disk_storage_used_in_bytes = disk_storage_used_in_bytes + self.total_disk_storage_size_in_bytes = total_disk_storage_size_in_bytes + + +class EncryptionDetails(msrest.serialization.Model): + """Details needed if the VM was encrypted at the time of backup. + + :param encryption_enabled: Identifies whether this backup copy represents an encrypted VM at + the time of backup. + :type encryption_enabled: bool + :param kek_url: Key Url. + :type kek_url: str + :param secret_key_url: Secret Url. + :type secret_key_url: str + :param kek_vault_id: ID of Key Vault where KEK is stored. + :type kek_vault_id: str + :param secret_key_vault_id: ID of Key Vault where Secret is stored. + :type secret_key_vault_id: str + """ + + _attribute_map = { + 'encryption_enabled': {'key': 'encryptionEnabled', 'type': 'bool'}, + 'kek_url': {'key': 'kekUrl', 'type': 'str'}, + 'secret_key_url': {'key': 'secretKeyUrl', 'type': 'str'}, + 'kek_vault_id': {'key': 'kekVaultId', 'type': 'str'}, + 'secret_key_vault_id': {'key': 'secretKeyVaultId', 'type': 'str'}, + } + + def __init__( + self, + *, + encryption_enabled: Optional[bool] = None, + kek_url: Optional[str] = None, + secret_key_url: Optional[str] = None, + kek_vault_id: Optional[str] = None, + secret_key_vault_id: Optional[str] = None, + **kwargs + ): + super(EncryptionDetails, self).__init__(**kwargs) + self.encryption_enabled = encryption_enabled + self.kek_url = kek_url + self.secret_key_url = secret_key_url + self.kek_vault_id = kek_vault_id + self.secret_key_vault_id = secret_key_vault_id + + +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 type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: str + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """Error Detail class which encapsulates Code, Message and Recommendations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error Message related to the Code. + :vartype message: str + :ivar recommendations: List of recommendation strings. + :vartype recommendations: list[str] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'recommendations': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.recommendations = None + + +class OperationResultInfoBase(msrest.serialization.Model): + """Base class for operation result info. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ExportJobsOperationResultInfo, OperationResultInfo. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'ExportJobsOperationResultInfo': 'ExportJobsOperationResultInfo', 'OperationResultInfo': 'OperationResultInfo'} + } + + def __init__( + self, + **kwargs + ): + super(OperationResultInfoBase, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class ExportJobsOperationResultInfo(OperationResultInfoBase): + """This class is used to send blob details after exporting jobs. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param blob_url: URL of the blob into which the serialized string of list of jobs is exported. + :type blob_url: str + :param blob_sas_key: SAS key to access the blob. It expires in 15 mins. + :type blob_sas_key: str + :param excel_file_blob_url: URL of the blob into which the ExcelFile is uploaded. + :type excel_file_blob_url: str + :param excel_file_blob_sas_key: SAS key to access the blob. It expires in 15 mins. + :type excel_file_blob_sas_key: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'blob_url': {'key': 'blobUrl', 'type': 'str'}, + 'blob_sas_key': {'key': 'blobSasKey', 'type': 'str'}, + 'excel_file_blob_url': {'key': 'excelFileBlobUrl', 'type': 'str'}, + 'excel_file_blob_sas_key': {'key': 'excelFileBlobSasKey', 'type': 'str'}, + } + + def __init__( + self, + *, + blob_url: Optional[str] = None, + blob_sas_key: Optional[str] = None, + excel_file_blob_url: Optional[str] = None, + excel_file_blob_sas_key: Optional[str] = None, + **kwargs + ): + super(ExportJobsOperationResultInfo, self).__init__(**kwargs) + self.object_type = 'ExportJobsOperationResultInfo' # type: str + self.blob_url = blob_url + self.blob_sas_key = blob_sas_key + self.excel_file_blob_url = excel_file_blob_url + self.excel_file_blob_sas_key = excel_file_blob_sas_key + + +class ExtendedProperties(msrest.serialization.Model): + """Extended Properties for Azure IaasVM Backup. + + :param disk_exclusion_properties: Extended Properties for Disk Exclusion. + :type disk_exclusion_properties: + ~azure.mgmt.recoveryservicesbackup.models.DiskExclusionProperties + """ + + _attribute_map = { + 'disk_exclusion_properties': {'key': 'diskExclusionProperties', 'type': 'DiskExclusionProperties'}, + } + + def __init__( + self, + *, + disk_exclusion_properties: Optional["DiskExclusionProperties"] = None, + **kwargs + ): + super(ExtendedProperties, self).__init__(**kwargs) + self.disk_exclusion_properties = disk_exclusion_properties + + +class GenericContainer(ProtectionContainer): + """Base class for generic container of backup items. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param fabric_name: Name of the container's fabric. + :type fabric_name: str + :param extended_information: Extended information (not returned in List container API calls). + :type extended_information: + ~azure.mgmt.recoveryservicesbackup.models.GenericContainerExtendedInfo + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'fabric_name': {'key': 'fabricName', 'type': 'str'}, + 'extended_information': {'key': 'extendedInformation', 'type': 'GenericContainerExtendedInfo'}, + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + health_status: Optional[str] = None, + fabric_name: Optional[str] = None, + extended_information: Optional["GenericContainerExtendedInfo"] = None, + **kwargs + ): + super(GenericContainer, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, registration_status=registration_status, health_status=health_status, **kwargs) + self.container_type = 'GenericContainer' # type: str + self.fabric_name = fabric_name + self.extended_information = extended_information + + +class GenericContainerExtendedInfo(msrest.serialization.Model): + """Container extended information. + + :param raw_cert_data: Public key of container cert. + :type raw_cert_data: str + :param container_identity_info: Container identity information. + :type container_identity_info: ~azure.mgmt.recoveryservicesbackup.models.ContainerIdentityInfo + :param service_endpoints: Azure Backup Service Endpoints for the container. + :type service_endpoints: dict[str, str] + """ + + _attribute_map = { + 'raw_cert_data': {'key': 'rawCertData', 'type': 'str'}, + 'container_identity_info': {'key': 'containerIdentityInfo', 'type': 'ContainerIdentityInfo'}, + 'service_endpoints': {'key': 'serviceEndpoints', 'type': '{str}'}, + } + + def __init__( + self, + *, + raw_cert_data: Optional[str] = None, + container_identity_info: Optional["ContainerIdentityInfo"] = None, + service_endpoints: Optional[Dict[str, str]] = None, + **kwargs + ): + super(GenericContainerExtendedInfo, self).__init__(**kwargs) + self.raw_cert_data = raw_cert_data + self.container_identity_info = container_identity_info + self.service_endpoints = service_endpoints + + +class GenericProtectedItem(ProtectedItem): + """Base class for backup items. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param policy_state: Indicates consistency of policy object and policy applied to this backup + item. + :type policy_state: str + :param protection_state: Backup state of this backup item. Possible values include: "Invalid", + "IRPending", "Protected", "ProtectionError", "ProtectionStopped", "ProtectionPaused". + :type protection_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProtectionState + :param protected_item_id: Data Plane Service ID of the protected item. + :type protected_item_id: long + :param source_associations: Loosely coupled (type, value) associations (example - parent of a + protected item). + :type source_associations: dict[str, str] + :param fabric_name: Name of this backup item's fabric. + :type fabric_name: str + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'policy_state': {'key': 'policyState', 'type': 'str'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'protected_item_id': {'key': 'protectedItemId', 'type': 'long'}, + 'source_associations': {'key': 'sourceAssociations', 'type': '{str}'}, + 'fabric_name': {'key': 'fabricName', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "DataSourceType"]] = None, + container_name: Optional[str] = None, + source_resource_id: Optional[str] = None, + policy_id: Optional[str] = None, + last_recovery_point: Optional[datetime.datetime] = None, + backup_set_name: Optional[str] = None, + create_mode: Optional[Union[str, "CreateMode"]] = None, + deferred_delete_time_in_utc: Optional[datetime.datetime] = None, + is_scheduled_for_deferred_delete: Optional[bool] = None, + deferred_delete_time_remaining: Optional[str] = None, + is_deferred_delete_schedule_upcoming: Optional[bool] = None, + is_rehydrate: Optional[bool] = None, + friendly_name: Optional[str] = None, + policy_state: Optional[str] = None, + protection_state: Optional[Union[str, "ProtectionState"]] = None, + protected_item_id: Optional[int] = None, + source_associations: Optional[Dict[str, str]] = None, + fabric_name: Optional[str] = None, + **kwargs + ): + super(GenericProtectedItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, container_name=container_name, source_resource_id=source_resource_id, policy_id=policy_id, last_recovery_point=last_recovery_point, backup_set_name=backup_set_name, create_mode=create_mode, deferred_delete_time_in_utc=deferred_delete_time_in_utc, is_scheduled_for_deferred_delete=is_scheduled_for_deferred_delete, deferred_delete_time_remaining=deferred_delete_time_remaining, is_deferred_delete_schedule_upcoming=is_deferred_delete_schedule_upcoming, is_rehydrate=is_rehydrate, **kwargs) + self.protected_item_type = 'GenericProtectedItem' # type: str + self.friendly_name = friendly_name + self.policy_state = policy_state + self.protection_state = protection_state + self.protected_item_id = protected_item_id + self.source_associations = source_associations + self.fabric_name = fabric_name + + +class GenericProtectionPolicy(ProtectionPolicy): + """Azure VM (Mercury) workload-specific backup policy. + + All required parameters must be populated in order to send to Azure. + + :param protected_items_count: Number of items associated with this policy. + :type protected_items_count: int + :param backup_management_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 backup_management_type: str + :param sub_protection_policy: List of sub-protection policies which includes schedule and + retention. + :type sub_protection_policy: + list[~azure.mgmt.recoveryservicesbackup.models.SubProtectionPolicy] + :param time_zone: TimeZone optional input as string. For example: TimeZone = "Pacific Standard + Time". + :type time_zone: str + :param fabric_name: Name of this policy's fabric. + :type fabric_name: str + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'sub_protection_policy': {'key': 'subProtectionPolicy', 'type': '[SubProtectionPolicy]'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'fabric_name': {'key': 'fabricName', 'type': 'str'}, + } + + def __init__( + self, + *, + protected_items_count: Optional[int] = None, + sub_protection_policy: Optional[List["SubProtectionPolicy"]] = None, + time_zone: Optional[str] = None, + fabric_name: Optional[str] = None, + **kwargs + ): + super(GenericProtectionPolicy, self).__init__(protected_items_count=protected_items_count, **kwargs) + self.backup_management_type = 'GenericProtectionPolicy' # type: str + self.sub_protection_policy = sub_protection_policy + self.time_zone = time_zone + self.fabric_name = fabric_name + + +class GenericRecoveryPoint(RecoveryPoint): + """Generic backup copy. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param friendly_name: Friendly name of the backup copy. + :type friendly_name: str + :param recovery_point_type: Type of the backup copy. + :type recovery_point_type: str + :param recovery_point_time: Time at which this backup copy was created. + :type recovery_point_time: ~datetime.datetime + :param recovery_point_additional_info: Additional information associated with this backup copy. + :type recovery_point_additional_info: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, + 'recovery_point_additional_info': {'key': 'recoveryPointAdditionalInfo', 'type': 'str'}, + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + recovery_point_type: Optional[str] = None, + recovery_point_time: Optional[datetime.datetime] = None, + recovery_point_additional_info: Optional[str] = None, + **kwargs + ): + super(GenericRecoveryPoint, self).__init__(**kwargs) + self.object_type = 'GenericRecoveryPoint' # type: str + self.friendly_name = friendly_name + self.recovery_point_type = recovery_point_type + self.recovery_point_time = recovery_point_time + self.recovery_point_additional_info = recovery_point_additional_info + + +class GetProtectedItemQueryObject(msrest.serialization.Model): + """Filters to list backup items. + + :param expand: Specifies if the additional information should be provided for this item. + :type expand: str + """ + + _attribute_map = { + 'expand': {'key': 'expand', 'type': 'str'}, + } + + def __init__( + self, + *, + expand: Optional[str] = None, + **kwargs + ): + super(GetProtectedItemQueryObject, self).__init__(**kwargs) + self.expand = expand + + +class IaasVMBackupRequest(BackupRequest): + """IaaS VM workload-specific backup request. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_expiry_time_in_utc: Backup copy will expire after the time specified + (UTC). + :type recovery_point_expiry_time_in_utc: ~datetime.datetime + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_expiry_time_in_utc': {'key': 'recoveryPointExpiryTimeInUTC', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + recovery_point_expiry_time_in_utc: Optional[datetime.datetime] = None, + **kwargs + ): + super(IaasVMBackupRequest, self).__init__(**kwargs) + self.object_type = 'IaasVMBackupRequest' # type: str + self.recovery_point_expiry_time_in_utc = recovery_point_expiry_time_in_utc + + +class IaasVMILRRegistrationRequest(ILRRequest): + """Restore files/folders from a backup copy of IaaS VM. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_id: ID of the IaaS VM backup copy from where the files/folders have to be + restored. + :type recovery_point_id: str + :param virtual_machine_id: Fully qualified ARM ID of the virtual machine whose the files / + folders have to be restored. + :type virtual_machine_id: str + :param initiator_name: iSCSI initiator name. + :type initiator_name: str + :param renew_existing_registration: Whether to renew existing registration with the iSCSI + server. + :type renew_existing_registration: bool + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'virtual_machine_id': {'key': 'virtualMachineId', 'type': 'str'}, + 'initiator_name': {'key': 'initiatorName', 'type': 'str'}, + 'renew_existing_registration': {'key': 'renewExistingRegistration', 'type': 'bool'}, + } + + def __init__( + self, + *, + recovery_point_id: Optional[str] = None, + virtual_machine_id: Optional[str] = None, + initiator_name: Optional[str] = None, + renew_existing_registration: Optional[bool] = None, + **kwargs + ): + super(IaasVMILRRegistrationRequest, self).__init__(**kwargs) + self.object_type = 'IaasVMILRRegistrationRequest' # type: str + self.recovery_point_id = recovery_point_id + self.virtual_machine_id = virtual_machine_id + self.initiator_name = initiator_name + self.renew_existing_registration = renew_existing_registration + + +class IaasVMRecoveryPoint(RecoveryPoint): + """IaaS VM workload specific backup copy. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_type: Type of the backup copy. + :type recovery_point_type: str + :param recovery_point_time: Time at which this backup copy was created. + :type recovery_point_time: ~datetime.datetime + :param recovery_point_additional_info: Additional information associated with this backup copy. + :type recovery_point_additional_info: str + :param source_vm_storage_type: Storage type of the VM whose backup copy is created. + :type source_vm_storage_type: str + :param is_source_vm_encrypted: Identifies whether the VM was encrypted when the backup copy is + created. + :type is_source_vm_encrypted: bool + :param key_and_secret: Required details for recovering an encrypted VM. Applicable only when + IsSourceVMEncrypted is true. + :type key_and_secret: ~azure.mgmt.recoveryservicesbackup.models.KeyAndSecretDetails + :param is_instant_ilr_session_active: Is the session to recover items from this backup copy + still active. + :type is_instant_ilr_session_active: bool + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param is_managed_virtual_machine: Whether VM is with Managed Disks. + :type is_managed_virtual_machine: bool + :param virtual_machine_size: Virtual Machine Size. + :type virtual_machine_size: str + :param original_storage_account_option: Original Storage Account Option. + :type original_storage_account_option: bool + :param os_type: OS type. + :type os_type: str + :param recovery_point_disk_configuration: Disk configuration. + :type recovery_point_disk_configuration: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointDiskConfiguration + :param zones: Identifies the zone of the VM at the time of backup. Applicable only for + zone-pinned Vms. + :type zones: list[str] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, + 'recovery_point_additional_info': {'key': 'recoveryPointAdditionalInfo', 'type': 'str'}, + 'source_vm_storage_type': {'key': 'sourceVMStorageType', 'type': 'str'}, + 'is_source_vm_encrypted': {'key': 'isSourceVMEncrypted', 'type': 'bool'}, + 'key_and_secret': {'key': 'keyAndSecret', 'type': 'KeyAndSecretDetails'}, + 'is_instant_ilr_session_active': {'key': 'isInstantIlrSessionActive', 'type': 'bool'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'is_managed_virtual_machine': {'key': 'isManagedVirtualMachine', 'type': 'bool'}, + 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, + 'original_storage_account_option': {'key': 'originalStorageAccountOption', 'type': 'bool'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'recovery_point_disk_configuration': {'key': 'recoveryPointDiskConfiguration', 'type': 'RecoveryPointDiskConfiguration'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + } + + def __init__( + self, + *, + recovery_point_type: Optional[str] = None, + recovery_point_time: Optional[datetime.datetime] = None, + recovery_point_additional_info: Optional[str] = None, + source_vm_storage_type: Optional[str] = None, + is_source_vm_encrypted: Optional[bool] = None, + key_and_secret: Optional["KeyAndSecretDetails"] = None, + is_instant_ilr_session_active: Optional[bool] = None, + recovery_point_tier_details: Optional[List["RecoveryPointTierInformation"]] = None, + is_managed_virtual_machine: Optional[bool] = None, + virtual_machine_size: Optional[str] = None, + original_storage_account_option: Optional[bool] = None, + os_type: Optional[str] = None, + recovery_point_disk_configuration: Optional["RecoveryPointDiskConfiguration"] = None, + zones: Optional[List[str]] = None, + recovery_point_move_readiness_info: Optional[Dict[str, "RecoveryPointMoveReadinessInfo"]] = None, + **kwargs + ): + super(IaasVMRecoveryPoint, self).__init__(**kwargs) + self.object_type = 'IaasVMRecoveryPoint' # type: str + self.recovery_point_type = recovery_point_type + self.recovery_point_time = recovery_point_time + self.recovery_point_additional_info = recovery_point_additional_info + self.source_vm_storage_type = source_vm_storage_type + self.is_source_vm_encrypted = is_source_vm_encrypted + self.key_and_secret = key_and_secret + self.is_instant_ilr_session_active = is_instant_ilr_session_active + self.recovery_point_tier_details = recovery_point_tier_details + self.is_managed_virtual_machine = is_managed_virtual_machine + self.virtual_machine_size = virtual_machine_size + self.original_storage_account_option = original_storage_account_option + self.os_type = os_type + self.recovery_point_disk_configuration = recovery_point_disk_configuration + self.zones = zones + self.recovery_point_move_readiness_info = recovery_point_move_readiness_info + + +class IaasVMRecoveryPointAutoGenerated(RecoveryPoint): + """IaaS VM workload specific backup copy. + + 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 object_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 object_type: str + :ivar recovery_point_type: Type of the backup copy. + :vartype recovery_point_type: str + :ivar recovery_point_time: Time at which this backup copy was created. + :vartype recovery_point_time: ~datetime.datetime + :ivar recovery_point_additional_info: Additional information associated with this backup copy. + :vartype recovery_point_additional_info: str + :ivar source_vm_storage_type: Storage type of the VM whose backup copy is created. + :vartype source_vm_storage_type: str + :ivar is_source_vm_encrypted: Identifies whether the VM was encrypted when the backup copy is + created. + :vartype is_source_vm_encrypted: bool + :param key_and_secret: Required details for recovering an encrypted VM. Applicable only when + IsSourceVMEncrypted is true. + :type key_and_secret: ~azure.mgmt.recoveryservicesbackup.models.KeyAndSecretDetails + :param is_instant_ilr_session_active: Is the session to recover items from this backup copy + still active. + :type is_instant_ilr_session_active: bool + :param recovery_point_tier_details: Recovery point tier information. + :type recovery_point_tier_details: + list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierInformation] + :param is_managed_virtual_machine: Whether VM is with Managed Disks. + :type is_managed_virtual_machine: bool + :param virtual_machine_size: Virtual Machine Size. + :type virtual_machine_size: str + :param original_storage_account_option: Original Storage Account Option. + :type original_storage_account_option: bool + :param os_type: OS type. + :type os_type: str + :param recovery_point_disk_configuration: Disk configuration. + :type recovery_point_disk_configuration: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointDiskConfiguration + :param zones: Identifies the zone of the VM at the time of backup. Applicable only for + zone-pinned Vms. + :type zones: list[str] + :param recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier. + :type recovery_point_move_readiness_info: dict[str, + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointMoveReadinessInfo] + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_type': {'readonly': True}, + 'recovery_point_time': {'readonly': True}, + 'recovery_point_additional_info': {'readonly': True}, + 'source_vm_storage_type': {'readonly': True}, + 'is_source_vm_encrypted': {'readonly': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, + 'recovery_point_additional_info': {'key': 'recoveryPointAdditionalInfo', 'type': 'str'}, + 'source_vm_storage_type': {'key': 'sourceVMStorageType', 'type': 'str'}, + 'is_source_vm_encrypted': {'key': 'isSourceVMEncrypted', 'type': 'bool'}, + 'key_and_secret': {'key': 'keyAndSecret', 'type': 'KeyAndSecretDetails'}, + 'is_instant_ilr_session_active': {'key': 'isInstantIlrSessionActive', 'type': 'bool'}, + 'recovery_point_tier_details': {'key': 'recoveryPointTierDetails', 'type': '[RecoveryPointTierInformation]'}, + 'is_managed_virtual_machine': {'key': 'isManagedVirtualMachine', 'type': 'bool'}, + 'virtual_machine_size': {'key': 'virtualMachineSize', 'type': 'str'}, + 'original_storage_account_option': {'key': 'originalStorageAccountOption', 'type': 'bool'}, + 'os_type': {'key': 'osType', 'type': 'str'}, + 'recovery_point_disk_configuration': {'key': 'recoveryPointDiskConfiguration', 'type': 'RecoveryPointDiskConfiguration'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'recovery_point_move_readiness_info': {'key': 'recoveryPointMoveReadinessInfo', 'type': '{RecoveryPointMoveReadinessInfo}'}, + } + + def __init__( + self, + *, + key_and_secret: Optional["KeyAndSecretDetails"] = None, + is_instant_ilr_session_active: Optional[bool] = None, + recovery_point_tier_details: Optional[List["RecoveryPointTierInformation"]] = None, + is_managed_virtual_machine: Optional[bool] = None, + virtual_machine_size: Optional[str] = None, + original_storage_account_option: Optional[bool] = None, + os_type: Optional[str] = None, + recovery_point_disk_configuration: Optional["RecoveryPointDiskConfiguration"] = None, + zones: Optional[List[str]] = None, + recovery_point_move_readiness_info: Optional[Dict[str, "RecoveryPointMoveReadinessInfo"]] = None, + **kwargs + ): + super(IaasVMRecoveryPointAutoGenerated, self).__init__(**kwargs) + self.object_type = 'IaasVMRecoveryPoint' # type: str + self.recovery_point_type = None + self.recovery_point_time = None + self.recovery_point_additional_info = None + self.source_vm_storage_type = None + self.is_source_vm_encrypted = None + self.key_and_secret = key_and_secret + self.is_instant_ilr_session_active = is_instant_ilr_session_active + self.recovery_point_tier_details = recovery_point_tier_details + self.is_managed_virtual_machine = is_managed_virtual_machine + self.virtual_machine_size = virtual_machine_size + self.original_storage_account_option = original_storage_account_option + self.os_type = os_type + self.recovery_point_disk_configuration = recovery_point_disk_configuration + self.zones = zones + self.recovery_point_move_readiness_info = recovery_point_move_readiness_info + + +class IaasVMRestoreRequest(RestoreRequest): + """IaaS VM workload-specific restore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: IaasVMRestoreWithRehydrationRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_id: ID of the backup copy to be recovered. + :type recovery_point_id: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM which is being recovered. + :type source_resource_id: str + :param target_virtual_machine_id: This is the complete ARM Id of the VM that will be created. + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param target_resource_group_id: This is the ARM Id of the resource group that you want to + create for this Virtual machine and other artifacts. + For e.g. /subscriptions/{subId}/resourcegroups/{rg}. + :type target_resource_group_id: str + :param storage_account_id: Fully qualified ARM ID of the storage account to which the VM has to + be restored. + :type storage_account_id: str + :param virtual_network_id: This is the virtual network Id of the vnet that will be attached to + the virtual machine. + User will be validated for join action permissions in the linked access. + :type virtual_network_id: str + :param subnet_id: Subnet ID, is the subnet ID associated with the to be restored VM. For + Classic VMs it would be + {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource + ID used to represent + the subnet. + :type subnet_id: str + :param target_domain_name_id: Fully qualified ARM ID of the domain name to be associated to the + VM being restored. This applies only to Classic + Virtual Machines. + :type target_domain_name_id: str + :param region: Region in which the virtual machine is restored. + :type region: str + :param affinity_group: Affinity group associated to VM to be restored. Used only for Classic + Compute Virtual Machines. + :type affinity_group: str + :param create_new_cloud_service: Should a new cloud service be created while restoring the VM. + If this is false, VM will be restored to the same + cloud service as it was at the time of backup. + :type create_new_cloud_service: bool + :param original_storage_account_option: Original Storage Account Option. + :type original_storage_account_option: bool + :param encryption_details: Details needed if the VM was encrypted at the time of backup. + :type encryption_details: ~azure.mgmt.recoveryservicesbackup.models.EncryptionDetails + :param restore_disk_lun_list: List of Disk LUNs for partial restore. + :type restore_disk_lun_list: list[int] + :param restore_with_managed_disks: Flag to denote of an Unmanaged disk VM should be restored + with Managed disks. + :type restore_with_managed_disks: bool + :param disk_encryption_set_id: DiskEncryptionSet's ID - needed if the VM needs to be encrypted + at rest during restore with customer managed key. + :type disk_encryption_set_id: str + :param zones: Target zone where the VM and its disks should be restored. + :type zones: list[str] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'target_resource_group_id': {'key': 'targetResourceGroupId', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'virtual_network_id': {'key': 'virtualNetworkId', 'type': 'str'}, + 'subnet_id': {'key': 'subnetId', 'type': 'str'}, + 'target_domain_name_id': {'key': 'targetDomainNameId', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'affinity_group': {'key': 'affinityGroup', 'type': 'str'}, + 'create_new_cloud_service': {'key': 'createNewCloudService', 'type': 'bool'}, + 'original_storage_account_option': {'key': 'originalStorageAccountOption', 'type': 'bool'}, + 'encryption_details': {'key': 'encryptionDetails', 'type': 'EncryptionDetails'}, + 'restore_disk_lun_list': {'key': 'restoreDiskLunList', 'type': '[int]'}, + 'restore_with_managed_disks': {'key': 'restoreWithManagedDisks', 'type': 'bool'}, + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + _subtype_map = { + 'object_type': {'IaasVMRestoreWithRehydrationRequest': 'IaasVMRestoreWithRehydrationRequest'} + } + + def __init__( + self, + *, + recovery_point_id: Optional[str] = None, + recovery_type: Optional[Union[str, "RecoveryType"]] = None, + source_resource_id: Optional[str] = None, + target_virtual_machine_id: Optional[str] = None, + target_resource_group_id: Optional[str] = None, + storage_account_id: Optional[str] = None, + virtual_network_id: Optional[str] = None, + subnet_id: Optional[str] = None, + target_domain_name_id: Optional[str] = None, + region: Optional[str] = None, + affinity_group: Optional[str] = None, + create_new_cloud_service: Optional[bool] = None, + original_storage_account_option: Optional[bool] = None, + encryption_details: Optional["EncryptionDetails"] = None, + restore_disk_lun_list: Optional[List[int]] = None, + restore_with_managed_disks: Optional[bool] = None, + disk_encryption_set_id: Optional[str] = None, + zones: Optional[List[str]] = None, + **kwargs + ): + super(IaasVMRestoreRequest, self).__init__(**kwargs) + self.object_type = 'IaasVMRestoreRequest' # type: str + self.recovery_point_id = recovery_point_id + self.recovery_type = recovery_type + self.source_resource_id = source_resource_id + self.target_virtual_machine_id = target_virtual_machine_id + self.target_resource_group_id = target_resource_group_id + self.storage_account_id = storage_account_id + self.virtual_network_id = virtual_network_id + self.subnet_id = subnet_id + self.target_domain_name_id = target_domain_name_id + self.region = region + self.affinity_group = affinity_group + self.create_new_cloud_service = create_new_cloud_service + self.original_storage_account_option = original_storage_account_option + self.encryption_details = encryption_details + self.restore_disk_lun_list = restore_disk_lun_list + self.restore_with_managed_disks = restore_with_managed_disks + self.disk_encryption_set_id = disk_encryption_set_id + self.zones = zones + + +class IaasVMRestoreWithRehydrationRequest(IaasVMRestoreRequest): + """IaaS VM workload-specific restore with integrated rehydration of recovery point. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_point_id: ID of the backup copy to be recovered. + :type recovery_point_id: str + :param recovery_type: Type of this recovery. Possible values include: "Invalid", + "OriginalLocation", "AlternateLocation", "RestoreDisks", "Offline". + :type recovery_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryType + :param source_resource_id: Fully qualified ARM ID of the VM which is being recovered. + :type source_resource_id: str + :param target_virtual_machine_id: This is the complete ARM Id of the VM that will be created. + For e.g. + /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. + :type target_virtual_machine_id: str + :param target_resource_group_id: This is the ARM Id of the resource group that you want to + create for this Virtual machine and other artifacts. + For e.g. /subscriptions/{subId}/resourcegroups/{rg}. + :type target_resource_group_id: str + :param storage_account_id: Fully qualified ARM ID of the storage account to which the VM has to + be restored. + :type storage_account_id: str + :param virtual_network_id: This is the virtual network Id of the vnet that will be attached to + the virtual machine. + User will be validated for join action permissions in the linked access. + :type virtual_network_id: str + :param subnet_id: Subnet ID, is the subnet ID associated with the to be restored VM. For + Classic VMs it would be + {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource + ID used to represent + the subnet. + :type subnet_id: str + :param target_domain_name_id: Fully qualified ARM ID of the domain name to be associated to the + VM being restored. This applies only to Classic + Virtual Machines. + :type target_domain_name_id: str + :param region: Region in which the virtual machine is restored. + :type region: str + :param affinity_group: Affinity group associated to VM to be restored. Used only for Classic + Compute Virtual Machines. + :type affinity_group: str + :param create_new_cloud_service: Should a new cloud service be created while restoring the VM. + If this is false, VM will be restored to the same + cloud service as it was at the time of backup. + :type create_new_cloud_service: bool + :param original_storage_account_option: Original Storage Account Option. + :type original_storage_account_option: bool + :param encryption_details: Details needed if the VM was encrypted at the time of backup. + :type encryption_details: ~azure.mgmt.recoveryservicesbackup.models.EncryptionDetails + :param restore_disk_lun_list: List of Disk LUNs for partial restore. + :type restore_disk_lun_list: list[int] + :param restore_with_managed_disks: Flag to denote of an Unmanaged disk VM should be restored + with Managed disks. + :type restore_with_managed_disks: bool + :param disk_encryption_set_id: DiskEncryptionSet's ID - needed if the VM needs to be encrypted + at rest during restore with customer managed key. + :type disk_encryption_set_id: str + :param zones: Target zone where the VM and its disks should be restored. + :type zones: list[str] + :param recovery_point_rehydration_info: RP Rehydration Info. + :type recovery_point_rehydration_info: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointRehydrationInfo + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'recovery_type': {'key': 'recoveryType', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'target_virtual_machine_id': {'key': 'targetVirtualMachineId', 'type': 'str'}, + 'target_resource_group_id': {'key': 'targetResourceGroupId', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'virtual_network_id': {'key': 'virtualNetworkId', 'type': 'str'}, + 'subnet_id': {'key': 'subnetId', 'type': 'str'}, + 'target_domain_name_id': {'key': 'targetDomainNameId', 'type': 'str'}, + 'region': {'key': 'region', 'type': 'str'}, + 'affinity_group': {'key': 'affinityGroup', 'type': 'str'}, + 'create_new_cloud_service': {'key': 'createNewCloudService', 'type': 'bool'}, + 'original_storage_account_option': {'key': 'originalStorageAccountOption', 'type': 'bool'}, + 'encryption_details': {'key': 'encryptionDetails', 'type': 'EncryptionDetails'}, + 'restore_disk_lun_list': {'key': 'restoreDiskLunList', 'type': '[int]'}, + 'restore_with_managed_disks': {'key': 'restoreWithManagedDisks', 'type': 'bool'}, + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'recovery_point_rehydration_info': {'key': 'recoveryPointRehydrationInfo', 'type': 'RecoveryPointRehydrationInfo'}, + } + + def __init__( + self, + *, + recovery_point_id: Optional[str] = None, + recovery_type: Optional[Union[str, "RecoveryType"]] = None, + source_resource_id: Optional[str] = None, + target_virtual_machine_id: Optional[str] = None, + target_resource_group_id: Optional[str] = None, + storage_account_id: Optional[str] = None, + virtual_network_id: Optional[str] = None, + subnet_id: Optional[str] = None, + target_domain_name_id: Optional[str] = None, + region: Optional[str] = None, + affinity_group: Optional[str] = None, + create_new_cloud_service: Optional[bool] = None, + original_storage_account_option: Optional[bool] = None, + encryption_details: Optional["EncryptionDetails"] = None, + restore_disk_lun_list: Optional[List[int]] = None, + restore_with_managed_disks: Optional[bool] = None, + disk_encryption_set_id: Optional[str] = None, + zones: Optional[List[str]] = None, + recovery_point_rehydration_info: Optional["RecoveryPointRehydrationInfo"] = None, + **kwargs + ): + super(IaasVMRestoreWithRehydrationRequest, self).__init__(recovery_point_id=recovery_point_id, recovery_type=recovery_type, source_resource_id=source_resource_id, target_virtual_machine_id=target_virtual_machine_id, target_resource_group_id=target_resource_group_id, storage_account_id=storage_account_id, virtual_network_id=virtual_network_id, subnet_id=subnet_id, target_domain_name_id=target_domain_name_id, region=region, affinity_group=affinity_group, create_new_cloud_service=create_new_cloud_service, original_storage_account_option=original_storage_account_option, encryption_details=encryption_details, restore_disk_lun_list=restore_disk_lun_list, restore_with_managed_disks=restore_with_managed_disks, disk_encryption_set_id=disk_encryption_set_id, zones=zones, **kwargs) + self.object_type = 'IaasVMRestoreWithRehydrationRequest' # type: str + self.recovery_point_rehydration_info = recovery_point_rehydration_info + + +class ILRRequestResource(Resource): + """Parameters to Provision ILR API. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: ILRRequestResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.ILRRequest + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ILRRequest'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["ILRRequest"] = None, + **kwargs + ): + super(ILRRequestResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class InquiryInfo(msrest.serialization.Model): + """Details about inquired protectable items under a given container. + + :param status: Inquiry Status for this container such as + InProgress | Failed | Succeeded. + :type status: str + :param error_detail: Error Details if the Status is non-success. + :type error_detail: ~azure.mgmt.recoveryservicesbackup.models.ErrorDetail + :param inquiry_details: Inquiry Details which will have workload specific details. + For e.g. - For SQL and oracle this will contain different details. + :type inquiry_details: list[~azure.mgmt.recoveryservicesbackup.models.WorkloadInquiryDetails] + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error_detail': {'key': 'errorDetail', 'type': 'ErrorDetail'}, + 'inquiry_details': {'key': 'inquiryDetails', 'type': '[WorkloadInquiryDetails]'}, + } + + def __init__( + self, + *, + status: Optional[str] = None, + error_detail: Optional["ErrorDetail"] = None, + inquiry_details: Optional[List["WorkloadInquiryDetails"]] = None, + **kwargs + ): + super(InquiryInfo, self).__init__(**kwargs) + self.status = status + self.error_detail = error_detail + self.inquiry_details = inquiry_details + + +class InquiryValidation(msrest.serialization.Model): + """Validation for inquired protectable items under a given container. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param status: Status for the Inquiry Validation. + :type status: str + :param error_detail: Error Detail in case the status is non-success. + :type error_detail: ~azure.mgmt.recoveryservicesbackup.models.ErrorDetail + :ivar additional_detail: Error Additional Detail in case the status is non-success. + :vartype additional_detail: str + """ + + _validation = { + 'additional_detail': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error_detail': {'key': 'errorDetail', 'type': 'ErrorDetail'}, + 'additional_detail': {'key': 'additionalDetail', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[str] = None, + error_detail: Optional["ErrorDetail"] = None, + **kwargs + ): + super(InquiryValidation, self).__init__(**kwargs) + self.status = status + self.error_detail = error_detail + self.additional_detail = None + + +class InstantItemRecoveryTarget(msrest.serialization.Model): + """Target details for file / folder restore. + + :param client_scripts: List of client scripts. + :type client_scripts: list[~azure.mgmt.recoveryservicesbackup.models.ClientScriptForConnect] + """ + + _attribute_map = { + 'client_scripts': {'key': 'clientScripts', 'type': '[ClientScriptForConnect]'}, + } + + def __init__( + self, + *, + client_scripts: Optional[List["ClientScriptForConnect"]] = None, + **kwargs + ): + super(InstantItemRecoveryTarget, self).__init__(**kwargs) + self.client_scripts = client_scripts + + +class InstantRPAdditionalDetails(msrest.serialization.Model): + """InstantRPAdditionalDetails. + + :param azure_backup_rg_name_prefix: + :type azure_backup_rg_name_prefix: str + :param azure_backup_rg_name_suffix: + :type azure_backup_rg_name_suffix: str + """ + + _attribute_map = { + 'azure_backup_rg_name_prefix': {'key': 'azureBackupRGNamePrefix', 'type': 'str'}, + 'azure_backup_rg_name_suffix': {'key': 'azureBackupRGNameSuffix', 'type': 'str'}, + } + + def __init__( + self, + *, + azure_backup_rg_name_prefix: Optional[str] = None, + azure_backup_rg_name_suffix: Optional[str] = None, + **kwargs + ): + super(InstantRPAdditionalDetails, self).__init__(**kwargs) + self.azure_backup_rg_name_prefix = azure_backup_rg_name_prefix + self.azure_backup_rg_name_suffix = azure_backup_rg_name_suffix + + +class JobQueryObject(msrest.serialization.Model): + """Filters to list the jobs. + + :param status: Status of the job. Possible values include: "Invalid", "InProgress", + "Completed", "Failed", "CompletedWithWarnings", "Cancelled", "Cancelling". + :type status: str or ~azure.mgmt.recoveryservicesbackup.models.JobStatus + :param backup_management_type: Type of backup management for the job. Possible values include: + "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", "AzureStorage", + "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: Type of operation. Possible values include: "Invalid", "Register", + "UnRegister", "ConfigureBackup", "Backup", "Restore", "DisableBackup", "DeleteBackupData", + "CrossRegionRestore", "Undelete", "UpdateCustomerManagedKey". + :type operation: str or ~azure.mgmt.recoveryservicesbackup.models.JobOperationType + :param job_id: JobID represents the job uniquely. + :type job_id: str + :param start_time: Job has started at this time. Value is in UTC. + :type start_time: ~datetime.datetime + :param end_time: Job has ended at this time. Value is in UTC. + :type end_time: ~datetime.datetime + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "JobStatus"]] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + operation: Optional[Union[str, "JobOperationType"]] = None, + job_id: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(JobQueryObject, self).__init__(**kwargs) + self.status = status + self.backup_management_type = backup_management_type + self.operation = operation + self.job_id = job_id + self.start_time = start_time + self.end_time = end_time + + +class JobResource(Resource): + """Defines workload agnostic properties for a job. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: JobResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.Job + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'Job'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["Job"] = None, + **kwargs + ): + super(JobResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class JobResourceList(ResourceList): + """List of Job resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.JobResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[JobResource]'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["JobResource"]] = None, + **kwargs + ): + super(JobResourceList, self).__init__(next_link=next_link, **kwargs) + self.value = value + + +class KEKDetails(msrest.serialization.Model): + """KEK is encryption key for BEK. + + :param key_url: Key is KEK. + :type key_url: str + :param key_vault_id: Key Vault ID where this Key is stored. + :type key_vault_id: str + :param key_backup_data: KEK data. + :type key_backup_data: str + """ + + _attribute_map = { + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + 'key_backup_data': {'key': 'keyBackupData', 'type': 'str'}, + } + + def __init__( + self, + *, + key_url: Optional[str] = None, + key_vault_id: Optional[str] = None, + key_backup_data: Optional[str] = None, + **kwargs + ): + super(KEKDetails, self).__init__(**kwargs) + self.key_url = key_url + self.key_vault_id = key_vault_id + self.key_backup_data = key_backup_data + + +class KeyAndSecretDetails(msrest.serialization.Model): + """BEK is bitlocker key. +KEK is encryption key for BEK +If the VM was encrypted then we will store following details : + + +#. Secret(BEK) - Url + Backup Data + vaultId. +#. Key(KEK) - Url + Backup Data + vaultId. +#. EncryptionMechanism + BEK and KEK can potentially have different vault ids. + + :param kek_details: KEK is encryption key for BEK. + :type kek_details: ~azure.mgmt.recoveryservicesbackup.models.KEKDetails + :param bek_details: BEK is bitlocker encryption key. + :type bek_details: ~azure.mgmt.recoveryservicesbackup.models.BEKDetails + :param encryption_mechanism: Encryption mechanism: None/ SinglePass/ DoublePass. + :type encryption_mechanism: str + """ + + _attribute_map = { + 'kek_details': {'key': 'kekDetails', 'type': 'KEKDetails'}, + 'bek_details': {'key': 'bekDetails', 'type': 'BEKDetails'}, + 'encryption_mechanism': {'key': 'encryptionMechanism', 'type': 'str'}, + } + + def __init__( + self, + *, + kek_details: Optional["KEKDetails"] = None, + bek_details: Optional["BEKDetails"] = None, + encryption_mechanism: Optional[str] = None, + **kwargs + ): + super(KeyAndSecretDetails, self).__init__(**kwargs) + self.kek_details = kek_details + self.bek_details = bek_details + self.encryption_mechanism = encryption_mechanism + + +class KPIResourceHealthDetails(msrest.serialization.Model): + """KPI Resource Health Details. + + :param resource_health_status: Resource Health Status. Possible values include: "Healthy", + "TransientDegraded", "PersistentDegraded", "TransientUnhealthy", "PersistentUnhealthy", + "Invalid". + :type resource_health_status: str or + ~azure.mgmt.recoveryservicesbackup.models.ResourceHealthStatus + :param resource_health_details: Resource Health Status. + :type resource_health_details: + list[~azure.mgmt.recoveryservicesbackup.models.ResourceHealthDetails] + """ + + _attribute_map = { + 'resource_health_status': {'key': 'resourceHealthStatus', 'type': 'str'}, + 'resource_health_details': {'key': 'resourceHealthDetails', 'type': '[ResourceHealthDetails]'}, + } + + def __init__( + self, + *, + resource_health_status: Optional[Union[str, "ResourceHealthStatus"]] = None, + resource_health_details: Optional[List["ResourceHealthDetails"]] = None, + **kwargs + ): + super(KPIResourceHealthDetails, self).__init__(**kwargs) + self.resource_health_status = resource_health_status + self.resource_health_details = resource_health_details + + +class ListRecoveryPointsRecommendedForMoveRequest(msrest.serialization.Model): + """ListRecoveryPointsRecommendedForMoveRequest Request. + + :param object_type: Gets the class type. + :type object_type: str + :param excluded_rp_list: List of Recovery Points excluded from Move. + :type excluded_rp_list: list[str] + """ + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'excluded_rp_list': {'key': 'excludedRPList', 'type': '[str]'}, + } + + def __init__( + self, + *, + object_type: Optional[str] = None, + excluded_rp_list: Optional[List[str]] = None, + **kwargs + ): + super(ListRecoveryPointsRecommendedForMoveRequest, self).__init__(**kwargs) + self.object_type = object_type + self.excluded_rp_list = excluded_rp_list + + +class SchedulePolicy(msrest.serialization.Model): + """Base class for backup schedule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: LogSchedulePolicy, LongTermSchedulePolicy, SimpleSchedulePolicy. + + All required parameters must be populated in order to send to Azure. + + :param schedule_policy_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 schedule_policy_type: str + """ + + _validation = { + 'schedule_policy_type': {'required': True}, + } + + _attribute_map = { + 'schedule_policy_type': {'key': 'schedulePolicyType', 'type': 'str'}, + } + + _subtype_map = { + 'schedule_policy_type': {'LogSchedulePolicy': 'LogSchedulePolicy', 'LongTermSchedulePolicy': 'LongTermSchedulePolicy', 'SimpleSchedulePolicy': 'SimpleSchedulePolicy'} + } + + def __init__( + self, + **kwargs + ): + super(SchedulePolicy, self).__init__(**kwargs) + self.schedule_policy_type = None # type: Optional[str] + + +class LogSchedulePolicy(SchedulePolicy): + """Log policy schedule. + + All required parameters must be populated in order to send to Azure. + + :param schedule_policy_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 schedule_policy_type: str + :param schedule_frequency_in_mins: Frequency of the log schedule operation of this policy in + minutes. + :type schedule_frequency_in_mins: int + """ + + _validation = { + 'schedule_policy_type': {'required': True}, + } + + _attribute_map = { + 'schedule_policy_type': {'key': 'schedulePolicyType', 'type': 'str'}, + 'schedule_frequency_in_mins': {'key': 'scheduleFrequencyInMins', 'type': 'int'}, + } + + def __init__( + self, + *, + schedule_frequency_in_mins: Optional[int] = None, + **kwargs + ): + super(LogSchedulePolicy, self).__init__(**kwargs) + self.schedule_policy_type = 'LogSchedulePolicy' # type: str + self.schedule_frequency_in_mins = schedule_frequency_in_mins + + +class RetentionPolicy(msrest.serialization.Model): + """Base class for retention policy. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: LongTermRetentionPolicy, SimpleRetentionPolicy. + + All required parameters must be populated in order to send to Azure. + + :param retention_policy_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 retention_policy_type: str + """ + + _validation = { + 'retention_policy_type': {'required': True}, + } + + _attribute_map = { + 'retention_policy_type': {'key': 'retentionPolicyType', 'type': 'str'}, + } + + _subtype_map = { + 'retention_policy_type': {'LongTermRetentionPolicy': 'LongTermRetentionPolicy', 'SimpleRetentionPolicy': 'SimpleRetentionPolicy'} + } + + def __init__( + self, + **kwargs + ): + super(RetentionPolicy, self).__init__(**kwargs) + self.retention_policy_type = None # type: Optional[str] + + +class LongTermRetentionPolicy(RetentionPolicy): + """Long term retention policy. + + All required parameters must be populated in order to send to Azure. + + :param retention_policy_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 retention_policy_type: str + :param daily_schedule: Daily retention schedule of the protection policy. + :type daily_schedule: ~azure.mgmt.recoveryservicesbackup.models.DailyRetentionSchedule + :param weekly_schedule: Weekly retention schedule of the protection policy. + :type weekly_schedule: ~azure.mgmt.recoveryservicesbackup.models.WeeklyRetentionSchedule + :param monthly_schedule: Monthly retention schedule of the protection policy. + :type monthly_schedule: ~azure.mgmt.recoveryservicesbackup.models.MonthlyRetentionSchedule + :param yearly_schedule: Yearly retention schedule of the protection policy. + :type yearly_schedule: ~azure.mgmt.recoveryservicesbackup.models.YearlyRetentionSchedule + """ + + _validation = { + 'retention_policy_type': {'required': True}, + } + + _attribute_map = { + 'retention_policy_type': {'key': 'retentionPolicyType', 'type': 'str'}, + 'daily_schedule': {'key': 'dailySchedule', 'type': 'DailyRetentionSchedule'}, + 'weekly_schedule': {'key': 'weeklySchedule', 'type': 'WeeklyRetentionSchedule'}, + 'monthly_schedule': {'key': 'monthlySchedule', 'type': 'MonthlyRetentionSchedule'}, + 'yearly_schedule': {'key': 'yearlySchedule', 'type': 'YearlyRetentionSchedule'}, + } + + def __init__( + self, + *, + daily_schedule: Optional["DailyRetentionSchedule"] = None, + weekly_schedule: Optional["WeeklyRetentionSchedule"] = None, + monthly_schedule: Optional["MonthlyRetentionSchedule"] = None, + yearly_schedule: Optional["YearlyRetentionSchedule"] = None, + **kwargs + ): + super(LongTermRetentionPolicy, self).__init__(**kwargs) + self.retention_policy_type = 'LongTermRetentionPolicy' # type: str + self.daily_schedule = daily_schedule + self.weekly_schedule = weekly_schedule + self.monthly_schedule = monthly_schedule + self.yearly_schedule = yearly_schedule + + +class LongTermSchedulePolicy(SchedulePolicy): + """Long term policy schedule. + + All required parameters must be populated in order to send to Azure. + + :param schedule_policy_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 schedule_policy_type: str + """ + + _validation = { + 'schedule_policy_type': {'required': True}, + } + + _attribute_map = { + 'schedule_policy_type': {'key': 'schedulePolicyType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LongTermSchedulePolicy, self).__init__(**kwargs) + self.schedule_policy_type = 'LongTermSchedulePolicy' # type: str + + +class MabContainer(ProtectionContainer): + """Container with items backed up using MAB backup engine. + + All required parameters must be populated in order to send to Azure. + + :param friendly_name: Friendly name of the container. + :type friendly_name: str + :param backup_management_type: Type of backup management for the container. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param registration_status: Status of registration of the container with the Recovery Services + Vault. + :type registration_status: str + :param health_status: Status of health of the container. + :type health_status: str + :param container_type: Required. Type of the container. The value of this property for: 1. + Compute Azure VM is Microsoft.Compute/virtualMachines 2. + Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like + MAB, DPM etc) is + Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. + 6. Azure workload + Backup is VMAppContainer.Constant filled by server. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type container_type: str or ~azure.mgmt.recoveryservicesbackup.models.ContainerType + :param can_re_register: Can the container be registered one more time. + :type can_re_register: bool + :param container_id: ContainerID represents the container. + :type container_id: long + :param protected_item_count: Number of items backed up in this container. + :type protected_item_count: long + :param agent_version: Agent version of this container. + :type agent_version: str + :param extended_info: Additional information for this container. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.MabContainerExtendedInfo + :param mab_container_health_details: Health details on this mab container. + :type mab_container_health_details: + list[~azure.mgmt.recoveryservicesbackup.models.MABContainerHealthDetails] + :param container_health_state: Health state of mab container. + :type container_health_state: str + """ + + _validation = { + 'container_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'registration_status': {'key': 'registrationStatus', 'type': 'str'}, + 'health_status': {'key': 'healthStatus', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'can_re_register': {'key': 'canReRegister', 'type': 'bool'}, + 'container_id': {'key': 'containerId', 'type': 'long'}, + 'protected_item_count': {'key': 'protectedItemCount', 'type': 'long'}, + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'MabContainerExtendedInfo'}, + 'mab_container_health_details': {'key': 'mabContainerHealthDetails', 'type': '[MABContainerHealthDetails]'}, + 'container_health_state': {'key': 'containerHealthState', 'type': 'str'}, + } + + def __init__( + self, + *, + friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + registration_status: Optional[str] = None, + health_status: Optional[str] = None, + can_re_register: Optional[bool] = None, + container_id: Optional[int] = None, + protected_item_count: Optional[int] = None, + agent_version: Optional[str] = None, + extended_info: Optional["MabContainerExtendedInfo"] = None, + mab_container_health_details: Optional[List["MABContainerHealthDetails"]] = None, + container_health_state: Optional[str] = None, + **kwargs + ): + super(MabContainer, self).__init__(friendly_name=friendly_name, backup_management_type=backup_management_type, registration_status=registration_status, health_status=health_status, **kwargs) + self.container_type = 'Windows' # type: str + self.can_re_register = can_re_register + self.container_id = container_id + self.protected_item_count = protected_item_count + self.agent_version = agent_version + self.extended_info = extended_info + self.mab_container_health_details = mab_container_health_details + self.container_health_state = container_health_state + + +class MabContainerExtendedInfo(msrest.serialization.Model): + """Additional information of the container. + + :param last_refreshed_at: Time stamp when this container was refreshed. + :type last_refreshed_at: ~datetime.datetime + :param backup_item_type: Type of backup items associated with this container. Possible values + include: "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", + "VMwareVM", "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type backup_item_type: str or ~azure.mgmt.recoveryservicesbackup.models.BackupItemType + :param backup_items: List of backup items associated with this container. + :type backup_items: list[str] + :param policy_name: Backup policy associated with this container. + :type policy_name: str + :param last_backup_status: Latest backup status of this container. + :type last_backup_status: str + """ + + _attribute_map = { + 'last_refreshed_at': {'key': 'lastRefreshedAt', 'type': 'iso-8601'}, + 'backup_item_type': {'key': 'backupItemType', 'type': 'str'}, + 'backup_items': {'key': 'backupItems', 'type': '[str]'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + } + + def __init__( + self, + *, + last_refreshed_at: Optional[datetime.datetime] = None, + backup_item_type: Optional[Union[str, "BackupItemType"]] = None, + backup_items: Optional[List[str]] = None, + policy_name: Optional[str] = None, + last_backup_status: Optional[str] = None, + **kwargs + ): + super(MabContainerExtendedInfo, self).__init__(**kwargs) + self.last_refreshed_at = last_refreshed_at + self.backup_item_type = backup_item_type + self.backup_items = backup_items + self.policy_name = policy_name + self.last_backup_status = last_backup_status + + +class MABContainerHealthDetails(msrest.serialization.Model): + """MAB workload-specific Health Details. + + :param code: Health Code. + :type code: int + :param title: Health Title. + :type title: str + :param message: Health Message. + :type message: str + :param recommendations: Health Recommended Actions. + :type recommendations: list[str] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'int'}, + 'title': {'key': 'title', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + *, + code: Optional[int] = None, + title: Optional[str] = None, + message: Optional[str] = None, + recommendations: Optional[List[str]] = None, + **kwargs + ): + super(MABContainerHealthDetails, self).__init__(**kwargs) + self.code = code + self.title = title + self.message = message + self.recommendations = recommendations + + +class MabErrorInfo(msrest.serialization.Model): + """MAB workload-specific error information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error_string: Localized error string. + :vartype error_string: str + :ivar recommendations: List of localized recommendations. + :vartype recommendations: list[str] + """ + + _validation = { + 'error_string': {'readonly': True}, + 'recommendations': {'readonly': True}, + } + + _attribute_map = { + 'error_string': {'key': 'errorString', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MabErrorInfo, self).__init__(**kwargs) + self.error_string = None + self.recommendations = None + + +class MabFileFolderProtectedItem(ProtectedItem): + """MAB workload-specific backup item. + + All required parameters must be populated in order to send to Azure. + + :param protected_item_type: Required. backup item type.Constant filled by server. + :type protected_item_type: str + :param backup_management_type: Type of backup management for the backed up item. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param workload_type: Type of workload this item represents. Possible values include: + "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", + "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param container_name: Unique name of container. + :type container_name: str + :param source_resource_id: ARM ID of the resource to be backed up. + :type source_resource_id: str + :param policy_id: ID of the backup policy with which this item is backed up. + :type policy_id: str + :param last_recovery_point: Timestamp when the last (latest) backup copy was created for this + backup item. + :type last_recovery_point: ~datetime.datetime + :param backup_set_name: Name of the backup set the backup item belongs to. + :type backup_set_name: str + :param create_mode: Create mode to indicate recovery of existing soft deleted data source or + creation of new data source. Possible values include: "Invalid", "Default", "Recover". + :type create_mode: str or ~azure.mgmt.recoveryservicesbackup.models.CreateMode + :param deferred_delete_time_in_utc: Time for deferred deletion in UTC. + :type deferred_delete_time_in_utc: ~datetime.datetime + :param is_scheduled_for_deferred_delete: Flag to identify whether the DS is scheduled for + deferred delete. + :type is_scheduled_for_deferred_delete: bool + :param deferred_delete_time_remaining: Time remaining before the DS marked for deferred delete + is permanently deleted. + :type deferred_delete_time_remaining: str + :param is_deferred_delete_schedule_upcoming: Flag to identify whether the deferred deleted DS + is to be purged soon. + :type is_deferred_delete_schedule_upcoming: bool + :param is_rehydrate: Flag to identify that deferred deleted DS is to be moved into Pause state. + :type is_rehydrate: bool + :param friendly_name: Friendly name of this backup item. + :type friendly_name: str + :param computer_name: Name of the computer associated with this backup item. + :type computer_name: str + :param last_backup_status: Status of last backup operation. + :type last_backup_status: str + :param last_backup_time: Timestamp of the last backup operation on this backup item. + :type last_backup_time: ~datetime.datetime + :param protection_state: Protected, ProtectionStopped, IRPending or ProtectionError. + :type protection_state: str + :param deferred_delete_sync_time_in_utc: Sync time for deferred deletion in UTC. + :type deferred_delete_sync_time_in_utc: long + :param extended_info: Additional information with this backup item. + :type extended_info: + ~azure.mgmt.recoveryservicesbackup.models.MabFileFolderProtectedItemExtendedInfo + """ + + _validation = { + 'protected_item_type': {'required': True}, + } + + _attribute_map = { + 'protected_item_type': {'key': 'protectedItemType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'last_recovery_point': {'key': 'lastRecoveryPoint', 'type': 'iso-8601'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'deferred_delete_time_in_utc': {'key': 'deferredDeleteTimeInUTC', 'type': 'iso-8601'}, + 'is_scheduled_for_deferred_delete': {'key': 'isScheduledForDeferredDelete', 'type': 'bool'}, + 'deferred_delete_time_remaining': {'key': 'deferredDeleteTimeRemaining', 'type': 'str'}, + 'is_deferred_delete_schedule_upcoming': {'key': 'isDeferredDeleteScheduleUpcoming', 'type': 'bool'}, + 'is_rehydrate': {'key': 'isRehydrate', 'type': 'bool'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'computer_name': {'key': 'computerName', 'type': 'str'}, + 'last_backup_status': {'key': 'lastBackupStatus', 'type': 'str'}, + 'last_backup_time': {'key': 'lastBackupTime', 'type': 'iso-8601'}, + 'protection_state': {'key': 'protectionState', 'type': 'str'}, + 'deferred_delete_sync_time_in_utc': {'key': 'deferredDeleteSyncTimeInUTC', 'type': 'long'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'MabFileFolderProtectedItemExtendedInfo'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + workload_type: Optional[Union[str, "DataSourceType"]] = None, + container_name: Optional[str] = None, + source_resource_id: Optional[str] = None, + policy_id: Optional[str] = None, + last_recovery_point: Optional[datetime.datetime] = None, + backup_set_name: Optional[str] = None, + create_mode: Optional[Union[str, "CreateMode"]] = None, + deferred_delete_time_in_utc: Optional[datetime.datetime] = None, + is_scheduled_for_deferred_delete: Optional[bool] = None, + deferred_delete_time_remaining: Optional[str] = None, + is_deferred_delete_schedule_upcoming: Optional[bool] = None, + is_rehydrate: Optional[bool] = None, + friendly_name: Optional[str] = None, + computer_name: Optional[str] = None, + last_backup_status: Optional[str] = None, + last_backup_time: Optional[datetime.datetime] = None, + protection_state: Optional[str] = None, + deferred_delete_sync_time_in_utc: Optional[int] = None, + extended_info: Optional["MabFileFolderProtectedItemExtendedInfo"] = None, + **kwargs + ): + super(MabFileFolderProtectedItem, self).__init__(backup_management_type=backup_management_type, workload_type=workload_type, container_name=container_name, source_resource_id=source_resource_id, policy_id=policy_id, last_recovery_point=last_recovery_point, backup_set_name=backup_set_name, create_mode=create_mode, deferred_delete_time_in_utc=deferred_delete_time_in_utc, is_scheduled_for_deferred_delete=is_scheduled_for_deferred_delete, deferred_delete_time_remaining=deferred_delete_time_remaining, is_deferred_delete_schedule_upcoming=is_deferred_delete_schedule_upcoming, is_rehydrate=is_rehydrate, **kwargs) + self.protected_item_type = 'MabFileFolderProtectedItem' # type: str + self.friendly_name = friendly_name + self.computer_name = computer_name + self.last_backup_status = last_backup_status + self.last_backup_time = last_backup_time + self.protection_state = protection_state + self.deferred_delete_sync_time_in_utc = deferred_delete_sync_time_in_utc + self.extended_info = extended_info + + +class MabFileFolderProtectedItemExtendedInfo(msrest.serialization.Model): + """Additional information on the backed up item. + + :param last_refreshed_at: Last time when the agent data synced to service. + :type last_refreshed_at: ~datetime.datetime + :param oldest_recovery_point: The oldest backup copy available. + :type oldest_recovery_point: ~datetime.datetime + :param recovery_point_count: Number of backup copies associated with the backup item. + :type recovery_point_count: int + """ + + _attribute_map = { + 'last_refreshed_at': {'key': 'lastRefreshedAt', 'type': 'iso-8601'}, + 'oldest_recovery_point': {'key': 'oldestRecoveryPoint', 'type': 'iso-8601'}, + 'recovery_point_count': {'key': 'recoveryPointCount', 'type': 'int'}, + } + + def __init__( + self, + *, + last_refreshed_at: Optional[datetime.datetime] = None, + oldest_recovery_point: Optional[datetime.datetime] = None, + recovery_point_count: Optional[int] = None, + **kwargs + ): + super(MabFileFolderProtectedItemExtendedInfo, self).__init__(**kwargs) + self.last_refreshed_at = last_refreshed_at + self.oldest_recovery_point = oldest_recovery_point + self.recovery_point_count = recovery_point_count + + +class MabJob(Job): + """MAB workload-specific job. + + All required parameters must be populated in order to send to Azure. + + :param entity_friendly_name: Friendly name of the entity on which the current job is executing. + :type entity_friendly_name: str + :param backup_management_type: Backup management type to execute the current job. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: The operation name. + :type operation: str + :param status: Job status. + :type status: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param activity_id: ActivityId of job. + :type activity_id: str + :param job_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 job_type: str + :param duration: Time taken by job to run. + :type duration: ~datetime.timedelta + :param actions_info: The state/actions applicable on jobs like cancel/retry. + :type actions_info: list[str or ~azure.mgmt.recoveryservicesbackup.models.JobSupportedAction] + :param mab_server_name: Name of server protecting the DS. + :type mab_server_name: str + :param mab_server_type: Server type of MAB container. Possible values include: "Invalid", + "Unknown", "IaasVMContainer", "IaasVMServiceContainer", "DPMContainer", + "AzureBackupServerContainer", "MABContainer", "Cluster", "AzureSqlContainer", "Windows", + "VCenter", "VMAppContainer", "SQLAGWorkLoadContainer", "StorageContainer", "GenericContainer". + :type mab_server_type: str or ~azure.mgmt.recoveryservicesbackup.models.MabServerType + :param workload_type: Workload type of backup item. Possible values include: "Invalid", "VM", + "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", "SystemState", + "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", "SAPHanaDatabase", + "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + :param error_details: The errors. + :type error_details: list[~azure.mgmt.recoveryservicesbackup.models.MabErrorInfo] + :param extended_info: Additional information on the job. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.MabJobExtendedInfo + """ + + _validation = { + 'job_type': {'required': True}, + } + + _attribute_map = { + 'entity_friendly_name': {'key': 'entityFriendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'actions_info': {'key': 'actionsInfo', 'type': '[str]'}, + 'mab_server_name': {'key': 'mabServerName', 'type': 'str'}, + 'mab_server_type': {'key': 'mabServerType', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + 'error_details': {'key': 'errorDetails', 'type': '[MabErrorInfo]'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'MabJobExtendedInfo'}, + } + + def __init__( + self, + *, + entity_friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + operation: Optional[str] = None, + status: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + activity_id: Optional[str] = None, + duration: Optional[datetime.timedelta] = None, + actions_info: Optional[List[Union[str, "JobSupportedAction"]]] = None, + mab_server_name: Optional[str] = None, + mab_server_type: Optional[Union[str, "MabServerType"]] = None, + workload_type: Optional[Union[str, "WorkloadType"]] = None, + error_details: Optional[List["MabErrorInfo"]] = None, + extended_info: Optional["MabJobExtendedInfo"] = None, + **kwargs + ): + super(MabJob, self).__init__(entity_friendly_name=entity_friendly_name, backup_management_type=backup_management_type, operation=operation, status=status, start_time=start_time, end_time=end_time, activity_id=activity_id, **kwargs) + self.job_type = 'MabJob' # type: str + self.duration = duration + self.actions_info = actions_info + self.mab_server_name = mab_server_name + self.mab_server_type = mab_server_type + self.workload_type = workload_type + self.error_details = error_details + self.extended_info = extended_info + + +class MabJobExtendedInfo(msrest.serialization.Model): + """Additional information for the MAB workload-specific job. + + :param tasks_list: List of tasks for this job. + :type tasks_list: list[~azure.mgmt.recoveryservicesbackup.models.MabJobTaskDetails] + :param property_bag: The job properties. + :type property_bag: dict[str, str] + :param dynamic_error_message: Non localized error message specific to this job. + :type dynamic_error_message: str + """ + + _attribute_map = { + 'tasks_list': {'key': 'tasksList', 'type': '[MabJobTaskDetails]'}, + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + 'dynamic_error_message': {'key': 'dynamicErrorMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + tasks_list: Optional[List["MabJobTaskDetails"]] = None, + property_bag: Optional[Dict[str, str]] = None, + dynamic_error_message: Optional[str] = None, + **kwargs + ): + super(MabJobExtendedInfo, self).__init__(**kwargs) + self.tasks_list = tasks_list + self.property_bag = property_bag + self.dynamic_error_message = dynamic_error_message + + +class MabJobTaskDetails(msrest.serialization.Model): + """MAB workload-specific job task details. + + :param task_id: The task display name. + :type task_id: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param duration: Time elapsed for task. + :type duration: ~datetime.timedelta + :param status: The status. + :type status: str + """ + + _attribute_map = { + 'task_id': {'key': 'taskId', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + task_id: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + duration: Optional[datetime.timedelta] = None, + status: Optional[str] = None, + **kwargs + ): + super(MabJobTaskDetails, self).__init__(**kwargs) + self.task_id = task_id + self.start_time = start_time + self.end_time = end_time + self.duration = duration + self.status = status + + +class MabProtectionPolicy(ProtectionPolicy): + """Mab container-specific backup policy. + + All required parameters must be populated in order to send to Azure. + + :param protected_items_count: Number of items associated with this policy. + :type protected_items_count: int + :param backup_management_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 backup_management_type: str + :param schedule_policy: Backup schedule of backup policy. + :type schedule_policy: ~azure.mgmt.recoveryservicesbackup.models.SchedulePolicy + :param retention_policy: Retention policy details. + :type retention_policy: ~azure.mgmt.recoveryservicesbackup.models.RetentionPolicy + """ + + _validation = { + 'backup_management_type': {'required': True}, + } + + _attribute_map = { + 'protected_items_count': {'key': 'protectedItemsCount', 'type': 'int'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'schedule_policy': {'key': 'schedulePolicy', 'type': 'SchedulePolicy'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__( + self, + *, + protected_items_count: Optional[int] = None, + schedule_policy: Optional["SchedulePolicy"] = None, + retention_policy: Optional["RetentionPolicy"] = None, + **kwargs + ): + super(MabProtectionPolicy, self).__init__(protected_items_count=protected_items_count, **kwargs) + self.backup_management_type = 'MAB' # type: str + self.schedule_policy = schedule_policy + self.retention_policy = retention_policy + + +class MonthlyRetentionSchedule(msrest.serialization.Model): + """Monthly retention schedule. + + :param retention_schedule_format_type: Retention schedule format type for monthly retention + policy. Possible values include: "Invalid", "Daily", "Weekly". + :type retention_schedule_format_type: str or + ~azure.mgmt.recoveryservicesbackup.models.RetentionScheduleFormat + :param retention_schedule_daily: Daily retention format for monthly retention policy. + :type retention_schedule_daily: ~azure.mgmt.recoveryservicesbackup.models.DailyRetentionFormat + :param retention_schedule_weekly: Weekly retention format for monthly retention policy. + :type retention_schedule_weekly: + ~azure.mgmt.recoveryservicesbackup.models.WeeklyRetentionFormat + :param retention_times: Retention times of retention policy. + :type retention_times: list[~datetime.datetime] + :param retention_duration: Retention duration of retention Policy. + :type retention_duration: ~azure.mgmt.recoveryservicesbackup.models.RetentionDuration + """ + + _attribute_map = { + 'retention_schedule_format_type': {'key': 'retentionScheduleFormatType', 'type': 'str'}, + 'retention_schedule_daily': {'key': 'retentionScheduleDaily', 'type': 'DailyRetentionFormat'}, + 'retention_schedule_weekly': {'key': 'retentionScheduleWeekly', 'type': 'WeeklyRetentionFormat'}, + 'retention_times': {'key': 'retentionTimes', 'type': '[iso-8601]'}, + 'retention_duration': {'key': 'retentionDuration', 'type': 'RetentionDuration'}, + } + + def __init__( + self, + *, + retention_schedule_format_type: Optional[Union[str, "RetentionScheduleFormat"]] = None, + retention_schedule_daily: Optional["DailyRetentionFormat"] = None, + retention_schedule_weekly: Optional["WeeklyRetentionFormat"] = None, + retention_times: Optional[List[datetime.datetime]] = None, + retention_duration: Optional["RetentionDuration"] = None, + **kwargs + ): + super(MonthlyRetentionSchedule, self).__init__(**kwargs) + self.retention_schedule_format_type = retention_schedule_format_type + self.retention_schedule_daily = retention_schedule_daily + self.retention_schedule_weekly = retention_schedule_weekly + self.retention_times = retention_times + self.retention_duration = retention_duration + + +class MoveRPAcrossTiersRequest(msrest.serialization.Model): + """MoveRPAcrossTiersRequest. + + :param object_type: Gets the class type. + :type object_type: str + :param source_tier_type: Source tier from where RP needs to be moved. Possible values include: + "Invalid", "InstantRP", "HardenedRP", "ArchivedRP". + :type source_tier_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierType + :param target_tier_type: Target tier where RP needs to be moved. Possible values include: + "Invalid", "InstantRP", "HardenedRP", "ArchivedRP". + :type target_tier_type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierType + """ + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'source_tier_type': {'key': 'sourceTierType', 'type': 'str'}, + 'target_tier_type': {'key': 'targetTierType', 'type': 'str'}, + } + + def __init__( + self, + *, + object_type: Optional[str] = None, + source_tier_type: Optional[Union[str, "RecoveryPointTierType"]] = None, + target_tier_type: Optional[Union[str, "RecoveryPointTierType"]] = None, + **kwargs + ): + super(MoveRPAcrossTiersRequest, self).__init__(**kwargs) + self.object_type = object_type + self.source_tier_type = source_tier_type + self.target_tier_type = target_tier_type + + +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, + *, + value: Optional[str] = None, + localized_value: Optional[str] = None, + **kwargs + ): + super(NameInfo, self).__init__(**kwargs) + self.value = value + self.localized_value = localized_value + + +class NewErrorResponse(msrest.serialization.Model): + """The resource management error response. + + :param error: The error object. + :type error: ~azure.mgmt.recoveryservicesbackup.models.NewErrorResponseError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'NewErrorResponseError'}, + } + + def __init__( + self, + *, + error: Optional["NewErrorResponseError"] = None, + **kwargs + ): + super(NewErrorResponse, self).__init__(**kwargs) + self.error = error + + +class NewErrorResponseAutoGenerated(msrest.serialization.Model): + """The resource management error response. + + :param error: The error object. + :type error: ~azure.mgmt.recoveryservicesbackup.models.NewErrorResponseErrorAutoGenerated + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'NewErrorResponseErrorAutoGenerated'}, + } + + def __init__( + self, + *, + error: Optional["NewErrorResponseErrorAutoGenerated"] = None, + **kwargs + ): + super(NewErrorResponseAutoGenerated, self).__init__(**kwargs) + self.error = error + + +class NewErrorResponseError(msrest.serialization.Model): + """The error object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.recoveryservicesbackup.models.NewErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.recoveryservicesbackup.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[NewErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(NewErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class NewErrorResponseErrorAutoGenerated(msrest.serialization.Model): + """The error object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.recoveryservicesbackup.models.NewErrorResponseAutoGenerated] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.recoveryservicesbackup.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[NewErrorResponseAutoGenerated]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(NewErrorResponseErrorAutoGenerated, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class OperationResultInfo(OperationResultInfoBase): + """Operation result info. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param job_list: List of jobs created by this operation. + :type job_list: list[str] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'job_list': {'key': 'jobList', 'type': '[str]'}, + } + + def __init__( + self, + *, + job_list: Optional[List[str]] = None, + **kwargs + ): + super(OperationResultInfo, self).__init__(**kwargs) + self.object_type = 'OperationResultInfo' # type: str + self.job_list = job_list + + +class OperationWorkerResponse(msrest.serialization.Model): + """This is the base class for operation result responses. + + :param status_code: HTTP Status Code of the operation. Possible values include: "Continue", + "SwitchingProtocols", "OK", "Created", "Accepted", "NonAuthoritativeInformation", "NoContent", + "ResetContent", "PartialContent", "MultipleChoices", "Ambiguous", "MovedPermanently", "Moved", + "Found", "Redirect", "SeeOther", "RedirectMethod", "NotModified", "UseProxy", "Unused", + "TemporaryRedirect", "RedirectKeepVerb", "BadRequest", "Unauthorized", "PaymentRequired", + "Forbidden", "NotFound", "MethodNotAllowed", "NotAcceptable", "ProxyAuthenticationRequired", + "RequestTimeout", "Conflict", "Gone", "LengthRequired", "PreconditionFailed", + "RequestEntityTooLarge", "RequestUriTooLong", "UnsupportedMediaType", + "RequestedRangeNotSatisfiable", "ExpectationFailed", "UpgradeRequired", "InternalServerError", + "NotImplemented", "BadGateway", "ServiceUnavailable", "GatewayTimeout", + "HttpVersionNotSupported". + :type status_code: str or ~azure.mgmt.recoveryservicesbackup.models.HttpStatusCode + :param headers: HTTP headers associated with this operation. + :type headers: dict[str, list[str]] + """ + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{[str]}'}, + } + + def __init__( + self, + *, + status_code: Optional[Union[str, "HttpStatusCode"]] = None, + headers: Optional[Dict[str, List[str]]] = None, + **kwargs + ): + super(OperationWorkerResponse, self).__init__(**kwargs) + self.status_code = status_code + self.headers = headers + + +class OperationResultInfoBaseResource(OperationWorkerResponse): + """Base class for operation result info. + + :param status_code: HTTP Status Code of the operation. Possible values include: "Continue", + "SwitchingProtocols", "OK", "Created", "Accepted", "NonAuthoritativeInformation", "NoContent", + "ResetContent", "PartialContent", "MultipleChoices", "Ambiguous", "MovedPermanently", "Moved", + "Found", "Redirect", "SeeOther", "RedirectMethod", "NotModified", "UseProxy", "Unused", + "TemporaryRedirect", "RedirectKeepVerb", "BadRequest", "Unauthorized", "PaymentRequired", + "Forbidden", "NotFound", "MethodNotAllowed", "NotAcceptable", "ProxyAuthenticationRequired", + "RequestTimeout", "Conflict", "Gone", "LengthRequired", "PreconditionFailed", + "RequestEntityTooLarge", "RequestUriTooLong", "UnsupportedMediaType", + "RequestedRangeNotSatisfiable", "ExpectationFailed", "UpgradeRequired", "InternalServerError", + "NotImplemented", "BadGateway", "ServiceUnavailable", "GatewayTimeout", + "HttpVersionNotSupported". + :type status_code: str or ~azure.mgmt.recoveryservicesbackup.models.HttpStatusCode + :param headers: HTTP headers associated with this operation. + :type headers: dict[str, list[str]] + :param operation: OperationResultInfoBaseResource operation. + :type operation: ~azure.mgmt.recoveryservicesbackup.models.OperationResultInfoBase + """ + + _attribute_map = { + 'status_code': {'key': 'statusCode', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{[str]}'}, + 'operation': {'key': 'operation', 'type': 'OperationResultInfoBase'}, + } + + def __init__( + self, + *, + status_code: Optional[Union[str, "HttpStatusCode"]] = None, + headers: Optional[Dict[str, List[str]]] = None, + operation: Optional["OperationResultInfoBase"] = None, + **kwargs + ): + super(OperationResultInfoBaseResource, self).__init__(status_code=status_code, headers=headers, **kwargs) + self.operation = operation + + +class OperationStatus(msrest.serialization.Model): + """Operation status. + + :param id: ID of the operation. + :type id: str + :param name: Name of the operation. + :type name: str + :param status: Operation status. Possible values include: "Invalid", "InProgress", "Succeeded", + "Failed", "Canceled". + :type status: str or ~azure.mgmt.recoveryservicesbackup.models.OperationStatusValues + :param start_time: Operation start time. Format: ISO-8601. + :type start_time: ~datetime.datetime + :param end_time: Operation end time. Format: ISO-8601. + :type end_time: ~datetime.datetime + :param error: Error information related to this operation. + :type error: ~azure.mgmt.recoveryservicesbackup.models.OperationStatusError + :param properties: Additional information associated with this operation. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.OperationStatusExtendedInfo + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'OperationStatusError'}, + 'properties': {'key': 'properties', 'type': 'OperationStatusExtendedInfo'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + status: Optional[Union[str, "OperationStatusValues"]] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + error: Optional["OperationStatusError"] = None, + properties: Optional["OperationStatusExtendedInfo"] = None, + **kwargs + ): + super(OperationStatus, self).__init__(**kwargs) + self.id = id + self.name = name + self.status = status + self.start_time = start_time + self.end_time = end_time + self.error = error + self.properties = properties + + +class OperationStatusError(msrest.serialization.Model): + """Error information associated with operation status call. + + :param code: Error code of the operation failure. + :type code: str + :param message: Error message displayed if the operation failure. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(OperationStatusError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class OperationStatusExtendedInfo(msrest.serialization.Model): + """Base class for additional information of operation status. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: OperationStatusJobExtendedInfo, OperationStatusJobsExtendedInfo, OperationStatusProvisionILRExtendedInfo, OperationStatusRecoveryPointExtendedInfo. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'OperationStatusJobExtendedInfo': 'OperationStatusJobExtendedInfo', 'OperationStatusJobsExtendedInfo': 'OperationStatusJobsExtendedInfo', 'OperationStatusProvisionILRExtendedInfo': 'OperationStatusProvisionILRExtendedInfo', 'OperationStatusRecoveryPointExtendedInfo': 'OperationStatusRecoveryPointExtendedInfo'} + } + + def __init__( + self, + **kwargs + ): + super(OperationStatusExtendedInfo, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class OperationStatusJobExtendedInfo(OperationStatusExtendedInfo): + """Operation status job extended info. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param job_id: ID of the job created for this protected item. + :type job_id: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + } + + def __init__( + self, + *, + job_id: Optional[str] = None, + **kwargs + ): + super(OperationStatusJobExtendedInfo, self).__init__(**kwargs) + self.object_type = 'OperationStatusJobExtendedInfo' # type: str + self.job_id = job_id + + +class OperationStatusJobsExtendedInfo(OperationStatusExtendedInfo): + """Operation status extended info for list of jobs. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param job_ids: IDs of the jobs created for the protected item. + :type job_ids: list[str] + :param failed_jobs_error: Stores all the failed jobs along with the corresponding error codes. + :type failed_jobs_error: dict[str, str] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'job_ids': {'key': 'jobIds', 'type': '[str]'}, + 'failed_jobs_error': {'key': 'failedJobsError', 'type': '{str}'}, + } + + def __init__( + self, + *, + job_ids: Optional[List[str]] = None, + failed_jobs_error: Optional[Dict[str, str]] = None, + **kwargs + ): + super(OperationStatusJobsExtendedInfo, self).__init__(**kwargs) + self.object_type = 'OperationStatusJobsExtendedInfo' # type: str + self.job_ids = job_ids + self.failed_jobs_error = failed_jobs_error + + +class OperationStatusProvisionILRExtendedInfo(OperationStatusExtendedInfo): + """Operation status extended info for ILR provision action. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param recovery_target: Target details for file / folder restore. + :type recovery_target: ~azure.mgmt.recoveryservicesbackup.models.InstantItemRecoveryTarget + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_target': {'key': 'recoveryTarget', 'type': 'InstantItemRecoveryTarget'}, + } + + def __init__( + self, + *, + recovery_target: Optional["InstantItemRecoveryTarget"] = None, + **kwargs + ): + super(OperationStatusProvisionILRExtendedInfo, self).__init__(**kwargs) + self.object_type = 'OperationStatusProvisionILRExtendedInfo' # type: str + self.recovery_target = recovery_target + + +class OperationStatusRecoveryPointExtendedInfo(OperationStatusExtendedInfo): + """Operation status extended info for Updated Recovery Point. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param updated_recovery_point: Recovery Point info with updated source snapshot URI. + :type updated_recovery_point: ~azure.mgmt.recoveryservicesbackup.models.RecoveryPoint + :param deleted_backup_item_version: In case the share is in soft-deleted state, populate this + field with deleted backup item. + :type deleted_backup_item_version: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'updated_recovery_point': {'key': 'updatedRecoveryPoint', 'type': 'RecoveryPoint'}, + 'deleted_backup_item_version': {'key': 'deletedBackupItemVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + updated_recovery_point: Optional["RecoveryPoint"] = None, + deleted_backup_item_version: Optional[str] = None, + **kwargs + ): + super(OperationStatusRecoveryPointExtendedInfo, self).__init__(**kwargs) + self.object_type = 'OperationStatusRecoveryPointExtendedInfo' # type: str + self.updated_recovery_point = updated_recovery_point + self.deleted_backup_item_version = deleted_backup_item_version + + +class PointInTimeRange(msrest.serialization.Model): + """Provides details for log ranges. + + :param start_time: Start time of the time range for log recovery. + :type start_time: ~datetime.datetime + :param end_time: End time of the time range for log recovery. + :type end_time: ~datetime.datetime + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(PointInTimeRange, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + + +class PreBackupValidation(msrest.serialization.Model): + """Pre-backup validation for Azure VM Workload provider. + + :param status: Status of protectable item, i.e. InProgress,Succeeded,Failed. Possible values + include: "Invalid", "Success", "Failed". + :type status: str or ~azure.mgmt.recoveryservicesbackup.models.InquiryStatus + :param code: Error code of protectable item. + :type code: str + :param message: Message corresponding to the error code for the protectable item. + :type message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "InquiryStatus"]] = None, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(PreBackupValidation, self).__init__(**kwargs) + self.status = status + self.code = code + self.message = message + + +class PrepareDataMoveRequest(msrest.serialization.Model): + """Prepare DataMove Request. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_id: Required. ARM Id of target vault. + :type target_resource_id: str + :param target_region: Required. Target Region. + :type target_region: str + :param data_move_level: Required. DataMove Level. Possible values include: "Invalid", "Vault", + "Container". + :type data_move_level: str or ~azure.mgmt.recoveryservicesbackup.models.DataMoveLevel + :param source_container_arm_ids: Source Container ArmIds + This needs to be populated only if DataMoveLevel is set to container. + :type source_container_arm_ids: list[str] + :param ignore_moved: Ignore the artifacts which are already moved. + :type ignore_moved: bool + """ + + _validation = { + 'target_resource_id': {'required': True}, + 'target_region': {'required': True}, + 'data_move_level': {'required': True}, + } + + _attribute_map = { + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + 'target_region': {'key': 'targetRegion', 'type': 'str'}, + 'data_move_level': {'key': 'dataMoveLevel', 'type': 'str'}, + 'source_container_arm_ids': {'key': 'sourceContainerArmIds', 'type': '[str]'}, + 'ignore_moved': {'key': 'ignoreMoved', 'type': 'bool'}, + } + + def __init__( + self, + *, + target_resource_id: str, + target_region: str, + data_move_level: Union[str, "DataMoveLevel"], + source_container_arm_ids: Optional[List[str]] = None, + ignore_moved: Optional[bool] = None, + **kwargs + ): + super(PrepareDataMoveRequest, self).__init__(**kwargs) + self.target_resource_id = target_resource_id + self.target_region = target_region + self.data_move_level = data_move_level + self.source_container_arm_ids = source_container_arm_ids + self.ignore_moved = ignore_moved + + +class VaultStorageConfigOperationResultResponse(msrest.serialization.Model): + """Operation result response for Vault Storage Config. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: PrepareDataMoveResponse. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'PrepareDataMoveResponse': 'PrepareDataMoveResponse'} + } + + def __init__( + self, + **kwargs + ): + super(VaultStorageConfigOperationResultResponse, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class PrepareDataMoveResponse(VaultStorageConfigOperationResultResponse): + """Prepare DataMove Response. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param correlation_id: Co-relationId for move operation. + :type correlation_id: str + :param source_vault_properties: Source Vault Properties. + :type source_vault_properties: dict[str, str] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'source_vault_properties': {'key': 'sourceVaultProperties', 'type': '{str}'}, + } + + def __init__( + self, + *, + correlation_id: Optional[str] = None, + source_vault_properties: Optional[Dict[str, str]] = None, + **kwargs + ): + super(PrepareDataMoveResponse, self).__init__(**kwargs) + self.object_type = 'PrepareDataMoveResponse' # type: str + self.correlation_id = correlation_id + self.source_vault_properties = source_vault_properties + + +class PreValidateEnableBackupRequest(msrest.serialization.Model): + """Contract to validate if backup can be enabled on the given resource in a given vault and given configuration. +It will validate followings + + +#. Vault capacity +#. VM is already protected +#. Any VM related configuration passed in properties. + + :param resource_type: ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc. Possible values + include: "Invalid", "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", + "VMwareVM", "SystemState", "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", + "SAPHanaDatabase", "SAPAseDatabase". + :type resource_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param resource_id: ARM Virtual Machine Id. + :type resource_id: str + :param vault_id: ARM id of the Recovery Services Vault. + :type vault_id: str + :param properties: Configuration of VM if any needs to be validated like OS type etc. + :type properties: str + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'vault_id': {'key': 'vaultId', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_type: Optional[Union[str, "DataSourceType"]] = None, + resource_id: Optional[str] = None, + vault_id: Optional[str] = None, + properties: Optional[str] = None, + **kwargs + ): + super(PreValidateEnableBackupRequest, self).__init__(**kwargs) + self.resource_type = resource_type + self.resource_id = resource_id + self.vault_id = vault_id + self.properties = properties + + +class PreValidateEnableBackupResponse(msrest.serialization.Model): + """Response contract for enable backup validation request. + + :param status: Validation Status. Possible values include: "Invalid", "Succeeded", "Failed". + :type status: str or ~azure.mgmt.recoveryservicesbackup.models.ValidationStatus + :param error_code: Response error code. + :type error_code: str + :param error_message: Response error message. + :type error_message: str + :param recommendation: Recommended action for user. + :type recommendation: str + :param container_name: Specifies the product specific container name. E.g. + iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + for portal. + :type container_name: str + :param protected_item_name: Specifies the product specific ds name. E.g. + vm;iaasvmcontainer;rgname;vmname. This is required for portal. + :type protected_item_name: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'recommendation': {'key': 'recommendation', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'protected_item_name': {'key': 'protectedItemName', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "ValidationStatus"]] = None, + error_code: Optional[str] = None, + error_message: Optional[str] = None, + recommendation: Optional[str] = None, + container_name: Optional[str] = None, + protected_item_name: Optional[str] = None, + **kwargs + ): + super(PreValidateEnableBackupResponse, self).__init__(**kwargs) + self.status = status + self.error_code = error_code + self.error_message = error_message + self.recommendation = recommendation + self.container_name = container_name + self.protected_item_name = protected_item_name + + +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint network resource that is linked to the Private Endpoint connection. + + :param id: Gets or sets id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = id + + +class PrivateEndpointConnection(msrest.serialization.Model): + """Private Endpoint Connection Response Properties. + + :param provisioning_state: Gets or sets provisioning state of the private endpoint connection. + Possible values include: "Succeeded", "Deleting", "Failed", "Pending". + :type provisioning_state: str or ~azure.mgmt.recoveryservicesbackup.models.ProvisioningState + :param private_endpoint: Gets or sets private endpoint associated with the private endpoint + connection. + :type private_endpoint: ~azure.mgmt.recoveryservicesbackup.models.PrivateEndpoint + :param private_link_service_connection_state: Gets or sets private link service connection + state. + :type private_link_service_connection_state: + ~azure.mgmt.recoveryservicesbackup.models.PrivateLinkServiceConnectionState + """ + + _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, + *, + provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateEndpointConnectionResource(Resource): + """Private Endpoint Connection Response Properties. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: PrivateEndpointConnectionResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.PrivateEndpointConnection + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnection'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["PrivateEndpointConnection"] = None, + **kwargs + ): + super(PrivateEndpointConnectionResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """Private Link Service Connection State. + + :param status: Gets or sets the status. Possible values include: "Pending", "Approved", + "Rejected", "Disconnected". + :type status: str or ~azure.mgmt.recoveryservicesbackup.models.PrivateEndpointConnectionStatus + :param description: Gets or sets description. + :type description: str + :param action_required: Gets or sets actions required. + :type action_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'action_required': {'key': 'actionRequired', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "PrivateEndpointConnectionStatus"]] = None, + description: Optional[str] = None, + action_required: Optional[str] = None, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.action_required = action_required + + +class ProtectableContainerResource(Resource): + """Protectable Container Class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: ProtectableContainerResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.ProtectableContainer + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ProtectableContainer'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["ProtectableContainer"] = None, + **kwargs + ): + super(ProtectableContainerResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class ProtectableContainerResourceList(ResourceList): + """List of ProtectableContainer resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.ProtectableContainerResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ProtectableContainerResource]'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["ProtectableContainerResource"]] = None, + **kwargs + ): + super(ProtectableContainerResourceList, self).__init__(next_link=next_link, **kwargs) + self.value = value + + +class ProtectedItemQueryObject(msrest.serialization.Model): + """Filters to list backup items. + + :param health_state: Health State for the backed up item. Possible values include: "Passed", + "ActionRequired", "ActionSuggested", "Invalid". + :type health_state: str or ~azure.mgmt.recoveryservicesbackup.models.HealthState + :param backup_management_type: Backup management type for the backed up item. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param item_type: Type of workload this item represents. Possible values include: "Invalid", + "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", "SystemState", + "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", "SAPHanaDatabase", + "SAPAseDatabase". + :type item_type: str or ~azure.mgmt.recoveryservicesbackup.models.DataSourceType + :param policy_name: Backup policy name associated with the backup item. + :type policy_name: str + :param container_name: Name of the container. + :type container_name: str + :param backup_engine_name: Backup Engine name. + :type backup_engine_name: str + :param friendly_name: Friendly name of protected item. + :type friendly_name: str + :param fabric_name: Name of the fabric. + :type fabric_name: str + :param backup_set_name: Name of the backup set. + :type backup_set_name: str + """ + + _attribute_map = { + 'health_state': {'key': 'healthState', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'item_type': {'key': 'itemType', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'backup_engine_name': {'key': 'backupEngineName', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'fabric_name': {'key': 'fabricName', 'type': 'str'}, + 'backup_set_name': {'key': 'backupSetName', 'type': 'str'}, + } + + def __init__( + self, + *, + health_state: Optional[Union[str, "HealthState"]] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + item_type: Optional[Union[str, "DataSourceType"]] = None, + policy_name: Optional[str] = None, + container_name: Optional[str] = None, + backup_engine_name: Optional[str] = None, + friendly_name: Optional[str] = None, + fabric_name: Optional[str] = None, + backup_set_name: Optional[str] = None, + **kwargs + ): + super(ProtectedItemQueryObject, self).__init__(**kwargs) + self.health_state = health_state + self.backup_management_type = backup_management_type + self.item_type = item_type + self.policy_name = policy_name + self.container_name = container_name + self.backup_engine_name = backup_engine_name + self.friendly_name = friendly_name + self.fabric_name = fabric_name + self.backup_set_name = backup_set_name + + +class ProtectedItemResource(Resource): + """Base class for backup items. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: ProtectedItemResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.ProtectedItem + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ProtectedItem'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["ProtectedItem"] = None, + **kwargs + ): + super(ProtectedItemResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class ProtectedItemResourceList(ResourceList): + """List of ProtectedItem resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ProtectedItemResource]'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["ProtectedItemResource"]] = None, + **kwargs + ): + super(ProtectedItemResourceList, self).__init__(next_link=next_link, **kwargs) + self.value = value + + +class ProtectionContainerResource(Resource): + """Base class for container with backup items. Containers with specific workloads are derived from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: ProtectionContainerResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.ProtectionContainer + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ProtectionContainer'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["ProtectionContainer"] = None, + **kwargs + ): + super(ProtectionContainerResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class ProtectionContainerResourceList(ResourceList): + """List of ProtectionContainer resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.ProtectionContainerResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ProtectionContainerResource]'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["ProtectionContainerResource"]] = None, + **kwargs + ): + super(ProtectionContainerResourceList, self).__init__(next_link=next_link, **kwargs) + self.value = value + + +class ProtectionIntentQueryObject(msrest.serialization.Model): + """Filters to list protection intent. + + :param backup_management_type: Backup management type for the backed up item. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param item_type: Type of workload this item represents. Possible values include: "Invalid", + "SQLInstance", "SQLAvailabilityGroupContainer". + :type item_type: str or ~azure.mgmt.recoveryservicesbackup.models.IntentItemType + :param parent_name: Parent name of the intent. + :type parent_name: str + :param item_name: Item name of the intent. + :type item_name: str + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'item_type': {'key': 'itemType', 'type': 'str'}, + 'parent_name': {'key': 'parentName', 'type': 'str'}, + 'item_name': {'key': 'itemName', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + item_type: Optional[Union[str, "IntentItemType"]] = None, + parent_name: Optional[str] = None, + item_name: Optional[str] = None, + **kwargs + ): + super(ProtectionIntentQueryObject, self).__init__(**kwargs) + self.backup_management_type = backup_management_type + self.item_type = item_type + self.parent_name = parent_name + self.item_name = item_name + + +class ProtectionIntentResource(Resource): + """Base class for backup ProtectionIntent. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: ProtectionIntentResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.ProtectionIntent + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ProtectionIntent'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["ProtectionIntent"] = None, + **kwargs + ): + super(ProtectionIntentResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class ProtectionIntentResourceList(ResourceList): + """List of ProtectionIntent resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.ProtectionIntentResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ProtectionIntentResource]'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["ProtectionIntentResource"]] = None, + **kwargs + ): + super(ProtectionIntentResourceList, self).__init__(next_link=next_link, **kwargs) + self.value = value + + +class ProtectionPolicyQueryObject(msrest.serialization.Model): + """Filters the list backup policies API. + + :param backup_management_type: Backup management type for the backup policy. Possible values + include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param fabric_name: Fabric name for filter. + :type fabric_name: str + :param workload_type: Workload type for the backup policy. Possible values include: "Invalid", + "VM", "FileFolder", "AzureSqlDb", "SQLDB", "Exchange", "Sharepoint", "VMwareVM", "SystemState", + "Client", "GenericDataSource", "SQLDataBase", "AzureFileShare", "SAPHanaDatabase", + "SAPAseDatabase". + :type workload_type: str or ~azure.mgmt.recoveryservicesbackup.models.WorkloadType + """ + + _attribute_map = { + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'fabric_name': {'key': 'fabricName', 'type': 'str'}, + 'workload_type': {'key': 'workloadType', 'type': 'str'}, + } + + def __init__( + self, + *, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + fabric_name: Optional[str] = None, + workload_type: Optional[Union[str, "WorkloadType"]] = None, + **kwargs + ): + super(ProtectionPolicyQueryObject, self).__init__(**kwargs) + self.backup_management_type = backup_management_type + self.fabric_name = fabric_name + self.workload_type = workload_type + + +class ProtectionPolicyResource(Resource): + """Base class for backup policy. Workload-specific backup policies are derived from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: ProtectionPolicyResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.ProtectionPolicy + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ProtectionPolicy'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["ProtectionPolicy"] = None, + **kwargs + ): + super(ProtectionPolicyResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class ProtectionPolicyResourceList(ResourceList): + """List of ProtectionPolicy resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.ProtectionPolicyResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ProtectionPolicyResource]'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["ProtectionPolicyResource"]] = None, + **kwargs + ): + super(ProtectionPolicyResourceList, self).__init__(next_link=next_link, **kwargs) + self.value = value + + +class RecoveryPointDiskConfiguration(msrest.serialization.Model): + """Disk configuration. + + :param number_of_disks_included_in_backup: Number of disks included in backup. + :type number_of_disks_included_in_backup: int + :param number_of_disks_attached_to_vm: Number of disks attached to the VM. + :type number_of_disks_attached_to_vm: int + :param included_disk_list: Information of disks included in backup. + :type included_disk_list: list[~azure.mgmt.recoveryservicesbackup.models.DiskInformation] + :param excluded_disk_list: Information of disks excluded from backup. + :type excluded_disk_list: list[~azure.mgmt.recoveryservicesbackup.models.DiskInformation] + """ + + _attribute_map = { + 'number_of_disks_included_in_backup': {'key': 'numberOfDisksIncludedInBackup', 'type': 'int'}, + 'number_of_disks_attached_to_vm': {'key': 'numberOfDisksAttachedToVm', 'type': 'int'}, + 'included_disk_list': {'key': 'includedDiskList', 'type': '[DiskInformation]'}, + 'excluded_disk_list': {'key': 'excludedDiskList', 'type': '[DiskInformation]'}, + } + + def __init__( + self, + *, + number_of_disks_included_in_backup: Optional[int] = None, + number_of_disks_attached_to_vm: Optional[int] = None, + included_disk_list: Optional[List["DiskInformation"]] = None, + excluded_disk_list: Optional[List["DiskInformation"]] = None, + **kwargs + ): + super(RecoveryPointDiskConfiguration, self).__init__(**kwargs) + self.number_of_disks_included_in_backup = number_of_disks_included_in_backup + self.number_of_disks_attached_to_vm = number_of_disks_attached_to_vm + self.included_disk_list = included_disk_list + self.excluded_disk_list = excluded_disk_list + + +class RecoveryPointMoveReadinessInfo(msrest.serialization.Model): + """RecoveryPointMoveReadinessInfo. + + :param is_ready_for_move: + :type is_ready_for_move: bool + :param additional_info: + :type additional_info: str + """ + + _attribute_map = { + 'is_ready_for_move': {'key': 'isReadyForMove', 'type': 'bool'}, + 'additional_info': {'key': 'additionalInfo', 'type': 'str'}, + } + + def __init__( + self, + *, + is_ready_for_move: Optional[bool] = None, + additional_info: Optional[str] = None, + **kwargs + ): + super(RecoveryPointMoveReadinessInfo, self).__init__(**kwargs) + self.is_ready_for_move = is_ready_for_move + self.additional_info = additional_info + + +class RecoveryPointRehydrationInfo(msrest.serialization.Model): + """RP Rehydration Info. + + :param rehydration_retention_duration: How long the rehydrated RP should be kept + Should be ISO8601 Duration format e.g. "P7D". + :type rehydration_retention_duration: str + :param rehydration_priority: Rehydration Priority. Possible values include: "Standard", "High". + :type rehydration_priority: str or + ~azure.mgmt.recoveryservicesbackup.models.RehydrationPriority + """ + + _attribute_map = { + 'rehydration_retention_duration': {'key': 'rehydrationRetentionDuration', 'type': 'str'}, + 'rehydration_priority': {'key': 'rehydrationPriority', 'type': 'str'}, + } + + def __init__( + self, + *, + rehydration_retention_duration: Optional[str] = None, + rehydration_priority: Optional[Union[str, "RehydrationPriority"]] = None, + **kwargs + ): + super(RecoveryPointRehydrationInfo, self).__init__(**kwargs) + self.rehydration_retention_duration = rehydration_retention_duration + self.rehydration_priority = rehydration_priority + + +class RecoveryPointResource(Resource): + """Base class for backup copies. Workload-specific backup copies are derived from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: RecoveryPointResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.RecoveryPoint + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'RecoveryPoint'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["RecoveryPoint"] = None, + **kwargs + ): + super(RecoveryPointResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class RecoveryPointResourceList(ResourceList): + """List of RecoveryPoint resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[RecoveryPointResource]'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["RecoveryPointResource"]] = None, + **kwargs + ): + super(RecoveryPointResourceList, self).__init__(next_link=next_link, **kwargs) + self.value = value + + +class RecoveryPointTierInformation(msrest.serialization.Model): + """Recovery point tier information. + + :param type: Recovery point tier type. Possible values include: "Invalid", "InstantRP", + "HardenedRP", "ArchivedRP". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierType + :param status: Recovery point tier status. Possible values include: "Invalid", "Valid", + "Disabled", "Deleted", "Rehydrated". + :type status: str or ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointTierStatus + :param extended_info: Recovery point tier status. + :type extended_info: dict[str, str] + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': '{str}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "RecoveryPointTierType"]] = None, + status: Optional[Union[str, "RecoveryPointTierStatus"]] = None, + extended_info: Optional[Dict[str, str]] = None, + **kwargs + ): + super(RecoveryPointTierInformation, self).__init__(**kwargs) + self.type = type + self.status = status + self.extended_info = extended_info + + +class RestoreFileSpecs(msrest.serialization.Model): + """Restore file specs like file path, type and target folder path info. + + :param path: Source File/Folder path. + :type path: str + :param file_spec_type: Indicates what the Path variable stands for. + :type file_spec_type: str + :param target_folder_path: Destination folder path in target FileShare. + :type target_folder_path: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'file_spec_type': {'key': 'fileSpecType', 'type': 'str'}, + 'target_folder_path': {'key': 'targetFolderPath', 'type': 'str'}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + file_spec_type: Optional[str] = None, + target_folder_path: Optional[str] = None, + **kwargs + ): + super(RestoreFileSpecs, self).__init__(**kwargs) + self.path = path + self.file_spec_type = file_spec_type + self.target_folder_path = target_folder_path + + +class RestoreRequestResource(Resource): + """Base class for restore request. Workload-specific restore requests are derived from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: RestoreRequestResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.RestoreRequest + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'RestoreRequest'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["RestoreRequest"] = None, + **kwargs + ): + super(RestoreRequestResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class RetentionDuration(msrest.serialization.Model): + """Retention duration. + + :param count: Count of duration types. Retention duration is obtained by the counting the + duration type Count times. + For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. + :type count: int + :param duration_type: Retention duration type of retention policy. Possible values include: + "Invalid", "Days", "Weeks", "Months", "Years". + :type duration_type: str or ~azure.mgmt.recoveryservicesbackup.models.RetentionDurationType + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'duration_type': {'key': 'durationType', 'type': 'str'}, + } + + def __init__( + self, + *, + count: Optional[int] = None, + duration_type: Optional[Union[str, "RetentionDurationType"]] = None, + **kwargs + ): + super(RetentionDuration, self).__init__(**kwargs) + self.count = count + self.duration_type = duration_type + + +class Settings(msrest.serialization.Model): + """Common settings field for backup management. + + :param time_zone: TimeZone optional input as string. For example: TimeZone = "Pacific Standard + Time". + :type time_zone: str + :param issqlcompression: SQL compression flag. + :type issqlcompression: bool + :param is_compression: Workload compression flag. This has been added so that + 'isSqlCompression' + will be deprecated once clients upgrade to consider this flag. + :type is_compression: bool + """ + + _attribute_map = { + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'issqlcompression': {'key': 'issqlcompression', 'type': 'bool'}, + 'is_compression': {'key': 'isCompression', 'type': 'bool'}, + } + + def __init__( + self, + *, + time_zone: Optional[str] = None, + issqlcompression: Optional[bool] = None, + is_compression: Optional[bool] = None, + **kwargs + ): + super(Settings, self).__init__(**kwargs) + self.time_zone = time_zone + self.issqlcompression = issqlcompression + self.is_compression = is_compression + + +class SimpleRetentionPolicy(RetentionPolicy): + """Simple policy retention. + + All required parameters must be populated in order to send to Azure. + + :param retention_policy_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 retention_policy_type: str + :param retention_duration: Retention duration of the protection policy. + :type retention_duration: ~azure.mgmt.recoveryservicesbackup.models.RetentionDuration + """ + + _validation = { + 'retention_policy_type': {'required': True}, + } + + _attribute_map = { + 'retention_policy_type': {'key': 'retentionPolicyType', 'type': 'str'}, + 'retention_duration': {'key': 'retentionDuration', 'type': 'RetentionDuration'}, + } + + def __init__( + self, + *, + retention_duration: Optional["RetentionDuration"] = None, + **kwargs + ): + super(SimpleRetentionPolicy, self).__init__(**kwargs) + self.retention_policy_type = 'SimpleRetentionPolicy' # type: str + self.retention_duration = retention_duration + + +class SimpleSchedulePolicy(SchedulePolicy): + """Simple policy schedule. + + All required parameters must be populated in order to send to Azure. + + :param schedule_policy_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 schedule_policy_type: str + :param schedule_run_frequency: Frequency of the schedule operation of this policy. Possible + values include: "Invalid", "Daily", "Weekly". + :type schedule_run_frequency: str or ~azure.mgmt.recoveryservicesbackup.models.ScheduleRunType + :param schedule_run_days: List of days of week this schedule has to be run. + :type schedule_run_days: list[str or ~azure.mgmt.recoveryservicesbackup.models.DayOfWeek] + :param schedule_run_times: List of times of day this schedule has to be run. + :type schedule_run_times: list[~datetime.datetime] + :param schedule_weekly_frequency: At every number weeks this schedule has to be run. + :type schedule_weekly_frequency: int + """ + + _validation = { + 'schedule_policy_type': {'required': True}, + } + + _attribute_map = { + 'schedule_policy_type': {'key': 'schedulePolicyType', 'type': 'str'}, + 'schedule_run_frequency': {'key': 'scheduleRunFrequency', 'type': 'str'}, + 'schedule_run_days': {'key': 'scheduleRunDays', 'type': '[str]'}, + 'schedule_run_times': {'key': 'scheduleRunTimes', 'type': '[iso-8601]'}, + 'schedule_weekly_frequency': {'key': 'scheduleWeeklyFrequency', 'type': 'int'}, + } + + def __init__( + self, + *, + schedule_run_frequency: Optional[Union[str, "ScheduleRunType"]] = None, + schedule_run_days: Optional[List[Union[str, "DayOfWeek"]]] = None, + schedule_run_times: Optional[List[datetime.datetime]] = None, + schedule_weekly_frequency: Optional[int] = None, + **kwargs + ): + super(SimpleSchedulePolicy, self).__init__(**kwargs) + self.schedule_policy_type = 'SimpleSchedulePolicy' # type: str + self.schedule_run_frequency = schedule_run_frequency + self.schedule_run_days = schedule_run_days + self.schedule_run_times = schedule_run_times + self.schedule_weekly_frequency = schedule_weekly_frequency + + +class SQLDataDirectory(msrest.serialization.Model): + """SQLDataDirectory info. + + :param type: Type of data directory mapping. Possible values include: "Invalid", "Data", "Log". + :type type: str or ~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectoryType + :param path: File path. + :type path: str + :param logical_name: Logical name of the file. + :type logical_name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + 'logical_name': {'key': 'logicalName', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "SQLDataDirectoryType"]] = None, + path: Optional[str] = None, + logical_name: Optional[str] = None, + **kwargs + ): + super(SQLDataDirectory, self).__init__(**kwargs) + self.type = type + self.path = path + self.logical_name = logical_name + + +class SQLDataDirectoryMapping(msrest.serialization.Model): + """Encapsulates information regarding data directory. + + :param mapping_type: Type of data directory mapping. Possible values include: "Invalid", + "Data", "Log". + :type mapping_type: str or ~azure.mgmt.recoveryservicesbackup.models.SQLDataDirectoryType + :param source_logical_name: Restore source logical name path. + :type source_logical_name: str + :param source_path: Restore source path. + :type source_path: str + :param target_path: Target path. + :type target_path: str + """ + + _attribute_map = { + 'mapping_type': {'key': 'mappingType', 'type': 'str'}, + 'source_logical_name': {'key': 'sourceLogicalName', 'type': 'str'}, + 'source_path': {'key': 'sourcePath', 'type': 'str'}, + 'target_path': {'key': 'targetPath', 'type': 'str'}, + } + + def __init__( + self, + *, + mapping_type: Optional[Union[str, "SQLDataDirectoryType"]] = None, + source_logical_name: Optional[str] = None, + source_path: Optional[str] = None, + target_path: Optional[str] = None, + **kwargs + ): + super(SQLDataDirectoryMapping, self).__init__(**kwargs) + self.mapping_type = mapping_type + self.source_logical_name = source_logical_name + self.source_path = source_path + self.target_path = target_path + + +class SubProtectionPolicy(msrest.serialization.Model): + """Sub-protection policy which includes schedule and retention. + + :param policy_type: Type of backup policy type. Possible values include: "Invalid", "Full", + "Differential", "Log", "CopyOnlyFull", "Incremental". + :type policy_type: str or ~azure.mgmt.recoveryservicesbackup.models.PolicyType + :param schedule_policy: Backup schedule specified as part of backup policy. + :type schedule_policy: ~azure.mgmt.recoveryservicesbackup.models.SchedulePolicy + :param retention_policy: Retention policy with the details on backup copy retention ranges. + :type retention_policy: ~azure.mgmt.recoveryservicesbackup.models.RetentionPolicy + """ + + _attribute_map = { + 'policy_type': {'key': 'policyType', 'type': 'str'}, + 'schedule_policy': {'key': 'schedulePolicy', 'type': 'SchedulePolicy'}, + 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, + } + + def __init__( + self, + *, + policy_type: Optional[Union[str, "PolicyType"]] = None, + schedule_policy: Optional["SchedulePolicy"] = None, + retention_policy: Optional["RetentionPolicy"] = None, + **kwargs + ): + super(SubProtectionPolicy, self).__init__(**kwargs) + self.policy_type = policy_type + self.schedule_policy = schedule_policy + self.retention_policy = retention_policy + + +class TargetAFSRestoreInfo(msrest.serialization.Model): + """Target Azure File Share Info. + + :param name: File share name. + :type name: str + :param target_resource_id: Target file share resource ARM ID. + :type target_resource_id: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + target_resource_id: Optional[str] = None, + **kwargs + ): + super(TargetAFSRestoreInfo, self).__init__(**kwargs) + self.name = name + self.target_resource_id = target_resource_id + + +class TargetRestoreInfo(msrest.serialization.Model): + """Details about target workload during restore operation. + + :param overwrite_option: Can Overwrite if Target DataBase already exists. Possible values + include: "Invalid", "FailOnConflict", "Overwrite". + :type overwrite_option: str or ~azure.mgmt.recoveryservicesbackup.models.OverwriteOptions + :param container_id: Resource Id name of the container in which Target DataBase resides. + :type container_id: str + :param database_name: Database name InstanceName/DataBaseName for SQL or System/DbName for SAP + Hana. + :type database_name: str + :param target_directory_for_file_restore: Target directory location for restore as files. + :type target_directory_for_file_restore: str + """ + + _attribute_map = { + 'overwrite_option': {'key': 'overwriteOption', 'type': 'str'}, + 'container_id': {'key': 'containerId', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'target_directory_for_file_restore': {'key': 'targetDirectoryForFileRestore', 'type': 'str'}, + } + + def __init__( + self, + *, + overwrite_option: Optional[Union[str, "OverwriteOptions"]] = None, + container_id: Optional[str] = None, + database_name: Optional[str] = None, + target_directory_for_file_restore: Optional[str] = None, + **kwargs + ): + super(TargetRestoreInfo, self).__init__(**kwargs) + self.overwrite_option = overwrite_option + self.container_id = container_id + self.database_name = database_name + self.target_directory_for_file_restore = target_directory_for_file_restore + + +class TokenInformation(msrest.serialization.Model): + """The token information details. + + :param token: Token value. + :type token: str + :param expiry_time_in_utc_ticks: Expiry time of token. + :type expiry_time_in_utc_ticks: long + :param security_pin: Security PIN. + :type security_pin: str + """ + + _attribute_map = { + 'token': {'key': 'token', 'type': 'str'}, + 'expiry_time_in_utc_ticks': {'key': 'expiryTimeInUtcTicks', 'type': 'long'}, + 'security_pin': {'key': 'securityPIN', 'type': 'str'}, + } + + def __init__( + self, + *, + token: Optional[str] = None, + expiry_time_in_utc_ticks: Optional[int] = None, + security_pin: Optional[str] = None, + **kwargs + ): + super(TokenInformation, self).__init__(**kwargs) + self.token = token + self.expiry_time_in_utc_ticks = expiry_time_in_utc_ticks + self.security_pin = security_pin + + +class TriggerDataMoveRequest(msrest.serialization.Model): + """Trigger DataMove Request. + + All required parameters must be populated in order to send to Azure. + + :param source_resource_id: Required. ARM Id of source vault. + :type source_resource_id: str + :param source_region: Required. Source Region. + :type source_region: str + :param data_move_level: Required. DataMove Level. Possible values include: "Invalid", "Vault", + "Container". + :type data_move_level: str or ~azure.mgmt.recoveryservicesbackup.models.DataMoveLevel + :param correlation_id: Required. Correlation Id. + :type correlation_id: str + :param source_container_arm_ids: Source Container ArmIds. + :type source_container_arm_ids: list[str] + :param pause_gc: Pause GC. + :type pause_gc: bool + """ + + _validation = { + 'source_resource_id': {'required': True}, + 'source_region': {'required': True}, + 'data_move_level': {'required': True}, + 'correlation_id': {'required': True}, + } + + _attribute_map = { + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'source_region': {'key': 'sourceRegion', 'type': 'str'}, + 'data_move_level': {'key': 'dataMoveLevel', 'type': 'str'}, + 'correlation_id': {'key': 'correlationId', 'type': 'str'}, + 'source_container_arm_ids': {'key': 'sourceContainerArmIds', 'type': '[str]'}, + 'pause_gc': {'key': 'pauseGC', 'type': 'bool'}, + } + + def __init__( + self, + *, + source_resource_id: str, + source_region: str, + data_move_level: Union[str, "DataMoveLevel"], + correlation_id: str, + source_container_arm_ids: Optional[List[str]] = None, + pause_gc: Optional[bool] = None, + **kwargs + ): + super(TriggerDataMoveRequest, self).__init__(**kwargs) + self.source_resource_id = source_resource_id + self.source_region = source_region + self.data_move_level = data_move_level + self.correlation_id = correlation_id + self.source_container_arm_ids = source_container_arm_ids + self.pause_gc = pause_gc + + +class ValidateOperationRequest(msrest.serialization.Model): + """Base class for validate operation request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ValidateRestoreOperationRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'ValidateRestoreOperationRequest': 'ValidateRestoreOperationRequest'} + } + + def __init__( + self, + **kwargs + ): + super(ValidateOperationRequest, self).__init__(**kwargs) + self.object_type = None # type: Optional[str] + + +class ValidateRestoreOperationRequest(ValidateOperationRequest): + """AzureRestoreValidation request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ValidateIaasVMRestoreOperationRequest. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param restore_request: Sets restore request to be validated. + :type restore_request: ~azure.mgmt.recoveryservicesbackup.models.RestoreRequest + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'restore_request': {'key': 'restoreRequest', 'type': 'RestoreRequest'}, + } + + _subtype_map = { + 'object_type': {'ValidateIaasVMRestoreOperationRequest': 'ValidateIaasVMRestoreOperationRequest'} + } + + def __init__( + self, + *, + restore_request: Optional["RestoreRequest"] = None, + **kwargs + ): + super(ValidateRestoreOperationRequest, self).__init__(**kwargs) + self.object_type = 'ValidateRestoreOperationRequest' # type: str + self.restore_request = restore_request + + +class ValidateIaasVMRestoreOperationRequest(ValidateRestoreOperationRequest): + """AzureRestoreValidation request. + + All required parameters must be populated in order to send to Azure. + + :param object_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 object_type: str + :param restore_request: Sets restore request to be validated. + :type restore_request: ~azure.mgmt.recoveryservicesbackup.models.RestoreRequest + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'restore_request': {'key': 'restoreRequest', 'type': 'RestoreRequest'}, + } + + def __init__( + self, + *, + restore_request: Optional["RestoreRequest"] = None, + **kwargs + ): + super(ValidateIaasVMRestoreOperationRequest, self).__init__(restore_request=restore_request, **kwargs) + self.object_type = 'ValidateIaasVMRestoreOperationRequest' # type: str + + +class ValidateOperationResponse(msrest.serialization.Model): + """Base class for validate operation response. + + :param validation_results: Gets the validation result. + :type validation_results: list[~azure.mgmt.recoveryservicesbackup.models.ErrorDetail] + """ + + _attribute_map = { + 'validation_results': {'key': 'validationResults', 'type': '[ErrorDetail]'}, + } + + def __init__( + self, + *, + validation_results: Optional[List["ErrorDetail"]] = None, + **kwargs + ): + super(ValidateOperationResponse, self).__init__(**kwargs) + self.validation_results = validation_results + + +class ValidateOperationsResponse(msrest.serialization.Model): + """ValidateOperationsResponse. + + :param validate_operation_response: Base class for validate operation response. + :type validate_operation_response: + ~azure.mgmt.recoveryservicesbackup.models.ValidateOperationResponse + """ + + _attribute_map = { + 'validate_operation_response': {'key': 'validateOperationResponse', 'type': 'ValidateOperationResponse'}, + } + + def __init__( + self, + *, + validate_operation_response: Optional["ValidateOperationResponse"] = None, + **kwargs + ): + super(ValidateOperationsResponse, self).__init__(**kwargs) + self.validate_operation_response = validate_operation_response + + +class VaultJob(Job): + """Vault level Job. + + All required parameters must be populated in order to send to Azure. + + :param entity_friendly_name: Friendly name of the entity on which the current job is executing. + :type entity_friendly_name: str + :param backup_management_type: Backup management type to execute the current job. Possible + values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", + "AzureStorage", "AzureWorkload", "DefaultBackup". + :type backup_management_type: str or + ~azure.mgmt.recoveryservicesbackup.models.BackupManagementType + :param operation: The operation name. + :type operation: str + :param status: Job status. + :type status: str + :param start_time: The start time. + :type start_time: ~datetime.datetime + :param end_time: The end time. + :type end_time: ~datetime.datetime + :param activity_id: ActivityId of job. + :type activity_id: str + :param job_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 job_type: str + :param duration: Time elapsed during the execution of this job. + :type duration: ~datetime.timedelta + :param actions_info: Gets or sets the state/actions applicable on this job like cancel/retry. + :type actions_info: list[str or ~azure.mgmt.recoveryservicesbackup.models.JobSupportedAction] + :param error_details: Error details on execution of this job. + :type error_details: list[~azure.mgmt.recoveryservicesbackup.models.VaultJobErrorInfo] + :param extended_info: Additional information about the job. + :type extended_info: ~azure.mgmt.recoveryservicesbackup.models.VaultJobExtendedInfo + """ + + _validation = { + 'job_type': {'required': True}, + } + + _attribute_map = { + 'entity_friendly_name': {'key': 'entityFriendlyName', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'activity_id': {'key': 'activityId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'duration'}, + 'actions_info': {'key': 'actionsInfo', 'type': '[str]'}, + 'error_details': {'key': 'errorDetails', 'type': '[VaultJobErrorInfo]'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'VaultJobExtendedInfo'}, + } + + def __init__( + self, + *, + entity_friendly_name: Optional[str] = None, + backup_management_type: Optional[Union[str, "BackupManagementType"]] = None, + operation: Optional[str] = None, + status: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + activity_id: Optional[str] = None, + duration: Optional[datetime.timedelta] = None, + actions_info: Optional[List[Union[str, "JobSupportedAction"]]] = None, + error_details: Optional[List["VaultJobErrorInfo"]] = None, + extended_info: Optional["VaultJobExtendedInfo"] = None, + **kwargs + ): + super(VaultJob, self).__init__(entity_friendly_name=entity_friendly_name, backup_management_type=backup_management_type, operation=operation, status=status, start_time=start_time, end_time=end_time, activity_id=activity_id, **kwargs) + self.job_type = 'VaultJob' # type: str + self.duration = duration + self.actions_info = actions_info + self.error_details = error_details + self.extended_info = extended_info + + +class VaultJobErrorInfo(msrest.serialization.Model): + """Vault Job specific error information. + + :param error_code: Error code. + :type error_code: int + :param error_string: Localized error string. + :type error_string: str + :param recommendations: List of localized recommendations for above error code. + :type recommendations: list[str] + """ + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'error_string': {'key': 'errorString', 'type': 'str'}, + 'recommendations': {'key': 'recommendations', 'type': '[str]'}, + } + + def __init__( + self, + *, + error_code: Optional[int] = None, + error_string: Optional[str] = None, + recommendations: Optional[List[str]] = None, + **kwargs + ): + super(VaultJobErrorInfo, self).__init__(**kwargs) + self.error_code = error_code + self.error_string = error_string + self.recommendations = recommendations + + +class VaultJobExtendedInfo(msrest.serialization.Model): + """Vault Job for CMK - has CMK specific info. + + :param property_bag: Job properties. + :type property_bag: dict[str, str] + """ + + _attribute_map = { + 'property_bag': {'key': 'propertyBag', 'type': '{str}'}, + } + + def __init__( + self, + *, + property_bag: Optional[Dict[str, str]] = None, + **kwargs + ): + super(VaultJobExtendedInfo, self).__init__(**kwargs) + self.property_bag = property_bag + + +class WeeklyRetentionFormat(msrest.serialization.Model): + """Weekly retention format. + + :param days_of_the_week: List of days of the week. + :type days_of_the_week: list[str or ~azure.mgmt.recoveryservicesbackup.models.DayOfWeek] + :param weeks_of_the_month: List of weeks of month. + :type weeks_of_the_month: list[str or ~azure.mgmt.recoveryservicesbackup.models.WeekOfMonth] + """ + + _attribute_map = { + 'days_of_the_week': {'key': 'daysOfTheWeek', 'type': '[str]'}, + 'weeks_of_the_month': {'key': 'weeksOfTheMonth', 'type': '[str]'}, + } + + def __init__( + self, + *, + days_of_the_week: Optional[List[Union[str, "DayOfWeek"]]] = None, + weeks_of_the_month: Optional[List[Union[str, "WeekOfMonth"]]] = None, + **kwargs + ): + super(WeeklyRetentionFormat, self).__init__(**kwargs) + self.days_of_the_week = days_of_the_week + self.weeks_of_the_month = weeks_of_the_month + + +class WeeklyRetentionSchedule(msrest.serialization.Model): + """Weekly retention schedule. + + :param days_of_the_week: List of days of week for weekly retention policy. + :type days_of_the_week: list[str or ~azure.mgmt.recoveryservicesbackup.models.DayOfWeek] + :param retention_times: Retention times of retention policy. + :type retention_times: list[~datetime.datetime] + :param retention_duration: Retention duration of retention Policy. + :type retention_duration: ~azure.mgmt.recoveryservicesbackup.models.RetentionDuration + """ + + _attribute_map = { + 'days_of_the_week': {'key': 'daysOfTheWeek', 'type': '[str]'}, + 'retention_times': {'key': 'retentionTimes', 'type': '[iso-8601]'}, + 'retention_duration': {'key': 'retentionDuration', 'type': 'RetentionDuration'}, + } + + def __init__( + self, + *, + days_of_the_week: Optional[List[Union[str, "DayOfWeek"]]] = None, + retention_times: Optional[List[datetime.datetime]] = None, + retention_duration: Optional["RetentionDuration"] = None, + **kwargs + ): + super(WeeklyRetentionSchedule, self).__init__(**kwargs) + self.days_of_the_week = days_of_the_week + self.retention_times = retention_times + self.retention_duration = retention_duration + + +class WorkloadCrrAccessToken(CrrAccessToken): + """WorkloadCrrAccessToken. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Type of the specific object - used for deserializing.Constant + filled by server. + :type object_type: str + :param access_token_string: Access token used for authentication. + :type access_token_string: str + :param subscription_id: Subscription Id of the source vault. + :type subscription_id: str + :param resource_group_name: Resource Group name of the source vault. + :type resource_group_name: str + :param resource_name: Resource Name of the source vault. + :type resource_name: str + :param resource_id: Resource Id of the source vault. + :type resource_id: str + :param protection_container_id: Protected item container id. + :type protection_container_id: long + :param recovery_point_id: Recovery Point Id. + :type recovery_point_id: str + :param recovery_point_time: Recovery Point Time. + :type recovery_point_time: str + :param container_name: Container Unique name. + :type container_name: str + :param container_type: Container Type. + :type container_type: str + :param backup_management_type: Backup Management Type. + :type backup_management_type: str + :param datasource_type: Datasource Type. + :type datasource_type: str + :param datasource_name: Datasource Friendly Name. + :type datasource_name: str + :param datasource_id: Datasource Id. + :type datasource_id: str + :param datasource_container_name: Datasource Container Unique Name. + :type datasource_container_name: str + :param coordinator_service_stamp_id: CoordinatorServiceStampId to be used by BCM in restore + call. + :type coordinator_service_stamp_id: str + :param coordinator_service_stamp_uri: CoordinatorServiceStampUri to be used by BCM in restore + call. + :type coordinator_service_stamp_uri: str + :param protection_service_stamp_id: ProtectionServiceStampId to be used by BCM in restore call. + :type protection_service_stamp_id: str + :param protection_service_stamp_uri: ProtectionServiceStampUri to be used by BCM in restore + call. + :type protection_service_stamp_uri: str + :param token_extended_information: Extended Information about the token like FileSpec etc. + :type token_extended_information: str + :param rp_tier_information: Recovery point Tier Information. + :type rp_tier_information: dict[str, str] + :param rp_original_sa_option: Recovery point information: Original SA option. + :type rp_original_sa_option: bool + :param rp_is_managed_virtual_machine: Recovery point information: Managed virtual machine. + :type rp_is_managed_virtual_machine: bool + :param rp_vm_size_description: Recovery point information: VM size description. + :type rp_vm_size_description: str + :param b_ms_active_region: Active region name of BMS Stamp. + :type b_ms_active_region: str + :param protectable_object_unique_name: + :type protectable_object_unique_name: str + :param protectable_object_friendly_name: + :type protectable_object_friendly_name: str + :param protectable_object_workload_type: + :type protectable_object_workload_type: str + :param protectable_object_protection_state: + :type protectable_object_protection_state: str + :param protectable_object_container_host_os_name: + :type protectable_object_container_host_os_name: str + :param protectable_object_parent_logical_container_name: + :type protectable_object_parent_logical_container_name: str + :param container_id: Container Id. + :type container_id: str + :param policy_name: Policy Name. + :type policy_name: str + :param policy_id: Policy Id. + :type policy_id: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'access_token_string': {'key': 'accessTokenString', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'protection_container_id': {'key': 'protectionContainerId', 'type': 'long'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'datasource_type': {'key': 'datasourceType', 'type': 'str'}, + 'datasource_name': {'key': 'datasourceName', 'type': 'str'}, + 'datasource_id': {'key': 'datasourceId', 'type': 'str'}, + 'datasource_container_name': {'key': 'datasourceContainerName', 'type': 'str'}, + 'coordinator_service_stamp_id': {'key': 'coordinatorServiceStampId', 'type': 'str'}, + 'coordinator_service_stamp_uri': {'key': 'coordinatorServiceStampUri', 'type': 'str'}, + 'protection_service_stamp_id': {'key': 'protectionServiceStampId', 'type': 'str'}, + 'protection_service_stamp_uri': {'key': 'protectionServiceStampUri', 'type': 'str'}, + 'token_extended_information': {'key': 'tokenExtendedInformation', 'type': 'str'}, + 'rp_tier_information': {'key': 'rpTierInformation', 'type': '{str}'}, + 'rp_original_sa_option': {'key': 'rpOriginalSAOption', 'type': 'bool'}, + 'rp_is_managed_virtual_machine': {'key': 'rpIsManagedVirtualMachine', 'type': 'bool'}, + 'rp_vm_size_description': {'key': 'rpVMSizeDescription', 'type': 'str'}, + 'b_ms_active_region': {'key': 'bMSActiveRegion', 'type': 'str'}, + 'protectable_object_unique_name': {'key': 'protectableObjectUniqueName', 'type': 'str'}, + 'protectable_object_friendly_name': {'key': 'protectableObjectFriendlyName', 'type': 'str'}, + 'protectable_object_workload_type': {'key': 'protectableObjectWorkloadType', 'type': 'str'}, + 'protectable_object_protection_state': {'key': 'protectableObjectProtectionState', 'type': 'str'}, + 'protectable_object_container_host_os_name': {'key': 'protectableObjectContainerHostOsName', 'type': 'str'}, + 'protectable_object_parent_logical_container_name': {'key': 'protectableObjectParentLogicalContainerName', 'type': 'str'}, + 'container_id': {'key': 'containerId', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + } + + def __init__( + self, + *, + access_token_string: Optional[str] = None, + subscription_id: Optional[str] = None, + resource_group_name: Optional[str] = None, + resource_name: Optional[str] = None, + resource_id: Optional[str] = None, + protection_container_id: Optional[int] = None, + recovery_point_id: Optional[str] = None, + recovery_point_time: Optional[str] = None, + container_name: Optional[str] = None, + container_type: Optional[str] = None, + backup_management_type: Optional[str] = None, + datasource_type: Optional[str] = None, + datasource_name: Optional[str] = None, + datasource_id: Optional[str] = None, + datasource_container_name: Optional[str] = None, + coordinator_service_stamp_id: Optional[str] = None, + coordinator_service_stamp_uri: Optional[str] = None, + protection_service_stamp_id: Optional[str] = None, + protection_service_stamp_uri: Optional[str] = None, + token_extended_information: Optional[str] = None, + rp_tier_information: Optional[Dict[str, str]] = None, + rp_original_sa_option: Optional[bool] = None, + rp_is_managed_virtual_machine: Optional[bool] = None, + rp_vm_size_description: Optional[str] = None, + b_ms_active_region: Optional[str] = None, + protectable_object_unique_name: Optional[str] = None, + protectable_object_friendly_name: Optional[str] = None, + protectable_object_workload_type: Optional[str] = None, + protectable_object_protection_state: Optional[str] = None, + protectable_object_container_host_os_name: Optional[str] = None, + protectable_object_parent_logical_container_name: Optional[str] = None, + container_id: Optional[str] = None, + policy_name: Optional[str] = None, + policy_id: Optional[str] = None, + **kwargs + ): + super(WorkloadCrrAccessToken, self).__init__(access_token_string=access_token_string, subscription_id=subscription_id, resource_group_name=resource_group_name, resource_name=resource_name, resource_id=resource_id, protection_container_id=protection_container_id, recovery_point_id=recovery_point_id, recovery_point_time=recovery_point_time, container_name=container_name, container_type=container_type, backup_management_type=backup_management_type, datasource_type=datasource_type, datasource_name=datasource_name, datasource_id=datasource_id, datasource_container_name=datasource_container_name, coordinator_service_stamp_id=coordinator_service_stamp_id, coordinator_service_stamp_uri=coordinator_service_stamp_uri, protection_service_stamp_id=protection_service_stamp_id, protection_service_stamp_uri=protection_service_stamp_uri, token_extended_information=token_extended_information, rp_tier_information=rp_tier_information, rp_original_sa_option=rp_original_sa_option, rp_is_managed_virtual_machine=rp_is_managed_virtual_machine, rp_vm_size_description=rp_vm_size_description, b_ms_active_region=b_ms_active_region, **kwargs) + self.object_type = 'WorkloadCrrAccessToken' # type: str + self.protectable_object_unique_name = protectable_object_unique_name + self.protectable_object_friendly_name = protectable_object_friendly_name + self.protectable_object_workload_type = protectable_object_workload_type + self.protectable_object_protection_state = protectable_object_protection_state + self.protectable_object_container_host_os_name = protectable_object_container_host_os_name + self.protectable_object_parent_logical_container_name = protectable_object_parent_logical_container_name + self.container_id = container_id + self.policy_name = policy_name + self.policy_id = policy_id + + +class WorkloadInquiryDetails(msrest.serialization.Model): + """Details of an inquired protectable item. + + :param type: Type of the Workload such as SQL, Oracle etc. + :type type: str + :param item_count: Contains the protectable item Count inside this Container. + :type item_count: long + :param inquiry_validation: Inquiry validation such as permissions and other backup validations. + :type inquiry_validation: ~azure.mgmt.recoveryservicesbackup.models.InquiryValidation + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'item_count': {'key': 'itemCount', 'type': 'long'}, + 'inquiry_validation': {'key': 'inquiryValidation', 'type': 'InquiryValidation'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + item_count: Optional[int] = None, + inquiry_validation: Optional["InquiryValidation"] = None, + **kwargs + ): + super(WorkloadInquiryDetails, self).__init__(**kwargs) + self.type = type + self.item_count = item_count + self.inquiry_validation = inquiry_validation + + +class WorkloadItemResource(Resource): + """Base class for backup item. Workload-specific backup items are derived from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: WorkloadItemResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.WorkloadItem + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'WorkloadItem'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["WorkloadItem"] = None, + **kwargs + ): + super(WorkloadItemResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class WorkloadItemResourceList(ResourceList): + """List of WorkloadItem resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.WorkloadItemResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[WorkloadItemResource]'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["WorkloadItemResource"]] = None, + **kwargs + ): + super(WorkloadItemResourceList, self).__init__(next_link=next_link, **kwargs) + self.value = value + + +class WorkloadProtectableItemResource(Resource): + """Base class for backup item. Workload-specific backup items are derived from this class. + + 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 location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: WorkloadProtectableItemResource properties. + :type properties: ~azure.mgmt.recoveryservicesbackup.models.WorkloadProtectableItem + """ + + _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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'WorkloadProtectableItem'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + e_tag: Optional[str] = None, + properties: Optional["WorkloadProtectableItem"] = None, + **kwargs + ): + super(WorkloadProtectableItemResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class WorkloadProtectableItemResourceList(ResourceList): + """List of WorkloadProtectableItem resources. + + :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :type next_link: str + :param value: List of resources. + :type value: list[~azure.mgmt.recoveryservicesbackup.models.WorkloadProtectableItemResource] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[WorkloadProtectableItemResource]'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["WorkloadProtectableItemResource"]] = None, + **kwargs + ): + super(WorkloadProtectableItemResourceList, self).__init__(next_link=next_link, **kwargs) + self.value = value + + +class YearlyRetentionSchedule(msrest.serialization.Model): + """Yearly retention schedule. + + :param retention_schedule_format_type: Retention schedule format for yearly retention policy. + Possible values include: "Invalid", "Daily", "Weekly". + :type retention_schedule_format_type: str or + ~azure.mgmt.recoveryservicesbackup.models.RetentionScheduleFormat + :param months_of_year: List of months of year of yearly retention policy. + :type months_of_year: list[str or ~azure.mgmt.recoveryservicesbackup.models.MonthOfYear] + :param retention_schedule_daily: Daily retention format for yearly retention policy. + :type retention_schedule_daily: ~azure.mgmt.recoveryservicesbackup.models.DailyRetentionFormat + :param retention_schedule_weekly: Weekly retention format for yearly retention policy. + :type retention_schedule_weekly: + ~azure.mgmt.recoveryservicesbackup.models.WeeklyRetentionFormat + :param retention_times: Retention times of retention policy. + :type retention_times: list[~datetime.datetime] + :param retention_duration: Retention duration of retention Policy. + :type retention_duration: ~azure.mgmt.recoveryservicesbackup.models.RetentionDuration + """ + + _attribute_map = { + 'retention_schedule_format_type': {'key': 'retentionScheduleFormatType', 'type': 'str'}, + 'months_of_year': {'key': 'monthsOfYear', 'type': '[str]'}, + 'retention_schedule_daily': {'key': 'retentionScheduleDaily', 'type': 'DailyRetentionFormat'}, + 'retention_schedule_weekly': {'key': 'retentionScheduleWeekly', 'type': 'WeeklyRetentionFormat'}, + 'retention_times': {'key': 'retentionTimes', 'type': '[iso-8601]'}, + 'retention_duration': {'key': 'retentionDuration', 'type': 'RetentionDuration'}, + } + + def __init__( + self, + *, + retention_schedule_format_type: Optional[Union[str, "RetentionScheduleFormat"]] = None, + months_of_year: Optional[List[Union[str, "MonthOfYear"]]] = None, + retention_schedule_daily: Optional["DailyRetentionFormat"] = None, + retention_schedule_weekly: Optional["WeeklyRetentionFormat"] = None, + retention_times: Optional[List[datetime.datetime]] = None, + retention_duration: Optional["RetentionDuration"] = None, + **kwargs + ): + super(YearlyRetentionSchedule, self).__init__(**kwargs) + self.retention_schedule_format_type = retention_schedule_format_type + self.months_of_year = months_of_year + self.retention_schedule_daily = retention_schedule_daily + self.retention_schedule_weekly = retention_schedule_weekly + self.retention_times = retention_times + self.retention_duration = retention_duration diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_recovery_services_backup_client_enums.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_recovery_services_backup_client_enums.py new file mode 100644 index 000000000000..3cea74f70c47 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_recovery_services_backup_client_enums.py @@ -0,0 +1,689 @@ +# 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. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +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 AzureFileShareType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """File Share type XSync or XSMB. + """ + + INVALID = "Invalid" + XSMB = "XSMB" + X_SYNC = "XSync" + +class BackupEngineType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the backup engine. + """ + + INVALID = "Invalid" + DPM_BACKUP_ENGINE = "DpmBackupEngine" + AZURE_BACKUP_SERVER_ENGINE = "AzureBackupServerEngine" + +class BackupItemType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of backup items associated with this container. + """ + + INVALID = "Invalid" + VM = "VM" + FILE_FOLDER = "FileFolder" + AZURE_SQL_DB = "AzureSqlDb" + SQLDB = "SQLDB" + EXCHANGE = "Exchange" + SHAREPOINT = "Sharepoint" + V_MWARE_VM = "VMwareVM" + SYSTEM_STATE = "SystemState" + CLIENT = "Client" + GENERIC_DATA_SOURCE = "GenericDataSource" + SQL_DATA_BASE = "SQLDataBase" + AZURE_FILE_SHARE = "AzureFileShare" + SAP_HANA_DATABASE = "SAPHanaDatabase" + SAP_ASE_DATABASE = "SAPAseDatabase" + +class BackupManagementType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Backup management type to execute the current job. + """ + + INVALID = "Invalid" + AZURE_IAAS_VM = "AzureIaasVM" + MAB = "MAB" + DPM = "DPM" + AZURE_BACKUP_SERVER = "AzureBackupServer" + AZURE_SQL = "AzureSql" + AZURE_STORAGE = "AzureStorage" + AZURE_WORKLOAD = "AzureWorkload" + DEFAULT_BACKUP = "DefaultBackup" + +class BackupType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of backup, viz. Full, Differential, Log or CopyOnlyFull + """ + + INVALID = "Invalid" + FULL = "Full" + DIFFERENTIAL = "Differential" + LOG = "Log" + COPY_ONLY_FULL = "CopyOnlyFull" + INCREMENTAL = "Incremental" + +class ContainerType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of container for filter + """ + + INVALID = "Invalid" + UNKNOWN = "Unknown" + IAAS_VM_CONTAINER = "IaasVMContainer" + IAAS_VM_SERVICE_CONTAINER = "IaasVMServiceContainer" + DPM_CONTAINER = "DPMContainer" + AZURE_BACKUP_SERVER_CONTAINER = "AzureBackupServerContainer" + MAB_CONTAINER = "MABContainer" + CLUSTER = "Cluster" + AZURE_SQL_CONTAINER = "AzureSqlContainer" + WINDOWS = "Windows" + V_CENTER = "VCenter" + VM_APP_CONTAINER = "VMAppContainer" + SQLAG_WORK_LOAD_CONTAINER = "SQLAGWorkLoadContainer" + STORAGE_CONTAINER = "StorageContainer" + GENERIC_CONTAINER = "GenericContainer" + +class CopyOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Options to resolve copy conflicts. + """ + + INVALID = "Invalid" + CREATE_COPY = "CreateCopy" + SKIP = "Skip" + OVERWRITE = "Overwrite" + FAIL_ON_CONFLICT = "FailOnConflict" + +class CreateMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Create mode to indicate recovery of existing soft deleted data source or creation of new data + source. + """ + + INVALID = "Invalid" + DEFAULT = "Default" + RECOVER = "Recover" + +class DataMoveLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """DataMove Level + """ + + INVALID = "Invalid" + VAULT = "Vault" + CONTAINER = "Container" + +class DataSourceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of workload this item represents. + """ + + INVALID = "Invalid" + VM = "VM" + FILE_FOLDER = "FileFolder" + AZURE_SQL_DB = "AzureSqlDb" + SQLDB = "SQLDB" + EXCHANGE = "Exchange" + SHAREPOINT = "Sharepoint" + V_MWARE_VM = "VMwareVM" + SYSTEM_STATE = "SystemState" + CLIENT = "Client" + GENERIC_DATA_SOURCE = "GenericDataSource" + SQL_DATA_BASE = "SQLDataBase" + AZURE_FILE_SHARE = "AzureFileShare" + SAP_HANA_DATABASE = "SAPHanaDatabase" + SAP_ASE_DATABASE = "SAPAseDatabase" + +class DayOfWeek(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + SUNDAY = "Sunday" + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + +class EncryptionAtRestType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Encryption At Rest Type + """ + + INVALID = "Invalid" + MICROSOFT_MANAGED = "MicrosoftManaged" + CUSTOMER_MANAGED = "CustomerManaged" + +class EnhancedSecurityState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Enabled or Disabled. + """ + + INVALID = "Invalid" + ENABLED = "Enabled" + DISABLED = "Disabled" + +class FabricName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies the fabric name - Azure or AD + """ + + INVALID = "Invalid" + AZURE = "Azure" + +class HealthState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Health State for the backed up item. + """ + + PASSED = "Passed" + ACTION_REQUIRED = "ActionRequired" + ACTION_SUGGESTED = "ActionSuggested" + INVALID = "Invalid" + +class HealthStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """backups running status for this backup item. + """ + + PASSED = "Passed" + ACTION_REQUIRED = "ActionRequired" + ACTION_SUGGESTED = "ActionSuggested" + INVALID = "Invalid" + +class HttpStatusCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """HTTP Status Code of the operation. + """ + + CONTINUE_ENUM = "Continue" + SWITCHING_PROTOCOLS = "SwitchingProtocols" + OK = "OK" + CREATED = "Created" + ACCEPTED = "Accepted" + NON_AUTHORITATIVE_INFORMATION = "NonAuthoritativeInformation" + NO_CONTENT = "NoContent" + RESET_CONTENT = "ResetContent" + PARTIAL_CONTENT = "PartialContent" + MULTIPLE_CHOICES = "MultipleChoices" + AMBIGUOUS = "Ambiguous" + MOVED_PERMANENTLY = "MovedPermanently" + MOVED = "Moved" + FOUND = "Found" + REDIRECT = "Redirect" + SEE_OTHER = "SeeOther" + REDIRECT_METHOD = "RedirectMethod" + NOT_MODIFIED = "NotModified" + USE_PROXY = "UseProxy" + UNUSED = "Unused" + TEMPORARY_REDIRECT = "TemporaryRedirect" + REDIRECT_KEEP_VERB = "RedirectKeepVerb" + BAD_REQUEST = "BadRequest" + UNAUTHORIZED = "Unauthorized" + PAYMENT_REQUIRED = "PaymentRequired" + FORBIDDEN = "Forbidden" + NOT_FOUND = "NotFound" + METHOD_NOT_ALLOWED = "MethodNotAllowed" + NOT_ACCEPTABLE = "NotAcceptable" + PROXY_AUTHENTICATION_REQUIRED = "ProxyAuthenticationRequired" + REQUEST_TIMEOUT = "RequestTimeout" + CONFLICT = "Conflict" + GONE = "Gone" + LENGTH_REQUIRED = "LengthRequired" + PRECONDITION_FAILED = "PreconditionFailed" + REQUEST_ENTITY_TOO_LARGE = "RequestEntityTooLarge" + REQUEST_URI_TOO_LONG = "RequestUriTooLong" + UNSUPPORTED_MEDIA_TYPE = "UnsupportedMediaType" + REQUESTED_RANGE_NOT_SATISFIABLE = "RequestedRangeNotSatisfiable" + EXPECTATION_FAILED = "ExpectationFailed" + UPGRADE_REQUIRED = "UpgradeRequired" + INTERNAL_SERVER_ERROR = "InternalServerError" + NOT_IMPLEMENTED = "NotImplemented" + BAD_GATEWAY = "BadGateway" + SERVICE_UNAVAILABLE = "ServiceUnavailable" + GATEWAY_TIMEOUT = "GatewayTimeout" + HTTP_VERSION_NOT_SUPPORTED = "HttpVersionNotSupported" + +class InfrastructureEncryptionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + INVALID = "Invalid" + DISABLED = "Disabled" + ENABLED = "Enabled" + +class InquiryStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of protectable item, i.e. InProgress,Succeeded,Failed + """ + + INVALID = "Invalid" + SUCCESS = "Success" + FAILED = "Failed" + +class IntentItemType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of workload this item represents + """ + + INVALID = "Invalid" + SQL_INSTANCE = "SQLInstance" + SQL_AVAILABILITY_GROUP_CONTAINER = "SQLAvailabilityGroupContainer" + +class JobOperationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of operation. + """ + + INVALID = "Invalid" + REGISTER = "Register" + UN_REGISTER = "UnRegister" + CONFIGURE_BACKUP = "ConfigureBackup" + BACKUP = "Backup" + RESTORE = "Restore" + DISABLE_BACKUP = "DisableBackup" + DELETE_BACKUP_DATA = "DeleteBackupData" + CROSS_REGION_RESTORE = "CrossRegionRestore" + UNDELETE = "Undelete" + UPDATE_CUSTOMER_MANAGED_KEY = "UpdateCustomerManagedKey" + +class JobStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of the job. + """ + + INVALID = "Invalid" + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" + COMPLETED_WITH_WARNINGS = "CompletedWithWarnings" + CANCELLED = "Cancelled" + CANCELLING = "Cancelling" + +class JobSupportedAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + INVALID = "Invalid" + CANCELLABLE = "Cancellable" + RETRIABLE = "Retriable" + +class LastBackupStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Last backup operation status. Possible values: Healthy, Unhealthy. + """ + + INVALID = "Invalid" + HEALTHY = "Healthy" + UNHEALTHY = "Unhealthy" + IR_PENDING = "IRPending" + +class LastUpdateStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + INVALID = "Invalid" + NOT_ENABLED = "NotEnabled" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + PARTIALLY_FAILED = "PartiallyFailed" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + +class MabServerType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Server type of MAB container. + """ + + INVALID = "Invalid" + UNKNOWN = "Unknown" + IAAS_VM_CONTAINER = "IaasVMContainer" + IAAS_VM_SERVICE_CONTAINER = "IaasVMServiceContainer" + DPM_CONTAINER = "DPMContainer" + AZURE_BACKUP_SERVER_CONTAINER = "AzureBackupServerContainer" + MAB_CONTAINER = "MABContainer" + CLUSTER = "Cluster" + AZURE_SQL_CONTAINER = "AzureSqlContainer" + WINDOWS = "Windows" + V_CENTER = "VCenter" + VM_APP_CONTAINER = "VMAppContainer" + SQLAG_WORK_LOAD_CONTAINER = "SQLAGWorkLoadContainer" + STORAGE_CONTAINER = "StorageContainer" + GENERIC_CONTAINER = "GenericContainer" + +class MonthOfYear(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + INVALID = "Invalid" + JANUARY = "January" + FEBRUARY = "February" + MARCH = "March" + APRIL = "April" + MAY = "May" + JUNE = "June" + JULY = "July" + AUGUST = "August" + SEPTEMBER = "September" + OCTOBER = "October" + NOVEMBER = "November" + DECEMBER = "December" + +class OperationStatusValues(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Operation status. + """ + + INVALID = "Invalid" + IN_PROGRESS = "InProgress" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + +class OperationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Re-Do Operation + """ + + INVALID = "Invalid" + REGISTER = "Register" + REREGISTER = "Reregister" + +class OverwriteOptions(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Can Overwrite if Target DataBase already exists + """ + + INVALID = "Invalid" + FAIL_ON_CONFLICT = "FailOnConflict" + OVERWRITE = "Overwrite" + +class PolicyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of backup policy type + """ + + INVALID = "Invalid" + FULL = "Full" + DIFFERENTIAL = "Differential" + LOG = "Log" + COPY_ONLY_FULL = "CopyOnlyFull" + INCREMENTAL = "Incremental" + +class PrivateEndpointConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets or sets the status + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + +class ProtectedItemHealthStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Health status of the backup item, evaluated based on last heartbeat received + """ + + INVALID = "Invalid" + HEALTHY = "Healthy" + UNHEALTHY = "Unhealthy" + NOT_REACHABLE = "NotReachable" + IR_PENDING = "IRPending" + +class ProtectedItemState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Backup state of the backed up item. + """ + + INVALID = "Invalid" + IR_PENDING = "IRPending" + PROTECTED = "Protected" + PROTECTION_ERROR = "ProtectionError" + PROTECTION_STOPPED = "ProtectionStopped" + PROTECTION_PAUSED = "ProtectionPaused" + +class ProtectionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Backup state of this backup item. + """ + + INVALID = "Invalid" + IR_PENDING = "IRPending" + PROTECTED = "Protected" + PROTECTION_ERROR = "ProtectionError" + PROTECTION_STOPPED = "ProtectionStopped" + PROTECTION_PAUSED = "ProtectionPaused" + +class ProtectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Specifies whether the container is registered or not + """ + + INVALID = "Invalid" + NOT_PROTECTED = "NotProtected" + PROTECTING = "Protecting" + PROTECTED = "Protected" + PROTECTION_FAILED = "ProtectionFailed" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Gets or sets provisioning state of the private endpoint connection + """ + + SUCCEEDED = "Succeeded" + DELETING = "Deleting" + FAILED = "Failed" + PENDING = "Pending" + +class RecoveryMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines whether the current recovery mode is file restore or database restore + """ + + INVALID = "Invalid" + FILE_RECOVERY = "FileRecovery" + WORKLOAD_RECOVERY = "WorkloadRecovery" + +class RecoveryPointTierStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Recovery point tier status. + """ + + INVALID = "Invalid" + VALID = "Valid" + DISABLED = "Disabled" + DELETED = "Deleted" + REHYDRATED = "Rehydrated" + +class RecoveryPointTierType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Recovery point tier type. + """ + + INVALID = "Invalid" + INSTANT_RP = "InstantRP" + HARDENED_RP = "HardenedRP" + ARCHIVED_RP = "ArchivedRP" + +class RecoveryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of this recovery. + """ + + INVALID = "Invalid" + ORIGINAL_LOCATION = "OriginalLocation" + ALTERNATE_LOCATION = "AlternateLocation" + RESTORE_DISKS = "RestoreDisks" + OFFLINE = "Offline" + +class RehydrationPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Rehydration Priority + """ + + STANDARD = "Standard" + HIGH = "High" + +class ResourceHealthStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Resource Health Status + """ + + HEALTHY = "Healthy" + TRANSIENT_DEGRADED = "TransientDegraded" + PERSISTENT_DEGRADED = "PersistentDegraded" + TRANSIENT_UNHEALTHY = "TransientUnhealthy" + PERSISTENT_UNHEALTHY = "PersistentUnhealthy" + INVALID = "Invalid" + +class RestorePointQueryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """RestorePoint type + """ + + INVALID = "Invalid" + FULL = "Full" + LOG = "Log" + DIFFERENTIAL = "Differential" + FULL_AND_DIFFERENTIAL = "FullAndDifferential" + ALL = "All" + INCREMENTAL = "Incremental" + +class RestorePointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of restore point + """ + + INVALID = "Invalid" + FULL = "Full" + LOG = "Log" + DIFFERENTIAL = "Differential" + INCREMENTAL = "Incremental" + +class RestoreRequestType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Restore Type (FullShareRestore or ItemLevelRestore) + """ + + INVALID = "Invalid" + FULL_SHARE_RESTORE = "FullShareRestore" + ITEM_LEVEL_RESTORE = "ItemLevelRestore" + +class RetentionDurationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Retention duration type of retention policy. + """ + + INVALID = "Invalid" + DAYS = "Days" + WEEKS = "Weeks" + MONTHS = "Months" + YEARS = "Years" + +class RetentionScheduleFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Retention schedule format type for monthly retention policy. + """ + + INVALID = "Invalid" + DAILY = "Daily" + WEEKLY = "Weekly" + +class ScheduleRunType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Frequency of the schedule operation of this policy. + """ + + INVALID = "Invalid" + DAILY = "Daily" + WEEKLY = "Weekly" + +class SoftDeleteFeatureState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Soft Delete feature state + """ + + INVALID = "Invalid" + ENABLED = "Enabled" + DISABLED = "Disabled" + +class SQLDataDirectoryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of data directory mapping + """ + + INVALID = "Invalid" + DATA = "Data" + LOG = "Log" + +class StorageType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Storage type + """ + + INVALID = "Invalid" + GEO_REDUNDANT = "GeoRedundant" + LOCALLY_REDUNDANT = "LocallyRedundant" + ZONE_REDUNDANT = "ZoneRedundant" + READ_ACCESS_GEO_ZONE_REDUNDANT = "ReadAccessGeoZoneRedundant" + +class StorageTypeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is + always Locked. + """ + + INVALID = "Invalid" + LOCKED = "Locked" + UNLOCKED = "Unlocked" + +class SupportStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Support status of feature + """ + + INVALID = "Invalid" + SUPPORTED = "Supported" + DEFAULT_OFF = "DefaultOFF" + DEFAULT_ON = "DefaultON" + NOT_SUPPORTED = "NotSupported" + +class Type(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Backup management type for this container. + """ + + INVALID = "Invalid" + BACKUP_PROTECTED_ITEM_COUNT_SUMMARY = "BackupProtectedItemCountSummary" + BACKUP_PROTECTION_CONTAINER_COUNT_SUMMARY = "BackupProtectionContainerCountSummary" + +class UsagesUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Unit of the usage. + """ + + COUNT = "Count" + BYTES = "Bytes" + SECONDS = "Seconds" + PERCENT = "Percent" + COUNT_PER_SECOND = "CountPerSecond" + BYTES_PER_SECOND = "BytesPerSecond" + +class ValidationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Validation Status + """ + + INVALID = "Invalid" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + +class WeekOfMonth(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + FIRST = "First" + SECOND = "Second" + THIRD = "Third" + FOURTH = "Fourth" + LAST = "Last" + INVALID = "Invalid" + +class WorkloadItemType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Workload item type of the item for which intent is to be set + """ + + INVALID = "Invalid" + SQL_INSTANCE = "SQLInstance" + SQL_DATA_BASE = "SQLDataBase" + SAP_HANA_SYSTEM = "SAPHanaSystem" + SAP_HANA_DATABASE = "SAPHanaDatabase" + SAP_ASE_SYSTEM = "SAPAseSystem" + SAP_ASE_DATABASE = "SAPAseDatabase" + +class WorkloadType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Workload type of backup item. + """ + + INVALID = "Invalid" + VM = "VM" + FILE_FOLDER = "FileFolder" + AZURE_SQL_DB = "AzureSqlDb" + SQLDB = "SQLDB" + EXCHANGE = "Exchange" + SHAREPOINT = "Sharepoint" + V_MWARE_VM = "VMwareVM" + SYSTEM_STATE = "SystemState" + CLIENT = "Client" + GENERIC_DATA_SOURCE = "GenericDataSource" + SQL_DATA_BASE = "SQLDataBase" + AZURE_FILE_SHARE = "AzureFileShare" + SAP_HANA_DATABASE = "SAPHanaDatabase" + SAP_ASE_DATABASE = "SAPAseDatabase" diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/__init__.py new file mode 100644 index 000000000000..fe527523e1c6 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/__init__.py @@ -0,0 +1,115 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._protection_intent_operations import ProtectionIntentOperations +from ._backup_status_operations import BackupStatusOperations +from ._feature_support_operations import FeatureSupportOperations +from ._backup_protection_intent_operations import BackupProtectionIntentOperations +from ._backup_usage_summaries_operations import BackupUsageSummariesOperations +from ._operations import Operations +from ._backup_resource_vault_configs_operations import BackupResourceVaultConfigsOperations +from ._backup_resource_encryption_configs_operations import BackupResourceEncryptionConfigsOperations +from ._private_endpoint_connection_operations import PrivateEndpointConnectionOperations +from ._private_endpoint_operations import PrivateEndpointOperations +from ._recovery_services_backup_client_operations import RecoveryServicesBackupClientOperationsMixin +from ._bms_prepare_data_move_operation_result_operations import BMSPrepareDataMoveOperationResultOperations +from ._protected_items_operations import ProtectedItemsOperations +from ._protected_item_operation_results_operations import ProtectedItemOperationResultsOperations +from ._recovery_points_operations import RecoveryPointsOperations +from ._restores_operations import RestoresOperations +from ._backup_policies_operations import BackupPoliciesOperations +from ._protection_policies_operations import ProtectionPoliciesOperations +from ._protection_policy_operation_results_operations import ProtectionPolicyOperationResultsOperations +from ._backup_jobs_operations import BackupJobsOperations +from ._job_details_operations import JobDetailsOperations +from ._job_cancellations_operations import JobCancellationsOperations +from ._job_operation_results_operations import JobOperationResultsOperations +from ._export_jobs_operation_results_operations import ExportJobsOperationResultsOperations +from ._jobs_operations import JobsOperations +from ._backup_protected_items_operations import BackupProtectedItemsOperations +from ._operation_operations import OperationOperations +from ._backup_engines_operations import BackupEnginesOperations +from ._protection_container_refresh_operation_results_operations import ProtectionContainerRefreshOperationResultsOperations +from ._protectable_containers_operations import ProtectableContainersOperations +from ._protection_containers_operations import ProtectionContainersOperations +from ._backup_workload_items_operations import BackupWorkloadItemsOperations +from ._protection_container_operation_results_operations import ProtectionContainerOperationResultsOperations +from ._backups_operations import BackupsOperations +from ._protected_item_operation_statuses_operations import ProtectedItemOperationStatusesOperations +from ._item_level_recovery_connections_operations import ItemLevelRecoveryConnectionsOperations +from ._backup_operation_results_operations import BackupOperationResultsOperations +from ._backup_operation_statuses_operations import BackupOperationStatusesOperations +from ._protection_policy_operation_statuses_operations import ProtectionPolicyOperationStatusesOperations +from ._backup_protectable_items_operations import BackupProtectableItemsOperations +from ._backup_protection_containers_operations import BackupProtectionContainersOperations +from ._security_pins_operations import SecurityPINsOperations +from ._recovery_points_recommended_for_move_operations import RecoveryPointsRecommendedForMoveOperations +from ._aad_properties_operations import AadPropertiesOperations +from ._cross_region_restore_operations import CrossRegionRestoreOperations +from ._backup_crr_job_details_operations import BackupCrrJobDetailsOperations +from ._backup_crr_jobs_operations import BackupCrrJobsOperations +from ._crr_operation_results_operations import CrrOperationResultsOperations +from ._crr_operation_status_operations import CrrOperationStatusOperations +from ._backup_resource_storage_configs_operations import BackupResourceStorageConfigsOperations +from ._recovery_points_crr_operations import RecoveryPointsCrrOperations +from ._backup_protected_items_crr_operations import BackupProtectedItemsCrrOperations + +__all__ = [ + 'ProtectionIntentOperations', + 'BackupStatusOperations', + 'FeatureSupportOperations', + 'BackupProtectionIntentOperations', + 'BackupUsageSummariesOperations', + 'Operations', + 'BackupResourceVaultConfigsOperations', + 'BackupResourceEncryptionConfigsOperations', + 'PrivateEndpointConnectionOperations', + 'PrivateEndpointOperations', + 'RecoveryServicesBackupClientOperationsMixin', + 'BMSPrepareDataMoveOperationResultOperations', + 'ProtectedItemsOperations', + 'ProtectedItemOperationResultsOperations', + 'RecoveryPointsOperations', + 'RestoresOperations', + 'BackupPoliciesOperations', + 'ProtectionPoliciesOperations', + 'ProtectionPolicyOperationResultsOperations', + 'BackupJobsOperations', + 'JobDetailsOperations', + 'JobCancellationsOperations', + 'JobOperationResultsOperations', + 'ExportJobsOperationResultsOperations', + 'JobsOperations', + 'BackupProtectedItemsOperations', + 'OperationOperations', + 'BackupEnginesOperations', + 'ProtectionContainerRefreshOperationResultsOperations', + 'ProtectableContainersOperations', + 'ProtectionContainersOperations', + 'BackupWorkloadItemsOperations', + 'ProtectionContainerOperationResultsOperations', + 'BackupsOperations', + 'ProtectedItemOperationStatusesOperations', + 'ItemLevelRecoveryConnectionsOperations', + 'BackupOperationResultsOperations', + 'BackupOperationStatusesOperations', + 'ProtectionPolicyOperationStatusesOperations', + 'BackupProtectableItemsOperations', + 'BackupProtectionContainersOperations', + 'SecurityPINsOperations', + 'RecoveryPointsRecommendedForMoveOperations', + 'AadPropertiesOperations', + 'CrossRegionRestoreOperations', + 'BackupCrrJobDetailsOperations', + 'BackupCrrJobsOperations', + 'CrrOperationResultsOperations', + 'CrrOperationStatusOperations', + 'BackupResourceStorageConfigsOperations', + 'RecoveryPointsCrrOperations', + 'BackupProtectedItemsCrrOperations', +] diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_aad_properties_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_aad_properties_operations.py new file mode 100644 index 000000000000..e99a8c16e9c0 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_aad_properties_operations.py @@ -0,0 +1,108 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class AadPropertiesOperations(object): + """AadPropertiesOperations 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.recoveryservicesbackup.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 + + def get( + self, + azure_region, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.AADPropertiesResource" + """Fetches the AAD properties from target region BCM stamp. + + Fetches the AAD properties from target region BCM stamp. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param filter: OData filter options. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AADPropertiesResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.AADPropertiesResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AADPropertiesResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, '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') + + # 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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AADPropertiesResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupAadProperties'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_crr_job_details_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_crr_job_details_operations.py new file mode 100644 index 000000000000..8716bcc1cad1 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_crr_job_details_operations.py @@ -0,0 +1,111 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupCrrJobDetailsOperations(object): + """BackupCrrJobDetailsOperations 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.recoveryservicesbackup.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 + + def get( + self, + azure_region, # type: str + parameters, # type: "_models.CrrJobRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.JobResource" + """Get CRR job details from target region. + + Get CRR job details from target region. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param parameters: CRR Job request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.CrrJobRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.JobResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CrrJobRequest') + 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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_crr_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_crr_jobs_operations.py new file mode 100644 index 000000000000..dd79a28a027c --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_crr_jobs_operations.py @@ -0,0 +1,141 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupCrrJobsOperations(object): + """BackupCrrJobsOperations 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.recoveryservicesbackup.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 + + def list( + self, + azure_region, # type: str + parameters, # type: "_models.CrrJobRequest" + filter=None, # type: Optional[str] + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.JobResourceList"] + """Gets the list of CRR jobs from the target region. + + Gets the list of CRR jobs from the target region. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param parameters: Backup CRR Job request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.CrrJobRequest + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 JobResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # 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') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, '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') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CrrJobRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CrrJobRequest') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('JobResourceList', 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]: + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJobs'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_engines_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_engines_operations.py new file mode 100644 index 000000000000..45d18fc6f8ea --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_engines_operations.py @@ -0,0 +1,207 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupEnginesOperations(object): + """BackupEnginesOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name, # type: str + resource_group_name, # type: str + filter=None, # type: Optional[str] + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BackupEngineBaseResourceList"] + """Backup management servers registered to Recovery Services Vault. Returns a pageable list of + servers. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 BackupEngineBaseResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.BackupEngineBaseResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupEngineBaseResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BackupEngineBaseResourceList', 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/{vaultName}/backupEngines'} # type: ignore + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + backup_engine_name, # type: str + filter=None, # type: Optional[str] + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupEngineBaseResource" + """Returns backup management server registered to Recovery Services Vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param backup_engine_name: Name of the backup management server. + :type backup_engine_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupEngineBaseResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupEngineBaseResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupEngineBaseResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'backupEngineName': self._serialize.url("backup_engine_name", backup_engine_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 skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # 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 + + 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) + + deserialized = self._deserialize('BackupEngineBaseResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines/{backupEngineName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_jobs_operations.py new file mode 100644 index 000000000000..634c4adfbaf0 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_jobs_operations.py @@ -0,0 +1,132 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupJobsOperations(object): + """BackupJobsOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name, # type: str + resource_group_name, # type: str + filter=None, # type: Optional[str] + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.JobResourceList"] + """Provides a pageable list of jobs. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 JobResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.JobResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('JobResourceList', 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/{vaultName}/backupJobs'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_operation_results_operations.py new file mode 100644 index 000000000000..f2478d5d9dcf --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_operation_results_operations.py @@ -0,0 +1,112 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupOperationResultsOperations(object): + """BackupOperationResultsOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Provides the status of the delete operations such as deleting backed up item. Once the + operation has started, the + status code in the response would be Accepted. It will continue to be in this state till it + reaches completion. On + successful completion, the status code will be OK. This method expects OperationID as an + argument. OperationID is + part of the Location header of the operation response. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param operation_id: OperationID which represents the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_operation_statuses_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_operation_statuses_operations.py new file mode 100644 index 000000000000..0892b51eeaec --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_operation_statuses_operations.py @@ -0,0 +1,113 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupOperationStatusesOperations(object): + """BackupOperationStatusesOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.OperationStatus" + """Fetches the status of an operation such as triggering a backup, restore. The status can be in + progress, completed + or failed. You can refer to the OperationStatus enum for all the possible states of an + operation. Some operations + create jobs. This method returns the list of jobs when the operation is complete. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param operation_id: OperationID which represents the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatus, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('OperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_policies_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_policies_operations.py new file mode 100644 index 000000000000..a593bc42169d --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_policies_operations.py @@ -0,0 +1,129 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupPoliciesOperations(object): + """BackupPoliciesOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name, # type: str + resource_group_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProtectionPolicyResourceList"] + """Lists of backup policies associated with Recovery Services Vault. API provides pagination + parameters to fetch + scoped results. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :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 ProtectionPolicyResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.ProtectionPolicyResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionPolicyResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProtectionPolicyResourceList', 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/{vaultName}/backupPolicies'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protectable_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protectable_items_operations.py new file mode 100644 index 000000000000..5b9868618d01 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protectable_items_operations.py @@ -0,0 +1,134 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupProtectableItemsOperations(object): + """BackupProtectableItemsOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name, # type: str + resource_group_name, # type: str + filter=None, # type: Optional[str] + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WorkloadProtectableItemResourceList"] + """Provides a pageable list of protectable objects within your subscription according to the query + filter and the + pagination parameters. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 WorkloadProtectableItemResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.WorkloadProtectableItemResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkloadProtectableItemResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkloadProtectableItemResourceList', 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/{vaultName}/backupProtectableItems'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protected_items_crr_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protected_items_crr_operations.py new file mode 100644 index 000000000000..1fdbb0bfbffb --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protected_items_crr_operations.py @@ -0,0 +1,133 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupProtectedItemsCrrOperations(object): + """BackupProtectedItemsCrrOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name, # type: str + resource_group_name, # type: str + filter=None, # type: Optional[str] + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProtectedItemResourceList"] + """Provides a pageable list of all items that are backed up within a vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 ProtectedItemResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectedItemResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProtectedItemResourceList', 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]: + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems/'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protected_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protected_items_operations.py new file mode 100644 index 000000000000..e8c0b81d08f4 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protected_items_operations.py @@ -0,0 +1,132 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupProtectedItemsOperations(object): + """BackupProtectedItemsOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name, # type: str + resource_group_name, # type: str + filter=None, # type: Optional[str] + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProtectedItemResourceList"] + """Provides a pageable list of all items that are backed up within a vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 ProtectedItemResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectedItemResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProtectedItemResourceList', 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/{vaultName}/backupProtectedItems'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protection_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protection_containers_operations.py new file mode 100644 index 000000000000..ee65f2bd7518 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protection_containers_operations.py @@ -0,0 +1,127 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupProtectionContainersOperations(object): + """BackupProtectionContainersOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name, # type: str + resource_group_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProtectionContainerResourceList"] + """Lists the containers registered to Recovery Services Vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :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 ProtectionContainerResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.ProtectionContainerResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProtectionContainerResourceList', 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/{vaultName}/backupProtectionContainers'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protection_intent_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protection_intent_operations.py new file mode 100644 index 000000000000..9bd19ccd1537 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protection_intent_operations.py @@ -0,0 +1,132 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupProtectionIntentOperations(object): + """BackupProtectionIntentOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name, # type: str + resource_group_name, # type: str + filter=None, # type: Optional[str] + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProtectionIntentResourceList"] + """Provides a pageable list of all intents that are present within a vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 ProtectionIntentResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.ProtectionIntentResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionIntentResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProtectionIntentResourceList', 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/{vaultName}/backupProtectionIntents'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_resource_encryption_configs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_resource_encryption_configs_operations.py new file mode 100644 index 000000000000..055aea07f296 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_resource_encryption_configs_operations.py @@ -0,0 +1,172 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupResourceEncryptionConfigsOperations(object): + """BackupResourceEncryptionConfigsOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupResourceEncryptionConfigResource" + """Fetches Vault Encryption config. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupResourceEncryptionConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupResourceEncryptionConfigResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupResourceEncryptionConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig'} # type: ignore + + def update( + self, + vault_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.BackupResourceEncryptionConfigResource" + **kwargs # type: Any + ): + # type: (...) -> None + """Updates Vault encryption config. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: Vault encryption input config request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackupResourceEncryptionConfigResource') + 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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_resource_storage_configs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_resource_storage_configs_operations.py new file mode 100644 index 000000000000..535731e8f366 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_resource_storage_configs_operations.py @@ -0,0 +1,241 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupResourceStorageConfigsOperations(object): + """BackupResourceStorageConfigsOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupResourceConfigResource" + """Fetches resource storage config. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupResourceConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupResourceConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupResourceConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig'} # type: ignore + + def update( + self, + vault_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.BackupResourceConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupResourceConfigResource" + """Updates vault storage model type. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: Vault storage config request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupResourceConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupResourceConfigResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackupResourceConfigResource') + 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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupResourceConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig'} # type: ignore + + def patch( + self, + vault_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.BackupResourceConfigResource" + **kwargs # type: Any + ): + # type: (...) -> None + """Updates vault storage model type. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: Vault storage config request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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 = "2018-12-20" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.patch.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackupResourceConfigResource') + 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 + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_resource_vault_configs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_resource_vault_configs_operations.py new file mode 100644 index 000000000000..b2475a216434 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_resource_vault_configs_operations.py @@ -0,0 +1,244 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupResourceVaultConfigsOperations(object): + """BackupResourceVaultConfigsOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupResourceVaultConfigResource" + """Fetches resource vault config. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupResourceVaultConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceVaultConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupResourceVaultConfigResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupResourceVaultConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig'} # type: ignore + + def update( + self, + vault_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.BackupResourceVaultConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupResourceVaultConfigResource" + """Updates vault security config. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: resource config request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceVaultConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupResourceVaultConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceVaultConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupResourceVaultConfigResource"] + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackupResourceVaultConfigResource') + 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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupResourceVaultConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig'} # type: ignore + + def put( + self, + vault_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.BackupResourceVaultConfigResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupResourceVaultConfigResource" + """Updates vault security config. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: resource config request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceVaultConfigResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupResourceVaultConfigResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupResourceVaultConfigResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupResourceVaultConfigResource"] + 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.put.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackupResourceVaultConfigResource') + 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 + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BackupResourceVaultConfigResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_status_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_status_operations.py new file mode 100644 index 000000000000..a7f9e31ad7a4 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_status_operations.py @@ -0,0 +1,110 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupStatusOperations(object): + """BackupStatusOperations 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.recoveryservicesbackup.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 + + def get( + self, + azure_region, # type: str + parameters, # type: "_models.BackupStatusRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.BackupStatusResponse" + """Get the container backup status. + + Get the container backup status. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param parameters: Container Backup Status Request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.BackupStatusRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BackupStatusResponse, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.BackupStatusResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupStatusResponse"] + 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.get.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackupStatusRequest') + 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 + + 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) + + deserialized = self._deserialize('BackupStatusResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupStatus'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_usage_summaries_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_usage_summaries_operations.py new file mode 100644 index 000000000000..8b3d4f9345a0 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_usage_summaries_operations.py @@ -0,0 +1,132 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupUsageSummariesOperations(object): + """BackupUsageSummariesOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name, # type: str + resource_group_name, # type: str + filter=None, # type: Optional[str] + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.BackupManagementUsageList"] + """Fetches the backup management usage summaries of the vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 BackupManagementUsageList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.BackupManagementUsageList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupManagementUsageList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BackupManagementUsageList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return 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/{vaultName}/backupUsageSummaries'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_workload_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_workload_items_operations.py new file mode 100644 index 000000000000..1c5513e7e343 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_workload_items_operations.py @@ -0,0 +1,142 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupWorkloadItemsOperations(object): + """BackupWorkloadItemsOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + filter=None, # type: Optional[str] + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WorkloadItemResourceList"] + """Provides a pageable list of workload item of a specific container according to the query filter + and the pagination + parameters. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the container. + :type fabric_name: str + :param container_name: Name of the container. + :type container_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :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 WorkloadItemResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.WorkloadItemResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkloadItemResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", 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 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) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkloadItemResourceList', 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/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/items'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backups_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backups_operations.py new file mode 100644 index 000000000000..271b86d9a6b6 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backups_operations.py @@ -0,0 +1,124 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BackupsOperations(object): + """BackupsOperations 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.recoveryservicesbackup.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 + + def trigger( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + parameters, # type: "_models.BackupRequestResource" + **kwargs # type: Any + ): + # type: (...) -> None + """Triggers backup for specified backed up item. This is an asynchronous operation. To know the + status of the + operation, call GetProtectedItemOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backup item. + :type fabric_name: str + :param container_name: Container name associated with the backup item. + :type container_name: str + :param protected_item_name: Backup item for which backup needs to be triggered. + :type protected_item_name: str + :param parameters: resource backup request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.BackupRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.trigger.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'BackupRequestResource') + 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 + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + trigger.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/backup'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_bms_prepare_data_move_operation_result_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_bms_prepare_data_move_operation_result_operations.py new file mode 100644 index 000000000000..9d1ba0a24c48 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_bms_prepare_data_move_operation_result_operations.py @@ -0,0 +1,112 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class BMSPrepareDataMoveOperationResultOperations(object): + """BMSPrepareDataMoveOperationResultOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VaultStorageConfigOperationResultResponse"] + """Fetches Operation Result for Prepare Data Move. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param operation_id: + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VaultStorageConfigOperationResultResponse, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.VaultStorageConfigOperationResultResponse or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VaultStorageConfigOperationResultResponse"]] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VaultStorageConfigOperationResultResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_cross_region_restore_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_cross_region_restore_operations.py new file mode 100644 index 000000000000..936c7d28cf98 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_cross_region_restore_operations.py @@ -0,0 +1,164 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +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]] + +class CrossRegionRestoreOperations(object): + """CrossRegionRestoreOperations 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.recoveryservicesbackup.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 + + def _trigger_initial( + self, + azure_region, # type: str + parameters, # type: "_models.CrossRegionRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> 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 = "2018-12-20" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._trigger_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'CrossRegionRestoreRequest') + 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 + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _trigger_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore'} # type: ignore + + def begin_trigger( + self, + azure_region, # type: str + parameters, # type: "_models.CrossRegionRestoreRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores the specified backed up data in a different region as compared to where the data is backed up. + + Restores the specified backed up data in a different region as compared to where the data is + backed up. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param parameters: resource cross region restore request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.CrossRegionRestoreRequest + :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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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._trigger_initial( + azure_region=azure_region, + parameters=parameters, + 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 = { + 'azureRegion': self._serialize.url("azure_region", azure_region, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **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_trigger.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_crr_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_crr_operation_results_operations.py new file mode 100644 index 000000000000..b65e4435fb91 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_crr_operation_results_operations.py @@ -0,0 +1,102 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class CrrOperationResultsOperations(object): + """CrrOperationResultsOperations 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.recoveryservicesbackup.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 + + def get( + self, + azure_region, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """get. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param operation_id: + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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 = "2018-12-20" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_crr_operation_status_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_crr_operation_status_operations.py new file mode 100644 index 000000000000..7307c4bc17a6 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_crr_operation_status_operations.py @@ -0,0 +1,105 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class CrrOperationStatusOperations(object): + """CrrOperationStatusOperations 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.recoveryservicesbackup.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 + + def get( + self, + azure_region, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.OperationStatus" + """get. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param operation_id: + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatus, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationsStatus/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_export_jobs_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_export_jobs_operation_results_operations.py new file mode 100644 index 000000000000..f252839f0a46 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_export_jobs_operation_results_operations.py @@ -0,0 +1,116 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class ExportJobsOperationResultsOperations(object): + """ExportJobsOperationResultsOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.OperationResultInfoBaseResource" + """Gets the operation result of operation triggered by Export Jobs API. If the operation is + successful, then it also + contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in + JSON serialized format. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param operation_id: OperationID which represents the export job. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationResultInfoBaseResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationResultInfoBaseResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResultInfoBaseResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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 = self._client.get(url, query_parameters, header_parameters) + 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) + + if response.status_code == 200: + deserialized = self._deserialize('OperationResultInfoBaseResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('OperationResultInfoBaseResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/operationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_feature_support_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_feature_support_operations.py new file mode 100644 index 000000000000..baff5a8814df --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_feature_support_operations.py @@ -0,0 +1,110 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class FeatureSupportOperations(object): + """FeatureSupportOperations 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.recoveryservicesbackup.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 + + def validate( + self, + azure_region, # type: str + parameters, # type: "_models.FeatureSupportRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.AzureVMResourceFeatureSupportResponse" + """It will validate if given feature with resource properties is supported in service. + + It will validate if given feature with resource properties is supported in service. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param parameters: Feature support request object. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.FeatureSupportRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AzureVMResourceFeatureSupportResponse, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.AzureVMResourceFeatureSupportResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureVMResourceFeatureSupportResponse"] + 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.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'FeatureSupportRequest') + 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 + + 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) + + deserialized = self._deserialize('AzureVMResourceFeatureSupportResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate.metadata = {'url': '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupValidateFeatures'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_item_level_recovery_connections_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_item_level_recovery_connections_operations.py new file mode 100644 index 000000000000..13afb2a2eb70 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_item_level_recovery_connections_operations.py @@ -0,0 +1,209 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class ItemLevelRecoveryConnectionsOperations(object): + """ItemLevelRecoveryConnectionsOperations 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.recoveryservicesbackup.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 + + def provision( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + recovery_point_id, # type: str + parameters, # type: "_models.ILRRequestResource" + **kwargs # type: Any + ): + # type: (...) -> None + """Provisions a script which invokes an iSCSI connection to the backup data. Executing this script + opens a file + explorer displaying all the recoverable files and folders. This is an asynchronous operation. + To know the status of + provisioning, call GetProtectedItemOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up items. + :type fabric_name: str + :param container_name: Container name associated with the backed up items. + :type container_name: str + :param protected_item_name: Backed up item name whose files/folders are to be restored. + :type protected_item_name: str + :param recovery_point_id: Recovery point ID which represents backed up data. iSCSI connection + will be provisioned + for this backed up data. + :type recovery_point_id: str + :param parameters: resource ILR request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.ILRRequestResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.provision.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ILRRequestResource') + 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 + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + provision.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/provisionInstantItemRecovery'} # type: ignore + + def revoke( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + recovery_point_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Revokes an iSCSI connection which can be used to download a script. Executing this script opens + a file explorer + displaying all recoverable files and folders. This is an asynchronous operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up items. + :type fabric_name: str + :param container_name: Container name associated with the backed up items. + :type container_name: str + :param protected_item_name: Backed up item name whose files/folders are to be restored. + :type protected_item_name: str + :param recovery_point_id: Recovery point ID which represents backed up data. iSCSI connection + will be revoked for + this backed up data. + :type recovery_point_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.revoke.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + revoke.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/revokeInstantItemRecovery'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_job_cancellations_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_job_cancellations_operations.py new file mode 100644 index 000000000000..4f9708f57c0a --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_job_cancellations_operations.py @@ -0,0 +1,107 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class JobCancellationsOperations(object): + """JobCancellationsOperations 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.recoveryservicesbackup.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 + + def trigger( + self, + vault_name, # type: str + resource_group_name, # type: str + job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call + GetCancelOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param job_name: Name of the job to cancel. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.trigger.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + trigger.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/cancel'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_job_details_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_job_details_operations.py new file mode 100644 index 000000000000..b5f602260fc5 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_job_details_operations.py @@ -0,0 +1,109 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class JobDetailsOperations(object): + """JobDetailsOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.JobResource" + """Gets extended information associated with the job. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param job_name: Name of the job whose details are to be fetched. + :type job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.JobResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.JobResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('JobResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_job_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_job_operation_results_operations.py new file mode 100644 index 000000000000..0df984220163 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_job_operation_results_operations.py @@ -0,0 +1,110 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class JobOperationResultsOperations(object): + """JobOperationResultsOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + job_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Fetches the result of any operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param job_name: Job name whose operation result has to be fetched. + :type job_name: str + :param operation_id: OperationID which represents the operation whose result has to be fetched. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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'), + '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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/operationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_jobs_operations.py new file mode 100644 index 000000000000..fbdaba246ae6 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_jobs_operations.py @@ -0,0 +1,107 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class JobsOperations(object): + """JobsOperations 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.recoveryservicesbackup.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 + + def export( + self, + vault_name, # type: str + resource_group_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Triggers export of jobs specified by filters and returns an OperationID to track. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.export.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + export.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobsExport'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_operation_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_operation_operations.py new file mode 100644 index 000000000000..b574b7d0ae55 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_operation_operations.py @@ -0,0 +1,113 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class OperationOperations(object): + """OperationOperations 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.recoveryservicesbackup.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 + + def validate( + self, + vault_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.ValidateOperationRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.ValidateOperationsResponse" + """Validate operation for specified backed up item. This is a synchronous operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: resource validate operation request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.ValidateOperationRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ValidateOperationsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ValidateOperationsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ValidateOperationsResponse"] + 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.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ValidateOperationRequest') + 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 + + 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) + + deserialized = self._deserialize('ValidateOperationsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperation'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_operations.py new file mode 100644 index 000000000000..d0fc6e429c1f --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_operations.py @@ -0,0 +1,109 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class Operations(object): + """Operations 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.recoveryservicesbackup.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 + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> 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.recoveryservicesbackup.models.ClientDiscoveryResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ClientDiscoveryResponse"] + error_map = { + 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 = 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) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ClientDiscoveryResponse', 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': '/providers/Microsoft.RecoveryServices/operations'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_private_endpoint_connection_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_private_endpoint_connection_operations.py new file mode 100644 index 000000000000..4c3451a6f519 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_private_endpoint_connection_operations.py @@ -0,0 +1,368 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +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]] + +class PrivateEndpointConnectionOperations(object): + """PrivateEndpointConnectionOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnectionResource" + """Get Private Endpoint Connection. This call is made by Backup Admin. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.PrivateEndpointConnectionResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _put_initial( + self, + vault_name, # type: str + resource_group_name, # type: str + private_endpoint_connection_name, # type: str + parameters, # type: "_models.PrivateEndpointConnectionResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnectionResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + 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._put_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateEndpointConnectionResource') + 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 + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _put_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_put( + self, + vault_name, # type: str + resource_group_name, # type: str + private_endpoint_connection_name, # type: str + parameters, # type: "_models.PrivateEndpointConnectionResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PrivateEndpointConnectionResource"] + """Approve or Reject Private Endpoint requests. This call is made by Backup Admin. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param parameters: Request body for operation. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.PrivateEndpointConnectionResource + :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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or 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 PrivateEndpointConnectionResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicesbackup.models.PrivateEndpointConnectionResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionResource"] + 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._put_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + private_endpoint_connection_name=private_endpoint_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_initial( + self, + vault_name, # type: str + resource_group_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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-03-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete( + self, + vault_name, # type: str + resource_group_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete Private Endpoint requests. This call is made by Backup Admin. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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._delete_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + private_endpoint_connection_name=private_endpoint_connection_name, + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_private_endpoint_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_private_endpoint_operations.py new file mode 100644 index 000000000000..a6998d1e966e --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_private_endpoint_operations.py @@ -0,0 +1,116 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class PrivateEndpointOperations(object): + """PrivateEndpointOperations 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.recoveryservicesbackup.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 + + def get_operation_status( + self, + vault_name, # type: str + resource_group_name, # type: str + private_endpoint_connection_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.OperationStatus" + """Gets the operation status for a private endpoint connection. + + Gets the operation status for a private endpoint connection. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param operation_id: Operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatus, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}/operationsStatus/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protectable_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protectable_containers_operations.py new file mode 100644 index 000000000000..af1b19038611 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protectable_containers_operations.py @@ -0,0 +1,131 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class ProtectableContainersOperations(object): + """ProtectableContainersOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProtectableContainerResourceList"] + """Lists the containers that can be registered to Recovery Services Vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: + :type fabric_name: str + :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 ProtectableContainerResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.ProtectableContainerResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectableContainerResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_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') + + 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) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProtectableContainerResourceList', 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/{vaultName}/backupFabrics/{fabricName}/protectableContainers'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protected_item_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protected_item_operation_results_operations.py new file mode 100644 index 000000000000..5c0fbaabe1e7 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protected_item_operation_results_operations.py @@ -0,0 +1,124 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class ProtectedItemOperationResultsOperations(object): + """ProtectedItemOperationResultsOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProtectedItemResource"] + """Fetches the result of any operation on the backup item. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backup item. + :type fabric_name: str + :param container_name: Container name associated with the backup item. + :type container_name: str + :param protected_item_name: Backup item name whose details are to be fetched. + :type protected_item_name: str + :param operation_id: OperationID which represents the operation whose result needs to be + fetched. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectedItemResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResource or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectedItemResource"]] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + 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('ProtectedItemResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protected_item_operation_statuses_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protected_item_operation_statuses_operations.py new file mode 100644 index 000000000000..6ca495e3191b --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protected_item_operation_statuses_operations.py @@ -0,0 +1,125 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class ProtectedItemOperationStatusesOperations(object): + """ProtectedItemOperationStatusesOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.OperationStatus" + """Fetches the status of an operation such as triggering a backup, restore. The status can be in + progress, completed + or failed. You can refer to the OperationStatus enum for all the possible states of the + operation. Some operations + create jobs. This method returns the list of jobs associated with the operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backup item. + :type fabric_name: str + :param container_name: Container name associated with the backup item. + :type container_name: str + :param protected_item_name: Backup item name whose details are to be fetched. + :type protected_item_name: str + :param operation_id: OperationID represents the operation whose status needs to be fetched. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatus, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('OperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationsStatus/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protected_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protected_items_operations.py new file mode 100644 index 000000000000..cecd100eff84 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protected_items_operations.py @@ -0,0 +1,280 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class ProtectedItemsOperations(object): + """ProtectedItemsOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.ProtectedItemResource" + """Provides the details of the backed up item. This is an asynchronous operation. To know the + status of the operation, + call the GetItemOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up item. + :type fabric_name: str + :param container_name: Container name associated with the backed up item. + :type container_name: str + :param protected_item_name: Backed up item name whose details are to be fetched. + :type protected_item_name: str + :param filter: OData filter options. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectedItemResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectedItemResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", 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') + 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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('ProtectedItemResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}'} # type: ignore + + def create_or_update( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + parameters, # type: "_models.ProtectedItemResource" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProtectedItemResource"] + """Enables backup of an item or to modifies the backup policy information of an already backed up + item. This is an + asynchronous operation. To know the status of the operation, call the GetItemOperationResult + API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backup item. + :type fabric_name: str + :param container_name: Container name associated with the backup item. + :type container_name: str + :param protected_item_name: Item name to be backed up. + :type protected_item_name: str + :param parameters: resource backed up item. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectedItemResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResource or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectedItemResource"]] + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ProtectedItemResource') + 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 + + 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('ProtectedItemResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}'} # type: ignore + + def delete( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Used to disable backup of an item within a container. This is an asynchronous operation. To + know the status of the + request, call the GetItemOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up item. + :type fabric_name: str + :param container_name: Container name associated with the backed up item. + :type container_name: str + :param protected_item_name: Backed up item to be deleted. + :type protected_item_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_container_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_container_operation_results_operations.py new file mode 100644 index 000000000000..7a0765c50e28 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_container_operation_results_operations.py @@ -0,0 +1,120 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class ProtectionContainerOperationResultsOperations(object): + """ProtectionContainerOperationResultsOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProtectionContainerResource"] + """Fetches the result of any operation on the container. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the container. + :type fabric_name: str + :param container_name: Container name whose information should be fetched. + :type container_name: str + :param operation_id: Operation ID which represents the operation whose result needs to be + fetched. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionContainerResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionContainerResource or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectionContainerResource"]] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + 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('ProtectionContainerResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/operationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_container_refresh_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_container_refresh_operation_results_operations.py new file mode 100644 index 000000000000..3e265dd33f61 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_container_refresh_operation_results_operations.py @@ -0,0 +1,111 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class ProtectionContainerRefreshOperationResultsOperations(object): + """ProtectionContainerRefreshOperationResultsOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Provides the result of the refresh operation triggered by the BeginRefresh operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the container. + :type fabric_name: str + :param operation_id: Operation ID associated with the operation whose result needs to be + fetched. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_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 = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/operationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_containers_operations.py new file mode 100644 index 000000000000..16b5ef497615 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_containers_operations.py @@ -0,0 +1,405 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class ProtectionContainersOperations(object): + """ProtectionContainersOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ProtectionContainerResource" + """Gets details of the specific container registered to your Recovery Services Vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Name of the fabric where the container belongs. + :type fabric_name: str + :param container_name: Name of the container whose details need to be fetched. + :type container_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionContainerResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionContainerResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionContainerResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", 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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('ProtectionContainerResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}'} # type: ignore + + def register( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + parameters, # type: "_models.ProtectionContainerResource" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProtectionContainerResource"] + """Registers the container with Recovery Services vault. + This is an asynchronous operation. To track the operation status, use location header to call + get latest status of + the operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the container. + :type fabric_name: str + :param container_name: Name of the container to be registered. + :type container_name: str + :param parameters: Request body for operation. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.ProtectionContainerResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionContainerResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionContainerResource or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectionContainerResource"]] + 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.register.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ProtectionContainerResource') + 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 + + 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('ProtectionContainerResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + register.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}'} # type: ignore + + def unregister( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Unregisters the given container from your Recovery Services Vault. This is an asynchronous + operation. To determine + whether the backend service has finished processing the request, call Get Container Operation + Result API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Name of the fabric where the container belongs. + :type fabric_name: str + :param container_name: Name of the container which needs to be unregistered from the Recovery + Services Vault. + :type container_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.unregister.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + unregister.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}'} # type: ignore + + def inquire( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Inquires all the protectable items under the given container. + + This is an async operation and the results should be tracked using location header or + Azure-async-url. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric Name associated with the container. + :type fabric_name: str + :param container_name: Name of the container in which inquiry needs to be triggered. + :type container_name: str + :param filter: OData filter options. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.inquire.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", 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') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + inquire.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/inquire'} # type: ignore + + def refresh( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Discovers all the containers in the subscription that can be backed up to Recovery Services + Vault. This is an + asynchronous operation. To know the status of the operation, call GetRefreshOperationResult + API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated the container. + :type fabric_name: str + :param filter: OData filter options. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + accept = "application/json" + + # Construct URL + url = self.refresh.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_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 = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + refresh.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/refreshContainers'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_intent_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_intent_operations.py new file mode 100644 index 000000000000..2036752ae78a --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_intent_operations.py @@ -0,0 +1,329 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class ProtectionIntentOperations(object): + """ProtectionIntentOperations 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.recoveryservicesbackup.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 + + def validate( + self, + azure_region, # type: str + parameters, # type: "_models.PreValidateEnableBackupRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.PreValidateEnableBackupResponse" + """It will validate followings + + + #. Vault capacity + #. VM is already protected + #. Any VM related configuration passed in properties. + + It will validate followings + + + #. Vault capacity + #. VM is already protected + #. Any VM related configuration passed in properties. + + :param azure_region: Azure region to hit Api. + :type azure_region: str + :param parameters: Enable backup validation request on Virtual Machine. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.PreValidateEnableBackupRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PreValidateEnableBackupResponse, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.PreValidateEnableBackupResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PreValidateEnableBackupResponse"] + 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.validate.metadata['url'] # type: ignore + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PreValidateEnableBackupRequest') + 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 + + 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) + + deserialized = self._deserialize('PreValidateEnableBackupResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + validate.metadata = {'url': '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupPreValidateProtection'} # type: ignore + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + intent_object_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ProtectionIntentResource" + """Provides the details of the protection intent up item. This is an asynchronous operation. To + know the status of the operation, + call the GetItemOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up item. + :type fabric_name: str + :param intent_object_name: Backed up item name whose details are to be fetched. + :type intent_object_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionIntentResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionIntentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionIntentResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, '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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('ProtectionIntentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}'} # type: ignore + + def create_or_update( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + intent_object_name, # type: str + parameters, # type: "_models.ProtectionIntentResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.ProtectionIntentResource" + """Create Intent for Enabling backup of an item. This is a synchronous operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backup item. + :type fabric_name: str + :param intent_object_name: Intent object name. + :type intent_object_name: str + :param parameters: resource backed up item. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.ProtectionIntentResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionIntentResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionIntentResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionIntentResource"] + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ProtectionIntentResource') + 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 + + 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) + + deserialized = self._deserialize('ProtectionIntentResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}'} # type: ignore + + def delete( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + intent_object_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Used to remove intent from an item. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the intent. + :type fabric_name: str + :param intent_object_name: Intent to be deleted. + :type intent_object_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-03-01" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, '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] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_policies_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_policies_operations.py new file mode 100644 index 000000000000..04df3a24c539 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_policies_operations.py @@ -0,0 +1,309 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +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]] + +class ProtectionPoliciesOperations(object): + """ProtectionPoliciesOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ProtectionPolicyResource" + """Provides the details of the backup policies associated to Recovery Services Vault. This is an + asynchronous + operation. Status of the operation can be fetched using GetPolicyOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param policy_name: Backup policy information to be fetched. + :type policy_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionPolicyResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionPolicyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionPolicyResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('ProtectionPolicyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}'} # type: ignore + + def create_or_update( + self, + vault_name, # type: str + resource_group_name, # type: str + policy_name, # type: str + parameters, # type: "_models.ProtectionPolicyResource" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProtectionPolicyResource"] + """Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation + can be fetched + using GetPolicyOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param policy_name: Backup policy to be created. + :type policy_name: str + :param parameters: resource backup policy. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.ProtectionPolicyResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionPolicyResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionPolicyResource or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProtectionPolicyResource"]] + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ProtectionPolicyResource') + 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 + + 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('ProtectionPolicyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}'} # type: ignore + + def _delete_initial( + self, + vault_name, # type: str + resource_group_name, # type: str + policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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-03-01" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}'} # type: ignore + + def begin_delete( + self, + vault_name, # type: str + resource_group_name, # type: str + policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous + operation. Status of the + operation can be fetched using GetProtectionPolicyOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param policy_name: Backup policy to be deleted. + :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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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._delete_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + policy_name=policy_name, + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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) + 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_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_policy_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_policy_operation_results_operations.py new file mode 100644 index 000000000000..1dfcbff1430a --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_policy_operation_results_operations.py @@ -0,0 +1,114 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class ProtectionPolicyOperationResultsOperations(object): + """ProtectionPolicyOperationResultsOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + policy_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ProtectionPolicyResource" + """Provides the result of an operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param policy_name: Backup policy name whose operation's result needs to be fetched. + :type policy_name: str + :param operation_id: Operation ID which represents the operation whose result needs to be + fetched. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProtectionPolicyResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.ProtectionPolicyResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProtectionPolicyResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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'), + '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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('ProtectionPolicyResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operationResults/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_policy_operation_statuses_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_policy_operation_statuses_operations.py new file mode 100644 index 000000000000..6b6d632753d0 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_protection_policy_operation_statuses_operations.py @@ -0,0 +1,118 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class ProtectionPolicyOperationStatusesOperations(object): + """ProtectionPolicyOperationStatusesOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + policy_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.OperationStatus" + """Provides the status of the asynchronous operations like backup, restore. The status can be in + progress, completed + or failed. You can refer to the Operation Status enum for all the possible states of an + operation. Some operations + create jobs. This method returns the list of jobs associated with operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param policy_name: Backup policy name whose operation's status needs to be fetched. + :type policy_name: str + :param operation_id: Operation ID which represents an operation whose status needs to be + fetched. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatus, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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'), + '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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('OperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_crr_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_crr_operations.py new file mode 100644 index 000000000000..f4100034a834 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_crr_operations.py @@ -0,0 +1,140 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class RecoveryPointsCrrOperations(object): + """RecoveryPointsCrrOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecoveryPointResourceList"] + """Lists the backup copies for the backed up item. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up item. + :type fabric_name: str + :param container_name: Container name associated with the backed up item. + :type container_name: str + :param protected_item_name: Backed up item whose backup copies are to be fetched. + :type protected_item_name: str + :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 RecoveryPointResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPointResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", 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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + 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) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecoveryPointResourceList', 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]: + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_operations.py new file mode 100644 index 000000000000..396defc7d651 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_operations.py @@ -0,0 +1,306 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class RecoveryPointsOperations(object): + """RecoveryPointsOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecoveryPointResourceList"] + """Lists the backup copies for the backed up item. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up item. + :type fabric_name: str + :param container_name: Container name associated with the backed up item. + :type container_name: str + :param protected_item_name: Backed up item whose backup copies are to be fetched. + :type protected_item_name: str + :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 RecoveryPointResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPointResourceList"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", 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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + 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) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecoveryPointResourceList', 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/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints'} # type: ignore + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + recovery_point_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.RecoveryPointResource" + """Provides the information of the backed up data identified using RecoveryPointID. This is an + asynchronous operation. + To know the status of the operation, call the GetProtectedItemOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with backed up item. + :type fabric_name: str + :param container_name: Container name associated with backed up item. + :type container_name: str + :param protected_item_name: Backed up item name whose backup data needs to be fetched. + :type protected_item_name: str + :param recovery_point_id: RecoveryPointID represents the backed up data to be fetched. + :type recovery_point_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RecoveryPointResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPointResource"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_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 = self._client.get(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('RecoveryPointResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}'} # type: ignore + + def get_access_token( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + recovery_point_id, # type: str + parameters, # type: "_models.AADPropertiesResource" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.CrrAccessTokenResource"] + """Returns the Access token for communication between BMS and Protection service. + + Returns the Access token for communication between BMS and Protection service. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the container. + :type fabric_name: str + :param container_name: Name of the container. + :type container_name: str + :param protected_item_name: Name of the Protected Item. + :type protected_item_name: str + :param recovery_point_id: Recovery Point Id. + :type recovery_point_id: str + :param parameters: Get Access Token request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.AADPropertiesResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CrrAccessTokenResource, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.CrrAccessTokenResource or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CrrAccessTokenResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-12-20" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.get_access_token.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'AADPropertiesResource') + 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 + + if response.status_code not in [200, 400]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponseAutoGenerated, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CrrAccessTokenResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_recommended_for_move_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_recommended_for_move_operations.py new file mode 100644 index 000000000000..73794009efd9 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_recommended_for_move_operations.py @@ -0,0 +1,145 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class RecoveryPointsRecommendedForMoveOperations(object): + """RecoveryPointsRecommendedForMoveOperations 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.recoveryservicesbackup.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 + + def list( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + parameters, # type: "_models.ListRecoveryPointsRecommendedForMoveRequest" + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.RecoveryPointResourceList"] + """Lists the recovery points recommended for move to another tier. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: + :type fabric_name: str + :param container_name: + :type container_name: str + :param protected_item_name: + :type protected_item_name: str + :param parameters: List Recovery points Recommended for Move Request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.ListRecoveryPointsRecommendedForMoveRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either RecoveryPointResourceList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointResourceList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.RecoveryPointResourceList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01" + content_type = "application/json" + accept = "application/json" + + def prepare_request(next_link=None): + # 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') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", 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') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ListRecoveryPointsRecommendedForMoveRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ListRecoveryPointsRecommendedForMoveRequest') + body_content_kwargs['content'] = body_content + request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RecoveryPointResourceList', 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/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPointsRecommendedForMove'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_services_backup_client_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_services_backup_client_operations.py new file mode 100644 index 000000000000..2ef78c79f3d5 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_services_backup_client_operations.py @@ -0,0 +1,487 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +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]] + +class RecoveryServicesBackupClientOperationsMixin(object): + + def get_operation_status( + self, + vault_name, # type: str + resource_group_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.OperationStatus" + """Fetches operation status for data move operation on vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param operation_id: + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationStatus, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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 = self._client.get(url, query_parameters, header_parameters) + 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) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationStatus/{operationId}'} # type: ignore + + def _bms_prepare_data_move_initial( + self, + vault_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.PrepareDataMoveRequest" + **kwargs # type: Any + ): + # type: (...) -> 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-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._bms_prepare_data_move_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrepareDataMoveRequest') + 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 + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _bms_prepare_data_move_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/prepareDataMove'} # type: ignore + + def begin_bms_prepare_data_move( + self, + vault_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.PrepareDataMoveRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Prepares source vault for Data Move operation. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: Prepare data move request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.PrepareDataMoveRequest + :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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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._bms_prepare_data_move_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + parameters=parameters, + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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) + 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_bms_prepare_data_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/prepareDataMove'} # type: ignore + + def _bms_trigger_data_move_initial( + self, + vault_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.TriggerDataMoveRequest" + **kwargs # type: Any + ): + # type: (...) -> 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-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._bms_trigger_data_move_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'TriggerDataMoveRequest') + 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 + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _bms_trigger_data_move_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove'} # type: ignore + + def begin_bms_trigger_data_move( + self, + vault_name, # type: str + resource_group_name, # type: str + parameters, # type: "_models.TriggerDataMoveRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Triggers Data Move Operation on target vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param parameters: Trigger data move request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.TriggerDataMoveRequest + :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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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._bms_trigger_data_move_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + parameters=parameters, + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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) + 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_bms_trigger_data_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove'} # type: ignore + + def _move_recovery_point_initial( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + recovery_point_id, # type: str + parameters, # type: "_models.MoveRPAcrossTiersRequest" + **kwargs # type: Any + ): + # type: (...) -> 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-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._move_recovery_point_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'MoveRPAcrossTiersRequest') + 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 + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _move_recovery_point_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/move'} # type: ignore + + def begin_move_recovery_point( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + recovery_point_id, # type: str + parameters, # type: "_models.MoveRPAcrossTiersRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Move recovery point from one datastore to another store. + + Move recovery point from one datastore to another store. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: + :type fabric_name: str + :param container_name: + :type container_name: str + :param protected_item_name: + :type protected_item_name: str + :param recovery_point_id: + :type recovery_point_id: str + :param parameters: Move Resource Across Tiers Request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.MoveRPAcrossTiersRequest + :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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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._move_recovery_point_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + fabric_name=fabric_name, + container_name=container_name, + protected_item_name=protected_item_name, + recovery_point_id=recovery_point_id, + parameters=parameters, + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_move_recovery_point.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/move'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_restores_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_restores_operations.py new file mode 100644 index 000000000000..8faff4b5c6b2 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_restores_operations.py @@ -0,0 +1,198 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +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]] + +class RestoresOperations(object): + """RestoresOperations 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.recoveryservicesbackup.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 + + def _trigger_initial( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + recovery_point_id, # type: str + parameters, # type: "_models.RestoreRequestResource" + **kwargs # type: Any + ): + # type: (...) -> 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-03-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._trigger_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'RestoreRequestResource') + 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 + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _trigger_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore'} # type: ignore + + def begin_trigger( + self, + vault_name, # type: str + resource_group_name, # type: str + fabric_name, # type: str + container_name, # type: str + protected_item_name, # type: str + recovery_point_id, # type: str + parameters, # type: "_models.RestoreRequestResource" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Restores the specified backed up data. This is an asynchronous operation. To know the status of + this API call, use + GetProtectedItemOperationResult API. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up items. + :type fabric_name: str + :param container_name: Container name associated with the backed up items. + :type container_name: str + :param protected_item_name: Backed up item to be restored. + :type protected_item_name: str + :param recovery_point_id: Recovery point ID which represents the backed up data to be restored. + :type recovery_point_id: str + :param parameters: resource restore request. + :type parameters: ~azure.mgmt.recoveryservicesbackup.models.RestoreRequestResource + :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: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + 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._trigger_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + fabric_name=fabric_name, + container_name=container_name, + protected_item_name=protected_item_name, + recovery_point_id=recovery_point_id, + parameters=parameters, + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **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_trigger.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_security_pins_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_security_pins_operations.py new file mode 100644 index 000000000000..8e17d4a3814f --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_security_pins_operations.py @@ -0,0 +1,105 @@ +# 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. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +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.mgmt.core.exceptions import ARMErrorFormat + +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]] + +class SecurityPINsOperations(object): + """SecurityPINsOperations 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.recoveryservicesbackup.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 + + def get( + self, + vault_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.TokenInformation" + """Get the security PIN. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the recovery services vault is + present. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TokenInformation, or the result of cls(response) + :rtype: ~azure.mgmt.recoveryservicesbackup.models.TokenInformation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TokenInformation"] + error_map = { + 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 = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", 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 = self._client.post(url, query_parameters, header_parameters) + 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) + + deserialized = self._deserialize('TokenInformation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupSecurityPIN'} # type: ignore diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/py.typed b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/sdk_packaging.toml b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/sdk_packaging.toml new file mode 100644 index 000000000000..cb7aed9f118c --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/sdk_packaging.toml @@ -0,0 +1,9 @@ +[packaging] +package_name = "azure-mgmt-recoveryservicesbackup" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Recoveryservicesbackup Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/setup.cfg b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/setup.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/setup.py new file mode 100644 index 000000000000..a69c4c13bf4d --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/setup.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-recoveryservicesbackup" +PACKAGE_PPRINT_NAME = "Recoveryservicesbackup Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + long_description_content_type='text/markdown', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.6.21', + 'azure-common~=1.1', + 'azure-mgmt-core>=1.2.0,<2.0.0', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +) diff --git a/sdk/recoveryservices/ci.yml b/sdk/recoveryservices/ci.yml index 837d6e053184..45f2e47e15c8 100644 --- a/sdk/recoveryservices/ci.yml +++ b/sdk/recoveryservices/ci.yml @@ -32,4 +32,6 @@ extends: Artifacts: - name: azure-mgmt-recoveryservices safeName: azuremgmtrecoveryservices + - name: azure-mgmt-recoveryservicesbackup + safeName: azuremgmtrecoveryservicesbackup diff --git a/shared_requirements.txt b/shared_requirements.txt index abdb0209959d..6e1e836a47df 100644 --- a/shared_requirements.txt +++ b/shared_requirements.txt @@ -275,6 +275,7 @@ opentelemetry-sdk<2.0.0,>=1.0.0 #override azure-mgmt-storagecache msrest>=0.6.21 #override azure-mgmt-videoanalyzer msrest>=0.6.21 #override azure-mgmt-extendedlocation msrest>=0.6.21 +#override azure-mgmt-recoveryservicesbackup msrest>=0.6.21 #override azure-mgmt-network msrest>=0.6.21 #override azure-mgmt-iothub msrest>=0.6.21 #override azure-mgmt-iotcentral msrest>=0.6.21