diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/CHANGELOG.md b/sdk/dataprotection/azure-mgmt-dataprotection/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/MANIFEST.in b/sdk/dataprotection/azure-mgmt-dataprotection/MANIFEST.in new file mode 100644 index 000000000000..3a9b6517412b --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/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/dataprotection/azure-mgmt-dataprotection/README.md b/sdk/dataprotection/azure-mgmt-dataprotection/README.md new file mode 100644 index 000000000000..defe17439704 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/README.md @@ -0,0 +1,27 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure MyService 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 [MyService 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-dataprotection%2FREADME.png) diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/_meta.json b/sdk/dataprotection/azure-mgmt-dataprotection/_meta.json new file mode 100644 index 000000000000..f995e5305b18 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "6a4ecaba56b6bc6bda4986730f1ff191d6420640", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/dataprotection/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/dataprotection/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/__init__.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/__init__.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/__init__.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/__init__.py new file mode 100644 index 000000000000..482859febe82 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/__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 ._configuration import DataProtectionClientConfiguration +from ._data_protection_client import DataProtectionClient +__all__ = ['DataProtectionClient', 'DataProtectionClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_configuration.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_configuration.py new file mode 100644 index 000000000000..ca165704dfca --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class DataProtectionClientConfiguration(AzureConfiguration): + """Configuration for DataProtectionClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription Id. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(DataProtectionClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-dataprotection/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_data_protection_client.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_data_protection_client.py new file mode 100644 index 000000000000..624bff884bcd --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_data_protection_client.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 msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import DataProtectionClientConfiguration +from .operations import BackupVaultsOperations +from .operations import OperationResultOperations +from .operations import OperationStatusOperations +from .operations import BackupVaultOperationResultsOperations +from .operations import DataProtectionOperations +from .operations import DataProtectionOperationsOperations +from .operations import BackupPoliciesOperations +from .operations import BackupInstancesOperations +from .operations import RecoveryPointsOperations +from .operations import JobsOperations +from .operations import RestorableTimeRangesOperations +from .operations import ExportJobsOperations +from .operations import ExportJobsOperationResultOperations +from . import models + + +class DataProtectionClient(SDKClient): + """Open API 2.0 Specs for Azure Data Protection service + + :ivar config: Configuration for client. + :vartype config: DataProtectionClientConfiguration + + :ivar backup_vaults: BackupVaults operations + :vartype backup_vaults: azure.mgmt.dataprotection.operations.BackupVaultsOperations + :ivar operation_result: OperationResult operations + :vartype operation_result: azure.mgmt.dataprotection.operations.OperationResultOperations + :ivar operation_status: OperationStatus operations + :vartype operation_status: azure.mgmt.dataprotection.operations.OperationStatusOperations + :ivar backup_vault_operation_results: BackupVaultOperationResults operations + :vartype backup_vault_operation_results: azure.mgmt.dataprotection.operations.BackupVaultOperationResultsOperations + :ivar data_protection: DataProtection operations + :vartype data_protection: azure.mgmt.dataprotection.operations.DataProtectionOperations + :ivar data_protection_operations: DataProtectionOperations operations + :vartype data_protection_operations: azure.mgmt.dataprotection.operations.DataProtectionOperationsOperations + :ivar backup_policies: BackupPolicies operations + :vartype backup_policies: azure.mgmt.dataprotection.operations.BackupPoliciesOperations + :ivar backup_instances: BackupInstances operations + :vartype backup_instances: azure.mgmt.dataprotection.operations.BackupInstancesOperations + :ivar recovery_points: RecoveryPoints operations + :vartype recovery_points: azure.mgmt.dataprotection.operations.RecoveryPointsOperations + :ivar jobs: Jobs operations + :vartype jobs: azure.mgmt.dataprotection.operations.JobsOperations + :ivar restorable_time_ranges: RestorableTimeRanges operations + :vartype restorable_time_ranges: azure.mgmt.dataprotection.operations.RestorableTimeRangesOperations + :ivar export_jobs: ExportJobs operations + :vartype export_jobs: azure.mgmt.dataprotection.operations.ExportJobsOperations + :ivar export_jobs_operation_result: ExportJobsOperationResult operations + :vartype export_jobs_operation_result: azure.mgmt.dataprotection.operations.ExportJobsOperationResultOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription Id. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = DataProtectionClientConfiguration(credentials, subscription_id, base_url) + super(DataProtectionClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2021-01-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.backup_vaults = BackupVaultsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operation_result = OperationResultOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.backup_vault_operation_results = BackupVaultOperationResultsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.data_protection = DataProtectionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.data_protection_operations = DataProtectionOperationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.backup_policies = BackupPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.backup_instances = BackupInstancesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.recovery_points = RecoveryPointsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.restorable_time_ranges = RestorableTimeRangesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.export_jobs = ExportJobsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.export_jobs_operation_result = ExportJobsOperationResultOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/__init__.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/__init__.py new file mode 100644 index 000000000000..1098bbdab387 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/__init__.py @@ -0,0 +1,363 @@ +# 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 AbsoluteDeleteOption + from ._models_py3 import AdHocBackupRuleOptions + from ._models_py3 import AdhocBackupTriggerOption + from ._models_py3 import AdhocBasedTaggingCriteria + from ._models_py3 import AdhocBasedTriggerContext + from ._models_py3 import AzureBackupDiscreteRecoveryPoint + from ._models_py3 import AzureBackupFindRestorableTimeRangesRequest + from ._models_py3 import AzureBackupFindRestorableTimeRangesRequestResource + from ._models_py3 import AzureBackupFindRestorableTimeRangesResponse + from ._models_py3 import AzureBackupFindRestorableTimeRangesResponseResource + from ._models_py3 import AzureBackupJob + from ._models_py3 import AzureBackupJobResource + from ._models_py3 import AzureBackupParams + from ._models_py3 import AzureBackupRecoveryPoint + from ._models_py3 import AzureBackupRecoveryPointBasedRestoreRequest + from ._models_py3 import AzureBackupRecoveryPointResource + from ._models_py3 import AzureBackupRecoveryTimeBasedRestoreRequest + from ._models_py3 import AzureBackupRehydrationRequest + from ._models_py3 import AzureBackupRestoreRequest + from ._models_py3 import AzureBackupRestoreWithRehydrationRequest + from ._models_py3 import AzureBackupRule + from ._models_py3 import AzureOperationalStoreParameters + from ._models_py3 import AzureRetentionRule + from ._models_py3 import BackupCriteria + from ._models_py3 import BackupInstance + from ._models_py3 import BackupInstanceResource + from ._models_py3 import BackupParameters + from ._models_py3 import BackupPolicy + from ._models_py3 import BackupSchedule + from ._models_py3 import BackupVault + from ._models_py3 import BackupVaultResource + from ._models_py3 import BaseBackupPolicy + from ._models_py3 import BaseBackupPolicyResource + from ._models_py3 import BasePolicyRule + from ._models_py3 import CheckNameAvailabilityRequest + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import ClientDiscoveryDisplay + from ._models_py3 import ClientDiscoveryForLogSpecification + from ._models_py3 import ClientDiscoveryForProperties + from ._models_py3 import ClientDiscoveryForServiceSpecification + from ._models_py3 import ClientDiscoveryValueForSingleApi + from ._models_py3 import CopyOnExpiryOption + from ._models_py3 import CopyOption + from ._models_py3 import CustomCopyOption + from ._models_py3 import Datasource + from ._models_py3 import DatasourceSet + from ._models_py3 import DataStoreInfoBase + from ._models_py3 import DataStoreParameters + from ._models_py3 import Day + from ._models_py3 import DeleteOption + from ._models_py3 import DppIdentityDetails + from ._models_py3 import DppResource + from ._models_py3 import DppResourceList + from ._models_py3 import DppTrackedResource + from ._models_py3 import DppTrackedResourceList + from ._models_py3 import DppWorkerRequest + from ._models_py3 import Error + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ExportJobsResult + from ._models_py3 import FeatureValidationRequest + from ._models_py3 import FeatureValidationRequestBase + from ._models_py3 import FeatureValidationResponse + from ._models_py3 import FeatureValidationResponseBase + from ._models_py3 import ImmediateCopyOption + from ._models_py3 import InnerError + from ._models_py3 import ItemLevelRestoreCriteria + from ._models_py3 import ItemLevelRestoreTargetInfo + from ._models_py3 import JobExtendedInfo + from ._models_py3 import JobSubTask + from ._models_py3 import OperationExtendedInfo + from ._models_py3 import OperationJobExtendedInfo + from ._models_py3 import OperationResource + from ._models_py3 import PatchResourceRequestInput + from ._models_py3 import PolicyInfo + from ._models_py3 import PolicyParameters + from ._models_py3 import ProtectionStatusDetails + from ._models_py3 import RangeBasedItemLevelRestoreCriteria + from ._models_py3 import RecoveryPointDataStoreDetails + from ._models_py3 import RecoveryPointsFilters + from ._models_py3 import RestorableTimeRange + from ._models_py3 import RestoreFilesTargetInfo + from ._models_py3 import RestoreJobRecoveryPointDetails + from ._models_py3 import RestoreTargetInfo + from ._models_py3 import RestoreTargetInfoBase + from ._models_py3 import RetentionTag + from ._models_py3 import ScheduleBasedBackupCriteria + from ._models_py3 import ScheduleBasedTriggerContext + from ._models_py3 import SourceLifeCycle + from ._models_py3 import StorageSetting + from ._models_py3 import SupportedFeature + from ._models_py3 import SystemData + from ._models_py3 import TaggingCriteria + from ._models_py3 import TargetCopySetting + from ._models_py3 import TargetDetails + from ._models_py3 import TriggerBackupRequest + from ._models_py3 import TriggerContext + from ._models_py3 import UserFacingError + from ._models_py3 import ValidateForBackupRequest + from ._models_py3 import ValidateRestoreRequestObject +except (SyntaxError, ImportError): + from ._models import AbsoluteDeleteOption + from ._models import AdHocBackupRuleOptions + from ._models import AdhocBackupTriggerOption + from ._models import AdhocBasedTaggingCriteria + from ._models import AdhocBasedTriggerContext + from ._models import AzureBackupDiscreteRecoveryPoint + from ._models import AzureBackupFindRestorableTimeRangesRequest + from ._models import AzureBackupFindRestorableTimeRangesRequestResource + from ._models import AzureBackupFindRestorableTimeRangesResponse + from ._models import AzureBackupFindRestorableTimeRangesResponseResource + from ._models import AzureBackupJob + from ._models import AzureBackupJobResource + from ._models import AzureBackupParams + from ._models import AzureBackupRecoveryPoint + from ._models import AzureBackupRecoveryPointBasedRestoreRequest + from ._models import AzureBackupRecoveryPointResource + from ._models import AzureBackupRecoveryTimeBasedRestoreRequest + from ._models import AzureBackupRehydrationRequest + from ._models import AzureBackupRestoreRequest + from ._models import AzureBackupRestoreWithRehydrationRequest + from ._models import AzureBackupRule + from ._models import AzureOperationalStoreParameters + from ._models import AzureRetentionRule + from ._models import BackupCriteria + from ._models import BackupInstance + from ._models import BackupInstanceResource + from ._models import BackupParameters + from ._models import BackupPolicy + from ._models import BackupSchedule + from ._models import BackupVault + from ._models import BackupVaultResource + from ._models import BaseBackupPolicy + from ._models import BaseBackupPolicyResource + from ._models import BasePolicyRule + from ._models import CheckNameAvailabilityRequest + from ._models import CheckNameAvailabilityResult + from ._models import ClientDiscoveryDisplay + from ._models import ClientDiscoveryForLogSpecification + from ._models import ClientDiscoveryForProperties + from ._models import ClientDiscoveryForServiceSpecification + from ._models import ClientDiscoveryValueForSingleApi + from ._models import CopyOnExpiryOption + from ._models import CopyOption + from ._models import CustomCopyOption + from ._models import Datasource + from ._models import DatasourceSet + from ._models import DataStoreInfoBase + from ._models import DataStoreParameters + from ._models import Day + from ._models import DeleteOption + from ._models import DppIdentityDetails + from ._models import DppResource + from ._models import DppResourceList + from ._models import DppTrackedResource + from ._models import DppTrackedResourceList + from ._models import DppWorkerRequest + from ._models import Error + from ._models import ErrorAdditionalInfo + from ._models import ExportJobsResult + from ._models import FeatureValidationRequest + from ._models import FeatureValidationRequestBase + from ._models import FeatureValidationResponse + from ._models import FeatureValidationResponseBase + from ._models import ImmediateCopyOption + from ._models import InnerError + from ._models import ItemLevelRestoreCriteria + from ._models import ItemLevelRestoreTargetInfo + from ._models import JobExtendedInfo + from ._models import JobSubTask + from ._models import OperationExtendedInfo + from ._models import OperationJobExtendedInfo + from ._models import OperationResource + from ._models import PatchResourceRequestInput + from ._models import PolicyInfo + from ._models import PolicyParameters + from ._models import ProtectionStatusDetails + from ._models import RangeBasedItemLevelRestoreCriteria + from ._models import RecoveryPointDataStoreDetails + from ._models import RecoveryPointsFilters + from ._models import RestorableTimeRange + from ._models import RestoreFilesTargetInfo + from ._models import RestoreJobRecoveryPointDetails + from ._models import RestoreTargetInfo + from ._models import RestoreTargetInfoBase + from ._models import RetentionTag + from ._models import ScheduleBasedBackupCriteria + from ._models import ScheduleBasedTriggerContext + from ._models import SourceLifeCycle + from ._models import StorageSetting + from ._models import SupportedFeature + from ._models import SystemData + from ._models import TaggingCriteria + from ._models import TargetCopySetting + from ._models import TargetDetails + from ._models import TriggerBackupRequest + from ._models import TriggerContext + from ._models import UserFacingError + from ._models import ValidateForBackupRequest + from ._models import ValidateRestoreRequestObject +from ._paged_models import AzureBackupJobResourcePaged +from ._paged_models import AzureBackupRecoveryPointResourcePaged +from ._paged_models import BackupInstanceResourcePaged +from ._paged_models import BackupVaultResourcePaged +from ._paged_models import BaseBackupPolicyResourcePaged +from ._paged_models import ClientDiscoveryValueForSingleApiPaged +from ._data_protection_client_enums import ( + RehydrationStatus, + RestoreSourceDataStoreType, + RehydrationPriority, + SourceDataStoreType, + DataStoreTypes, + Status, + CurrentProtectionState, + ProvisioningState, + StorageSettingStoreTypes, + StorageSettingTypes, + CreatedByType, + FeatureType, + FeatureSupportStatus, + RestoreTargetLocationType, + AbsoluteMarker, + DayOfWeek, + Month, + WeekNumber, +) + +__all__ = [ + 'AbsoluteDeleteOption', + 'AdHocBackupRuleOptions', + 'AdhocBackupTriggerOption', + 'AdhocBasedTaggingCriteria', + 'AdhocBasedTriggerContext', + 'AzureBackupDiscreteRecoveryPoint', + 'AzureBackupFindRestorableTimeRangesRequest', + 'AzureBackupFindRestorableTimeRangesRequestResource', + 'AzureBackupFindRestorableTimeRangesResponse', + 'AzureBackupFindRestorableTimeRangesResponseResource', + 'AzureBackupJob', + 'AzureBackupJobResource', + 'AzureBackupParams', + 'AzureBackupRecoveryPoint', + 'AzureBackupRecoveryPointBasedRestoreRequest', + 'AzureBackupRecoveryPointResource', + 'AzureBackupRecoveryTimeBasedRestoreRequest', + 'AzureBackupRehydrationRequest', + 'AzureBackupRestoreRequest', + 'AzureBackupRestoreWithRehydrationRequest', + 'AzureBackupRule', + 'AzureOperationalStoreParameters', + 'AzureRetentionRule', + 'BackupCriteria', + 'BackupInstance', + 'BackupInstanceResource', + 'BackupParameters', + 'BackupPolicy', + 'BackupSchedule', + 'BackupVault', + 'BackupVaultResource', + 'BaseBackupPolicy', + 'BaseBackupPolicyResource', + 'BasePolicyRule', + 'CheckNameAvailabilityRequest', + 'CheckNameAvailabilityResult', + 'ClientDiscoveryDisplay', + 'ClientDiscoveryForLogSpecification', + 'ClientDiscoveryForProperties', + 'ClientDiscoveryForServiceSpecification', + 'ClientDiscoveryValueForSingleApi', + 'CopyOnExpiryOption', + 'CopyOption', + 'CustomCopyOption', + 'Datasource', + 'DatasourceSet', + 'DataStoreInfoBase', + 'DataStoreParameters', + 'Day', + 'DeleteOption', + 'DppIdentityDetails', + 'DppResource', + 'DppResourceList', + 'DppTrackedResource', + 'DppTrackedResourceList', + 'DppWorkerRequest', + 'Error', + 'ErrorAdditionalInfo', + 'ExportJobsResult', + 'FeatureValidationRequest', + 'FeatureValidationRequestBase', + 'FeatureValidationResponse', + 'FeatureValidationResponseBase', + 'ImmediateCopyOption', + 'InnerError', + 'ItemLevelRestoreCriteria', + 'ItemLevelRestoreTargetInfo', + 'JobExtendedInfo', + 'JobSubTask', + 'OperationExtendedInfo', + 'OperationJobExtendedInfo', + 'OperationResource', + 'PatchResourceRequestInput', + 'PolicyInfo', + 'PolicyParameters', + 'ProtectionStatusDetails', + 'RangeBasedItemLevelRestoreCriteria', + 'RecoveryPointDataStoreDetails', + 'RecoveryPointsFilters', + 'RestorableTimeRange', + 'RestoreFilesTargetInfo', + 'RestoreJobRecoveryPointDetails', + 'RestoreTargetInfo', + 'RestoreTargetInfoBase', + 'RetentionTag', + 'ScheduleBasedBackupCriteria', + 'ScheduleBasedTriggerContext', + 'SourceLifeCycle', + 'StorageSetting', + 'SupportedFeature', + 'SystemData', + 'TaggingCriteria', + 'TargetCopySetting', + 'TargetDetails', + 'TriggerBackupRequest', + 'TriggerContext', + 'UserFacingError', + 'ValidateForBackupRequest', + 'ValidateRestoreRequestObject', + 'BackupVaultResourcePaged', + 'ClientDiscoveryValueForSingleApiPaged', + 'BaseBackupPolicyResourcePaged', + 'BackupInstanceResourcePaged', + 'AzureBackupRecoveryPointResourcePaged', + 'AzureBackupJobResourcePaged', + 'RehydrationStatus', + 'RestoreSourceDataStoreType', + 'RehydrationPriority', + 'SourceDataStoreType', + 'DataStoreTypes', + 'Status', + 'CurrentProtectionState', + 'ProvisioningState', + 'StorageSettingStoreTypes', + 'StorageSettingTypes', + 'CreatedByType', + 'FeatureType', + 'FeatureSupportStatus', + 'RestoreTargetLocationType', + 'AbsoluteMarker', + 'DayOfWeek', + 'Month', + 'WeekNumber', +] diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_data_protection_client_enums.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_data_protection_client_enums.py new file mode 100644 index 000000000000..61ff9bde9ef0 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_data_protection_client_enums.py @@ -0,0 +1,173 @@ +# 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 + + +class RehydrationStatus(str, Enum): + + create_in_progress = "CREATE_IN_PROGRESS" + completed = "COMPLETED" + delete_in_progress = "DELETE_IN_PROGRESS" + deleted = "DELETED" + failed = "FAILED" + + +class RestoreSourceDataStoreType(str, Enum): + + operational_store = "OperationalStore" + vault_store = "VaultStore" + archive_store = "ArchiveStore" + + +class RehydrationPriority(str, Enum): + + invalid = "Invalid" + high = "High" + standard = "Standard" + + +class SourceDataStoreType(str, Enum): + + archive_store = "ArchiveStore" + snapshot_store = "SnapshotStore" + vault_store = "VaultStore" + + +class DataStoreTypes(str, Enum): + + operational_store = "OperationalStore" + vault_store = "VaultStore" + archive_store = "ArchiveStore" + + +class Status(str, Enum): + + configuring_protection = "ConfiguringProtection" + configuring_protection_failed = "ConfiguringProtectionFailed" + protection_configured = "ProtectionConfigured" + protection_stopped = "ProtectionStopped" + soft_deleted = "SoftDeleted" + soft_deleting = "SoftDeleting" + + +class CurrentProtectionState(str, Enum): + + invalid = "Invalid" + not_protected = "NotProtected" + configuring_protection = "ConfiguringProtection" + protection_configured = "ProtectionConfigured" + backup_schedules_suspended = "BackupSchedulesSuspended" + retention_schedules_suspended = "RetentionSchedulesSuspended" + protection_stopped = "ProtectionStopped" + protection_error = "ProtectionError" + configuring_protection_failed = "ConfiguringProtectionFailed" + soft_deleting = "SoftDeleting" + soft_deleted = "SoftDeleted" + updating_protection = "UpdatingProtection" + + +class ProvisioningState(str, Enum): + + failed = "Failed" + provisioning = "Provisioning" + succeeded = "Succeeded" + unknown = "Unknown" + updating = "Updating" + + +class StorageSettingStoreTypes(str, Enum): + + archive_store = "ArchiveStore" + snapshot_store = "SnapshotStore" + vault_store = "VaultStore" + + +class StorageSettingTypes(str, Enum): + + geo_redundant = "GeoRedundant" + locally_redundant = "LocallyRedundant" + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + +class FeatureType(str, Enum): + + invalid = "Invalid" + data_source_type = "DataSourceType" + + +class FeatureSupportStatus(str, Enum): + + invalid = "Invalid" + not_supported = "NotSupported" + alpha_preview = "AlphaPreview" + private_preview = "PrivatePreview" + public_preview = "PublicPreview" + generally_available = "GenerallyAvailable" + + +class RestoreTargetLocationType(str, Enum): + + invalid = "Invalid" + azure_blobs = "AzureBlobs" + azure_files = "AzureFiles" + + +class AbsoluteMarker(str, Enum): + + all_backup = "AllBackup" + first_of_day = "FirstOfDay" + first_of_month = "FirstOfMonth" + first_of_week = "FirstOfWeek" + first_of_year = "FirstOfYear" + + +class DayOfWeek(str, Enum): + + friday = "Friday" + monday = "Monday" + saturday = "Saturday" + sunday = "Sunday" + thursday = "Thursday" + tuesday = "Tuesday" + wednesday = "Wednesday" + + +class Month(str, Enum): + + april = "April" + august = "August" + december = "December" + february = "February" + january = "January" + july = "July" + june = "June" + march = "March" + may = "May" + november = "November" + october = "October" + september = "September" + + +class WeekNumber(str, Enum): + + first = "First" + fourth = "Fourth" + last = "Last" + second = "Second" + third = "Third" diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_models.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_models.py new file mode 100644 index 000000000000..44ef130b0c52 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_models.py @@ -0,0 +1,3648 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class DeleteOption(Model): + """DeleteOption. + + Delete Option. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AbsoluteDeleteOption + + All required parameters must be populated in order to send to Azure. + + :param duration: Required. Duration of deletion after given timespan + :type duration: str + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'duration': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'duration': {'key': 'duration', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AbsoluteDeleteOption': 'AbsoluteDeleteOption'} + } + + def __init__(self, **kwargs): + super(DeleteOption, self).__init__(**kwargs) + self.duration = kwargs.get('duration', None) + self.object_type = None + + +class AbsoluteDeleteOption(DeleteOption): + """AbsoluteDeleteOption. + + Delete option with duration. + + All required parameters must be populated in order to send to Azure. + + :param duration: Required. Duration of deletion after given timespan + :type duration: str + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'duration': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'duration': {'key': 'duration', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AbsoluteDeleteOption, self).__init__(**kwargs) + self.object_type = 'AbsoluteDeleteOption' + + +class AdHocBackupRuleOptions(Model): + """AdHocBackupRuleOptions. + + Adhoc backup rules. + + All required parameters must be populated in order to send to Azure. + + :param rule_name: Required. + :type rule_name: str + :param trigger_option: Required. + :type trigger_option: + ~azure.mgmt.dataprotection.models.AdhocBackupTriggerOption + """ + + _validation = { + 'rule_name': {'required': True}, + 'trigger_option': {'required': True}, + } + + _attribute_map = { + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + 'trigger_option': {'key': 'triggerOption', 'type': 'AdhocBackupTriggerOption'}, + } + + def __init__(self, **kwargs): + super(AdHocBackupRuleOptions, self).__init__(**kwargs) + self.rule_name = kwargs.get('rule_name', None) + self.trigger_option = kwargs.get('trigger_option', None) + + +class AdhocBackupTriggerOption(Model): + """AdhocBackupTriggerOption. + + Adhoc backup trigger option. + + :param retention_tag_override: + :type retention_tag_override: str + """ + + _attribute_map = { + 'retention_tag_override': {'key': 'retentionTagOverride', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AdhocBackupTriggerOption, self).__init__(**kwargs) + self.retention_tag_override = kwargs.get('retention_tag_override', None) + + +class AdhocBasedTaggingCriteria(Model): + """AdhocBasedTaggingCriteria. + + Adhoc backup tagging criteria. + + :param tag_info: Retention tag information + :type tag_info: ~azure.mgmt.dataprotection.models.RetentionTag + """ + + _attribute_map = { + 'tag_info': {'key': 'tagInfo', 'type': 'RetentionTag'}, + } + + def __init__(self, **kwargs): + super(AdhocBasedTaggingCriteria, self).__init__(**kwargs) + self.tag_info = kwargs.get('tag_info', None) + + +class TriggerContext(Model): + """TriggerContext. + + Trigger context. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AdhocBasedTriggerContext, ScheduleBasedTriggerContext + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'AdhocBasedTriggerContext': 'AdhocBasedTriggerContext', 'ScheduleBasedTriggerContext': 'ScheduleBasedTriggerContext'} + } + + def __init__(self, **kwargs): + super(TriggerContext, self).__init__(**kwargs) + self.object_type = None + + +class AdhocBasedTriggerContext(TriggerContext): + """AdhocBasedTriggerContext. + + Adhoc trigger context. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param tagging_criteria: Required. Tagging Criteria containing retention + tag for adhoc backup. + :type tagging_criteria: + ~azure.mgmt.dataprotection.models.AdhocBasedTaggingCriteria + """ + + _validation = { + 'object_type': {'required': True}, + 'tagging_criteria': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'tagging_criteria': {'key': 'taggingCriteria', 'type': 'AdhocBasedTaggingCriteria'}, + } + + def __init__(self, **kwargs): + super(AdhocBasedTriggerContext, self).__init__(**kwargs) + self.tagging_criteria = kwargs.get('tagging_criteria', None) + self.object_type = 'AdhocBasedTriggerContext' + + +class AzureBackupRecoveryPoint(Model): + """AzureBackupRecoveryPoint. + + Azure backup recoveryPoint. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupDiscreteRecoveryPoint + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'AzureBackupDiscreteRecoveryPoint': 'AzureBackupDiscreteRecoveryPoint'} + } + + def __init__(self, **kwargs): + super(AzureBackupRecoveryPoint, self).__init__(**kwargs) + self.object_type = None + + +class AzureBackupDiscreteRecoveryPoint(AzureBackupRecoveryPoint): + """AzureBackupDiscreteRecoveryPoint. + + Azure backup discrete RecoveryPoint. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param friendly_name: + :type friendly_name: str + :param recovery_point_data_stores_details: + :type recovery_point_data_stores_details: + list[~azure.mgmt.dataprotection.models.RecoveryPointDataStoreDetails] + :param recovery_point_time: Required. + :type recovery_point_time: datetime + :param policy_name: + :type policy_name: str + :param policy_version: + :type policy_version: str + :param recovery_point_id: + :type recovery_point_id: str + :param recovery_point_type: + :type recovery_point_type: str + :param retention_tag_name: + :type retention_tag_name: str + :param retention_tag_version: + :type retention_tag_version: str + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_time': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'recovery_point_data_stores_details': {'key': 'recoveryPointDataStoresDetails', 'type': '[RecoveryPointDataStoreDetails]'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'policy_version': {'key': 'policyVersion', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, + 'retention_tag_name': {'key': 'retentionTagName', 'type': 'str'}, + 'retention_tag_version': {'key': 'retentionTagVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureBackupDiscreteRecoveryPoint, self).__init__(**kwargs) + self.friendly_name = kwargs.get('friendly_name', None) + self.recovery_point_data_stores_details = kwargs.get('recovery_point_data_stores_details', None) + self.recovery_point_time = kwargs.get('recovery_point_time', None) + self.policy_name = kwargs.get('policy_name', None) + self.policy_version = kwargs.get('policy_version', None) + self.recovery_point_id = kwargs.get('recovery_point_id', None) + self.recovery_point_type = kwargs.get('recovery_point_type', None) + self.retention_tag_name = kwargs.get('retention_tag_name', None) + self.retention_tag_version = kwargs.get('retention_tag_version', None) + self.object_type = 'AzureBackupDiscreteRecoveryPoint' + + +class AzureBackupFindRestorableTimeRangesRequest(Model): + """List Restore Ranges Request. + + All required parameters must be populated in order to send to Azure. + + :param source_data_store_type: Required. Gets or sets the type of the + source data store. Possible values include: 'OperationalStore', + 'VaultStore', 'ArchiveStore' + :type source_data_store_type: str or + ~azure.mgmt.dataprotection.models.RestoreSourceDataStoreType + :param start_time: Start time for the List Restore Ranges request. ISO + 8601 format. + :type start_time: str + :param end_time: End time for the List Restore Ranges request. ISO 8601 + format. + :type end_time: str + """ + + _validation = { + 'source_data_store_type': {'required': True}, + } + + _attribute_map = { + 'source_data_store_type': {'key': 'sourceDataStoreType', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureBackupFindRestorableTimeRangesRequest, self).__init__(**kwargs) + self.source_data_store_type = kwargs.get('source_data_store_type', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + + +class DppWorkerRequest(Model): + """DppWorkerRequest. + + :param subscription_id: + :type subscription_id: str + :param uri: + :type uri: str + :param headers: + :type headers: dict[str, list[str]] + :param supported_group_versions: + :type supported_group_versions: list[str] + :param culture_info: + :type culture_info: str + :param parameters: + :type parameters: dict[str, str] + :param http_method: + :type http_method: str + """ + + _attribute_map = { + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{[str]}'}, + 'supported_group_versions': {'key': 'supportedGroupVersions', 'type': '[str]'}, + 'culture_info': {'key': 'cultureInfo', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'http_method': {'key': 'httpMethod', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DppWorkerRequest, self).__init__(**kwargs) + self.subscription_id = kwargs.get('subscription_id', None) + self.uri = kwargs.get('uri', None) + self.headers = kwargs.get('headers', None) + self.supported_group_versions = kwargs.get('supported_group_versions', None) + self.culture_info = kwargs.get('culture_info', None) + self.parameters = kwargs.get('parameters', None) + self.http_method = kwargs.get('http_method', None) + + +class AzureBackupFindRestorableTimeRangesRequestResource(DppWorkerRequest): + """List Restore Ranges Request. + + :param subscription_id: + :type subscription_id: str + :param uri: + :type uri: str + :param headers: + :type headers: dict[str, list[str]] + :param supported_group_versions: + :type supported_group_versions: list[str] + :param culture_info: + :type culture_info: str + :param parameters: + :type parameters: dict[str, str] + :param http_method: + :type http_method: str + :param content: AzureBackupFindRestorableTimeRangesRequestResource content + :type content: + ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesRequest + """ + + _attribute_map = { + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{[str]}'}, + 'supported_group_versions': {'key': 'supportedGroupVersions', 'type': '[str]'}, + 'culture_info': {'key': 'cultureInfo', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'http_method': {'key': 'httpMethod', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'AzureBackupFindRestorableTimeRangesRequest'}, + } + + def __init__(self, **kwargs): + super(AzureBackupFindRestorableTimeRangesRequestResource, self).__init__(**kwargs) + self.content = kwargs.get('content', None) + + +class AzureBackupFindRestorableTimeRangesResponse(Model): + """List Restore Ranges Response. + + :param restorable_time_ranges: Returns the Restore Ranges available on the + Backup Instance. + :type restorable_time_ranges: + list[~azure.mgmt.dataprotection.models.RestorableTimeRange] + :param object_type: + :type object_type: str + """ + + _attribute_map = { + 'restorable_time_ranges': {'key': 'restorableTimeRanges', 'type': '[RestorableTimeRange]'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureBackupFindRestorableTimeRangesResponse, self).__init__(**kwargs) + self.restorable_time_ranges = kwargs.get('restorable_time_ranges', None) + self.object_type = kwargs.get('object_type', None) + + +class DppResource(Model): + """DppResource. + + Resource 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 system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + """ + + _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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, **kwargs): + super(DppResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = kwargs.get('system_data', None) + + +class AzureBackupFindRestorableTimeRangesResponseResource(DppResource): + """List Restore Ranges Response. + + 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 system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + :param properties: AzureBackupFindRestorableTimeRangesResponseResource + properties + :type properties: + ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesResponse + """ + + _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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'AzureBackupFindRestorableTimeRangesResponse'}, + } + + def __init__(self, **kwargs): + super(AzureBackupFindRestorableTimeRangesResponseResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class AzureBackupJob(Model): + """AzureBackup Job Class. + + 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 activity_id: Required. Job Activity Id + :type activity_id: str + :param backup_instance_friendly_name: Required. Name of the Backup + Instance + :type backup_instance_friendly_name: str + :ivar backup_instance_id: ARM ID of the Backup Instance + :vartype backup_instance_id: str + :param data_source_id: Required. ARM ID of the DataSource + :type data_source_id: str + :param data_source_location: Required. Location of the DataSource + :type data_source_location: str + :param data_source_name: Required. User Friendly Name of the DataSource + :type data_source_name: str + :param data_source_set_name: Required. Data Source Set Name of the + DataSource + :type data_source_set_name: str + :param data_source_type: Required. Type of DataSource + :type data_source_type: str + :param duration: Total run time of the job. ISO 8601 format. + :type duration: str + :ivar end_time: EndTime of the job(in UTC) + :vartype end_time: datetime + :ivar error_details: A List, detailing the errors related to the job + :vartype error_details: + list[~azure.mgmt.dataprotection.models.UserFacingError] + :ivar extended_info: Extended Information about the job + :vartype extended_info: ~azure.mgmt.dataprotection.models.JobExtendedInfo + :param is_user_triggered: Required. Indicated that whether the job is + adhoc(true) or scheduled(false) + :type is_user_triggered: bool + :param operation: Required. It indicates the type of Job i.e. + Backup:full/log/diff ;Restore:ALR/OLR; Tiering:Backup/Archive ; + Management:ConfigureProtection/UnConfigure + :type operation: str + :param operation_category: Required. It indicates the type of Job i.e. + Backup/Restore/Tiering/Management + :type operation_category: str + :ivar policy_id: ARM ID of the policy + :vartype policy_id: str + :ivar policy_name: Name of the policy + :vartype policy_name: str + :param progress_enabled: Required. Indicated whether progress is enabled + for the job + :type progress_enabled: bool + :ivar progress_url: Url which contains job's progress + :vartype progress_url: str + :ivar restore_type: It indicates the sub type of operation i.e. in case of + Restore it can be ALR/OLR + :vartype restore_type: str + :param source_resource_group: Required. Resource Group Name of the + Datasource + :type source_resource_group: str + :param source_subscription_id: Required. SubscriptionId corresponding to + the DataSource + :type source_subscription_id: str + :param start_time: Required. StartTime of the job(in UTC) + :type start_time: datetime + :param status: Required. Status of the job like + InProgress/Success/Failed/Cancelled/SuccessWithWarning + :type status: str + :param subscription_id: Required. Subscription Id of the corresponding + backup vault + :type subscription_id: str + :param supported_actions: Required. List of supported actions + :type supported_actions: list[str] + :param vault_name: Required. Name of the vault + :type vault_name: str + :param etag: + :type etag: str + :param source_data_store_name: + :type source_data_store_name: str + :param destination_data_store_name: + :type destination_data_store_name: str + """ + + _validation = { + 'activity_id': {'required': True}, + 'backup_instance_friendly_name': {'required': True}, + 'backup_instance_id': {'readonly': True}, + 'data_source_id': {'required': True}, + 'data_source_location': {'required': True}, + 'data_source_name': {'required': True}, + 'data_source_set_name': {'required': True}, + 'data_source_type': {'required': True}, + 'end_time': {'readonly': True}, + 'error_details': {'readonly': True}, + 'extended_info': {'readonly': True}, + 'is_user_triggered': {'required': True}, + 'operation': {'required': True}, + 'operation_category': {'required': True}, + 'policy_id': {'readonly': True}, + 'policy_name': {'readonly': True}, + 'progress_enabled': {'required': True}, + 'progress_url': {'readonly': True}, + 'restore_type': {'readonly': True}, + 'source_resource_group': {'required': True}, + 'source_subscription_id': {'required': True}, + 'start_time': {'required': True}, + 'status': {'required': True}, + 'subscription_id': {'required': True}, + 'supported_actions': {'required': True}, + 'vault_name': {'required': True}, + } + + _attribute_map = { + 'activity_id': {'key': 'activityID', 'type': 'str'}, + 'backup_instance_friendly_name': {'key': 'backupInstanceFriendlyName', 'type': 'str'}, + 'backup_instance_id': {'key': 'backupInstanceId', 'type': 'str'}, + 'data_source_id': {'key': 'dataSourceId', 'type': 'str'}, + 'data_source_location': {'key': 'dataSourceLocation', 'type': 'str'}, + 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, + 'data_source_set_name': {'key': 'dataSourceSetName', 'type': 'str'}, + 'data_source_type': {'key': 'dataSourceType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error_details': {'key': 'errorDetails', 'type': '[UserFacingError]'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'JobExtendedInfo'}, + 'is_user_triggered': {'key': 'isUserTriggered', 'type': 'bool'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'operation_category': {'key': 'operationCategory', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'progress_enabled': {'key': 'progressEnabled', 'type': 'bool'}, + 'progress_url': {'key': 'progressUrl', 'type': 'str'}, + 'restore_type': {'key': 'restoreType', 'type': 'str'}, + 'source_resource_group': {'key': 'sourceResourceGroup', 'type': 'str'}, + 'source_subscription_id': {'key': 'sourceSubscriptionID', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'supported_actions': {'key': 'supportedActions', 'type': '[str]'}, + 'vault_name': {'key': 'vaultName', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'source_data_store_name': {'key': 'sourceDataStoreName', 'type': 'str'}, + 'destination_data_store_name': {'key': 'destinationDataStoreName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureBackupJob, self).__init__(**kwargs) + self.activity_id = kwargs.get('activity_id', None) + self.backup_instance_friendly_name = kwargs.get('backup_instance_friendly_name', None) + self.backup_instance_id = None + self.data_source_id = kwargs.get('data_source_id', None) + self.data_source_location = kwargs.get('data_source_location', None) + self.data_source_name = kwargs.get('data_source_name', None) + self.data_source_set_name = kwargs.get('data_source_set_name', None) + self.data_source_type = kwargs.get('data_source_type', None) + self.duration = kwargs.get('duration', None) + self.end_time = None + self.error_details = None + self.extended_info = None + self.is_user_triggered = kwargs.get('is_user_triggered', None) + self.operation = kwargs.get('operation', None) + self.operation_category = kwargs.get('operation_category', None) + self.policy_id = None + self.policy_name = None + self.progress_enabled = kwargs.get('progress_enabled', None) + self.progress_url = None + self.restore_type = None + self.source_resource_group = kwargs.get('source_resource_group', None) + self.source_subscription_id = kwargs.get('source_subscription_id', None) + self.start_time = kwargs.get('start_time', None) + self.status = kwargs.get('status', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.supported_actions = kwargs.get('supported_actions', None) + self.vault_name = kwargs.get('vault_name', None) + self.etag = kwargs.get('etag', None) + self.source_data_store_name = kwargs.get('source_data_store_name', None) + self.destination_data_store_name = kwargs.get('destination_data_store_name', None) + + +class AzureBackupJobResource(DppResource): + """AzureBackup Job Resource 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 system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + :param properties: AzureBackupJobResource properties + :type properties: ~azure.mgmt.dataprotection.models.AzureBackupJob + """ + + _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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'AzureBackupJob'}, + } + + def __init__(self, **kwargs): + super(AzureBackupJobResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class BackupParameters(Model): + """BackupParameters. + + BackupParameters base. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupParams + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'AzureBackupParams': 'AzureBackupParams'} + } + + def __init__(self, **kwargs): + super(BackupParameters, self).__init__(**kwargs) + self.object_type = None + + +class AzureBackupParams(BackupParameters): + """AzureBackupParams. + + Azure backup parameters. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param backup_type: Required. BackupType ; Full/Incremental etc + :type backup_type: str + """ + + _validation = { + 'object_type': {'required': True}, + 'backup_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'backup_type': {'key': 'backupType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureBackupParams, self).__init__(**kwargs) + self.backup_type = kwargs.get('backup_type', None) + self.object_type = 'AzureBackupParams' + + +class AzureBackupRestoreRequest(Model): + """AzureBackupRestoreRequest. + + Azure backup restore request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupRecoveryPointBasedRestoreRequest, + AzureBackupRecoveryTimeBasedRestoreRequest + + All required parameters must be populated in order to send to Azure. + + :param restore_target_info: Required. Gets or sets the restore target + information. + :type restore_target_info: + ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :param source_data_store_type: Required. Gets or sets the type of the + source data store. Possible values include: 'ArchiveStore', + 'SnapshotStore', 'VaultStore' + :type source_data_store_type: str or + ~azure.mgmt.dataprotection.models.SourceDataStoreType + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'restore_target_info': {'required': True}, + 'source_data_store_type': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'restore_target_info': {'key': 'restoreTargetInfo', 'type': 'RestoreTargetInfoBase'}, + 'source_data_store_type': {'key': 'sourceDataStoreType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureBackupRecoveryPointBasedRestoreRequest': 'AzureBackupRecoveryPointBasedRestoreRequest', 'AzureBackupRecoveryTimeBasedRestoreRequest': 'AzureBackupRecoveryTimeBasedRestoreRequest'} + } + + def __init__(self, **kwargs): + super(AzureBackupRestoreRequest, self).__init__(**kwargs) + self.restore_target_info = kwargs.get('restore_target_info', None) + self.source_data_store_type = kwargs.get('source_data_store_type', None) + self.object_type = None + + +class AzureBackupRecoveryPointBasedRestoreRequest(AzureBackupRestoreRequest): + """AzureBackupRecoveryPointBasedRestoreRequest. + + Azure backup recoveryPoint based restore request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupRestoreWithRehydrationRequest + + All required parameters must be populated in order to send to Azure. + + :param restore_target_info: Required. Gets or sets the restore target + information. + :type restore_target_info: + ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :param source_data_store_type: Required. Gets or sets the type of the + source data store. Possible values include: 'ArchiveStore', + 'SnapshotStore', 'VaultStore' + :type source_data_store_type: str or + ~azure.mgmt.dataprotection.models.SourceDataStoreType + :param object_type: Required. Constant filled by server. + :type object_type: str + :param recovery_point_id: Required. + :type recovery_point_id: str + """ + + _validation = { + 'restore_target_info': {'required': True}, + 'source_data_store_type': {'required': True}, + 'object_type': {'required': True}, + 'recovery_point_id': {'required': True}, + } + + _attribute_map = { + 'restore_target_info': {'key': 'restoreTargetInfo', 'type': 'RestoreTargetInfoBase'}, + 'source_data_store_type': {'key': 'sourceDataStoreType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureBackupRestoreWithRehydrationRequest': 'AzureBackupRestoreWithRehydrationRequest'} + } + + def __init__(self, **kwargs): + super(AzureBackupRecoveryPointBasedRestoreRequest, self).__init__(**kwargs) + self.recovery_point_id = kwargs.get('recovery_point_id', None) + self.object_type = 'AzureBackupRecoveryPointBasedRestoreRequest' + + +class AzureBackupRecoveryPointResource(DppResource): + """AzureBackupRecoveryPointResource. + + Azure backup recoveryPoint 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 system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + :param properties: AzureBackupRecoveryPointResource properties + :type properties: + ~azure.mgmt.dataprotection.models.AzureBackupRecoveryPoint + """ + + _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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'AzureBackupRecoveryPoint'}, + } + + def __init__(self, **kwargs): + super(AzureBackupRecoveryPointResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class AzureBackupRecoveryTimeBasedRestoreRequest(AzureBackupRestoreRequest): + """AzureBackupRecoveryTimeBasedRestoreRequest. + + AzureBackup RecoveryPointTime Based Restore Request. + + All required parameters must be populated in order to send to Azure. + + :param restore_target_info: Required. Gets or sets the restore target + information. + :type restore_target_info: + ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :param source_data_store_type: Required. Gets or sets the type of the + source data store. Possible values include: 'ArchiveStore', + 'SnapshotStore', 'VaultStore' + :type source_data_store_type: str or + ~azure.mgmt.dataprotection.models.SourceDataStoreType + :param object_type: Required. Constant filled by server. + :type object_type: str + :param recovery_point_time: Required. The recovery time in ISO 8601 format + example - 2020-08-14T17:30:00.0000000Z. + :type recovery_point_time: str + """ + + _validation = { + 'restore_target_info': {'required': True}, + 'source_data_store_type': {'required': True}, + 'object_type': {'required': True}, + 'recovery_point_time': {'required': True}, + } + + _attribute_map = { + 'restore_target_info': {'key': 'restoreTargetInfo', 'type': 'RestoreTargetInfoBase'}, + 'source_data_store_type': {'key': 'sourceDataStoreType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureBackupRecoveryTimeBasedRestoreRequest, self).__init__(**kwargs) + self.recovery_point_time = kwargs.get('recovery_point_time', None) + self.object_type = 'AzureBackupRecoveryTimeBasedRestoreRequest' + + +class AzureBackupRehydrationRequest(Model): + """AzureBackupRehydrationRequest. + + Azure Backup Rehydrate Request. + + All required parameters must be populated in order to send to Azure. + + :param recovery_point_id: Required. Id of the recovery point to be + recovered + :type recovery_point_id: str + :param rehydration_priority: Priority to be used for rehydration. Values + High or Standard. Possible values include: 'Invalid', 'High', 'Standard' + :type rehydration_priority: str or + ~azure.mgmt.dataprotection.models.RehydrationPriority + :param rehydration_retention_duration: Required. Retention duration in ISO + 8601 format i.e P10D . + :type rehydration_retention_duration: str + """ + + _validation = { + 'recovery_point_id': {'required': True}, + 'rehydration_retention_duration': {'required': True}, + } + + _attribute_map = { + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'rehydration_priority': {'key': 'rehydrationPriority', 'type': 'str'}, + 'rehydration_retention_duration': {'key': 'rehydrationRetentionDuration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureBackupRehydrationRequest, self).__init__(**kwargs) + self.recovery_point_id = kwargs.get('recovery_point_id', None) + self.rehydration_priority = kwargs.get('rehydration_priority', None) + self.rehydration_retention_duration = kwargs.get('rehydration_retention_duration', None) + + +class AzureBackupRestoreWithRehydrationRequest(AzureBackupRecoveryPointBasedRestoreRequest): + """AzureBackupRestoreWithRehydrationRequest. + + AzureBackup Restore with Rehydration Request. + + All required parameters must be populated in order to send to Azure. + + :param restore_target_info: Required. Gets or sets the restore target + information. + :type restore_target_info: + ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :param source_data_store_type: Required. Gets or sets the type of the + source data store. Possible values include: 'ArchiveStore', + 'SnapshotStore', 'VaultStore' + :type source_data_store_type: str or + ~azure.mgmt.dataprotection.models.SourceDataStoreType + :param object_type: Required. Constant filled by server. + :type object_type: str + :param recovery_point_id: Required. + :type recovery_point_id: str + :param rehydration_priority: Required. Priority to be used for + rehydration. Values High or Standard. Possible values include: 'Invalid', + 'High', 'Standard' + :type rehydration_priority: str or + ~azure.mgmt.dataprotection.models.RehydrationPriority + :param rehydration_retention_duration: Required. Retention duration in ISO + 8601 format i.e P10D . + :type rehydration_retention_duration: str + """ + + _validation = { + 'restore_target_info': {'required': True}, + 'source_data_store_type': {'required': True}, + 'object_type': {'required': True}, + 'recovery_point_id': {'required': True}, + 'rehydration_priority': {'required': True}, + 'rehydration_retention_duration': {'required': True}, + } + + _attribute_map = { + 'restore_target_info': {'key': 'restoreTargetInfo', 'type': 'RestoreTargetInfoBase'}, + 'source_data_store_type': {'key': 'sourceDataStoreType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'rehydration_priority': {'key': 'rehydrationPriority', 'type': 'str'}, + 'rehydration_retention_duration': {'key': 'rehydrationRetentionDuration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureBackupRestoreWithRehydrationRequest, self).__init__(**kwargs) + self.rehydration_priority = kwargs.get('rehydration_priority', None) + self.rehydration_retention_duration = kwargs.get('rehydration_retention_duration', None) + self.object_type = 'AzureBackupRestoreWithRehydrationRequest' + + +class BasePolicyRule(Model): + """BasePolicyRule. + + BasePolicy Rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupRule, AzureRetentionRule + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'name': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureBackupRule': 'AzureBackupRule', 'AzureRetentionRule': 'AzureRetentionRule'} + } + + def __init__(self, **kwargs): + super(BasePolicyRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.object_type = None + + +class AzureBackupRule(BasePolicyRule): + """AzureBackupRule. + + Azure backup rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :param object_type: Required. Constant filled by server. + :type object_type: str + :param backup_parameters: + :type backup_parameters: + ~azure.mgmt.dataprotection.models.BackupParameters + :param data_store: Required. + :type data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + :param trigger: Required. + :type trigger: ~azure.mgmt.dataprotection.models.TriggerContext + """ + + _validation = { + 'name': {'required': True}, + 'object_type': {'required': True}, + 'data_store': {'required': True}, + 'trigger': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'backup_parameters': {'key': 'backupParameters', 'type': 'BackupParameters'}, + 'data_store': {'key': 'dataStore', 'type': 'DataStoreInfoBase'}, + 'trigger': {'key': 'trigger', 'type': 'TriggerContext'}, + } + + def __init__(self, **kwargs): + super(AzureBackupRule, self).__init__(**kwargs) + self.backup_parameters = kwargs.get('backup_parameters', None) + self.data_store = kwargs.get('data_store', None) + self.trigger = kwargs.get('trigger', None) + self.object_type = 'AzureBackupRule' + + +class DataStoreParameters(Model): + """Parameters for DataStore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureOperationalStoreParameters + + All required parameters must be populated in order to send to Azure. + + :param data_store_type: Required. type of datastore; + Operational/Vault/Archive. Possible values include: 'OperationalStore', + 'VaultStore', 'ArchiveStore' + :type data_store_type: str or + ~azure.mgmt.dataprotection.models.DataStoreTypes + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'data_store_type': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'data_store_type': {'key': 'dataStoreType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureOperationalStoreParameters': 'AzureOperationalStoreParameters'} + } + + def __init__(self, **kwargs): + super(DataStoreParameters, self).__init__(**kwargs) + self.data_store_type = kwargs.get('data_store_type', None) + self.object_type = None + + +class AzureOperationalStoreParameters(DataStoreParameters): + """Parameters for Operational-Tier DataStore. + + All required parameters must be populated in order to send to Azure. + + :param data_store_type: Required. type of datastore; + Operational/Vault/Archive. Possible values include: 'OperationalStore', + 'VaultStore', 'ArchiveStore' + :type data_store_type: str or + ~azure.mgmt.dataprotection.models.DataStoreTypes + :param object_type: Required. Constant filled by server. + :type object_type: str + :param resource_group_id: Gets or sets the Snapshot Resource Group Uri. + :type resource_group_id: str + """ + + _validation = { + 'data_store_type': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'data_store_type': {'key': 'dataStoreType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureOperationalStoreParameters, self).__init__(**kwargs) + self.resource_group_id = kwargs.get('resource_group_id', None) + self.object_type = 'AzureOperationalStoreParameters' + + +class AzureRetentionRule(BasePolicyRule): + """AzureRetentionRule. + + Azure retention rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :param object_type: Required. Constant filled by server. + :type object_type: str + :param is_default: + :type is_default: bool + :param lifecycles: Required. + :type lifecycles: list[~azure.mgmt.dataprotection.models.SourceLifeCycle] + """ + + _validation = { + 'name': {'required': True}, + 'object_type': {'required': True}, + 'lifecycles': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'lifecycles': {'key': 'lifecycles', 'type': '[SourceLifeCycle]'}, + } + + def __init__(self, **kwargs): + super(AzureRetentionRule, self).__init__(**kwargs) + self.is_default = kwargs.get('is_default', None) + self.lifecycles = kwargs.get('lifecycles', None) + self.object_type = 'AzureRetentionRule' + + +class BackupCriteria(Model): + """BackupCriteria. + + BackupCriteria base class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduleBasedBackupCriteria + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'ScheduleBasedBackupCriteria': 'ScheduleBasedBackupCriteria'} + } + + def __init__(self, **kwargs): + super(BackupCriteria, self).__init__(**kwargs) + self.object_type = None + + +class BackupInstance(Model): + """Backup Instance. + + 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 friendly_name: Gets or sets the Backup Instance friendly name. + :type friendly_name: str + :param data_source_info: Required. Gets or sets the data source + information. + :type data_source_info: ~azure.mgmt.dataprotection.models.Datasource + :param data_source_set_info: Gets or sets the data source set information. + :type data_source_set_info: + ~azure.mgmt.dataprotection.models.DatasourceSet + :param policy_info: Required. Gets or sets the policy information. + :type policy_info: ~azure.mgmt.dataprotection.models.PolicyInfo + :ivar protection_status: Specifies the protection status of the resource + :vartype protection_status: + ~azure.mgmt.dataprotection.models.ProtectionStatusDetails + :ivar current_protection_state: Specifies the current protection state of + the resource. Possible values include: 'Invalid', 'NotProtected', + 'ConfiguringProtection', 'ProtectionConfigured', + 'BackupSchedulesSuspended', 'RetentionSchedulesSuspended', + 'ProtectionStopped', 'ProtectionError', 'ConfiguringProtectionFailed', + 'SoftDeleting', 'SoftDeleted', 'UpdatingProtection' + :vartype current_protection_state: str or + ~azure.mgmt.dataprotection.models.CurrentProtectionState + :ivar protection_error_details: Specifies the protection error of the + resource + :vartype protection_error_details: + ~azure.mgmt.dataprotection.models.UserFacingError + :ivar provisioning_state: Specifies the provisioning state of the resource + i.e. provisioning/updating/Succeeded/Failed + :vartype provisioning_state: str + :param object_type: Required. + :type object_type: str + """ + + _validation = { + 'data_source_info': {'required': True}, + 'policy_info': {'required': True}, + 'protection_status': {'readonly': True}, + 'current_protection_state': {'readonly': True}, + 'protection_error_details': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'data_source_info': {'key': 'dataSourceInfo', 'type': 'Datasource'}, + 'data_source_set_info': {'key': 'dataSourceSetInfo', 'type': 'DatasourceSet'}, + 'policy_info': {'key': 'policyInfo', 'type': 'PolicyInfo'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'ProtectionStatusDetails'}, + 'current_protection_state': {'key': 'currentProtectionState', 'type': 'str'}, + 'protection_error_details': {'key': 'protectionErrorDetails', 'type': 'UserFacingError'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BackupInstance, self).__init__(**kwargs) + self.friendly_name = kwargs.get('friendly_name', None) + self.data_source_info = kwargs.get('data_source_info', None) + self.data_source_set_info = kwargs.get('data_source_set_info', None) + self.policy_info = kwargs.get('policy_info', None) + self.protection_status = None + self.current_protection_state = None + self.protection_error_details = None + self.provisioning_state = None + self.object_type = kwargs.get('object_type', None) + + +class BackupInstanceResource(DppResource): + """BackupInstanceResource. + + BackupInstance 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 system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + :param properties: BackupInstanceResource properties + :type properties: ~azure.mgmt.dataprotection.models.BackupInstance + """ + + _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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'BackupInstance'}, + } + + def __init__(self, **kwargs): + super(BackupInstanceResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class BaseBackupPolicy(Model): + """BaseBackupPolicy. + + BackupPolicy base. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BackupPolicy + + All required parameters must be populated in order to send to Azure. + + :param datasource_types: Required. Type of datasource for the backup + management + :type datasource_types: list[str] + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'datasource_types': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'datasource_types': {'key': 'datasourceTypes', 'type': '[str]'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'BackupPolicy': 'BackupPolicy'} + } + + def __init__(self, **kwargs): + super(BaseBackupPolicy, self).__init__(**kwargs) + self.datasource_types = kwargs.get('datasource_types', None) + self.object_type = None + + +class BackupPolicy(BaseBackupPolicy): + """BackupPolicy. + + Rule based backup policy. + + All required parameters must be populated in order to send to Azure. + + :param datasource_types: Required. Type of datasource for the backup + management + :type datasource_types: list[str] + :param object_type: Required. Constant filled by server. + :type object_type: str + :param policy_rules: Required. Policy rule dictionary that contains rules + for each backuptype i.e Full/Incremental/Logs etc + :type policy_rules: list[~azure.mgmt.dataprotection.models.BasePolicyRule] + """ + + _validation = { + 'datasource_types': {'required': True}, + 'object_type': {'required': True}, + 'policy_rules': {'required': True}, + } + + _attribute_map = { + 'datasource_types': {'key': 'datasourceTypes', 'type': '[str]'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'policy_rules': {'key': 'policyRules', 'type': '[BasePolicyRule]'}, + } + + def __init__(self, **kwargs): + super(BackupPolicy, self).__init__(**kwargs) + self.policy_rules = kwargs.get('policy_rules', None) + self.object_type = 'BackupPolicy' + + +class BackupSchedule(Model): + """BackupSchedule. + + Schedule for backup. + + All required parameters must be populated in order to send to Azure. + + :param repeating_time_intervals: Required. ISO 8601 repeating time + interval format + :type repeating_time_intervals: list[str] + """ + + _validation = { + 'repeating_time_intervals': {'required': True}, + } + + _attribute_map = { + 'repeating_time_intervals': {'key': 'repeatingTimeIntervals', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(BackupSchedule, self).__init__(**kwargs) + self.repeating_time_intervals = kwargs.get('repeating_time_intervals', None) + + +class BackupVault(Model): + """BackupVault. + + Backup Vault. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: Provisioning state of the BackupVault resource. + Possible values include: 'Failed', 'Provisioning', 'Succeeded', 'Unknown', + 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.dataprotection.models.ProvisioningState + :param storage_settings: Required. Storage Settings + :type storage_settings: + list[~azure.mgmt.dataprotection.models.StorageSetting] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'storage_settings': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'storage_settings': {'key': 'storageSettings', 'type': '[StorageSetting]'}, + } + + def __init__(self, **kwargs): + super(BackupVault, self).__init__(**kwargs) + self.provisioning_state = None + self.storage_settings = kwargs.get('storage_settings', None) + + +class DppTrackedResource(Model): + """DppTrackedResource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param e_tag: Optional ETag. + :type e_tag: str + :ivar id: Resource Id represents the complete path to the resource. + :vartype id: str + :param identity: Input Managed Identity Details + :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :param location: Resource location. + :type location: str + :ivar name: Resource name associated with the resource. + :vartype name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar type: Resource type represents the complete path of the form + Namespace/ResourceType/ResourceType/... + :vartype type: str + :param system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'DppIdentityDetails'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, **kwargs): + super(DppTrackedResource, self).__init__(**kwargs) + self.e_tag = kwargs.get('e_tag', None) + self.id = None + self.identity = kwargs.get('identity', None) + self.location = kwargs.get('location', None) + self.name = None + self.tags = kwargs.get('tags', None) + self.type = None + self.system_data = kwargs.get('system_data', None) + + +class BackupVaultResource(DppTrackedResource): + """BackupVault Resource. + + Backup Vault Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param e_tag: Optional ETag. + :type e_tag: str + :ivar id: Resource Id represents the complete path to the resource. + :vartype id: str + :param identity: Input Managed Identity Details + :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :param location: Resource location. + :type location: str + :ivar name: Resource name associated with the resource. + :vartype name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar type: Resource type represents the complete path of the form + Namespace/ResourceType/ResourceType/... + :vartype type: str + :param system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + :param properties: Required. BackupVaultResource properties + :type properties: ~azure.mgmt.dataprotection.models.BackupVault + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'DppIdentityDetails'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'BackupVault'}, + } + + def __init__(self, **kwargs): + super(BackupVaultResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class BaseBackupPolicyResource(DppResource): + """BaseBackupPolicyResource. + + BaseBackupPolicy 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 system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + :param properties: BaseBackupPolicyResource properties + :type properties: ~azure.mgmt.dataprotection.models.BaseBackupPolicy + """ + + _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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'BaseBackupPolicy'}, + } + + def __init__(self, **kwargs): + super(BaseBackupPolicyResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class CheckNameAvailabilityRequest(Model): + """CheckNameAvailabilityRequest. + + CheckNameAvailability Request. + + :param name: Resource name for which availability needs to be checked + :type name: str + :param type: Describes the Resource type: + Microsoft.DataProtection/BackupVaults + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class CheckNameAvailabilityResult(Model): + """CheckNameAvailabilityResult. + + CheckNameAvailability Result. + + :param message: Gets or sets the message. + :type message: str + :param name_available: Gets or sets a value indicating whether [name + available]. + :type name_available: bool + :param reason: Gets or sets the reason. + :type reason: str + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + + +class ClientDiscoveryDisplay(Model): + """ClientDiscoveryDisplay. + + Localized display information of an operation. + + :param description: Description of the operation having details of what + operation is about. + :type description: str + :param operation: Operations Name itself. + :type operation: str + :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 + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ClientDiscoveryDisplay, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.operation = kwargs.get('operation', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + + +class ClientDiscoveryForLogSpecification(Model): + """ClientDiscoveryForLogSpecification. + + Class to represent shoebox log specification in json client discovery. + + :param blob_duration: blob duration of shoebox log specification + :type blob_duration: str + :param display_name: Localized display name + :type display_name: str + :param name: Name for shoebox log specification. + :type name: str + """ + + _attribute_map = { + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ClientDiscoveryForLogSpecification, self).__init__(**kwargs) + self.blob_duration = kwargs.get('blob_duration', None) + self.display_name = kwargs.get('display_name', None) + self.name = kwargs.get('name', None) + + +class ClientDiscoveryForProperties(Model): + """ClientDiscoveryForProperties. + + Class to represent shoebox properties in json client discovery. + + :param service_specification: Operation properties. + :type service_specification: + ~azure.mgmt.dataprotection.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(Model): + """ClientDiscoveryForServiceSpecification. + + 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.dataprotection.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 ClientDiscoveryValueForSingleApi(Model): + """ClientDiscoveryValueForSingleApi. + + Available operation details. + + :param display: Contains the localized display information for this + particular operation + :type display: ~azure.mgmt.dataprotection.models.ClientDiscoveryDisplay + :param name: Name of the Operation. + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :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: Properties for the given operation. + :type properties: + ~azure.mgmt.dataprotection.models.ClientDiscoveryForProperties + """ + + _attribute_map = { + 'display': {'key': 'display', 'type': 'ClientDiscoveryDisplay'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ClientDiscoveryForProperties'}, + } + + def __init__(self, **kwargs): + super(ClientDiscoveryValueForSingleApi, self).__init__(**kwargs) + self.display = kwargs.get('display', None) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) + + +class CloudError(Model): + """CloudError. + + An error response from Azure Backup. + + :param error: + :type error: ~azure.mgmt.dataprotection.models.Error + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CopyOption(Model): + """CopyOption. + + Options to copy. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CopyOnExpiryOption, CustomCopyOption, ImmediateCopyOption + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'CopyOnExpiryOption': 'CopyOnExpiryOption', 'CustomCopyOption': 'CustomCopyOption', 'ImmediateCopyOption': 'ImmediateCopyOption'} + } + + def __init__(self, **kwargs): + super(CopyOption, self).__init__(**kwargs) + self.object_type = None + + +class CopyOnExpiryOption(CopyOption): + """CopyOnExpiryOption. + + Copy on Expiry Option. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CopyOnExpiryOption, self).__init__(**kwargs) + self.object_type = 'CopyOnExpiryOption' + + +class CustomCopyOption(CopyOption): + """CustomCopyOption. + + Duration based custom options to copy. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param duration: Data copied after given timespan + :type duration: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomCopyOption, self).__init__(**kwargs) + self.duration = kwargs.get('duration', None) + self.object_type = 'CustomCopyOption' + + +class Datasource(Model): + """Datasource. + + Datasource to be backed up. + + All required parameters must be populated in order to send to Azure. + + :param datasource_type: DatasourceType of the resource. + :type datasource_type: str + :param object_type: Type of Datasource object, used to initialize the + right inherited type + :type object_type: str + :param resource_id: Required. Full ARM ID of the resource. For azure + resources, this is ARM ID. For non azure resources, this will be the ID + created by backup service via Fabric/Vault. + :type resource_id: str + :param resource_location: Location of datasource. + :type resource_location: str + :param resource_name: Unique identifier of the resource in the context of + parent. + :type resource_name: str + :param resource_type: Resource Type of Datasource. + :type resource_type: str + :param resource_uri: Uri of the resource. + :type resource_uri: str + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'datasource_type': {'key': 'datasourceType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'resource_id': {'key': 'resourceID', 'type': 'str'}, + 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Datasource, self).__init__(**kwargs) + self.datasource_type = kwargs.get('datasource_type', None) + self.object_type = kwargs.get('object_type', None) + self.resource_id = kwargs.get('resource_id', None) + self.resource_location = kwargs.get('resource_location', None) + self.resource_name = kwargs.get('resource_name', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_uri = kwargs.get('resource_uri', None) + + +class DatasourceSet(Model): + """DatasourceSet. + + DatasourceSet details of datasource to be backed up. + + All required parameters must be populated in order to send to Azure. + + :param datasource_type: DatasourceType of the resource. + :type datasource_type: str + :param object_type: Type of Datasource object, used to initialize the + right inherited type + :type object_type: str + :param resource_id: Required. Full ARM ID of the resource. For azure + resources, this is ARM ID. For non azure resources, this will be the ID + created by backup service via Fabric/Vault. + :type resource_id: str + :param resource_location: Location of datasource. + :type resource_location: str + :param resource_name: Unique identifier of the resource in the context of + parent. + :type resource_name: str + :param resource_type: Resource Type of Datasource. + :type resource_type: str + :param resource_uri: Uri of the resource. + :type resource_uri: str + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'datasource_type': {'key': 'datasourceType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'resource_id': {'key': 'resourceID', 'type': 'str'}, + 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DatasourceSet, self).__init__(**kwargs) + self.datasource_type = kwargs.get('datasource_type', None) + self.object_type = kwargs.get('object_type', None) + self.resource_id = kwargs.get('resource_id', None) + self.resource_location = kwargs.get('resource_location', None) + self.resource_name = kwargs.get('resource_name', None) + self.resource_type = kwargs.get('resource_type', None) + self.resource_uri = kwargs.get('resource_uri', None) + + +class DataStoreInfoBase(Model): + """DataStoreInfoBase. + + DataStoreInfo base. + + All required parameters must be populated in order to send to Azure. + + :param data_store_type: Required. type of datastore; + Operational/Vault/Archive. Possible values include: 'OperationalStore', + 'VaultStore', 'ArchiveStore' + :type data_store_type: str or + ~azure.mgmt.dataprotection.models.DataStoreTypes + :param object_type: Required. Type of Datasource object, used to + initialize the right inherited type + :type object_type: str + """ + + _validation = { + 'data_store_type': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'data_store_type': {'key': 'dataStoreType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataStoreInfoBase, self).__init__(**kwargs) + self.data_store_type = kwargs.get('data_store_type', None) + self.object_type = kwargs.get('object_type', None) + + +class Day(Model): + """Day. + + Day of the week. + + :param date_property: Date of the month + :type date_property: int + :param is_last: Whether Date is last date of month + :type is_last: bool + """ + + _attribute_map = { + 'date_property': {'key': 'date', 'type': 'int'}, + 'is_last': {'key': 'isLast', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(Day, self).__init__(**kwargs) + self.date_property = kwargs.get('date_property', None) + self.is_last = kwargs.get('is_last', None) + + +class DppIdentityDetails(Model): + """DppIdentityDetails. + + Identity details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The object ID of the service principal object for the + managed identity that is used to grant role-based access to an Azure + resource. + :vartype principal_id: str + :ivar tenant_id: A Globally Unique Identifier (GUID) that represents the + Azure AD tenant where the resource is now a member. + :vartype tenant_id: str + :param type: The identityType which can be either SystemAssigned or None + :type type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DppIdentityDetails, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class DppResourceList(Model): + """List Resource. + + ListResource. + + :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(DppResourceList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + + +class DppTrackedResourceList(Model): + """DppTrackedResourceList. + + :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(DppTrackedResourceList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + + +class Error(Model): + """The resource management error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.dataprotection.models.ErrorAdditionalInfo] + :ivar code: The error code. + :vartype code: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.dataprotection.models.Error] + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + """ + + _validation = { + 'additional_info': {'readonly': True}, + 'code': {'readonly': True}, + 'details': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[Error]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.additional_info = None + self.code = None + self.details = None + self.message = None + self.target = None + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar info: The additional info. + :vartype info: object + :ivar type: The additional info type. + :vartype type: str + """ + + _validation = { + 'info': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'info': {'key': 'info', 'type': 'object'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.info = None + self.type = None + + +class ExportJobsResult(Model): + """ExportJobsResult. + + The result for export jobs containing blob details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob_url: URL of the blob into which the serialized string of list + of jobs is exported. + :vartype blob_url: str + :ivar blob_sas_key: SAS key to access the blob. + :vartype blob_sas_key: str + :ivar excel_file_blob_url: URL of the blob into which the ExcelFile is + uploaded. + :vartype excel_file_blob_url: str + :ivar excel_file_blob_sas_key: SAS key to access the ExcelFile blob. + :vartype excel_file_blob_sas_key: str + """ + + _validation = { + 'blob_url': {'readonly': True}, + 'blob_sas_key': {'readonly': True}, + 'excel_file_blob_url': {'readonly': True}, + 'excel_file_blob_sas_key': {'readonly': True}, + } + + _attribute_map = { + '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(ExportJobsResult, self).__init__(**kwargs) + self.blob_url = None + self.blob_sas_key = None + self.excel_file_blob_url = None + self.excel_file_blob_sas_key = None + + +class FeatureValidationRequestBase(Model): + """Base class for Backup Feature support. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FeatureValidationRequest + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'FeatureValidationRequest': 'FeatureValidationRequest'} + } + + def __init__(self, **kwargs): + super(FeatureValidationRequestBase, self).__init__(**kwargs) + self.object_type = None + + +class FeatureValidationRequest(FeatureValidationRequestBase): + """Base class for feature object. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param feature_type: backup support feature type. Possible values include: + 'Invalid', 'DataSourceType' + :type feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType + :param feature_name: backup support feature name. + :type feature_name: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'feature_type': {'key': 'featureType', 'type': 'str'}, + 'feature_name': {'key': 'featureName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FeatureValidationRequest, self).__init__(**kwargs) + self.feature_type = kwargs.get('feature_type', None) + self.feature_name = kwargs.get('feature_name', None) + self.object_type = 'FeatureValidationRequest' + + +class FeatureValidationResponseBase(Model): + """Base class for Backup Feature support. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FeatureValidationResponse + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'FeatureValidationResponse': 'FeatureValidationResponse'} + } + + def __init__(self, **kwargs): + super(FeatureValidationResponseBase, self).__init__(**kwargs) + self.object_type = None + + +class FeatureValidationResponse(FeatureValidationResponseBase): + """Feature Validation Response. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param feature_type: backup support feature type. Possible values include: + 'Invalid', 'DataSourceType' + :type feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType + :param features: Response features + :type features: list[~azure.mgmt.dataprotection.models.SupportedFeature] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'feature_type': {'key': 'featureType', 'type': 'str'}, + 'features': {'key': 'features', 'type': '[SupportedFeature]'}, + } + + def __init__(self, **kwargs): + super(FeatureValidationResponse, self).__init__(**kwargs) + self.feature_type = kwargs.get('feature_type', None) + self.features = kwargs.get('features', None) + self.object_type = 'FeatureValidationResponse' + + +class ImmediateCopyOption(CopyOption): + """ImmediateCopyOption. + + Immediate copy Option. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImmediateCopyOption, self).__init__(**kwargs) + self.object_type = 'ImmediateCopyOption' + + +class InnerError(Model): + """InnerError. + + Inner Error. + + :param additional_info: Any Key value pairs that can be provided to the + client for additional verbose information. + :type additional_info: dict[str, str] + :param code: Unique code for this error + :type code: str + :param embedded_inner_error: Child Inner Error, to allow Nesting. + :type embedded_inner_error: ~azure.mgmt.dataprotection.models.InnerError + """ + + _attribute_map = { + 'additional_info': {'key': 'additionalInfo', 'type': '{str}'}, + 'code': {'key': 'code', 'type': 'str'}, + 'embedded_inner_error': {'key': 'embeddedInnerError', 'type': 'InnerError'}, + } + + def __init__(self, **kwargs): + super(InnerError, self).__init__(**kwargs) + self.additional_info = kwargs.get('additional_info', None) + self.code = kwargs.get('code', None) + self.embedded_inner_error = kwargs.get('embedded_inner_error', None) + + +class ItemLevelRestoreCriteria(Model): + """Class to contain criteria for item level restore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: RangeBasedItemLevelRestoreCriteria + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'RangeBasedItemLevelRestoreCriteria': 'RangeBasedItemLevelRestoreCriteria'} + } + + def __init__(self, **kwargs): + super(ItemLevelRestoreCriteria, self).__init__(**kwargs) + self.object_type = None + + +class RestoreTargetInfoBase(Model): + """Base class common to RestoreTargetInfo and RestoreFilesTargetInfo. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ItemLevelRestoreTargetInfo, RestoreFilesTargetInfo, + RestoreTargetInfo + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar recovery_option: Required. Recovery Option. Default value: + "FailIfExists" . + :vartype recovery_option: str + :param restore_location: Target Restore region + :type restore_location: str + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'recovery_option': {'required': True, 'constant': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'recovery_option': {'key': 'recoveryOption', 'type': 'str'}, + 'restore_location': {'key': 'restoreLocation', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'ItemLevelRestoreTargetInfo': 'ItemLevelRestoreTargetInfo', 'RestoreFilesTargetInfo': 'RestoreFilesTargetInfo', 'RestoreTargetInfo': 'RestoreTargetInfo'} + } + + recovery_option = "FailIfExists" + + def __init__(self, **kwargs): + super(RestoreTargetInfoBase, self).__init__(**kwargs) + self.restore_location = kwargs.get('restore_location', None) + self.object_type = None + + +class ItemLevelRestoreTargetInfo(RestoreTargetInfoBase): + """Restore target info for Item level restore operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar recovery_option: Required. Recovery Option. Default value: + "FailIfExists" . + :vartype recovery_option: str + :param restore_location: Target Restore region + :type restore_location: str + :param object_type: Required. Constant filled by server. + :type object_type: str + :param restore_criteria: Required. Restore Criteria + :type restore_criteria: + list[~azure.mgmt.dataprotection.models.ItemLevelRestoreCriteria] + :param datasource_info: Required. Information of target DS + :type datasource_info: ~azure.mgmt.dataprotection.models.Datasource + :param datasource_set_info: Information of target DS Set + :type datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + """ + + _validation = { + 'recovery_option': {'required': True, 'constant': True}, + 'object_type': {'required': True}, + 'restore_criteria': {'required': True}, + 'datasource_info': {'required': True}, + } + + _attribute_map = { + 'recovery_option': {'key': 'recoveryOption', 'type': 'str'}, + 'restore_location': {'key': 'restoreLocation', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'restore_criteria': {'key': 'restoreCriteria', 'type': '[ItemLevelRestoreCriteria]'}, + 'datasource_info': {'key': 'datasourceInfo', 'type': 'Datasource'}, + 'datasource_set_info': {'key': 'datasourceSetInfo', 'type': 'DatasourceSet'}, + } + + def __init__(self, **kwargs): + super(ItemLevelRestoreTargetInfo, self).__init__(**kwargs) + self.restore_criteria = kwargs.get('restore_criteria', None) + self.datasource_info = kwargs.get('datasource_info', None) + self.datasource_set_info = kwargs.get('datasource_set_info', None) + self.object_type = 'ItemLevelRestoreTargetInfo' + + +class JobExtendedInfo(Model): + """Extended Information about the job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param additional_details: Job's Additional Details + :type additional_details: dict[str, str] + :ivar backup_instance_state: State of the Backup Instance + :vartype backup_instance_state: str + :ivar data_transferred_in_bytes: Number of bytes transferred + :vartype data_transferred_in_bytes: float + :ivar recovery_destination: Destination where restore is done + :vartype recovery_destination: str + :ivar source_recover_point: Details of the Source Recovery Point + :vartype source_recover_point: + ~azure.mgmt.dataprotection.models.RestoreJobRecoveryPointDetails + :ivar sub_tasks: List of Sub Tasks of the job + :vartype sub_tasks: list[~azure.mgmt.dataprotection.models.JobSubTask] + :ivar target_recover_point: Details of the Target Recovery Point + :vartype target_recover_point: + ~azure.mgmt.dataprotection.models.RestoreJobRecoveryPointDetails + """ + + _validation = { + 'backup_instance_state': {'readonly': True}, + 'data_transferred_in_bytes': {'readonly': True}, + 'recovery_destination': {'readonly': True}, + 'source_recover_point': {'readonly': True}, + 'sub_tasks': {'readonly': True}, + 'target_recover_point': {'readonly': True}, + } + + _attribute_map = { + 'additional_details': {'key': 'additionalDetails', 'type': '{str}'}, + 'backup_instance_state': {'key': 'backupInstanceState', 'type': 'str'}, + 'data_transferred_in_bytes': {'key': 'dataTransferredInBytes', 'type': 'float'}, + 'recovery_destination': {'key': 'recoveryDestination', 'type': 'str'}, + 'source_recover_point': {'key': 'sourceRecoverPoint', 'type': 'RestoreJobRecoveryPointDetails'}, + 'sub_tasks': {'key': 'subTasks', 'type': '[JobSubTask]'}, + 'target_recover_point': {'key': 'targetRecoverPoint', 'type': 'RestoreJobRecoveryPointDetails'}, + } + + def __init__(self, **kwargs): + super(JobExtendedInfo, self).__init__(**kwargs) + self.additional_details = kwargs.get('additional_details', None) + self.backup_instance_state = None + self.data_transferred_in_bytes = None + self.recovery_destination = None + self.source_recover_point = None + self.sub_tasks = None + self.target_recover_point = None + + +class JobSubTask(Model): + """Details of Job's Sub Task. + + 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 additional_details: Additional details of Sub Tasks + :type additional_details: dict[str, str] + :param task_id: Required. Task Id of the Sub Task + :type task_id: int + :param task_name: Required. Name of the Sub Task + :type task_name: str + :ivar task_progress: Progress of the Sub Task + :vartype task_progress: str + :param task_status: Required. Status of the Sub Task + :type task_status: str + """ + + _validation = { + 'task_id': {'required': True}, + 'task_name': {'required': True}, + 'task_progress': {'readonly': True}, + 'task_status': {'required': True}, + } + + _attribute_map = { + 'additional_details': {'key': 'additionalDetails', 'type': '{str}'}, + 'task_id': {'key': 'taskId', 'type': 'int'}, + 'task_name': {'key': 'taskName', 'type': 'str'}, + 'task_progress': {'key': 'taskProgress', 'type': 'str'}, + 'task_status': {'key': 'taskStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobSubTask, self).__init__(**kwargs) + self.additional_details = kwargs.get('additional_details', None) + self.task_id = kwargs.get('task_id', None) + self.task_name = kwargs.get('task_name', None) + self.task_progress = None + self.task_status = kwargs.get('task_status', None) + + +class OperationExtendedInfo(Model): + """OperationExtendedInfo. + + Operation Extended Info. + + :param object_type: This property will be used as the discriminator for + deciding the specific types in the polymorphic chain of types. + :type object_type: str + """ + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationExtendedInfo, self).__init__(**kwargs) + self.object_type = kwargs.get('object_type', None) + + +class OperationJobExtendedInfo(OperationExtendedInfo): + """OperationJobExtendedInfo. + + Operation Job Extended Info. + + :param object_type: This property will be used as the discriminator for + deciding the specific types in the polymorphic chain of types. + :type object_type: str + :param job_id: Arm Id of the job created for this operation. + :type job_id: str + """ + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationJobExtendedInfo, self).__init__(**kwargs) + self.job_id = kwargs.get('job_id', None) + + +class OperationResource(Model): + """OperationResource. + + Operation Resource. + + :param end_time: End time of the operation + :type end_time: datetime + :param error: Required if status == failed or status == canceled. This is + the OData v4 error format, used by the RPC and will go into the v2.2 Azure + REST API guidelines. + The full set of optional properties (e.g. inner errors / details) can be + found in the "Error Response" section. + :type error: ~azure.mgmt.dataprotection.models.Error + :param id: It should match what is used to GET the operation result + :type id: str + :param name: It must match the last segment of the "id" field, and will + typically be a GUID / system generated value + :type name: str + :param properties: End time of the operation + :type properties: ~azure.mgmt.dataprotection.models.OperationExtendedInfo + :param start_time: Start time of the operation + :type start_time: datetime + :param status: + :type status: str + """ + + _attribute_map = { + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'Error'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'OperationExtendedInfo'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationResource, self).__init__(**kwargs) + self.end_time = kwargs.get('end_time', None) + self.error = kwargs.get('error', None) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) + self.start_time = kwargs.get('start_time', None) + self.status = kwargs.get('status', None) + + +class PatchResourceRequestInput(Model): + """PatchResourceRequestInput. + + Patch Request content for Microsoft.DataProtection resources. + + :param identity: Input Managed Identity Details + :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'identity': {'key': 'identity', 'type': 'DppIdentityDetails'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(PatchResourceRequestInput, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.tags = kwargs.get('tags', None) + + +class PolicyInfo(Model): + """PolicyInfo. + + Policy Info in backupInstance. + + 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 policy_id: Required. + :type policy_id: str + :ivar policy_version: + :vartype policy_version: str + :param policy_parameters: Policy parameters for the backup instance + :type policy_parameters: + ~azure.mgmt.dataprotection.models.PolicyParameters + """ + + _validation = { + 'policy_id': {'required': True}, + 'policy_version': {'readonly': True}, + } + + _attribute_map = { + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'policy_version': {'key': 'policyVersion', 'type': 'str'}, + 'policy_parameters': {'key': 'policyParameters', 'type': 'PolicyParameters'}, + } + + def __init__(self, **kwargs): + super(PolicyInfo, self).__init__(**kwargs) + self.policy_id = kwargs.get('policy_id', None) + self.policy_version = None + self.policy_parameters = kwargs.get('policy_parameters', None) + + +class PolicyParameters(Model): + """Parameters in Policy. + + :param data_store_parameters_list: Gets or sets the DataStore Parameters + :type data_store_parameters_list: + list[~azure.mgmt.dataprotection.models.DataStoreParameters] + """ + + _attribute_map = { + 'data_store_parameters_list': {'key': 'dataStoreParametersList', 'type': '[DataStoreParameters]'}, + } + + def __init__(self, **kwargs): + super(PolicyParameters, self).__init__(**kwargs) + self.data_store_parameters_list = kwargs.get('data_store_parameters_list', None) + + +class ProtectionStatusDetails(Model): + """ProtectionStatusDetails. + + Protection status details. + + :param error_details: Specifies the protection status error of the + resource + :type error_details: ~azure.mgmt.dataprotection.models.UserFacingError + :param status: Specifies the protection status of the resource. Possible + values include: 'ConfiguringProtection', 'ConfiguringProtectionFailed', + 'ProtectionConfigured', 'ProtectionStopped', 'SoftDeleted', 'SoftDeleting' + :type status: str or ~azure.mgmt.dataprotection.models.Status + """ + + _attribute_map = { + 'error_details': {'key': 'errorDetails', 'type': 'UserFacingError'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProtectionStatusDetails, self).__init__(**kwargs) + self.error_details = kwargs.get('error_details', None) + self.status = kwargs.get('status', None) + + +class RangeBasedItemLevelRestoreCriteria(ItemLevelRestoreCriteria): + """Item Level target info for restore operation. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param min_matching_value: minimum value for range prefix match + :type min_matching_value: str + :param max_matching_value: maximum value for range prefix match + :type max_matching_value: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'min_matching_value': {'key': 'minMatchingValue', 'type': 'str'}, + 'max_matching_value': {'key': 'maxMatchingValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RangeBasedItemLevelRestoreCriteria, self).__init__(**kwargs) + self.min_matching_value = kwargs.get('min_matching_value', None) + self.max_matching_value = kwargs.get('max_matching_value', None) + self.object_type = 'RangeBasedItemLevelRestoreCriteria' + + +class RecoveryPointDataStoreDetails(Model): + """RecoveryPointDataStoreDetails. + + RecoveryPoint datastore details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param creation_time: + :type creation_time: datetime + :param expiry_time: + :type expiry_time: datetime + :param id: + :type id: str + :param meta_data: + :type meta_data: str + :param state: + :type state: str + :param type: + :type type: str + :param visible: + :type visible: bool + :ivar rehydration_expiry_time: + :vartype rehydration_expiry_time: datetime + :ivar rehydration_status: Possible values include: 'CREATE_IN_PROGRESS', + 'COMPLETED', 'DELETE_IN_PROGRESS', 'DELETED', 'FAILED' + :vartype rehydration_status: str or + ~azure.mgmt.dataprotection.models.RehydrationStatus + """ + + _validation = { + 'rehydration_expiry_time': {'readonly': True}, + 'rehydration_status': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'str'}, + 'meta_data': {'key': 'metaData', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'visible': {'key': 'visible', 'type': 'bool'}, + 'rehydration_expiry_time': {'key': 'rehydrationExpiryTime', 'type': 'iso-8601'}, + 'rehydration_status': {'key': 'rehydrationStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RecoveryPointDataStoreDetails, self).__init__(**kwargs) + self.creation_time = kwargs.get('creation_time', None) + self.expiry_time = kwargs.get('expiry_time', None) + self.id = kwargs.get('id', None) + self.meta_data = kwargs.get('meta_data', None) + self.state = kwargs.get('state', None) + self.type = kwargs.get('type', None) + self.visible = kwargs.get('visible', None) + self.rehydration_expiry_time = None + self.rehydration_status = None + + +class RecoveryPointsFilters(Model): + """RecoveryPointsFilters. + + :param restore_point_data_store_id: + :type restore_point_data_store_id: str + :param is_visible: + :type is_visible: bool + :param start_date: + :type start_date: str + :param end_date: + :type end_date: str + :param extended_info: + :type extended_info: bool + :param restore_point_state: + :type restore_point_state: str + """ + + _attribute_map = { + 'restore_point_data_store_id': {'key': 'restorePointDataStoreId', 'type': 'str'}, + 'is_visible': {'key': 'isVisible', 'type': 'bool'}, + 'start_date': {'key': 'startDate', 'type': 'str'}, + 'end_date': {'key': 'endDate', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'bool'}, + 'restore_point_state': {'key': 'restorePointState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RecoveryPointsFilters, self).__init__(**kwargs) + self.restore_point_data_store_id = kwargs.get('restore_point_data_store_id', None) + self.is_visible = kwargs.get('is_visible', None) + self.start_date = kwargs.get('start_date', None) + self.end_date = kwargs.get('end_date', None) + self.extended_info = kwargs.get('extended_info', None) + self.restore_point_state = kwargs.get('restore_point_state', None) + + +class RestorableTimeRange(Model): + """RestorableTimeRange. + + All required parameters must be populated in order to send to Azure. + + :param start_time: Required. Start time for the available restore range + :type start_time: str + :param end_time: Required. End time for the available restore range + :type end_time: str + :param object_type: + :type object_type: str + """ + + _validation = { + 'start_time': {'required': True}, + 'end_time': {'required': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RestorableTimeRange, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.object_type = kwargs.get('object_type', None) + + +class RestoreFilesTargetInfo(RestoreTargetInfoBase): + """Class encapsulating restore as files target parameters. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar recovery_option: Required. Recovery Option. Default value: + "FailIfExists" . + :vartype recovery_option: str + :param restore_location: Target Restore region + :type restore_location: str + :param object_type: Required. Constant filled by server. + :type object_type: str + :param target_details: Required. Destination of RestoreAsFiles operation, + when destination is not a datasource + :type target_details: ~azure.mgmt.dataprotection.models.TargetDetails + """ + + _validation = { + 'recovery_option': {'required': True, 'constant': True}, + 'object_type': {'required': True}, + 'target_details': {'required': True}, + } + + _attribute_map = { + 'recovery_option': {'key': 'recoveryOption', 'type': 'str'}, + 'restore_location': {'key': 'restoreLocation', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'target_details': {'key': 'targetDetails', 'type': 'TargetDetails'}, + } + + def __init__(self, **kwargs): + super(RestoreFilesTargetInfo, self).__init__(**kwargs) + self.target_details = kwargs.get('target_details', None) + self.object_type = 'RestoreFilesTargetInfo' + + +class RestoreJobRecoveryPointDetails(Model): + """RestoreJobRecoveryPointDetails. + + :param recovery_point_id: + :type recovery_point_id: str + :param recovery_point_time: + :type recovery_point_time: datetime + """ + + _attribute_map = { + 'recovery_point_id': {'key': 'recoveryPointID', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(RestoreJobRecoveryPointDetails, self).__init__(**kwargs) + self.recovery_point_id = kwargs.get('recovery_point_id', None) + self.recovery_point_time = kwargs.get('recovery_point_time', None) + + +class RestoreTargetInfo(RestoreTargetInfoBase): + """Class encapsulating restore target parameters. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar recovery_option: Required. Recovery Option. Default value: + "FailIfExists" . + :vartype recovery_option: str + :param restore_location: Target Restore region + :type restore_location: str + :param object_type: Required. Constant filled by server. + :type object_type: str + :param datasource_info: Required. Information of target DS + :type datasource_info: ~azure.mgmt.dataprotection.models.Datasource + :param datasource_set_info: Information of target DS Set + :type datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + """ + + _validation = { + 'recovery_option': {'required': True, 'constant': True}, + 'object_type': {'required': True}, + 'datasource_info': {'required': True}, + } + + _attribute_map = { + 'recovery_option': {'key': 'recoveryOption', 'type': 'str'}, + 'restore_location': {'key': 'restoreLocation', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'datasource_info': {'key': 'datasourceInfo', 'type': 'Datasource'}, + 'datasource_set_info': {'key': 'datasourceSetInfo', 'type': 'DatasourceSet'}, + } + + def __init__(self, **kwargs): + super(RestoreTargetInfo, self).__init__(**kwargs) + self.datasource_info = kwargs.get('datasource_info', None) + self.datasource_set_info = kwargs.get('datasource_set_info', None) + self.object_type = 'RestoreTargetInfo' + + +class RetentionTag(Model): + """RetentionTag. + + Retention tag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar e_tag: Retention Tag version. + :vartype e_tag: str + :ivar id: Retention Tag version. + :vartype id: str + :param tag_name: Required. Retention Tag Name to relate it to retention + rule. + :type tag_name: str + """ + + _validation = { + 'e_tag': {'readonly': True}, + 'id': {'readonly': True}, + 'tag_name': {'required': True}, + } + + _attribute_map = { + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RetentionTag, self).__init__(**kwargs) + self.e_tag = None + self.id = None + self.tag_name = kwargs.get('tag_name', None) + + +class ScheduleBasedBackupCriteria(BackupCriteria): + """ScheduleBasedBackupCriteria. + + Schedule based backup criteria. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param absolute_criteria: it contains absolute values like "AllBackup" / + "FirstOfDay" / "FirstOfWeek" / "FirstOfMonth" + and should be part of AbsoluteMarker enum + :type absolute_criteria: list[str or + ~azure.mgmt.dataprotection.models.AbsoluteMarker] + :param days_of_month: This is day of the month from 1 to 28 other wise + last of month + :type days_of_month: list[~azure.mgmt.dataprotection.models.Day] + :param days_of_the_week: It should be Sunday/Monday/T..../Saturday + :type days_of_the_week: list[str or + ~azure.mgmt.dataprotection.models.DayOfWeek] + :param months_of_year: It should be January/February/....../December + :type months_of_year: list[str or ~azure.mgmt.dataprotection.models.Month] + :param schedule_times: List of schedule times for backup + :type schedule_times: list[datetime] + :param weeks_of_the_month: It should be First/Second/Third/Fourth/Last + :type weeks_of_the_month: list[str or + ~azure.mgmt.dataprotection.models.WeekNumber] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'absolute_criteria': {'key': 'absoluteCriteria', 'type': '[str]'}, + 'days_of_month': {'key': 'daysOfMonth', 'type': '[Day]'}, + 'days_of_the_week': {'key': 'daysOfTheWeek', 'type': '[str]'}, + 'months_of_year': {'key': 'monthsOfYear', 'type': '[str]'}, + 'schedule_times': {'key': 'scheduleTimes', 'type': '[iso-8601]'}, + 'weeks_of_the_month': {'key': 'weeksOfTheMonth', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ScheduleBasedBackupCriteria, self).__init__(**kwargs) + self.absolute_criteria = kwargs.get('absolute_criteria', None) + self.days_of_month = kwargs.get('days_of_month', None) + self.days_of_the_week = kwargs.get('days_of_the_week', None) + self.months_of_year = kwargs.get('months_of_year', None) + self.schedule_times = kwargs.get('schedule_times', None) + self.weeks_of_the_month = kwargs.get('weeks_of_the_month', None) + self.object_type = 'ScheduleBasedBackupCriteria' + + +class ScheduleBasedTriggerContext(TriggerContext): + """ScheduleBasedTriggerContext. + + Schedule based trigger context. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param schedule: Required. Schedule for this backup + :type schedule: ~azure.mgmt.dataprotection.models.BackupSchedule + :param tagging_criteria: Required. List of tags that can be applicable for + given schedule. + :type tagging_criteria: + list[~azure.mgmt.dataprotection.models.TaggingCriteria] + """ + + _validation = { + 'object_type': {'required': True}, + 'schedule': {'required': True}, + 'tagging_criteria': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'schedule': {'key': 'schedule', 'type': 'BackupSchedule'}, + 'tagging_criteria': {'key': 'taggingCriteria', 'type': '[TaggingCriteria]'}, + } + + def __init__(self, **kwargs): + super(ScheduleBasedTriggerContext, self).__init__(**kwargs) + self.schedule = kwargs.get('schedule', None) + self.tagging_criteria = kwargs.get('tagging_criteria', None) + self.object_type = 'ScheduleBasedTriggerContext' + + +class SourceLifeCycle(Model): + """SourceLifeCycle. + + Source LifeCycle. + + All required parameters must be populated in order to send to Azure. + + :param delete_after: Required. + :type delete_after: ~azure.mgmt.dataprotection.models.DeleteOption + :param source_data_store: Required. + :type source_data_store: + ~azure.mgmt.dataprotection.models.DataStoreInfoBase + :param target_data_store_copy_settings: + :type target_data_store_copy_settings: + list[~azure.mgmt.dataprotection.models.TargetCopySetting] + """ + + _validation = { + 'delete_after': {'required': True}, + 'source_data_store': {'required': True}, + } + + _attribute_map = { + 'delete_after': {'key': 'deleteAfter', 'type': 'DeleteOption'}, + 'source_data_store': {'key': 'sourceDataStore', 'type': 'DataStoreInfoBase'}, + 'target_data_store_copy_settings': {'key': 'targetDataStoreCopySettings', 'type': '[TargetCopySetting]'}, + } + + def __init__(self, **kwargs): + super(SourceLifeCycle, self).__init__(**kwargs) + self.delete_after = kwargs.get('delete_after', None) + self.source_data_store = kwargs.get('source_data_store', None) + self.target_data_store_copy_settings = kwargs.get('target_data_store_copy_settings', None) + + +class StorageSetting(Model): + """StorageSetting. + + Storage setting. + + :param datastore_type: Gets or sets the type of the datastore. Possible + values include: 'ArchiveStore', 'SnapshotStore', 'VaultStore' + :type datastore_type: str or + ~azure.mgmt.dataprotection.models.StorageSettingStoreTypes + :param type: Gets or sets the type. Possible values include: + 'GeoRedundant', 'LocallyRedundant' + :type type: str or ~azure.mgmt.dataprotection.models.StorageSettingTypes + """ + + _attribute_map = { + 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageSetting, self).__init__(**kwargs) + self.datastore_type = kwargs.get('datastore_type', None) + self.type = kwargs.get('type', None) + + +class SupportedFeature(Model): + """Elements class for feature request. + + :param feature_name: support feature type. + :type feature_name: str + :param support_status: feature support status. Possible values include: + 'Invalid', 'NotSupported', 'AlphaPreview', 'PrivatePreview', + 'PublicPreview', 'GenerallyAvailable' + :type support_status: str or + ~azure.mgmt.dataprotection.models.FeatureSupportStatus + :param exposure_controlled_features: support feature type. + :type exposure_controlled_features: list[str] + """ + + _attribute_map = { + 'feature_name': {'key': 'featureName', 'type': 'str'}, + 'support_status': {'key': 'supportStatus', 'type': 'str'}, + 'exposure_controlled_features': {'key': 'exposureControlledFeatures', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(SupportedFeature, self).__init__(**kwargs) + self.feature_name = kwargs.get('feature_name', None) + self.support_status = kwargs.get('support_status', None) + self.exposure_controlled_features = kwargs.get('exposure_controlled_features', None) + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.dataprotection.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.dataprotection.models.CreatedByType + :param last_modified_at: The type of identity that last modified the + resource. + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TaggingCriteria(Model): + """TaggingCriteria. + + Tagging criteria. + + All required parameters must be populated in order to send to Azure. + + :param criteria: Criteria which decides whether the tag can be applied to + a triggered backup. + :type criteria: list[~azure.mgmt.dataprotection.models.BackupCriteria] + :param is_default: Required. Specifies if tag is default. + :type is_default: bool + :param tagging_priority: Required. Retention Tag priority. + :type tagging_priority: long + :param tag_info: Required. Retention tag information + :type tag_info: ~azure.mgmt.dataprotection.models.RetentionTag + """ + + _validation = { + 'is_default': {'required': True}, + 'tagging_priority': {'required': True}, + 'tag_info': {'required': True}, + } + + _attribute_map = { + 'criteria': {'key': 'criteria', 'type': '[BackupCriteria]'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'tagging_priority': {'key': 'taggingPriority', 'type': 'long'}, + 'tag_info': {'key': 'tagInfo', 'type': 'RetentionTag'}, + } + + def __init__(self, **kwargs): + super(TaggingCriteria, self).__init__(**kwargs) + self.criteria = kwargs.get('criteria', None) + self.is_default = kwargs.get('is_default', None) + self.tagging_priority = kwargs.get('tagging_priority', None) + self.tag_info = kwargs.get('tag_info', None) + + +class TargetCopySetting(Model): + """TargetCopySetting. + + Target copy settings. + + All required parameters must be populated in order to send to Azure. + + :param copy_after: Required. It can be CustomCopyOption or + ImmediateCopyOption. + :type copy_after: ~azure.mgmt.dataprotection.models.CopyOption + :param data_store: Required. Info of target datastore + :type data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + """ + + _validation = { + 'copy_after': {'required': True}, + 'data_store': {'required': True}, + } + + _attribute_map = { + 'copy_after': {'key': 'copyAfter', 'type': 'CopyOption'}, + 'data_store': {'key': 'dataStore', 'type': 'DataStoreInfoBase'}, + } + + def __init__(self, **kwargs): + super(TargetCopySetting, self).__init__(**kwargs) + self.copy_after = kwargs.get('copy_after', None) + self.data_store = kwargs.get('data_store', None) + + +class TargetDetails(Model): + """Class encapsulating target details, used where the destination is not a + datasource. + + All required parameters must be populated in order to send to Azure. + + :param file_prefix: Required. Restore operation may create multiple files + inside location pointed by Url + Below will be the common prefix for all of them + :type file_prefix: str + :param restore_target_location_type: Required. Denotes the target location + where the data will be restored, + string value for the enum + {Microsoft.Internal.AzureBackup.DataProtection.Common.Interface.RestoreTargetLocationType}. + Possible values include: 'Invalid', 'AzureBlobs', 'AzureFiles' + :type restore_target_location_type: str or + ~azure.mgmt.dataprotection.models.RestoreTargetLocationType + :param url: Required. Url denoting the restore destination. It can point + to container / file share etc + :type url: str + """ + + _validation = { + 'file_prefix': {'required': True}, + 'restore_target_location_type': {'required': True}, + 'url': {'required': True}, + } + + _attribute_map = { + 'file_prefix': {'key': 'filePrefix', 'type': 'str'}, + 'restore_target_location_type': {'key': 'restoreTargetLocationType', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TargetDetails, self).__init__(**kwargs) + self.file_prefix = kwargs.get('file_prefix', None) + self.restore_target_location_type = kwargs.get('restore_target_location_type', None) + self.url = kwargs.get('url', None) + + +class TriggerBackupRequest(Model): + """TriggerBackupRequest. + + Trigger backup request. + + All required parameters must be populated in order to send to Azure. + + :param backup_rule_options: Required. Name for the Rule of the Policy + which needs to be applied for this backup + :type backup_rule_options: + ~azure.mgmt.dataprotection.models.AdHocBackupRuleOptions + """ + + _validation = { + 'backup_rule_options': {'required': True}, + } + + _attribute_map = { + 'backup_rule_options': {'key': 'backupRuleOptions', 'type': 'AdHocBackupRuleOptions'}, + } + + def __init__(self, **kwargs): + super(TriggerBackupRequest, self).__init__(**kwargs) + self.backup_rule_options = kwargs.get('backup_rule_options', None) + + +class UserFacingError(Model): + """Error object used by layers that have access to localized content, and + propagate that to user. + + :param code: Unique code for this error + :type code: str + :param details: Additional related Errors + :type details: list[~azure.mgmt.dataprotection.models.UserFacingError] + :param inner_error: Inner Error + :type inner_error: ~azure.mgmt.dataprotection.models.InnerError + :param is_retryable: Whether the operation will be retryable or not + :type is_retryable: bool + :param is_user_error: Whether the operation is due to a user error or + service error + :type is_user_error: bool + :param properties: Any key value pairs that can be injected inside error + object + :type properties: dict[str, str] + :param message: + :type message: str + :param recommended_action: RecommendedAction � localized. + :type recommended_action: list[str] + :param target: Target of the error. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[UserFacingError]'}, + 'inner_error': {'key': 'innerError', 'type': 'InnerError'}, + 'is_retryable': {'key': 'isRetryable', 'type': 'bool'}, + 'is_user_error': {'key': 'isUserError', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'message': {'key': 'message', 'type': 'str'}, + 'recommended_action': {'key': 'recommendedAction', 'type': '[str]'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserFacingError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) + self.is_retryable = kwargs.get('is_retryable', None) + self.is_user_error = kwargs.get('is_user_error', None) + self.properties = kwargs.get('properties', None) + self.message = kwargs.get('message', None) + self.recommended_action = kwargs.get('recommended_action', None) + self.target = kwargs.get('target', None) + + +class ValidateForBackupRequest(Model): + """ValidateForBackupRequest. + + Validate for backup request. + + All required parameters must be populated in order to send to Azure. + + :param backup_instance: Required. + :type backup_instance: ~azure.mgmt.dataprotection.models.BackupInstance + """ + + _validation = { + 'backup_instance': {'required': True}, + } + + _attribute_map = { + 'backup_instance': {'key': 'backupInstance', 'type': 'BackupInstance'}, + } + + def __init__(self, **kwargs): + super(ValidateForBackupRequest, self).__init__(**kwargs) + self.backup_instance = kwargs.get('backup_instance', None) + + +class ValidateRestoreRequestObject(Model): + """ValidateRestoreRequestObject. + + Validate restore request object. + + All required parameters must be populated in order to send to Azure. + + :param restore_request_object: Required. Gets or sets the restore request + object. + :type restore_request_object: + ~azure.mgmt.dataprotection.models.AzureBackupRestoreRequest + """ + + _validation = { + 'restore_request_object': {'required': True}, + } + + _attribute_map = { + 'restore_request_object': {'key': 'restoreRequestObject', 'type': 'AzureBackupRestoreRequest'}, + } + + def __init__(self, **kwargs): + super(ValidateRestoreRequestObject, self).__init__(**kwargs) + self.restore_request_object = kwargs.get('restore_request_object', None) diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_models_py3.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_models_py3.py new file mode 100644 index 000000000000..f3666ae35058 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_models_py3.py @@ -0,0 +1,3648 @@ +# 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 msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class DeleteOption(Model): + """DeleteOption. + + Delete Option. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AbsoluteDeleteOption + + All required parameters must be populated in order to send to Azure. + + :param duration: Required. Duration of deletion after given timespan + :type duration: str + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'duration': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'duration': {'key': 'duration', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AbsoluteDeleteOption': 'AbsoluteDeleteOption'} + } + + def __init__(self, *, duration: str, **kwargs) -> None: + super(DeleteOption, self).__init__(**kwargs) + self.duration = duration + self.object_type = None + + +class AbsoluteDeleteOption(DeleteOption): + """AbsoluteDeleteOption. + + Delete option with duration. + + All required parameters must be populated in order to send to Azure. + + :param duration: Required. Duration of deletion after given timespan + :type duration: str + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'duration': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'duration': {'key': 'duration', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, *, duration: str, **kwargs) -> None: + super(AbsoluteDeleteOption, self).__init__(duration=duration, **kwargs) + self.object_type = 'AbsoluteDeleteOption' + + +class AdHocBackupRuleOptions(Model): + """AdHocBackupRuleOptions. + + Adhoc backup rules. + + All required parameters must be populated in order to send to Azure. + + :param rule_name: Required. + :type rule_name: str + :param trigger_option: Required. + :type trigger_option: + ~azure.mgmt.dataprotection.models.AdhocBackupTriggerOption + """ + + _validation = { + 'rule_name': {'required': True}, + 'trigger_option': {'required': True}, + } + + _attribute_map = { + 'rule_name': {'key': 'ruleName', 'type': 'str'}, + 'trigger_option': {'key': 'triggerOption', 'type': 'AdhocBackupTriggerOption'}, + } + + def __init__(self, *, rule_name: str, trigger_option, **kwargs) -> None: + super(AdHocBackupRuleOptions, self).__init__(**kwargs) + self.rule_name = rule_name + self.trigger_option = trigger_option + + +class AdhocBackupTriggerOption(Model): + """AdhocBackupTriggerOption. + + Adhoc backup trigger option. + + :param retention_tag_override: + :type retention_tag_override: str + """ + + _attribute_map = { + 'retention_tag_override': {'key': 'retentionTagOverride', 'type': 'str'}, + } + + def __init__(self, *, retention_tag_override: str=None, **kwargs) -> None: + super(AdhocBackupTriggerOption, self).__init__(**kwargs) + self.retention_tag_override = retention_tag_override + + +class AdhocBasedTaggingCriteria(Model): + """AdhocBasedTaggingCriteria. + + Adhoc backup tagging criteria. + + :param tag_info: Retention tag information + :type tag_info: ~azure.mgmt.dataprotection.models.RetentionTag + """ + + _attribute_map = { + 'tag_info': {'key': 'tagInfo', 'type': 'RetentionTag'}, + } + + def __init__(self, *, tag_info=None, **kwargs) -> None: + super(AdhocBasedTaggingCriteria, self).__init__(**kwargs) + self.tag_info = tag_info + + +class TriggerContext(Model): + """TriggerContext. + + Trigger context. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AdhocBasedTriggerContext, ScheduleBasedTriggerContext + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'AdhocBasedTriggerContext': 'AdhocBasedTriggerContext', 'ScheduleBasedTriggerContext': 'ScheduleBasedTriggerContext'} + } + + def __init__(self, **kwargs) -> None: + super(TriggerContext, self).__init__(**kwargs) + self.object_type = None + + +class AdhocBasedTriggerContext(TriggerContext): + """AdhocBasedTriggerContext. + + Adhoc trigger context. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param tagging_criteria: Required. Tagging Criteria containing retention + tag for adhoc backup. + :type tagging_criteria: + ~azure.mgmt.dataprotection.models.AdhocBasedTaggingCriteria + """ + + _validation = { + 'object_type': {'required': True}, + 'tagging_criteria': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'tagging_criteria': {'key': 'taggingCriteria', 'type': 'AdhocBasedTaggingCriteria'}, + } + + def __init__(self, *, tagging_criteria, **kwargs) -> None: + super(AdhocBasedTriggerContext, self).__init__(**kwargs) + self.tagging_criteria = tagging_criteria + self.object_type = 'AdhocBasedTriggerContext' + + +class AzureBackupRecoveryPoint(Model): + """AzureBackupRecoveryPoint. + + Azure backup recoveryPoint. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupDiscreteRecoveryPoint + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'AzureBackupDiscreteRecoveryPoint': 'AzureBackupDiscreteRecoveryPoint'} + } + + def __init__(self, **kwargs) -> None: + super(AzureBackupRecoveryPoint, self).__init__(**kwargs) + self.object_type = None + + +class AzureBackupDiscreteRecoveryPoint(AzureBackupRecoveryPoint): + """AzureBackupDiscreteRecoveryPoint. + + Azure backup discrete RecoveryPoint. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param friendly_name: + :type friendly_name: str + :param recovery_point_data_stores_details: + :type recovery_point_data_stores_details: + list[~azure.mgmt.dataprotection.models.RecoveryPointDataStoreDetails] + :param recovery_point_time: Required. + :type recovery_point_time: datetime + :param policy_name: + :type policy_name: str + :param policy_version: + :type policy_version: str + :param recovery_point_id: + :type recovery_point_id: str + :param recovery_point_type: + :type recovery_point_type: str + :param retention_tag_name: + :type retention_tag_name: str + :param retention_tag_version: + :type retention_tag_version: str + """ + + _validation = { + 'object_type': {'required': True}, + 'recovery_point_time': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'recovery_point_data_stores_details': {'key': 'recoveryPointDataStoresDetails', 'type': '[RecoveryPointDataStoreDetails]'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'policy_version': {'key': 'policyVersion', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'recovery_point_type': {'key': 'recoveryPointType', 'type': 'str'}, + 'retention_tag_name': {'key': 'retentionTagName', 'type': 'str'}, + 'retention_tag_version': {'key': 'retentionTagVersion', 'type': 'str'}, + } + + def __init__(self, *, recovery_point_time, friendly_name: str=None, recovery_point_data_stores_details=None, policy_name: str=None, policy_version: str=None, recovery_point_id: str=None, recovery_point_type: str=None, retention_tag_name: str=None, retention_tag_version: str=None, **kwargs) -> None: + super(AzureBackupDiscreteRecoveryPoint, self).__init__(**kwargs) + self.friendly_name = friendly_name + self.recovery_point_data_stores_details = recovery_point_data_stores_details + self.recovery_point_time = recovery_point_time + self.policy_name = policy_name + self.policy_version = policy_version + self.recovery_point_id = recovery_point_id + self.recovery_point_type = recovery_point_type + self.retention_tag_name = retention_tag_name + self.retention_tag_version = retention_tag_version + self.object_type = 'AzureBackupDiscreteRecoveryPoint' + + +class AzureBackupFindRestorableTimeRangesRequest(Model): + """List Restore Ranges Request. + + All required parameters must be populated in order to send to Azure. + + :param source_data_store_type: Required. Gets or sets the type of the + source data store. Possible values include: 'OperationalStore', + 'VaultStore', 'ArchiveStore' + :type source_data_store_type: str or + ~azure.mgmt.dataprotection.models.RestoreSourceDataStoreType + :param start_time: Start time for the List Restore Ranges request. ISO + 8601 format. + :type start_time: str + :param end_time: End time for the List Restore Ranges request. ISO 8601 + format. + :type end_time: str + """ + + _validation = { + 'source_data_store_type': {'required': True}, + } + + _attribute_map = { + 'source_data_store_type': {'key': 'sourceDataStoreType', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + } + + def __init__(self, *, source_data_store_type, start_time: str=None, end_time: str=None, **kwargs) -> None: + super(AzureBackupFindRestorableTimeRangesRequest, self).__init__(**kwargs) + self.source_data_store_type = source_data_store_type + self.start_time = start_time + self.end_time = end_time + + +class DppWorkerRequest(Model): + """DppWorkerRequest. + + :param subscription_id: + :type subscription_id: str + :param uri: + :type uri: str + :param headers: + :type headers: dict[str, list[str]] + :param supported_group_versions: + :type supported_group_versions: list[str] + :param culture_info: + :type culture_info: str + :param parameters: + :type parameters: dict[str, str] + :param http_method: + :type http_method: str + """ + + _attribute_map = { + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{[str]}'}, + 'supported_group_versions': {'key': 'supportedGroupVersions', 'type': '[str]'}, + 'culture_info': {'key': 'cultureInfo', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'http_method': {'key': 'httpMethod', 'type': 'str'}, + } + + def __init__(self, *, subscription_id: str=None, uri: str=None, headers=None, supported_group_versions=None, culture_info: str=None, parameters=None, http_method: str=None, **kwargs) -> None: + super(DppWorkerRequest, self).__init__(**kwargs) + self.subscription_id = subscription_id + self.uri = uri + self.headers = headers + self.supported_group_versions = supported_group_versions + self.culture_info = culture_info + self.parameters = parameters + self.http_method = http_method + + +class AzureBackupFindRestorableTimeRangesRequestResource(DppWorkerRequest): + """List Restore Ranges Request. + + :param subscription_id: + :type subscription_id: str + :param uri: + :type uri: str + :param headers: + :type headers: dict[str, list[str]] + :param supported_group_versions: + :type supported_group_versions: list[str] + :param culture_info: + :type culture_info: str + :param parameters: + :type parameters: dict[str, str] + :param http_method: + :type http_method: str + :param content: AzureBackupFindRestorableTimeRangesRequestResource content + :type content: + ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesRequest + """ + + _attribute_map = { + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'headers': {'key': 'headers', 'type': '{[str]}'}, + 'supported_group_versions': {'key': 'supportedGroupVersions', 'type': '[str]'}, + 'culture_info': {'key': 'cultureInfo', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{str}'}, + 'http_method': {'key': 'httpMethod', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'AzureBackupFindRestorableTimeRangesRequest'}, + } + + def __init__(self, *, subscription_id: str=None, uri: str=None, headers=None, supported_group_versions=None, culture_info: str=None, parameters=None, http_method: str=None, content=None, **kwargs) -> None: + super(AzureBackupFindRestorableTimeRangesRequestResource, self).__init__(subscription_id=subscription_id, uri=uri, headers=headers, supported_group_versions=supported_group_versions, culture_info=culture_info, parameters=parameters, http_method=http_method, **kwargs) + self.content = content + + +class AzureBackupFindRestorableTimeRangesResponse(Model): + """List Restore Ranges Response. + + :param restorable_time_ranges: Returns the Restore Ranges available on the + Backup Instance. + :type restorable_time_ranges: + list[~azure.mgmt.dataprotection.models.RestorableTimeRange] + :param object_type: + :type object_type: str + """ + + _attribute_map = { + 'restorable_time_ranges': {'key': 'restorableTimeRanges', 'type': '[RestorableTimeRange]'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, *, restorable_time_ranges=None, object_type: str=None, **kwargs) -> None: + super(AzureBackupFindRestorableTimeRangesResponse, self).__init__(**kwargs) + self.restorable_time_ranges = restorable_time_ranges + self.object_type = object_type + + +class DppResource(Model): + """DppResource. + + Resource 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 system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + """ + + _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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, *, system_data=None, **kwargs) -> None: + super(DppResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = system_data + + +class AzureBackupFindRestorableTimeRangesResponseResource(DppResource): + """List Restore Ranges Response. + + 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 system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + :param properties: AzureBackupFindRestorableTimeRangesResponseResource + properties + :type properties: + ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesResponse + """ + + _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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'AzureBackupFindRestorableTimeRangesResponse'}, + } + + def __init__(self, *, system_data=None, properties=None, **kwargs) -> None: + super(AzureBackupFindRestorableTimeRangesResponseResource, self).__init__(system_data=system_data, **kwargs) + self.properties = properties + + +class AzureBackupJob(Model): + """AzureBackup Job Class. + + 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 activity_id: Required. Job Activity Id + :type activity_id: str + :param backup_instance_friendly_name: Required. Name of the Backup + Instance + :type backup_instance_friendly_name: str + :ivar backup_instance_id: ARM ID of the Backup Instance + :vartype backup_instance_id: str + :param data_source_id: Required. ARM ID of the DataSource + :type data_source_id: str + :param data_source_location: Required. Location of the DataSource + :type data_source_location: str + :param data_source_name: Required. User Friendly Name of the DataSource + :type data_source_name: str + :param data_source_set_name: Required. Data Source Set Name of the + DataSource + :type data_source_set_name: str + :param data_source_type: Required. Type of DataSource + :type data_source_type: str + :param duration: Total run time of the job. ISO 8601 format. + :type duration: str + :ivar end_time: EndTime of the job(in UTC) + :vartype end_time: datetime + :ivar error_details: A List, detailing the errors related to the job + :vartype error_details: + list[~azure.mgmt.dataprotection.models.UserFacingError] + :ivar extended_info: Extended Information about the job + :vartype extended_info: ~azure.mgmt.dataprotection.models.JobExtendedInfo + :param is_user_triggered: Required. Indicated that whether the job is + adhoc(true) or scheduled(false) + :type is_user_triggered: bool + :param operation: Required. It indicates the type of Job i.e. + Backup:full/log/diff ;Restore:ALR/OLR; Tiering:Backup/Archive ; + Management:ConfigureProtection/UnConfigure + :type operation: str + :param operation_category: Required. It indicates the type of Job i.e. + Backup/Restore/Tiering/Management + :type operation_category: str + :ivar policy_id: ARM ID of the policy + :vartype policy_id: str + :ivar policy_name: Name of the policy + :vartype policy_name: str + :param progress_enabled: Required. Indicated whether progress is enabled + for the job + :type progress_enabled: bool + :ivar progress_url: Url which contains job's progress + :vartype progress_url: str + :ivar restore_type: It indicates the sub type of operation i.e. in case of + Restore it can be ALR/OLR + :vartype restore_type: str + :param source_resource_group: Required. Resource Group Name of the + Datasource + :type source_resource_group: str + :param source_subscription_id: Required. SubscriptionId corresponding to + the DataSource + :type source_subscription_id: str + :param start_time: Required. StartTime of the job(in UTC) + :type start_time: datetime + :param status: Required. Status of the job like + InProgress/Success/Failed/Cancelled/SuccessWithWarning + :type status: str + :param subscription_id: Required. Subscription Id of the corresponding + backup vault + :type subscription_id: str + :param supported_actions: Required. List of supported actions + :type supported_actions: list[str] + :param vault_name: Required. Name of the vault + :type vault_name: str + :param etag: + :type etag: str + :param source_data_store_name: + :type source_data_store_name: str + :param destination_data_store_name: + :type destination_data_store_name: str + """ + + _validation = { + 'activity_id': {'required': True}, + 'backup_instance_friendly_name': {'required': True}, + 'backup_instance_id': {'readonly': True}, + 'data_source_id': {'required': True}, + 'data_source_location': {'required': True}, + 'data_source_name': {'required': True}, + 'data_source_set_name': {'required': True}, + 'data_source_type': {'required': True}, + 'end_time': {'readonly': True}, + 'error_details': {'readonly': True}, + 'extended_info': {'readonly': True}, + 'is_user_triggered': {'required': True}, + 'operation': {'required': True}, + 'operation_category': {'required': True}, + 'policy_id': {'readonly': True}, + 'policy_name': {'readonly': True}, + 'progress_enabled': {'required': True}, + 'progress_url': {'readonly': True}, + 'restore_type': {'readonly': True}, + 'source_resource_group': {'required': True}, + 'source_subscription_id': {'required': True}, + 'start_time': {'required': True}, + 'status': {'required': True}, + 'subscription_id': {'required': True}, + 'supported_actions': {'required': True}, + 'vault_name': {'required': True}, + } + + _attribute_map = { + 'activity_id': {'key': 'activityID', 'type': 'str'}, + 'backup_instance_friendly_name': {'key': 'backupInstanceFriendlyName', 'type': 'str'}, + 'backup_instance_id': {'key': 'backupInstanceId', 'type': 'str'}, + 'data_source_id': {'key': 'dataSourceId', 'type': 'str'}, + 'data_source_location': {'key': 'dataSourceLocation', 'type': 'str'}, + 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, + 'data_source_set_name': {'key': 'dataSourceSetName', 'type': 'str'}, + 'data_source_type': {'key': 'dataSourceType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error_details': {'key': 'errorDetails', 'type': '[UserFacingError]'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'JobExtendedInfo'}, + 'is_user_triggered': {'key': 'isUserTriggered', 'type': 'bool'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'operation_category': {'key': 'operationCategory', 'type': 'str'}, + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'policy_name': {'key': 'policyName', 'type': 'str'}, + 'progress_enabled': {'key': 'progressEnabled', 'type': 'bool'}, + 'progress_url': {'key': 'progressUrl', 'type': 'str'}, + 'restore_type': {'key': 'restoreType', 'type': 'str'}, + 'source_resource_group': {'key': 'sourceResourceGroup', 'type': 'str'}, + 'source_subscription_id': {'key': 'sourceSubscriptionID', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'supported_actions': {'key': 'supportedActions', 'type': '[str]'}, + 'vault_name': {'key': 'vaultName', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'source_data_store_name': {'key': 'sourceDataStoreName', 'type': 'str'}, + 'destination_data_store_name': {'key': 'destinationDataStoreName', 'type': 'str'}, + } + + def __init__(self, *, activity_id: str, backup_instance_friendly_name: str, data_source_id: str, data_source_location: str, data_source_name: str, data_source_set_name: str, data_source_type: str, is_user_triggered: bool, operation: str, operation_category: str, progress_enabled: bool, source_resource_group: str, source_subscription_id: str, start_time, status: str, subscription_id: str, supported_actions, vault_name: str, duration: str=None, etag: str=None, source_data_store_name: str=None, destination_data_store_name: str=None, **kwargs) -> None: + super(AzureBackupJob, self).__init__(**kwargs) + self.activity_id = activity_id + self.backup_instance_friendly_name = backup_instance_friendly_name + self.backup_instance_id = None + self.data_source_id = data_source_id + self.data_source_location = data_source_location + self.data_source_name = data_source_name + self.data_source_set_name = data_source_set_name + self.data_source_type = data_source_type + self.duration = duration + self.end_time = None + self.error_details = None + self.extended_info = None + self.is_user_triggered = is_user_triggered + self.operation = operation + self.operation_category = operation_category + self.policy_id = None + self.policy_name = None + self.progress_enabled = progress_enabled + self.progress_url = None + self.restore_type = None + self.source_resource_group = source_resource_group + self.source_subscription_id = source_subscription_id + self.start_time = start_time + self.status = status + self.subscription_id = subscription_id + self.supported_actions = supported_actions + self.vault_name = vault_name + self.etag = etag + self.source_data_store_name = source_data_store_name + self.destination_data_store_name = destination_data_store_name + + +class AzureBackupJobResource(DppResource): + """AzureBackup Job Resource 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 system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + :param properties: AzureBackupJobResource properties + :type properties: ~azure.mgmt.dataprotection.models.AzureBackupJob + """ + + _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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'AzureBackupJob'}, + } + + def __init__(self, *, system_data=None, properties=None, **kwargs) -> None: + super(AzureBackupJobResource, self).__init__(system_data=system_data, **kwargs) + self.properties = properties + + +class BackupParameters(Model): + """BackupParameters. + + BackupParameters base. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupParams + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'AzureBackupParams': 'AzureBackupParams'} + } + + def __init__(self, **kwargs) -> None: + super(BackupParameters, self).__init__(**kwargs) + self.object_type = None + + +class AzureBackupParams(BackupParameters): + """AzureBackupParams. + + Azure backup parameters. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param backup_type: Required. BackupType ; Full/Incremental etc + :type backup_type: str + """ + + _validation = { + 'object_type': {'required': True}, + 'backup_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'backup_type': {'key': 'backupType', 'type': 'str'}, + } + + def __init__(self, *, backup_type: str, **kwargs) -> None: + super(AzureBackupParams, self).__init__(**kwargs) + self.backup_type = backup_type + self.object_type = 'AzureBackupParams' + + +class AzureBackupRestoreRequest(Model): + """AzureBackupRestoreRequest. + + Azure backup restore request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupRecoveryPointBasedRestoreRequest, + AzureBackupRecoveryTimeBasedRestoreRequest + + All required parameters must be populated in order to send to Azure. + + :param restore_target_info: Required. Gets or sets the restore target + information. + :type restore_target_info: + ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :param source_data_store_type: Required. Gets or sets the type of the + source data store. Possible values include: 'ArchiveStore', + 'SnapshotStore', 'VaultStore' + :type source_data_store_type: str or + ~azure.mgmt.dataprotection.models.SourceDataStoreType + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'restore_target_info': {'required': True}, + 'source_data_store_type': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'restore_target_info': {'key': 'restoreTargetInfo', 'type': 'RestoreTargetInfoBase'}, + 'source_data_store_type': {'key': 'sourceDataStoreType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureBackupRecoveryPointBasedRestoreRequest': 'AzureBackupRecoveryPointBasedRestoreRequest', 'AzureBackupRecoveryTimeBasedRestoreRequest': 'AzureBackupRecoveryTimeBasedRestoreRequest'} + } + + def __init__(self, *, restore_target_info, source_data_store_type, **kwargs) -> None: + super(AzureBackupRestoreRequest, self).__init__(**kwargs) + self.restore_target_info = restore_target_info + self.source_data_store_type = source_data_store_type + self.object_type = None + + +class AzureBackupRecoveryPointBasedRestoreRequest(AzureBackupRestoreRequest): + """AzureBackupRecoveryPointBasedRestoreRequest. + + Azure backup recoveryPoint based restore request. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupRestoreWithRehydrationRequest + + All required parameters must be populated in order to send to Azure. + + :param restore_target_info: Required. Gets or sets the restore target + information. + :type restore_target_info: + ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :param source_data_store_type: Required. Gets or sets the type of the + source data store. Possible values include: 'ArchiveStore', + 'SnapshotStore', 'VaultStore' + :type source_data_store_type: str or + ~azure.mgmt.dataprotection.models.SourceDataStoreType + :param object_type: Required. Constant filled by server. + :type object_type: str + :param recovery_point_id: Required. + :type recovery_point_id: str + """ + + _validation = { + 'restore_target_info': {'required': True}, + 'source_data_store_type': {'required': True}, + 'object_type': {'required': True}, + 'recovery_point_id': {'required': True}, + } + + _attribute_map = { + 'restore_target_info': {'key': 'restoreTargetInfo', 'type': 'RestoreTargetInfoBase'}, + 'source_data_store_type': {'key': 'sourceDataStoreType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureBackupRestoreWithRehydrationRequest': 'AzureBackupRestoreWithRehydrationRequest'} + } + + def __init__(self, *, restore_target_info, source_data_store_type, recovery_point_id: str, **kwargs) -> None: + super(AzureBackupRecoveryPointBasedRestoreRequest, self).__init__(restore_target_info=restore_target_info, source_data_store_type=source_data_store_type, **kwargs) + self.recovery_point_id = recovery_point_id + self.object_type = 'AzureBackupRecoveryPointBasedRestoreRequest' + + +class AzureBackupRecoveryPointResource(DppResource): + """AzureBackupRecoveryPointResource. + + Azure backup recoveryPoint 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 system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + :param properties: AzureBackupRecoveryPointResource properties + :type properties: + ~azure.mgmt.dataprotection.models.AzureBackupRecoveryPoint + """ + + _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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'AzureBackupRecoveryPoint'}, + } + + def __init__(self, *, system_data=None, properties=None, **kwargs) -> None: + super(AzureBackupRecoveryPointResource, self).__init__(system_data=system_data, **kwargs) + self.properties = properties + + +class AzureBackupRecoveryTimeBasedRestoreRequest(AzureBackupRestoreRequest): + """AzureBackupRecoveryTimeBasedRestoreRequest. + + AzureBackup RecoveryPointTime Based Restore Request. + + All required parameters must be populated in order to send to Azure. + + :param restore_target_info: Required. Gets or sets the restore target + information. + :type restore_target_info: + ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :param source_data_store_type: Required. Gets or sets the type of the + source data store. Possible values include: 'ArchiveStore', + 'SnapshotStore', 'VaultStore' + :type source_data_store_type: str or + ~azure.mgmt.dataprotection.models.SourceDataStoreType + :param object_type: Required. Constant filled by server. + :type object_type: str + :param recovery_point_time: Required. The recovery time in ISO 8601 format + example - 2020-08-14T17:30:00.0000000Z. + :type recovery_point_time: str + """ + + _validation = { + 'restore_target_info': {'required': True}, + 'source_data_store_type': {'required': True}, + 'object_type': {'required': True}, + 'recovery_point_time': {'required': True}, + } + + _attribute_map = { + 'restore_target_info': {'key': 'restoreTargetInfo', 'type': 'RestoreTargetInfoBase'}, + 'source_data_store_type': {'key': 'sourceDataStoreType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'str'}, + } + + def __init__(self, *, restore_target_info, source_data_store_type, recovery_point_time: str, **kwargs) -> None: + super(AzureBackupRecoveryTimeBasedRestoreRequest, self).__init__(restore_target_info=restore_target_info, source_data_store_type=source_data_store_type, **kwargs) + self.recovery_point_time = recovery_point_time + self.object_type = 'AzureBackupRecoveryTimeBasedRestoreRequest' + + +class AzureBackupRehydrationRequest(Model): + """AzureBackupRehydrationRequest. + + Azure Backup Rehydrate Request. + + All required parameters must be populated in order to send to Azure. + + :param recovery_point_id: Required. Id of the recovery point to be + recovered + :type recovery_point_id: str + :param rehydration_priority: Priority to be used for rehydration. Values + High or Standard. Possible values include: 'Invalid', 'High', 'Standard' + :type rehydration_priority: str or + ~azure.mgmt.dataprotection.models.RehydrationPriority + :param rehydration_retention_duration: Required. Retention duration in ISO + 8601 format i.e P10D . + :type rehydration_retention_duration: str + """ + + _validation = { + 'recovery_point_id': {'required': True}, + 'rehydration_retention_duration': {'required': True}, + } + + _attribute_map = { + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'rehydration_priority': {'key': 'rehydrationPriority', 'type': 'str'}, + 'rehydration_retention_duration': {'key': 'rehydrationRetentionDuration', 'type': 'str'}, + } + + def __init__(self, *, recovery_point_id: str, rehydration_retention_duration: str, rehydration_priority=None, **kwargs) -> None: + super(AzureBackupRehydrationRequest, self).__init__(**kwargs) + self.recovery_point_id = recovery_point_id + self.rehydration_priority = rehydration_priority + self.rehydration_retention_duration = rehydration_retention_duration + + +class AzureBackupRestoreWithRehydrationRequest(AzureBackupRecoveryPointBasedRestoreRequest): + """AzureBackupRestoreWithRehydrationRequest. + + AzureBackup Restore with Rehydration Request. + + All required parameters must be populated in order to send to Azure. + + :param restore_target_info: Required. Gets or sets the restore target + information. + :type restore_target_info: + ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :param source_data_store_type: Required. Gets or sets the type of the + source data store. Possible values include: 'ArchiveStore', + 'SnapshotStore', 'VaultStore' + :type source_data_store_type: str or + ~azure.mgmt.dataprotection.models.SourceDataStoreType + :param object_type: Required. Constant filled by server. + :type object_type: str + :param recovery_point_id: Required. + :type recovery_point_id: str + :param rehydration_priority: Required. Priority to be used for + rehydration. Values High or Standard. Possible values include: 'Invalid', + 'High', 'Standard' + :type rehydration_priority: str or + ~azure.mgmt.dataprotection.models.RehydrationPriority + :param rehydration_retention_duration: Required. Retention duration in ISO + 8601 format i.e P10D . + :type rehydration_retention_duration: str + """ + + _validation = { + 'restore_target_info': {'required': True}, + 'source_data_store_type': {'required': True}, + 'object_type': {'required': True}, + 'recovery_point_id': {'required': True}, + 'rehydration_priority': {'required': True}, + 'rehydration_retention_duration': {'required': True}, + } + + _attribute_map = { + 'restore_target_info': {'key': 'restoreTargetInfo', 'type': 'RestoreTargetInfoBase'}, + 'source_data_store_type': {'key': 'sourceDataStoreType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'rehydration_priority': {'key': 'rehydrationPriority', 'type': 'str'}, + 'rehydration_retention_duration': {'key': 'rehydrationRetentionDuration', 'type': 'str'}, + } + + def __init__(self, *, restore_target_info, source_data_store_type, recovery_point_id: str, rehydration_priority, rehydration_retention_duration: str, **kwargs) -> None: + super(AzureBackupRestoreWithRehydrationRequest, self).__init__(restore_target_info=restore_target_info, source_data_store_type=source_data_store_type, recovery_point_id=recovery_point_id, **kwargs) + self.rehydration_priority = rehydration_priority + self.rehydration_retention_duration = rehydration_retention_duration + self.object_type = 'AzureBackupRestoreWithRehydrationRequest' + + +class BasePolicyRule(Model): + """BasePolicyRule. + + BasePolicy Rule. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureBackupRule, AzureRetentionRule + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'name': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureBackupRule': 'AzureBackupRule', 'AzureRetentionRule': 'AzureRetentionRule'} + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(BasePolicyRule, self).__init__(**kwargs) + self.name = name + self.object_type = None + + +class AzureBackupRule(BasePolicyRule): + """AzureBackupRule. + + Azure backup rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :param object_type: Required. Constant filled by server. + :type object_type: str + :param backup_parameters: + :type backup_parameters: + ~azure.mgmt.dataprotection.models.BackupParameters + :param data_store: Required. + :type data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + :param trigger: Required. + :type trigger: ~azure.mgmt.dataprotection.models.TriggerContext + """ + + _validation = { + 'name': {'required': True}, + 'object_type': {'required': True}, + 'data_store': {'required': True}, + 'trigger': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'backup_parameters': {'key': 'backupParameters', 'type': 'BackupParameters'}, + 'data_store': {'key': 'dataStore', 'type': 'DataStoreInfoBase'}, + 'trigger': {'key': 'trigger', 'type': 'TriggerContext'}, + } + + def __init__(self, *, name: str, data_store, trigger, backup_parameters=None, **kwargs) -> None: + super(AzureBackupRule, self).__init__(name=name, **kwargs) + self.backup_parameters = backup_parameters + self.data_store = data_store + self.trigger = trigger + self.object_type = 'AzureBackupRule' + + +class DataStoreParameters(Model): + """Parameters for DataStore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureOperationalStoreParameters + + All required parameters must be populated in order to send to Azure. + + :param data_store_type: Required. type of datastore; + Operational/Vault/Archive. Possible values include: 'OperationalStore', + 'VaultStore', 'ArchiveStore' + :type data_store_type: str or + ~azure.mgmt.dataprotection.models.DataStoreTypes + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'data_store_type': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'data_store_type': {'key': 'dataStoreType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'AzureOperationalStoreParameters': 'AzureOperationalStoreParameters'} + } + + def __init__(self, *, data_store_type, **kwargs) -> None: + super(DataStoreParameters, self).__init__(**kwargs) + self.data_store_type = data_store_type + self.object_type = None + + +class AzureOperationalStoreParameters(DataStoreParameters): + """Parameters for Operational-Tier DataStore. + + All required parameters must be populated in order to send to Azure. + + :param data_store_type: Required. type of datastore; + Operational/Vault/Archive. Possible values include: 'OperationalStore', + 'VaultStore', 'ArchiveStore' + :type data_store_type: str or + ~azure.mgmt.dataprotection.models.DataStoreTypes + :param object_type: Required. Constant filled by server. + :type object_type: str + :param resource_group_id: Gets or sets the Snapshot Resource Group Uri. + :type resource_group_id: str + """ + + _validation = { + 'data_store_type': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'data_store_type': {'key': 'dataStoreType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'resource_group_id': {'key': 'resourceGroupId', 'type': 'str'}, + } + + def __init__(self, *, data_store_type, resource_group_id: str=None, **kwargs) -> None: + super(AzureOperationalStoreParameters, self).__init__(data_store_type=data_store_type, **kwargs) + self.resource_group_id = resource_group_id + self.object_type = 'AzureOperationalStoreParameters' + + +class AzureRetentionRule(BasePolicyRule): + """AzureRetentionRule. + + Azure retention rule. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :param object_type: Required. Constant filled by server. + :type object_type: str + :param is_default: + :type is_default: bool + :param lifecycles: Required. + :type lifecycles: list[~azure.mgmt.dataprotection.models.SourceLifeCycle] + """ + + _validation = { + 'name': {'required': True}, + 'object_type': {'required': True}, + 'lifecycles': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'lifecycles': {'key': 'lifecycles', 'type': '[SourceLifeCycle]'}, + } + + def __init__(self, *, name: str, lifecycles, is_default: bool=None, **kwargs) -> None: + super(AzureRetentionRule, self).__init__(name=name, **kwargs) + self.is_default = is_default + self.lifecycles = lifecycles + self.object_type = 'AzureRetentionRule' + + +class BackupCriteria(Model): + """BackupCriteria. + + BackupCriteria base class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduleBasedBackupCriteria + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'ScheduleBasedBackupCriteria': 'ScheduleBasedBackupCriteria'} + } + + def __init__(self, **kwargs) -> None: + super(BackupCriteria, self).__init__(**kwargs) + self.object_type = None + + +class BackupInstance(Model): + """Backup Instance. + + 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 friendly_name: Gets or sets the Backup Instance friendly name. + :type friendly_name: str + :param data_source_info: Required. Gets or sets the data source + information. + :type data_source_info: ~azure.mgmt.dataprotection.models.Datasource + :param data_source_set_info: Gets or sets the data source set information. + :type data_source_set_info: + ~azure.mgmt.dataprotection.models.DatasourceSet + :param policy_info: Required. Gets or sets the policy information. + :type policy_info: ~azure.mgmt.dataprotection.models.PolicyInfo + :ivar protection_status: Specifies the protection status of the resource + :vartype protection_status: + ~azure.mgmt.dataprotection.models.ProtectionStatusDetails + :ivar current_protection_state: Specifies the current protection state of + the resource. Possible values include: 'Invalid', 'NotProtected', + 'ConfiguringProtection', 'ProtectionConfigured', + 'BackupSchedulesSuspended', 'RetentionSchedulesSuspended', + 'ProtectionStopped', 'ProtectionError', 'ConfiguringProtectionFailed', + 'SoftDeleting', 'SoftDeleted', 'UpdatingProtection' + :vartype current_protection_state: str or + ~azure.mgmt.dataprotection.models.CurrentProtectionState + :ivar protection_error_details: Specifies the protection error of the + resource + :vartype protection_error_details: + ~azure.mgmt.dataprotection.models.UserFacingError + :ivar provisioning_state: Specifies the provisioning state of the resource + i.e. provisioning/updating/Succeeded/Failed + :vartype provisioning_state: str + :param object_type: Required. + :type object_type: str + """ + + _validation = { + 'data_source_info': {'required': True}, + 'policy_info': {'required': True}, + 'protection_status': {'readonly': True}, + 'current_protection_state': {'readonly': True}, + 'protection_error_details': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'data_source_info': {'key': 'dataSourceInfo', 'type': 'Datasource'}, + 'data_source_set_info': {'key': 'dataSourceSetInfo', 'type': 'DatasourceSet'}, + 'policy_info': {'key': 'policyInfo', 'type': 'PolicyInfo'}, + 'protection_status': {'key': 'protectionStatus', 'type': 'ProtectionStatusDetails'}, + 'current_protection_state': {'key': 'currentProtectionState', 'type': 'str'}, + 'protection_error_details': {'key': 'protectionErrorDetails', 'type': 'UserFacingError'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, *, data_source_info, policy_info, object_type: str, friendly_name: str=None, data_source_set_info=None, **kwargs) -> None: + super(BackupInstance, self).__init__(**kwargs) + self.friendly_name = friendly_name + self.data_source_info = data_source_info + self.data_source_set_info = data_source_set_info + self.policy_info = policy_info + self.protection_status = None + self.current_protection_state = None + self.protection_error_details = None + self.provisioning_state = None + self.object_type = object_type + + +class BackupInstanceResource(DppResource): + """BackupInstanceResource. + + BackupInstance 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 system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + :param properties: BackupInstanceResource properties + :type properties: ~azure.mgmt.dataprotection.models.BackupInstance + """ + + _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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'BackupInstance'}, + } + + def __init__(self, *, system_data=None, properties=None, **kwargs) -> None: + super(BackupInstanceResource, self).__init__(system_data=system_data, **kwargs) + self.properties = properties + + +class BaseBackupPolicy(Model): + """BaseBackupPolicy. + + BackupPolicy base. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: BackupPolicy + + All required parameters must be populated in order to send to Azure. + + :param datasource_types: Required. Type of datasource for the backup + management + :type datasource_types: list[str] + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'datasource_types': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'datasource_types': {'key': 'datasourceTypes', 'type': '[str]'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'BackupPolicy': 'BackupPolicy'} + } + + def __init__(self, *, datasource_types, **kwargs) -> None: + super(BaseBackupPolicy, self).__init__(**kwargs) + self.datasource_types = datasource_types + self.object_type = None + + +class BackupPolicy(BaseBackupPolicy): + """BackupPolicy. + + Rule based backup policy. + + All required parameters must be populated in order to send to Azure. + + :param datasource_types: Required. Type of datasource for the backup + management + :type datasource_types: list[str] + :param object_type: Required. Constant filled by server. + :type object_type: str + :param policy_rules: Required. Policy rule dictionary that contains rules + for each backuptype i.e Full/Incremental/Logs etc + :type policy_rules: list[~azure.mgmt.dataprotection.models.BasePolicyRule] + """ + + _validation = { + 'datasource_types': {'required': True}, + 'object_type': {'required': True}, + 'policy_rules': {'required': True}, + } + + _attribute_map = { + 'datasource_types': {'key': 'datasourceTypes', 'type': '[str]'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'policy_rules': {'key': 'policyRules', 'type': '[BasePolicyRule]'}, + } + + def __init__(self, *, datasource_types, policy_rules, **kwargs) -> None: + super(BackupPolicy, self).__init__(datasource_types=datasource_types, **kwargs) + self.policy_rules = policy_rules + self.object_type = 'BackupPolicy' + + +class BackupSchedule(Model): + """BackupSchedule. + + Schedule for backup. + + All required parameters must be populated in order to send to Azure. + + :param repeating_time_intervals: Required. ISO 8601 repeating time + interval format + :type repeating_time_intervals: list[str] + """ + + _validation = { + 'repeating_time_intervals': {'required': True}, + } + + _attribute_map = { + 'repeating_time_intervals': {'key': 'repeatingTimeIntervals', 'type': '[str]'}, + } + + def __init__(self, *, repeating_time_intervals, **kwargs) -> None: + super(BackupSchedule, self).__init__(**kwargs) + self.repeating_time_intervals = repeating_time_intervals + + +class BackupVault(Model): + """BackupVault. + + Backup Vault. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: Provisioning state of the BackupVault resource. + Possible values include: 'Failed', 'Provisioning', 'Succeeded', 'Unknown', + 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.dataprotection.models.ProvisioningState + :param storage_settings: Required. Storage Settings + :type storage_settings: + list[~azure.mgmt.dataprotection.models.StorageSetting] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'storage_settings': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'storage_settings': {'key': 'storageSettings', 'type': '[StorageSetting]'}, + } + + def __init__(self, *, storage_settings, **kwargs) -> None: + super(BackupVault, self).__init__(**kwargs) + self.provisioning_state = None + self.storage_settings = storage_settings + + +class DppTrackedResource(Model): + """DppTrackedResource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param e_tag: Optional ETag. + :type e_tag: str + :ivar id: Resource Id represents the complete path to the resource. + :vartype id: str + :param identity: Input Managed Identity Details + :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :param location: Resource location. + :type location: str + :ivar name: Resource name associated with the resource. + :vartype name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar type: Resource type represents the complete path of the form + Namespace/ResourceType/ResourceType/... + :vartype type: str + :param system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'DppIdentityDetails'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, *, e_tag: str=None, identity=None, location: str=None, tags=None, system_data=None, **kwargs) -> None: + super(DppTrackedResource, self).__init__(**kwargs) + self.e_tag = e_tag + self.id = None + self.identity = identity + self.location = location + self.name = None + self.tags = tags + self.type = None + self.system_data = system_data + + +class BackupVaultResource(DppTrackedResource): + """BackupVault Resource. + + Backup Vault Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param e_tag: Optional ETag. + :type e_tag: str + :ivar id: Resource Id represents the complete path to the resource. + :vartype id: str + :param identity: Input Managed Identity Details + :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :param location: Resource location. + :type location: str + :ivar name: Resource name associated with the resource. + :vartype name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar type: Resource type represents the complete path of the form + Namespace/ResourceType/ResourceType/... + :vartype type: str + :param system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + :param properties: Required. BackupVaultResource properties + :type properties: ~azure.mgmt.dataprotection.models.BackupVault + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'DppIdentityDetails'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'BackupVault'}, + } + + def __init__(self, *, properties, e_tag: str=None, identity=None, location: str=None, tags=None, system_data=None, **kwargs) -> None: + super(BackupVaultResource, self).__init__(e_tag=e_tag, identity=identity, location=location, tags=tags, system_data=system_data, **kwargs) + self.properties = properties + + +class BaseBackupPolicyResource(DppResource): + """BaseBackupPolicyResource. + + BaseBackupPolicy 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 system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + :param properties: BaseBackupPolicyResource properties + :type properties: ~azure.mgmt.dataprotection.models.BaseBackupPolicy + """ + + _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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'BaseBackupPolicy'}, + } + + def __init__(self, *, system_data=None, properties=None, **kwargs) -> None: + super(BaseBackupPolicyResource, self).__init__(system_data=system_data, **kwargs) + self.properties = properties + + +class CheckNameAvailabilityRequest(Model): + """CheckNameAvailabilityRequest. + + CheckNameAvailability Request. + + :param name: Resource name for which availability needs to be checked + :type name: str + :param type: Describes the Resource type: + Microsoft.DataProtection/BackupVaults + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type: str=None, **kwargs) -> None: + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + self.type = type + + +class CheckNameAvailabilityResult(Model): + """CheckNameAvailabilityResult. + + CheckNameAvailability Result. + + :param message: Gets or sets the message. + :type message: str + :param name_available: Gets or sets a value indicating whether [name + available]. + :type name_available: bool + :param reason: Gets or sets the reason. + :type reason: str + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, *, message: str=None, name_available: bool=None, reason: str=None, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.message = message + self.name_available = name_available + self.reason = reason + + +class ClientDiscoveryDisplay(Model): + """ClientDiscoveryDisplay. + + Localized display information of an operation. + + :param description: Description of the operation having details of what + operation is about. + :type description: str + :param operation: Operations Name itself. + :type operation: str + :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 + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, operation: str=None, provider: str=None, resource: str=None, **kwargs) -> None: + super(ClientDiscoveryDisplay, self).__init__(**kwargs) + self.description = description + self.operation = operation + self.provider = provider + self.resource = resource + + +class ClientDiscoveryForLogSpecification(Model): + """ClientDiscoveryForLogSpecification. + + Class to represent shoebox log specification in json client discovery. + + :param blob_duration: blob duration of shoebox log specification + :type blob_duration: str + :param display_name: Localized display name + :type display_name: str + :param name: Name for shoebox log specification. + :type name: str + """ + + _attribute_map = { + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, blob_duration: str=None, display_name: str=None, name: str=None, **kwargs) -> None: + super(ClientDiscoveryForLogSpecification, self).__init__(**kwargs) + self.blob_duration = blob_duration + self.display_name = display_name + self.name = name + + +class ClientDiscoveryForProperties(Model): + """ClientDiscoveryForProperties. + + Class to represent shoebox properties in json client discovery. + + :param service_specification: Operation properties. + :type service_specification: + ~azure.mgmt.dataprotection.models.ClientDiscoveryForServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ClientDiscoveryForServiceSpecification'}, + } + + def __init__(self, *, service_specification=None, **kwargs) -> None: + super(ClientDiscoveryForProperties, self).__init__(**kwargs) + self.service_specification = service_specification + + +class ClientDiscoveryForServiceSpecification(Model): + """ClientDiscoveryForServiceSpecification. + + 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.dataprotection.models.ClientDiscoveryForLogSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[ClientDiscoveryForLogSpecification]'}, + } + + def __init__(self, *, log_specifications=None, **kwargs) -> None: + super(ClientDiscoveryForServiceSpecification, self).__init__(**kwargs) + self.log_specifications = log_specifications + + +class ClientDiscoveryValueForSingleApi(Model): + """ClientDiscoveryValueForSingleApi. + + Available operation details. + + :param display: Contains the localized display information for this + particular operation + :type display: ~azure.mgmt.dataprotection.models.ClientDiscoveryDisplay + :param name: Name of the Operation. + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :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: Properties for the given operation. + :type properties: + ~azure.mgmt.dataprotection.models.ClientDiscoveryForProperties + """ + + _attribute_map = { + 'display': {'key': 'display', 'type': 'ClientDiscoveryDisplay'}, + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ClientDiscoveryForProperties'}, + } + + def __init__(self, *, display=None, name: str=None, is_data_action: bool=None, origin: str=None, properties=None, **kwargs) -> None: + super(ClientDiscoveryValueForSingleApi, self).__init__(**kwargs) + self.display = display + self.name = name + self.is_data_action = is_data_action + self.origin = origin + self.properties = properties + + +class CloudError(Model): + """CloudError. + + An error response from Azure Backup. + + :param error: + :type error: ~azure.mgmt.dataprotection.models.Error + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CopyOption(Model): + """CopyOption. + + Options to copy. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: CopyOnExpiryOption, CustomCopyOption, ImmediateCopyOption + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'CopyOnExpiryOption': 'CopyOnExpiryOption', 'CustomCopyOption': 'CustomCopyOption', 'ImmediateCopyOption': 'ImmediateCopyOption'} + } + + def __init__(self, **kwargs) -> None: + super(CopyOption, self).__init__(**kwargs) + self.object_type = None + + +class CopyOnExpiryOption(CopyOption): + """CopyOnExpiryOption. + + Copy on Expiry Option. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CopyOnExpiryOption, self).__init__(**kwargs) + self.object_type = 'CopyOnExpiryOption' + + +class CustomCopyOption(CopyOption): + """CustomCopyOption. + + Duration based custom options to copy. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param duration: Data copied after given timespan + :type duration: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'str'}, + } + + def __init__(self, *, duration: str=None, **kwargs) -> None: + super(CustomCopyOption, self).__init__(**kwargs) + self.duration = duration + self.object_type = 'CustomCopyOption' + + +class Datasource(Model): + """Datasource. + + Datasource to be backed up. + + All required parameters must be populated in order to send to Azure. + + :param datasource_type: DatasourceType of the resource. + :type datasource_type: str + :param object_type: Type of Datasource object, used to initialize the + right inherited type + :type object_type: str + :param resource_id: Required. Full ARM ID of the resource. For azure + resources, this is ARM ID. For non azure resources, this will be the ID + created by backup service via Fabric/Vault. + :type resource_id: str + :param resource_location: Location of datasource. + :type resource_location: str + :param resource_name: Unique identifier of the resource in the context of + parent. + :type resource_name: str + :param resource_type: Resource Type of Datasource. + :type resource_type: str + :param resource_uri: Uri of the resource. + :type resource_uri: str + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'datasource_type': {'key': 'datasourceType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'resource_id': {'key': 'resourceID', 'type': 'str'}, + 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str, datasource_type: str=None, object_type: str=None, resource_location: str=None, resource_name: str=None, resource_type: str=None, resource_uri: str=None, **kwargs) -> None: + super(Datasource, self).__init__(**kwargs) + self.datasource_type = datasource_type + self.object_type = object_type + self.resource_id = resource_id + self.resource_location = resource_location + self.resource_name = resource_name + self.resource_type = resource_type + self.resource_uri = resource_uri + + +class DatasourceSet(Model): + """DatasourceSet. + + DatasourceSet details of datasource to be backed up. + + All required parameters must be populated in order to send to Azure. + + :param datasource_type: DatasourceType of the resource. + :type datasource_type: str + :param object_type: Type of Datasource object, used to initialize the + right inherited type + :type object_type: str + :param resource_id: Required. Full ARM ID of the resource. For azure + resources, this is ARM ID. For non azure resources, this will be the ID + created by backup service via Fabric/Vault. + :type resource_id: str + :param resource_location: Location of datasource. + :type resource_location: str + :param resource_name: Unique identifier of the resource in the context of + parent. + :type resource_name: str + :param resource_type: Resource Type of Datasource. + :type resource_type: str + :param resource_uri: Uri of the resource. + :type resource_uri: str + """ + + _validation = { + 'resource_id': {'required': True}, + } + + _attribute_map = { + 'datasource_type': {'key': 'datasourceType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'resource_id': {'key': 'resourceID', 'type': 'str'}, + 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str, datasource_type: str=None, object_type: str=None, resource_location: str=None, resource_name: str=None, resource_type: str=None, resource_uri: str=None, **kwargs) -> None: + super(DatasourceSet, self).__init__(**kwargs) + self.datasource_type = datasource_type + self.object_type = object_type + self.resource_id = resource_id + self.resource_location = resource_location + self.resource_name = resource_name + self.resource_type = resource_type + self.resource_uri = resource_uri + + +class DataStoreInfoBase(Model): + """DataStoreInfoBase. + + DataStoreInfo base. + + All required parameters must be populated in order to send to Azure. + + :param data_store_type: Required. type of datastore; + Operational/Vault/Archive. Possible values include: 'OperationalStore', + 'VaultStore', 'ArchiveStore' + :type data_store_type: str or + ~azure.mgmt.dataprotection.models.DataStoreTypes + :param object_type: Required. Type of Datasource object, used to + initialize the right inherited type + :type object_type: str + """ + + _validation = { + 'data_store_type': {'required': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'data_store_type': {'key': 'dataStoreType', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, *, data_store_type, object_type: str, **kwargs) -> None: + super(DataStoreInfoBase, self).__init__(**kwargs) + self.data_store_type = data_store_type + self.object_type = object_type + + +class Day(Model): + """Day. + + Day of the week. + + :param date_property: Date of the month + :type date_property: int + :param is_last: Whether Date is last date of month + :type is_last: bool + """ + + _attribute_map = { + 'date_property': {'key': 'date', 'type': 'int'}, + 'is_last': {'key': 'isLast', 'type': 'bool'}, + } + + def __init__(self, *, date_property: int=None, is_last: bool=None, **kwargs) -> None: + super(Day, self).__init__(**kwargs) + self.date_property = date_property + self.is_last = is_last + + +class DppIdentityDetails(Model): + """DppIdentityDetails. + + Identity details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The object ID of the service principal object for the + managed identity that is used to grant role-based access to an Azure + resource. + :vartype principal_id: str + :ivar tenant_id: A Globally Unique Identifier (GUID) that represents the + Azure AD tenant where the resource is now a member. + :vartype tenant_id: str + :param type: The identityType which can be either SystemAssigned or None + :type type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, **kwargs) -> None: + super(DppIdentityDetails, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class DppResourceList(Model): + """List Resource. + + ListResource. + + :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: str=None, **kwargs) -> None: + super(DppResourceList, self).__init__(**kwargs) + self.next_link = next_link + + +class DppTrackedResourceList(Model): + """DppTrackedResourceList. + + :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: str=None, **kwargs) -> None: + super(DppTrackedResourceList, self).__init__(**kwargs) + self.next_link = next_link + + +class Error(Model): + """The resource management error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.dataprotection.models.ErrorAdditionalInfo] + :ivar code: The error code. + :vartype code: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.dataprotection.models.Error] + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + """ + + _validation = { + 'additional_info': {'readonly': True}, + 'code': {'readonly': True}, + 'details': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[Error]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.additional_info = None + self.code = None + self.details = None + self.message = None + self.target = None + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar info: The additional info. + :vartype info: object + :ivar type: The additional info type. + :vartype type: str + """ + + _validation = { + 'info': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'info': {'key': 'info', 'type': 'object'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.info = None + self.type = None + + +class ExportJobsResult(Model): + """ExportJobsResult. + + The result for export jobs containing blob details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob_url: URL of the blob into which the serialized string of list + of jobs is exported. + :vartype blob_url: str + :ivar blob_sas_key: SAS key to access the blob. + :vartype blob_sas_key: str + :ivar excel_file_blob_url: URL of the blob into which the ExcelFile is + uploaded. + :vartype excel_file_blob_url: str + :ivar excel_file_blob_sas_key: SAS key to access the ExcelFile blob. + :vartype excel_file_blob_sas_key: str + """ + + _validation = { + 'blob_url': {'readonly': True}, + 'blob_sas_key': {'readonly': True}, + 'excel_file_blob_url': {'readonly': True}, + 'excel_file_blob_sas_key': {'readonly': True}, + } + + _attribute_map = { + '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) -> None: + super(ExportJobsResult, self).__init__(**kwargs) + self.blob_url = None + self.blob_sas_key = None + self.excel_file_blob_url = None + self.excel_file_blob_sas_key = None + + +class FeatureValidationRequestBase(Model): + """Base class for Backup Feature support. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FeatureValidationRequest + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'FeatureValidationRequest': 'FeatureValidationRequest'} + } + + def __init__(self, **kwargs) -> None: + super(FeatureValidationRequestBase, self).__init__(**kwargs) + self.object_type = None + + +class FeatureValidationRequest(FeatureValidationRequestBase): + """Base class for feature object. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param feature_type: backup support feature type. Possible values include: + 'Invalid', 'DataSourceType' + :type feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType + :param feature_name: backup support feature name. + :type feature_name: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'feature_type': {'key': 'featureType', 'type': 'str'}, + 'feature_name': {'key': 'featureName', 'type': 'str'}, + } + + def __init__(self, *, feature_type=None, feature_name: str=None, **kwargs) -> None: + super(FeatureValidationRequest, self).__init__(**kwargs) + self.feature_type = feature_type + self.feature_name = feature_name + self.object_type = 'FeatureValidationRequest' + + +class FeatureValidationResponseBase(Model): + """Base class for Backup Feature support. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: FeatureValidationResponse + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'FeatureValidationResponse': 'FeatureValidationResponse'} + } + + def __init__(self, **kwargs) -> None: + super(FeatureValidationResponseBase, self).__init__(**kwargs) + self.object_type = None + + +class FeatureValidationResponse(FeatureValidationResponseBase): + """Feature Validation Response. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param feature_type: backup support feature type. Possible values include: + 'Invalid', 'DataSourceType' + :type feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType + :param features: Response features + :type features: list[~azure.mgmt.dataprotection.models.SupportedFeature] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'feature_type': {'key': 'featureType', 'type': 'str'}, + 'features': {'key': 'features', 'type': '[SupportedFeature]'}, + } + + def __init__(self, *, feature_type=None, features=None, **kwargs) -> None: + super(FeatureValidationResponse, self).__init__(**kwargs) + self.feature_type = feature_type + self.features = features + self.object_type = 'FeatureValidationResponse' + + +class ImmediateCopyOption(CopyOption): + """ImmediateCopyOption. + + Immediate copy Option. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ImmediateCopyOption, self).__init__(**kwargs) + self.object_type = 'ImmediateCopyOption' + + +class InnerError(Model): + """InnerError. + + Inner Error. + + :param additional_info: Any Key value pairs that can be provided to the + client for additional verbose information. + :type additional_info: dict[str, str] + :param code: Unique code for this error + :type code: str + :param embedded_inner_error: Child Inner Error, to allow Nesting. + :type embedded_inner_error: ~azure.mgmt.dataprotection.models.InnerError + """ + + _attribute_map = { + 'additional_info': {'key': 'additionalInfo', 'type': '{str}'}, + 'code': {'key': 'code', 'type': 'str'}, + 'embedded_inner_error': {'key': 'embeddedInnerError', 'type': 'InnerError'}, + } + + def __init__(self, *, additional_info=None, code: str=None, embedded_inner_error=None, **kwargs) -> None: + super(InnerError, self).__init__(**kwargs) + self.additional_info = additional_info + self.code = code + self.embedded_inner_error = embedded_inner_error + + +class ItemLevelRestoreCriteria(Model): + """Class to contain criteria for item level restore. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: RangeBasedItemLevelRestoreCriteria + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. 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': {'RangeBasedItemLevelRestoreCriteria': 'RangeBasedItemLevelRestoreCriteria'} + } + + def __init__(self, **kwargs) -> None: + super(ItemLevelRestoreCriteria, self).__init__(**kwargs) + self.object_type = None + + +class RestoreTargetInfoBase(Model): + """Base class common to RestoreTargetInfo and RestoreFilesTargetInfo. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ItemLevelRestoreTargetInfo, RestoreFilesTargetInfo, + RestoreTargetInfo + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar recovery_option: Required. Recovery Option. Default value: + "FailIfExists" . + :vartype recovery_option: str + :param restore_location: Target Restore region + :type restore_location: str + :param object_type: Required. Constant filled by server. + :type object_type: str + """ + + _validation = { + 'recovery_option': {'required': True, 'constant': True}, + 'object_type': {'required': True}, + } + + _attribute_map = { + 'recovery_option': {'key': 'recoveryOption', 'type': 'str'}, + 'restore_location': {'key': 'restoreLocation', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + _subtype_map = { + 'object_type': {'ItemLevelRestoreTargetInfo': 'ItemLevelRestoreTargetInfo', 'RestoreFilesTargetInfo': 'RestoreFilesTargetInfo', 'RestoreTargetInfo': 'RestoreTargetInfo'} + } + + recovery_option = "FailIfExists" + + def __init__(self, *, restore_location: str=None, **kwargs) -> None: + super(RestoreTargetInfoBase, self).__init__(**kwargs) + self.restore_location = restore_location + self.object_type = None + + +class ItemLevelRestoreTargetInfo(RestoreTargetInfoBase): + """Restore target info for Item level restore operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar recovery_option: Required. Recovery Option. Default value: + "FailIfExists" . + :vartype recovery_option: str + :param restore_location: Target Restore region + :type restore_location: str + :param object_type: Required. Constant filled by server. + :type object_type: str + :param restore_criteria: Required. Restore Criteria + :type restore_criteria: + list[~azure.mgmt.dataprotection.models.ItemLevelRestoreCriteria] + :param datasource_info: Required. Information of target DS + :type datasource_info: ~azure.mgmt.dataprotection.models.Datasource + :param datasource_set_info: Information of target DS Set + :type datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + """ + + _validation = { + 'recovery_option': {'required': True, 'constant': True}, + 'object_type': {'required': True}, + 'restore_criteria': {'required': True}, + 'datasource_info': {'required': True}, + } + + _attribute_map = { + 'recovery_option': {'key': 'recoveryOption', 'type': 'str'}, + 'restore_location': {'key': 'restoreLocation', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'restore_criteria': {'key': 'restoreCriteria', 'type': '[ItemLevelRestoreCriteria]'}, + 'datasource_info': {'key': 'datasourceInfo', 'type': 'Datasource'}, + 'datasource_set_info': {'key': 'datasourceSetInfo', 'type': 'DatasourceSet'}, + } + + def __init__(self, *, restore_criteria, datasource_info, restore_location: str=None, datasource_set_info=None, **kwargs) -> None: + super(ItemLevelRestoreTargetInfo, self).__init__(restore_location=restore_location, **kwargs) + self.restore_criteria = restore_criteria + self.datasource_info = datasource_info + self.datasource_set_info = datasource_set_info + self.object_type = 'ItemLevelRestoreTargetInfo' + + +class JobExtendedInfo(Model): + """Extended Information about the job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param additional_details: Job's Additional Details + :type additional_details: dict[str, str] + :ivar backup_instance_state: State of the Backup Instance + :vartype backup_instance_state: str + :ivar data_transferred_in_bytes: Number of bytes transferred + :vartype data_transferred_in_bytes: float + :ivar recovery_destination: Destination where restore is done + :vartype recovery_destination: str + :ivar source_recover_point: Details of the Source Recovery Point + :vartype source_recover_point: + ~azure.mgmt.dataprotection.models.RestoreJobRecoveryPointDetails + :ivar sub_tasks: List of Sub Tasks of the job + :vartype sub_tasks: list[~azure.mgmt.dataprotection.models.JobSubTask] + :ivar target_recover_point: Details of the Target Recovery Point + :vartype target_recover_point: + ~azure.mgmt.dataprotection.models.RestoreJobRecoveryPointDetails + """ + + _validation = { + 'backup_instance_state': {'readonly': True}, + 'data_transferred_in_bytes': {'readonly': True}, + 'recovery_destination': {'readonly': True}, + 'source_recover_point': {'readonly': True}, + 'sub_tasks': {'readonly': True}, + 'target_recover_point': {'readonly': True}, + } + + _attribute_map = { + 'additional_details': {'key': 'additionalDetails', 'type': '{str}'}, + 'backup_instance_state': {'key': 'backupInstanceState', 'type': 'str'}, + 'data_transferred_in_bytes': {'key': 'dataTransferredInBytes', 'type': 'float'}, + 'recovery_destination': {'key': 'recoveryDestination', 'type': 'str'}, + 'source_recover_point': {'key': 'sourceRecoverPoint', 'type': 'RestoreJobRecoveryPointDetails'}, + 'sub_tasks': {'key': 'subTasks', 'type': '[JobSubTask]'}, + 'target_recover_point': {'key': 'targetRecoverPoint', 'type': 'RestoreJobRecoveryPointDetails'}, + } + + def __init__(self, *, additional_details=None, **kwargs) -> None: + super(JobExtendedInfo, self).__init__(**kwargs) + self.additional_details = additional_details + self.backup_instance_state = None + self.data_transferred_in_bytes = None + self.recovery_destination = None + self.source_recover_point = None + self.sub_tasks = None + self.target_recover_point = None + + +class JobSubTask(Model): + """Details of Job's Sub Task. + + 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 additional_details: Additional details of Sub Tasks + :type additional_details: dict[str, str] + :param task_id: Required. Task Id of the Sub Task + :type task_id: int + :param task_name: Required. Name of the Sub Task + :type task_name: str + :ivar task_progress: Progress of the Sub Task + :vartype task_progress: str + :param task_status: Required. Status of the Sub Task + :type task_status: str + """ + + _validation = { + 'task_id': {'required': True}, + 'task_name': {'required': True}, + 'task_progress': {'readonly': True}, + 'task_status': {'required': True}, + } + + _attribute_map = { + 'additional_details': {'key': 'additionalDetails', 'type': '{str}'}, + 'task_id': {'key': 'taskId', 'type': 'int'}, + 'task_name': {'key': 'taskName', 'type': 'str'}, + 'task_progress': {'key': 'taskProgress', 'type': 'str'}, + 'task_status': {'key': 'taskStatus', 'type': 'str'}, + } + + def __init__(self, *, task_id: int, task_name: str, task_status: str, additional_details=None, **kwargs) -> None: + super(JobSubTask, self).__init__(**kwargs) + self.additional_details = additional_details + self.task_id = task_id + self.task_name = task_name + self.task_progress = None + self.task_status = task_status + + +class OperationExtendedInfo(Model): + """OperationExtendedInfo. + + Operation Extended Info. + + :param object_type: This property will be used as the discriminator for + deciding the specific types in the polymorphic chain of types. + :type object_type: str + """ + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, *, object_type: str=None, **kwargs) -> None: + super(OperationExtendedInfo, self).__init__(**kwargs) + self.object_type = object_type + + +class OperationJobExtendedInfo(OperationExtendedInfo): + """OperationJobExtendedInfo. + + Operation Job Extended Info. + + :param object_type: This property will be used as the discriminator for + deciding the specific types in the polymorphic chain of types. + :type object_type: str + :param job_id: Arm Id of the job created for this operation. + :type job_id: str + """ + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + } + + def __init__(self, *, object_type: str=None, job_id: str=None, **kwargs) -> None: + super(OperationJobExtendedInfo, self).__init__(object_type=object_type, **kwargs) + self.job_id = job_id + + +class OperationResource(Model): + """OperationResource. + + Operation Resource. + + :param end_time: End time of the operation + :type end_time: datetime + :param error: Required if status == failed or status == canceled. This is + the OData v4 error format, used by the RPC and will go into the v2.2 Azure + REST API guidelines. + The full set of optional properties (e.g. inner errors / details) can be + found in the "Error Response" section. + :type error: ~azure.mgmt.dataprotection.models.Error + :param id: It should match what is used to GET the operation result + :type id: str + :param name: It must match the last segment of the "id" field, and will + typically be a GUID / system generated value + :type name: str + :param properties: End time of the operation + :type properties: ~azure.mgmt.dataprotection.models.OperationExtendedInfo + :param start_time: Start time of the operation + :type start_time: datetime + :param status: + :type status: str + """ + + _attribute_map = { + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'Error'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'OperationExtendedInfo'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, end_time=None, error=None, id: str=None, name: str=None, properties=None, start_time=None, status: str=None, **kwargs) -> None: + super(OperationResource, self).__init__(**kwargs) + self.end_time = end_time + self.error = error + self.id = id + self.name = name + self.properties = properties + self.start_time = start_time + self.status = status + + +class PatchResourceRequestInput(Model): + """PatchResourceRequestInput. + + Patch Request content for Microsoft.DataProtection resources. + + :param identity: Input Managed Identity Details + :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'identity': {'key': 'identity', 'type': 'DppIdentityDetails'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, identity=None, tags=None, **kwargs) -> None: + super(PatchResourceRequestInput, self).__init__(**kwargs) + self.identity = identity + self.tags = tags + + +class PolicyInfo(Model): + """PolicyInfo. + + Policy Info in backupInstance. + + 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 policy_id: Required. + :type policy_id: str + :ivar policy_version: + :vartype policy_version: str + :param policy_parameters: Policy parameters for the backup instance + :type policy_parameters: + ~azure.mgmt.dataprotection.models.PolicyParameters + """ + + _validation = { + 'policy_id': {'required': True}, + 'policy_version': {'readonly': True}, + } + + _attribute_map = { + 'policy_id': {'key': 'policyId', 'type': 'str'}, + 'policy_version': {'key': 'policyVersion', 'type': 'str'}, + 'policy_parameters': {'key': 'policyParameters', 'type': 'PolicyParameters'}, + } + + def __init__(self, *, policy_id: str, policy_parameters=None, **kwargs) -> None: + super(PolicyInfo, self).__init__(**kwargs) + self.policy_id = policy_id + self.policy_version = None + self.policy_parameters = policy_parameters + + +class PolicyParameters(Model): + """Parameters in Policy. + + :param data_store_parameters_list: Gets or sets the DataStore Parameters + :type data_store_parameters_list: + list[~azure.mgmt.dataprotection.models.DataStoreParameters] + """ + + _attribute_map = { + 'data_store_parameters_list': {'key': 'dataStoreParametersList', 'type': '[DataStoreParameters]'}, + } + + def __init__(self, *, data_store_parameters_list=None, **kwargs) -> None: + super(PolicyParameters, self).__init__(**kwargs) + self.data_store_parameters_list = data_store_parameters_list + + +class ProtectionStatusDetails(Model): + """ProtectionStatusDetails. + + Protection status details. + + :param error_details: Specifies the protection status error of the + resource + :type error_details: ~azure.mgmt.dataprotection.models.UserFacingError + :param status: Specifies the protection status of the resource. Possible + values include: 'ConfiguringProtection', 'ConfiguringProtectionFailed', + 'ProtectionConfigured', 'ProtectionStopped', 'SoftDeleted', 'SoftDeleting' + :type status: str or ~azure.mgmt.dataprotection.models.Status + """ + + _attribute_map = { + 'error_details': {'key': 'errorDetails', 'type': 'UserFacingError'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, error_details=None, status=None, **kwargs) -> None: + super(ProtectionStatusDetails, self).__init__(**kwargs) + self.error_details = error_details + self.status = status + + +class RangeBasedItemLevelRestoreCriteria(ItemLevelRestoreCriteria): + """Item Level target info for restore operation. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param min_matching_value: minimum value for range prefix match + :type min_matching_value: str + :param max_matching_value: maximum value for range prefix match + :type max_matching_value: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'min_matching_value': {'key': 'minMatchingValue', 'type': 'str'}, + 'max_matching_value': {'key': 'maxMatchingValue', 'type': 'str'}, + } + + def __init__(self, *, min_matching_value: str=None, max_matching_value: str=None, **kwargs) -> None: + super(RangeBasedItemLevelRestoreCriteria, self).__init__(**kwargs) + self.min_matching_value = min_matching_value + self.max_matching_value = max_matching_value + self.object_type = 'RangeBasedItemLevelRestoreCriteria' + + +class RecoveryPointDataStoreDetails(Model): + """RecoveryPointDataStoreDetails. + + RecoveryPoint datastore details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param creation_time: + :type creation_time: datetime + :param expiry_time: + :type expiry_time: datetime + :param id: + :type id: str + :param meta_data: + :type meta_data: str + :param state: + :type state: str + :param type: + :type type: str + :param visible: + :type visible: bool + :ivar rehydration_expiry_time: + :vartype rehydration_expiry_time: datetime + :ivar rehydration_status: Possible values include: 'CREATE_IN_PROGRESS', + 'COMPLETED', 'DELETE_IN_PROGRESS', 'DELETED', 'FAILED' + :vartype rehydration_status: str or + ~azure.mgmt.dataprotection.models.RehydrationStatus + """ + + _validation = { + 'rehydration_expiry_time': {'readonly': True}, + 'rehydration_status': {'readonly': True}, + } + + _attribute_map = { + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'expiry_time': {'key': 'expiryTime', 'type': 'iso-8601'}, + 'id': {'key': 'id', 'type': 'str'}, + 'meta_data': {'key': 'metaData', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'visible': {'key': 'visible', 'type': 'bool'}, + 'rehydration_expiry_time': {'key': 'rehydrationExpiryTime', 'type': 'iso-8601'}, + 'rehydration_status': {'key': 'rehydrationStatus', 'type': 'str'}, + } + + def __init__(self, *, creation_time=None, expiry_time=None, id: str=None, meta_data: str=None, state: str=None, type: str=None, visible: bool=None, **kwargs) -> None: + super(RecoveryPointDataStoreDetails, self).__init__(**kwargs) + self.creation_time = creation_time + self.expiry_time = expiry_time + self.id = id + self.meta_data = meta_data + self.state = state + self.type = type + self.visible = visible + self.rehydration_expiry_time = None + self.rehydration_status = None + + +class RecoveryPointsFilters(Model): + """RecoveryPointsFilters. + + :param restore_point_data_store_id: + :type restore_point_data_store_id: str + :param is_visible: + :type is_visible: bool + :param start_date: + :type start_date: str + :param end_date: + :type end_date: str + :param extended_info: + :type extended_info: bool + :param restore_point_state: + :type restore_point_state: str + """ + + _attribute_map = { + 'restore_point_data_store_id': {'key': 'restorePointDataStoreId', 'type': 'str'}, + 'is_visible': {'key': 'isVisible', 'type': 'bool'}, + 'start_date': {'key': 'startDate', 'type': 'str'}, + 'end_date': {'key': 'endDate', 'type': 'str'}, + 'extended_info': {'key': 'extendedInfo', 'type': 'bool'}, + 'restore_point_state': {'key': 'restorePointState', 'type': 'str'}, + } + + def __init__(self, *, restore_point_data_store_id: str=None, is_visible: bool=None, start_date: str=None, end_date: str=None, extended_info: bool=None, restore_point_state: str=None, **kwargs) -> None: + super(RecoveryPointsFilters, self).__init__(**kwargs) + self.restore_point_data_store_id = restore_point_data_store_id + self.is_visible = is_visible + self.start_date = start_date + self.end_date = end_date + self.extended_info = extended_info + self.restore_point_state = restore_point_state + + +class RestorableTimeRange(Model): + """RestorableTimeRange. + + All required parameters must be populated in order to send to Azure. + + :param start_time: Required. Start time for the available restore range + :type start_time: str + :param end_time: Required. End time for the available restore range + :type end_time: str + :param object_type: + :type object_type: str + """ + + _validation = { + 'start_time': {'required': True}, + 'end_time': {'required': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + } + + def __init__(self, *, start_time: str, end_time: str, object_type: str=None, **kwargs) -> None: + super(RestorableTimeRange, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.object_type = object_type + + +class RestoreFilesTargetInfo(RestoreTargetInfoBase): + """Class encapsulating restore as files target parameters. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar recovery_option: Required. Recovery Option. Default value: + "FailIfExists" . + :vartype recovery_option: str + :param restore_location: Target Restore region + :type restore_location: str + :param object_type: Required. Constant filled by server. + :type object_type: str + :param target_details: Required. Destination of RestoreAsFiles operation, + when destination is not a datasource + :type target_details: ~azure.mgmt.dataprotection.models.TargetDetails + """ + + _validation = { + 'recovery_option': {'required': True, 'constant': True}, + 'object_type': {'required': True}, + 'target_details': {'required': True}, + } + + _attribute_map = { + 'recovery_option': {'key': 'recoveryOption', 'type': 'str'}, + 'restore_location': {'key': 'restoreLocation', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'target_details': {'key': 'targetDetails', 'type': 'TargetDetails'}, + } + + def __init__(self, *, target_details, restore_location: str=None, **kwargs) -> None: + super(RestoreFilesTargetInfo, self).__init__(restore_location=restore_location, **kwargs) + self.target_details = target_details + self.object_type = 'RestoreFilesTargetInfo' + + +class RestoreJobRecoveryPointDetails(Model): + """RestoreJobRecoveryPointDetails. + + :param recovery_point_id: + :type recovery_point_id: str + :param recovery_point_time: + :type recovery_point_time: datetime + """ + + _attribute_map = { + 'recovery_point_id': {'key': 'recoveryPointID', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, recovery_point_id: str=None, recovery_point_time=None, **kwargs) -> None: + super(RestoreJobRecoveryPointDetails, self).__init__(**kwargs) + self.recovery_point_id = recovery_point_id + self.recovery_point_time = recovery_point_time + + +class RestoreTargetInfo(RestoreTargetInfoBase): + """Class encapsulating restore target parameters. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar recovery_option: Required. Recovery Option. Default value: + "FailIfExists" . + :vartype recovery_option: str + :param restore_location: Target Restore region + :type restore_location: str + :param object_type: Required. Constant filled by server. + :type object_type: str + :param datasource_info: Required. Information of target DS + :type datasource_info: ~azure.mgmt.dataprotection.models.Datasource + :param datasource_set_info: Information of target DS Set + :type datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + """ + + _validation = { + 'recovery_option': {'required': True, 'constant': True}, + 'object_type': {'required': True}, + 'datasource_info': {'required': True}, + } + + _attribute_map = { + 'recovery_option': {'key': 'recoveryOption', 'type': 'str'}, + 'restore_location': {'key': 'restoreLocation', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'datasource_info': {'key': 'datasourceInfo', 'type': 'Datasource'}, + 'datasource_set_info': {'key': 'datasourceSetInfo', 'type': 'DatasourceSet'}, + } + + def __init__(self, *, datasource_info, restore_location: str=None, datasource_set_info=None, **kwargs) -> None: + super(RestoreTargetInfo, self).__init__(restore_location=restore_location, **kwargs) + self.datasource_info = datasource_info + self.datasource_set_info = datasource_set_info + self.object_type = 'RestoreTargetInfo' + + +class RetentionTag(Model): + """RetentionTag. + + Retention tag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar e_tag: Retention Tag version. + :vartype e_tag: str + :ivar id: Retention Tag version. + :vartype id: str + :param tag_name: Required. Retention Tag Name to relate it to retention + rule. + :type tag_name: str + """ + + _validation = { + 'e_tag': {'readonly': True}, + 'id': {'readonly': True}, + 'tag_name': {'required': True}, + } + + _attribute_map = { + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'tag_name': {'key': 'tagName', 'type': 'str'}, + } + + def __init__(self, *, tag_name: str, **kwargs) -> None: + super(RetentionTag, self).__init__(**kwargs) + self.e_tag = None + self.id = None + self.tag_name = tag_name + + +class ScheduleBasedBackupCriteria(BackupCriteria): + """ScheduleBasedBackupCriteria. + + Schedule based backup criteria. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param absolute_criteria: it contains absolute values like "AllBackup" / + "FirstOfDay" / "FirstOfWeek" / "FirstOfMonth" + and should be part of AbsoluteMarker enum + :type absolute_criteria: list[str or + ~azure.mgmt.dataprotection.models.AbsoluteMarker] + :param days_of_month: This is day of the month from 1 to 28 other wise + last of month + :type days_of_month: list[~azure.mgmt.dataprotection.models.Day] + :param days_of_the_week: It should be Sunday/Monday/T..../Saturday + :type days_of_the_week: list[str or + ~azure.mgmt.dataprotection.models.DayOfWeek] + :param months_of_year: It should be January/February/....../December + :type months_of_year: list[str or ~azure.mgmt.dataprotection.models.Month] + :param schedule_times: List of schedule times for backup + :type schedule_times: list[datetime] + :param weeks_of_the_month: It should be First/Second/Third/Fourth/Last + :type weeks_of_the_month: list[str or + ~azure.mgmt.dataprotection.models.WeekNumber] + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'absolute_criteria': {'key': 'absoluteCriteria', 'type': '[str]'}, + 'days_of_month': {'key': 'daysOfMonth', 'type': '[Day]'}, + 'days_of_the_week': {'key': 'daysOfTheWeek', 'type': '[str]'}, + 'months_of_year': {'key': 'monthsOfYear', 'type': '[str]'}, + 'schedule_times': {'key': 'scheduleTimes', 'type': '[iso-8601]'}, + 'weeks_of_the_month': {'key': 'weeksOfTheMonth', 'type': '[str]'}, + } + + def __init__(self, *, absolute_criteria=None, days_of_month=None, days_of_the_week=None, months_of_year=None, schedule_times=None, weeks_of_the_month=None, **kwargs) -> None: + super(ScheduleBasedBackupCriteria, self).__init__(**kwargs) + self.absolute_criteria = absolute_criteria + self.days_of_month = days_of_month + self.days_of_the_week = days_of_the_week + self.months_of_year = months_of_year + self.schedule_times = schedule_times + self.weeks_of_the_month = weeks_of_the_month + self.object_type = 'ScheduleBasedBackupCriteria' + + +class ScheduleBasedTriggerContext(TriggerContext): + """ScheduleBasedTriggerContext. + + Schedule based trigger context. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param schedule: Required. Schedule for this backup + :type schedule: ~azure.mgmt.dataprotection.models.BackupSchedule + :param tagging_criteria: Required. List of tags that can be applicable for + given schedule. + :type tagging_criteria: + list[~azure.mgmt.dataprotection.models.TaggingCriteria] + """ + + _validation = { + 'object_type': {'required': True}, + 'schedule': {'required': True}, + 'tagging_criteria': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'schedule': {'key': 'schedule', 'type': 'BackupSchedule'}, + 'tagging_criteria': {'key': 'taggingCriteria', 'type': '[TaggingCriteria]'}, + } + + def __init__(self, *, schedule, tagging_criteria, **kwargs) -> None: + super(ScheduleBasedTriggerContext, self).__init__(**kwargs) + self.schedule = schedule + self.tagging_criteria = tagging_criteria + self.object_type = 'ScheduleBasedTriggerContext' + + +class SourceLifeCycle(Model): + """SourceLifeCycle. + + Source LifeCycle. + + All required parameters must be populated in order to send to Azure. + + :param delete_after: Required. + :type delete_after: ~azure.mgmt.dataprotection.models.DeleteOption + :param source_data_store: Required. + :type source_data_store: + ~azure.mgmt.dataprotection.models.DataStoreInfoBase + :param target_data_store_copy_settings: + :type target_data_store_copy_settings: + list[~azure.mgmt.dataprotection.models.TargetCopySetting] + """ + + _validation = { + 'delete_after': {'required': True}, + 'source_data_store': {'required': True}, + } + + _attribute_map = { + 'delete_after': {'key': 'deleteAfter', 'type': 'DeleteOption'}, + 'source_data_store': {'key': 'sourceDataStore', 'type': 'DataStoreInfoBase'}, + 'target_data_store_copy_settings': {'key': 'targetDataStoreCopySettings', 'type': '[TargetCopySetting]'}, + } + + def __init__(self, *, delete_after, source_data_store, target_data_store_copy_settings=None, **kwargs) -> None: + super(SourceLifeCycle, self).__init__(**kwargs) + self.delete_after = delete_after + self.source_data_store = source_data_store + self.target_data_store_copy_settings = target_data_store_copy_settings + + +class StorageSetting(Model): + """StorageSetting. + + Storage setting. + + :param datastore_type: Gets or sets the type of the datastore. Possible + values include: 'ArchiveStore', 'SnapshotStore', 'VaultStore' + :type datastore_type: str or + ~azure.mgmt.dataprotection.models.StorageSettingStoreTypes + :param type: Gets or sets the type. Possible values include: + 'GeoRedundant', 'LocallyRedundant' + :type type: str or ~azure.mgmt.dataprotection.models.StorageSettingTypes + """ + + _attribute_map = { + 'datastore_type': {'key': 'datastoreType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, datastore_type=None, type=None, **kwargs) -> None: + super(StorageSetting, self).__init__(**kwargs) + self.datastore_type = datastore_type + self.type = type + + +class SupportedFeature(Model): + """Elements class for feature request. + + :param feature_name: support feature type. + :type feature_name: str + :param support_status: feature support status. Possible values include: + 'Invalid', 'NotSupported', 'AlphaPreview', 'PrivatePreview', + 'PublicPreview', 'GenerallyAvailable' + :type support_status: str or + ~azure.mgmt.dataprotection.models.FeatureSupportStatus + :param exposure_controlled_features: support feature type. + :type exposure_controlled_features: list[str] + """ + + _attribute_map = { + 'feature_name': {'key': 'featureName', 'type': 'str'}, + 'support_status': {'key': 'supportStatus', 'type': 'str'}, + 'exposure_controlled_features': {'key': 'exposureControlledFeatures', 'type': '[str]'}, + } + + def __init__(self, *, feature_name: str=None, support_status=None, exposure_controlled_features=None, **kwargs) -> None: + super(SupportedFeature, self).__init__(**kwargs) + self.feature_name = feature_name + self.support_status = support_status + self.exposure_controlled_features = exposure_controlled_features + + +class SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or + ~azure.mgmt.dataprotection.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.dataprotection.models.CreatedByType + :param last_modified_at: The type of identity that last modified the + resource. + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TaggingCriteria(Model): + """TaggingCriteria. + + Tagging criteria. + + All required parameters must be populated in order to send to Azure. + + :param criteria: Criteria which decides whether the tag can be applied to + a triggered backup. + :type criteria: list[~azure.mgmt.dataprotection.models.BackupCriteria] + :param is_default: Required. Specifies if tag is default. + :type is_default: bool + :param tagging_priority: Required. Retention Tag priority. + :type tagging_priority: long + :param tag_info: Required. Retention tag information + :type tag_info: ~azure.mgmt.dataprotection.models.RetentionTag + """ + + _validation = { + 'is_default': {'required': True}, + 'tagging_priority': {'required': True}, + 'tag_info': {'required': True}, + } + + _attribute_map = { + 'criteria': {'key': 'criteria', 'type': '[BackupCriteria]'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, + 'tagging_priority': {'key': 'taggingPriority', 'type': 'long'}, + 'tag_info': {'key': 'tagInfo', 'type': 'RetentionTag'}, + } + + def __init__(self, *, is_default: bool, tagging_priority: int, tag_info, criteria=None, **kwargs) -> None: + super(TaggingCriteria, self).__init__(**kwargs) + self.criteria = criteria + self.is_default = is_default + self.tagging_priority = tagging_priority + self.tag_info = tag_info + + +class TargetCopySetting(Model): + """TargetCopySetting. + + Target copy settings. + + All required parameters must be populated in order to send to Azure. + + :param copy_after: Required. It can be CustomCopyOption or + ImmediateCopyOption. + :type copy_after: ~azure.mgmt.dataprotection.models.CopyOption + :param data_store: Required. Info of target datastore + :type data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + """ + + _validation = { + 'copy_after': {'required': True}, + 'data_store': {'required': True}, + } + + _attribute_map = { + 'copy_after': {'key': 'copyAfter', 'type': 'CopyOption'}, + 'data_store': {'key': 'dataStore', 'type': 'DataStoreInfoBase'}, + } + + def __init__(self, *, copy_after, data_store, **kwargs) -> None: + super(TargetCopySetting, self).__init__(**kwargs) + self.copy_after = copy_after + self.data_store = data_store + + +class TargetDetails(Model): + """Class encapsulating target details, used where the destination is not a + datasource. + + All required parameters must be populated in order to send to Azure. + + :param file_prefix: Required. Restore operation may create multiple files + inside location pointed by Url + Below will be the common prefix for all of them + :type file_prefix: str + :param restore_target_location_type: Required. Denotes the target location + where the data will be restored, + string value for the enum + {Microsoft.Internal.AzureBackup.DataProtection.Common.Interface.RestoreTargetLocationType}. + Possible values include: 'Invalid', 'AzureBlobs', 'AzureFiles' + :type restore_target_location_type: str or + ~azure.mgmt.dataprotection.models.RestoreTargetLocationType + :param url: Required. Url denoting the restore destination. It can point + to container / file share etc + :type url: str + """ + + _validation = { + 'file_prefix': {'required': True}, + 'restore_target_location_type': {'required': True}, + 'url': {'required': True}, + } + + _attribute_map = { + 'file_prefix': {'key': 'filePrefix', 'type': 'str'}, + 'restore_target_location_type': {'key': 'restoreTargetLocationType', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, *, file_prefix: str, restore_target_location_type, url: str, **kwargs) -> None: + super(TargetDetails, self).__init__(**kwargs) + self.file_prefix = file_prefix + self.restore_target_location_type = restore_target_location_type + self.url = url + + +class TriggerBackupRequest(Model): + """TriggerBackupRequest. + + Trigger backup request. + + All required parameters must be populated in order to send to Azure. + + :param backup_rule_options: Required. Name for the Rule of the Policy + which needs to be applied for this backup + :type backup_rule_options: + ~azure.mgmt.dataprotection.models.AdHocBackupRuleOptions + """ + + _validation = { + 'backup_rule_options': {'required': True}, + } + + _attribute_map = { + 'backup_rule_options': {'key': 'backupRuleOptions', 'type': 'AdHocBackupRuleOptions'}, + } + + def __init__(self, *, backup_rule_options, **kwargs) -> None: + super(TriggerBackupRequest, self).__init__(**kwargs) + self.backup_rule_options = backup_rule_options + + +class UserFacingError(Model): + """Error object used by layers that have access to localized content, and + propagate that to user. + + :param code: Unique code for this error + :type code: str + :param details: Additional related Errors + :type details: list[~azure.mgmt.dataprotection.models.UserFacingError] + :param inner_error: Inner Error + :type inner_error: ~azure.mgmt.dataprotection.models.InnerError + :param is_retryable: Whether the operation will be retryable or not + :type is_retryable: bool + :param is_user_error: Whether the operation is due to a user error or + service error + :type is_user_error: bool + :param properties: Any key value pairs that can be injected inside error + object + :type properties: dict[str, str] + :param message: + :type message: str + :param recommended_action: RecommendedAction � localized. + :type recommended_action: list[str] + :param target: Target of the error. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[UserFacingError]'}, + 'inner_error': {'key': 'innerError', 'type': 'InnerError'}, + 'is_retryable': {'key': 'isRetryable', 'type': 'bool'}, + 'is_user_error': {'key': 'isUserError', 'type': 'bool'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'message': {'key': 'message', 'type': 'str'}, + 'recommended_action': {'key': 'recommendedAction', 'type': '[str]'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, details=None, inner_error=None, is_retryable: bool=None, is_user_error: bool=None, properties=None, message: str=None, recommended_action=None, target: str=None, **kwargs) -> None: + super(UserFacingError, self).__init__(**kwargs) + self.code = code + self.details = details + self.inner_error = inner_error + self.is_retryable = is_retryable + self.is_user_error = is_user_error + self.properties = properties + self.message = message + self.recommended_action = recommended_action + self.target = target + + +class ValidateForBackupRequest(Model): + """ValidateForBackupRequest. + + Validate for backup request. + + All required parameters must be populated in order to send to Azure. + + :param backup_instance: Required. + :type backup_instance: ~azure.mgmt.dataprotection.models.BackupInstance + """ + + _validation = { + 'backup_instance': {'required': True}, + } + + _attribute_map = { + 'backup_instance': {'key': 'backupInstance', 'type': 'BackupInstance'}, + } + + def __init__(self, *, backup_instance, **kwargs) -> None: + super(ValidateForBackupRequest, self).__init__(**kwargs) + self.backup_instance = backup_instance + + +class ValidateRestoreRequestObject(Model): + """ValidateRestoreRequestObject. + + Validate restore request object. + + All required parameters must be populated in order to send to Azure. + + :param restore_request_object: Required. Gets or sets the restore request + object. + :type restore_request_object: + ~azure.mgmt.dataprotection.models.AzureBackupRestoreRequest + """ + + _validation = { + 'restore_request_object': {'required': True}, + } + + _attribute_map = { + 'restore_request_object': {'key': 'restoreRequestObject', 'type': 'AzureBackupRestoreRequest'}, + } + + def __init__(self, *, restore_request_object, **kwargs) -> None: + super(ValidateRestoreRequestObject, self).__init__(**kwargs) + self.restore_request_object = restore_request_object diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_paged_models.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_paged_models.py new file mode 100644 index 000000000000..fe122441a97e --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_paged_models.py @@ -0,0 +1,92 @@ +# 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 msrest.paging import Paged + + +class BackupVaultResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`BackupVaultResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BackupVaultResource]'} + } + + def __init__(self, *args, **kwargs): + + super(BackupVaultResourcePaged, self).__init__(*args, **kwargs) +class ClientDiscoveryValueForSingleApiPaged(Paged): + """ + A paging container for iterating over a list of :class:`ClientDiscoveryValueForSingleApi ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ClientDiscoveryValueForSingleApi]'} + } + + def __init__(self, *args, **kwargs): + + super(ClientDiscoveryValueForSingleApiPaged, self).__init__(*args, **kwargs) +class BaseBackupPolicyResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`BaseBackupPolicyResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BaseBackupPolicyResource]'} + } + + def __init__(self, *args, **kwargs): + + super(BaseBackupPolicyResourcePaged, self).__init__(*args, **kwargs) +class BackupInstanceResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`BackupInstanceResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BackupInstanceResource]'} + } + + def __init__(self, *args, **kwargs): + + super(BackupInstanceResourcePaged, self).__init__(*args, **kwargs) +class AzureBackupRecoveryPointResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`AzureBackupRecoveryPointResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AzureBackupRecoveryPointResource]'} + } + + def __init__(self, *args, **kwargs): + + super(AzureBackupRecoveryPointResourcePaged, self).__init__(*args, **kwargs) +class AzureBackupJobResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`AzureBackupJobResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AzureBackupJobResource]'} + } + + def __init__(self, *args, **kwargs): + + super(AzureBackupJobResourcePaged, self).__init__(*args, **kwargs) diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/__init__.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/__init__.py new file mode 100644 index 000000000000..24f3dbba6dfd --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/__init__.py @@ -0,0 +1,40 @@ +# 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 ._backup_vaults_operations import BackupVaultsOperations +from ._operation_result_operations import OperationResultOperations +from ._operation_status_operations import OperationStatusOperations +from ._backup_vault_operation_results_operations import BackupVaultOperationResultsOperations +from ._data_protection_operations import DataProtectionOperations +from ._data_protection_operations_operations import DataProtectionOperationsOperations +from ._backup_policies_operations import BackupPoliciesOperations +from ._backup_instances_operations import BackupInstancesOperations +from ._recovery_points_operations import RecoveryPointsOperations +from ._jobs_operations import JobsOperations +from ._restorable_time_ranges_operations import RestorableTimeRangesOperations +from ._export_jobs_operations import ExportJobsOperations +from ._export_jobs_operation_result_operations import ExportJobsOperationResultOperations + +__all__ = [ + 'BackupVaultsOperations', + 'OperationResultOperations', + 'OperationStatusOperations', + 'BackupVaultOperationResultsOperations', + 'DataProtectionOperations', + 'DataProtectionOperationsOperations', + 'BackupPoliciesOperations', + 'BackupInstancesOperations', + 'RecoveryPointsOperations', + 'JobsOperations', + 'RestorableTimeRangesOperations', + 'ExportJobsOperations', + 'ExportJobsOperationResultOperations', +] diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_instances_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_instances_operations.py new file mode 100644 index 000000000000..d0fef2eb6433 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_instances_operations.py @@ -0,0 +1,974 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class BackupInstancesOperations(object): + """BackupInstancesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def list( + self, vault_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a backup instances belonging to a backup vault. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of BackupInstanceResource + :rtype: + ~azure.mgmt.dataprotection.models.BackupInstanceResourcePaged[~azure.mgmt.dataprotection.models.BackupInstanceResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.BackupInstanceResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances'} + + def get( + self, vault_name, resource_group_name, backup_instance_name, custom_headers=None, raw=False, **operation_config): + """Gets a backup instance with name in a backup vault. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param backup_instance_name: The name of the backup instance + :type backup_instance_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BackupInstanceResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dataprotection.models.BackupInstanceResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + 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'), + 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BackupInstanceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}'} + + + def _create_or_update_initial( + self, vault_name, resource_group_name, backup_instance_name, system_data=None, properties=None, custom_headers=None, raw=False, **operation_config): + parameters = models.BackupInstanceResource(system_data=system_data, properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + 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'), + 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'BackupInstanceResource') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BackupInstanceResource', response) + if response.status_code == 201: + deserialized = self._deserialize('BackupInstanceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, vault_name, resource_group_name, backup_instance_name, system_data=None, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a backup instance in a backup vault. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param backup_instance_name: The name of the backup instance + :type backup_instance_name: str + :param system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + :param properties: BackupInstanceResource properties + :type properties: ~azure.mgmt.dataprotection.models.BackupInstance + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BackupInstanceResource + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.dataprotection.models.BackupInstanceResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.dataprotection.models.BackupInstanceResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + backup_instance_name=backup_instance_name, + system_data=system_data, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BackupInstanceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}'} + + + def _delete_initial( + self, vault_name, resource_group_name, backup_instance_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + 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'), + 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + 'Retry-After': 'int', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def delete( + self, vault_name, resource_group_name, backup_instance_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a backup instance in a backup vault. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param backup_instance_name: The name of the backup instance + :type backup_instance_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + backup_instance_name=backup_instance_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + 'Retry-After': 'int', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}'} + + + def _adhoc_backup_initial( + self, vault_name, resource_group_name, backup_instance_name, backup_rule_options, custom_headers=None, raw=False, **operation_config): + parameters = models.TriggerBackupRequest(backup_rule_options=backup_rule_options) + + # Construct URL + url = self.adhoc_backup.metadata['url'] + 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'), + 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TriggerBackupRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('OperationJobExtendedInfo', response) + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + 'Retry-After': 'int', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def adhoc_backup( + self, vault_name, resource_group_name, backup_instance_name, backup_rule_options, custom_headers=None, raw=False, polling=True, **operation_config): + """Trigger adhoc backup . + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param backup_instance_name: The name of the backup instance + :type backup_instance_name: str + :param backup_rule_options: Name for the Rule of the Policy which + needs to be applied for this backup + :type backup_rule_options: + ~azure.mgmt.dataprotection.models.AdHocBackupRuleOptions + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + OperationJobExtendedInfo or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo]] + :raises: :class:`CloudError` + """ + raw_result = self._adhoc_backup_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + backup_instance_name=backup_instance_name, + backup_rule_options=backup_rule_options, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + 'Retry-After': 'int', + } + deserialized = self._deserialize('OperationJobExtendedInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + adhoc_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/backup'} + + + def _validate_for_backup_initial( + self, vault_name, resource_group_name, backup_instance, custom_headers=None, raw=False, **operation_config): + parameters = models.ValidateForBackupRequest(backup_instance=backup_instance) + + # Construct URL + url = self.validate_for_backup.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ValidateForBackupRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('OperationJobExtendedInfo', response) + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + 'Retry-After': 'int', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def validate_for_backup( + self, vault_name, resource_group_name, backup_instance, custom_headers=None, raw=False, polling=True, **operation_config): + """Validate whether adhoc backup will be successful or not. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param backup_instance: + :type backup_instance: + ~azure.mgmt.dataprotection.models.BackupInstance + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + OperationJobExtendedInfo or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_for_backup_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + backup_instance=backup_instance, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + 'Retry-After': 'int', + } + deserialized = self._deserialize('OperationJobExtendedInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate_for_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/validateForBackup'} + + + def _trigger_rehydrate_initial( + self, resource_group_name, vault_name, parameters, backup_instance_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.trigger_rehydrate.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AzureBackupRehydrationRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + 'Retry-After': 'int', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def trigger_rehydrate( + self, resource_group_name, vault_name, parameters, backup_instance_name, custom_headers=None, raw=False, polling=True, **operation_config): + """rehydrate recovery point for restore for a BackupInstance. + + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param vault_name: The name of the backup vault. + :type vault_name: str + :param parameters: Request body for operation + :type parameters: + ~azure.mgmt.dataprotection.models.AzureBackupRehydrationRequest + :param backup_instance_name: + :type backup_instance_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._trigger_rehydrate_initial( + resource_group_name=resource_group_name, + vault_name=vault_name, + parameters=parameters, + backup_instance_name=backup_instance_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + 'Retry-After': 'int', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + trigger_rehydrate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/rehydrate'} + + + def _trigger_restore_initial( + self, vault_name, resource_group_name, backup_instance_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.trigger_restore.metadata['url'] + 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'), + 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AzureBackupRestoreRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('OperationJobExtendedInfo', response) + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + 'Retry-After': 'int', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def trigger_restore( + self, vault_name, resource_group_name, backup_instance_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Triggers restore for a BackupInstance. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param backup_instance_name: The name of the backup instance + :type backup_instance_name: str + :param parameters: Request body for operation + :type parameters: + ~azure.mgmt.dataprotection.models.AzureBackupRestoreRequest + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + OperationJobExtendedInfo or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo]] + :raises: :class:`CloudError` + """ + raw_result = self._trigger_restore_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + backup_instance_name=backup_instance_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + 'Retry-After': 'int', + } + deserialized = self._deserialize('OperationJobExtendedInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + trigger_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/restore'} + + + def _validate_for_restore_initial( + self, vault_name, resource_group_name, backup_instance_name, restore_request_object, custom_headers=None, raw=False, **operation_config): + parameters = models.ValidateRestoreRequestObject(restore_request_object=restore_request_object) + + # Construct URL + url = self.validate_for_restore.metadata['url'] + 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'), + 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ValidateRestoreRequestObject') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('OperationJobExtendedInfo', response) + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + 'Retry-After': 'int', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def validate_for_restore( + self, vault_name, resource_group_name, backup_instance_name, restore_request_object, custom_headers=None, raw=False, polling=True, **operation_config): + """Validates if Restore can be triggered for a DataSource. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param backup_instance_name: The name of the backup instance + :type backup_instance_name: str + :param restore_request_object: Gets or sets the restore request + object. + :type restore_request_object: + ~azure.mgmt.dataprotection.models.AzureBackupRestoreRequest + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + OperationJobExtendedInfo or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_for_restore_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + backup_instance_name=backup_instance_name, + restore_request_object=restore_request_object, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + 'Retry-After': 'int', + } + deserialized = self._deserialize('OperationJobExtendedInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate_for_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/validateRestore'} diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_policies_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_policies_operations.py new file mode 100644 index 000000000000..bc296bdd94eb --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_policies_operations.py @@ -0,0 +1,312 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class BackupPoliciesOperations(object): + """BackupPoliciesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def list( + self, vault_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Returns list of backup policies belonging to a backup vault. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of BaseBackupPolicyResource + :rtype: + ~azure.mgmt.dataprotection.models.BaseBackupPolicyResourcePaged[~azure.mgmt.dataprotection.models.BaseBackupPolicyResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.BaseBackupPolicyResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies'} + + def get( + self, vault_name, resource_group_name, backup_policy_name, custom_headers=None, raw=False, **operation_config): + """Gets a backup policy belonging to a backup vault. + + Gets a backup policy belonging to a backup vault. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param backup_policy_name: + :type backup_policy_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BaseBackupPolicyResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dataprotection.models.BaseBackupPolicyResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + 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'), + 'backupPolicyName': self._serialize.url("backup_policy_name", backup_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BaseBackupPolicyResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}'} + + def create_or_update( + self, vault_name, resource_group_name, backup_policy_name, system_data=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Creates or Updates a backup policy belonging to a backup vault. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param backup_policy_name: Name of the policy + :type backup_policy_name: str + :param system_data: + :type system_data: ~azure.mgmt.dataprotection.models.SystemData + :param properties: BaseBackupPolicyResource properties + :type properties: ~azure.mgmt.dataprotection.models.BaseBackupPolicy + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BaseBackupPolicyResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dataprotection.models.BaseBackupPolicyResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.BaseBackupPolicyResource(system_data=system_data, properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + 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'), + 'backupPolicyName': self._serialize.url("backup_policy_name", backup_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'BaseBackupPolicyResource') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BaseBackupPolicyResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}'} + + def delete( + self, vault_name, resource_group_name, backup_policy_name, custom_headers=None, raw=False, **operation_config): + """Deletes a backup policy belonging to a backup vault. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param backup_policy_name: + :type backup_policy_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + 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'), + 'backupPolicyName': self._serialize.url("backup_policy_name", backup_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}'} diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_vault_operation_results_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_vault_operation_results_operations.py new file mode 100644 index 000000000000..9296070821e8 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_vault_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class BackupVaultOperationResultsOperations(object): + """BackupVaultOperationResultsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def get( + self, vault_name, resource_group_name, operation_id, custom_headers=None, raw=False, **operation_config): + """ + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param operation_id: + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BackupVaultResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dataprotection.models.BackupVaultResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BackupVaultResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/operationResults/{operationId}'} diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_vaults_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_vaults_operations.py new file mode 100644 index 000000000000..0cc4f88632c1 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_vaults_operations.py @@ -0,0 +1,579 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class BackupVaultsOperations(object): + """BackupVaultsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def get_in_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Returns resource collection belonging to a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of BackupVaultResource + :rtype: + ~azure.mgmt.dataprotection.models.BackupVaultResourcePaged[~azure.mgmt.dataprotection.models.BackupVaultResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.get_in_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.BackupVaultResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + get_in_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/backupVaults'} + + def get_in_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Returns resource collection belonging to a resource group. + + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of BackupVaultResource + :rtype: + ~azure.mgmt.dataprotection.models.BackupVaultResourcePaged[~azure.mgmt.dataprotection.models.BackupVaultResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.get_in_resource_group.metadata['url'] + path_format_arguments = { + '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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.BackupVaultResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + get_in_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults'} + + def get( + self, vault_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Returns a resource belonging to a resource group. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BackupVaultResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dataprotection.models.BackupVaultResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BackupVaultResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}'} + + + def _create_or_update_initial( + self, vault_name, resource_group_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'BackupVaultResource') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BackupVaultResource', response) + if response.status_code == 201: + deserialized = self._deserialize('BackupVaultResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, vault_name, resource_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a BackupVault resource belonging to a resource + group. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param parameters: Request body for operation + :type parameters: + ~azure.mgmt.dataprotection.models.BackupVaultResource + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BackupVaultResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.dataprotection.models.BackupVaultResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.dataprotection.models.BackupVaultResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BackupVaultResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}'} + + def delete( + self, vault_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Deletes a BackupVault resource from the resource group. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}'} + + + def _update_initial( + self, vault_name, resource_group_name, identity=None, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.PatchResourceRequestInput(identity=identity, tags=tags) + + # Construct URL + url = self.update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PatchResourceRequestInput') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BackupVaultResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, vault_name, resource_group_name, identity=None, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a BackupVault resource belonging to a resource group. For + example, updating tags for a resource. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param identity: Input Managed Identity Details + :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :param tags: Resource tags. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BackupVaultResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.dataprotection.models.BackupVaultResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.dataprotection.models.BackupVaultResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + identity=identity, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BackupVaultResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}'} + + def check_name_availability( + self, resource_group_name, location, name=None, type=None, custom_headers=None, raw=False, **operation_config): + """API to check for resource name availability. + + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param location: The location in which uniqueness will be verified. + :type location: str + :param name: Resource name for which availability needs to be checked + :type name: str + :param type: Describes the Resource type: + Microsoft.DataProtection/BackupVaults + :type type: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dataprotection.models.CheckNameAvailabilityResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.CheckNameAvailabilityRequest(name=name, type=type) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CheckNameAvailabilityRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/checkNameAvailability'} diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_data_protection_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_data_protection_operations.py new file mode 100644 index 000000000000..6063cef107df --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_data_protection_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DataProtectionOperations(object): + """DataProtectionOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def check_feature_support( + self, location, parameters, custom_headers=None, raw=False, **operation_config): + """Validates if a feature is supported. + + :param location: + :type location: str + :param parameters: Feature support request object + :type parameters: + ~azure.mgmt.dataprotection.models.FeatureValidationRequestBase + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: FeatureValidationResponseBase or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.dataprotection.models.FeatureValidationResponseBase or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.check_feature_support.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'FeatureValidationRequestBase') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FeatureValidationResponseBase', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_feature_support.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/checkFeatureSupport'} diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_data_protection_operations_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_data_protection_operations_operations.py new file mode 100644 index 000000000000..d64d43896c89 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_data_protection_operations_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DataProtectionOperationsOperations(object): + """DataProtectionOperationsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Returns the list of available operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ClientDiscoveryValueForSingleApi + :rtype: + ~azure.mgmt.dataprotection.models.ClientDiscoveryValueForSingleApiPaged[~azure.mgmt.dataprotection.models.ClientDiscoveryValueForSingleApi] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ClientDiscoveryValueForSingleApiPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.DataProtection/operations'} diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_export_jobs_operation_result_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_export_jobs_operation_result_operations.py new file mode 100644 index 000000000000..86b33c52698d --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_export_jobs_operation_result_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ExportJobsOperationResultOperations(object): + """ExportJobsOperationResultOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def get( + self, resource_group_name, vault_name, operation_id, custom_headers=None, raw=False, **operation_config): + """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 resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param vault_name: The name of the backup vault. + :type vault_name: str + :param operation_id: OperationID which represents the export job. + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExportJobsResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dataprotection.models.ExportJobsResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ExportJobsResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/operations/{operationId}'} diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_export_jobs_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_export_jobs_operations.py new file mode 100644 index 000000000000..c80dddc90763 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_export_jobs_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ExportJobsOperations(object): + """ExportJobsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + + def _trigger_initial( + self, resource_group_name, vault_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.trigger.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vaultName': self._serialize.url("vault_name", vault_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def trigger( + self, resource_group_name, vault_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Triggers export of jobs and returns an OperationID to track. + + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param vault_name: The name of the backup vault. + :type vault_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._trigger_initial( + resource_group_name=resource_group_name, + vault_name=vault_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Location': 'str', + 'Retry-After': 'int', + }) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + trigger.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/exportBackupJobs'} diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_jobs_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_jobs_operations.py new file mode 100644 index 000000000000..d901c0be9ad3 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_jobs_operations.py @@ -0,0 +1,179 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class JobsOperations(object): + """JobsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def list( + self, resource_group_name, vault_name, custom_headers=None, raw=False, **operation_config): + """Returns list of jobs belonging to a backup vault. + + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param vault_name: The name of the backup vault. + :type vault_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AzureBackupJobResource + :rtype: + ~azure.mgmt.dataprotection.models.AzureBackupJobResourcePaged[~azure.mgmt.dataprotection.models.AzureBackupJobResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vaultName': self._serialize.url("vault_name", vault_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AzureBackupJobResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs'} + + def get( + self, resource_group_name, vault_name, job_id, custom_headers=None, raw=False, **operation_config): + """Gets a job with id in a backup vault. + + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param vault_name: The name of the backup vault. + :type vault_name: str + :param job_id: The Job ID. This is a GUID-formatted string (e.g. + 00000000-0000-0000-0000-000000000000). + :type job_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AzureBackupJobResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dataprotection.models.AzureBackupJobResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'jobId': self._serialize.url("job_id", job_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AzureBackupJobResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/{jobId}'} diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_operation_result_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_operation_result_operations.py new file mode 100644 index 000000000000..1318cc961e57 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_operation_result_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class OperationResultOperations(object): + """OperationResultOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def get( + self, operation_id, location, custom_headers=None, raw=False, **operation_config): + """Gets the operation status for a resource. + + Gets the operation result for a resource. + + :param operation_id: + :type operation_id: str + :param location: + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationJobExtendedInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dataprotection.models.OperationJobExtendedInfo or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'location': self._serialize.url("location", location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationJobExtendedInfo', response) + header_dict = { + 'Location': 'str', + 'Azure-AsyncOperation': 'str', + 'Retry-After': 'int', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationResults/{operationId}'} diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_operation_status_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_operation_status_operations.py new file mode 100644 index 000000000000..2d1383a20885 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_operation_status_operations.py @@ -0,0 +1,101 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class OperationStatusOperations(object): + """OperationStatusOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def get( + self, location, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets the operation status for a resource. + + :param location: + :type location: str + :param operation_id: + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.dataprotection.models.OperationResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationStatus/{operationId}'} diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_recovery_points_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_recovery_points_operations.py new file mode 100644 index 000000000000..d76f3a2ef149 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_recovery_points_operations.py @@ -0,0 +1,194 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RecoveryPointsOperations(object): + """RecoveryPointsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def list( + self, vault_name, resource_group_name, backup_instance_name, filter=None, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Returns a list of Recovery Points for a DataSource in a vault. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param backup_instance_name: The name of the backup instance + :type backup_instance_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :type skip_token: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AzureBackupRecoveryPointResource + :rtype: + ~azure.mgmt.dataprotection.models.AzureBackupRecoveryPointResourcePaged[~azure.mgmt.dataprotection.models.AzureBackupRecoveryPointResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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'), + 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AzureBackupRecoveryPointResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints'} + + def get( + self, vault_name, resource_group_name, backup_instance_name, recovery_point_id, custom_headers=None, raw=False, **operation_config): + """Gets a Recovery Point using recoveryPointId for a Datasource. + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param backup_instance_name: The name of the backup instance + :type backup_instance_name: str + :param recovery_point_id: + :type recovery_point_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AzureBackupRecoveryPointResource or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.dataprotection.models.AzureBackupRecoveryPointResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + 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'), + 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AzureBackupRecoveryPointResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints/{recoveryPointId}'} diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_restorable_time_ranges_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_restorable_time_ranges_operations.py new file mode 100644 index 000000000000..6edc710dc779 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_restorable_time_ranges_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RestorableTimeRangesOperations(object): + """RestorableTimeRangesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2021-01-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01" + + self.config = config + + def find( + self, vault_name, resource_group_name, backup_instance_name, parameters, custom_headers=None, raw=False, **operation_config): + """ + + :param vault_name: The name of the backup vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + backup vault is present. + :type resource_group_name: str + :param backup_instance_name: The name of the backup instance + :type backup_instance_name: str + :param parameters: Request body for operation + :type parameters: + ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesRequest + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AzureBackupFindRestorableTimeRangesResponseResource or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesResponseResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.find.metadata['url'] + 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'), + 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AzureBackupFindRestorableTimeRangesRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AzureBackupFindRestorableTimeRangesResponseResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + find.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/findRestorableTimeRanges'} diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/version.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/version.py new file mode 100644 index 000000000000..affaef0c987e --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/version.py @@ -0,0 +1,13 @@ +# 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/dataprotection/azure-mgmt-dataprotection/sdk_packaging.toml b/sdk/dataprotection/azure-mgmt-dataprotection/sdk_packaging.toml new file mode 100644 index 000000000000..55cade730ba1 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-dataprotection" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/setup.cfg b/sdk/dataprotection/azure-mgmt-dataprotection/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/setup.py b/sdk/dataprotection/azure-mgmt-dataprotection/setup.py new file mode 100644 index 000000000000..3cfe455a49a7 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/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-dataprotection" +PACKAGE_PPRINT_NAME = "MyService 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', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +) diff --git a/sdk/dataprotection/ci.yml b/sdk/dataprotection/ci.yml new file mode 100644 index 000000000000..d1e272d85ee7 --- /dev/null +++ b/sdk/dataprotection/ci.yml @@ -0,0 +1,35 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/dataprotection/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/dataprotection/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: dataprotection + Artifacts: + - name: azure-mgmt-dataprotection + safeName: azuremgmtdataprotection