diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_recovery_services_backup_client.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_recovery_services_backup_client.py index d8f1cb73fd71..2e88cc4a436c 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_recovery_services_backup_client.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_recovery_services_backup_client.py @@ -29,6 +29,14 @@ from .operations import JobsOperations from .operations import BackupProtectedItemsOperations from .operations import OperationOperations +from .operations import AadPropertiesOperations +from .operations import CrossRegionRestoreOperations +from .operations import BackupCrrJobDetailsOperations +from .operations import BackupCrrJobsOperations +from .operations import CrrOperationResultsOperations +from .operations import CrrOperationStatusOperations +from .operations import RecoveryPointsCrrOperations +from .operations import BackupProtectedItemsCrrOperations from .operations import ProtectionIntentOperations from .operations import BackupStatusOperations from .operations import FeatureSupportOperations @@ -92,6 +100,22 @@ class RecoveryServicesBackupClient(SDKClient): :vartype backup_protected_items: azure.mgmt.recoveryservicesbackup.operations.BackupProtectedItemsOperations :ivar operation: Operation operations :vartype operation: azure.mgmt.recoveryservicesbackup.operations.OperationOperations + :ivar aad_properties: AadProperties operations + :vartype aad_properties: azure.mgmt.recoveryservicesbackup.operations.AadPropertiesOperations + :ivar cross_region_restore: CrossRegionRestore operations + :vartype cross_region_restore: azure.mgmt.recoveryservicesbackup.operations.CrossRegionRestoreOperations + :ivar backup_crr_job_details: BackupCrrJobDetails operations + :vartype backup_crr_job_details: azure.mgmt.recoveryservicesbackup.operations.BackupCrrJobDetailsOperations + :ivar backup_crr_jobs: BackupCrrJobs operations + :vartype backup_crr_jobs: azure.mgmt.recoveryservicesbackup.operations.BackupCrrJobsOperations + :ivar crr_operation_results: CrrOperationResults operations + :vartype crr_operation_results: azure.mgmt.recoveryservicesbackup.operations.CrrOperationResultsOperations + :ivar crr_operation_status: CrrOperationStatus operations + :vartype crr_operation_status: azure.mgmt.recoveryservicesbackup.operations.CrrOperationStatusOperations + :ivar recovery_points_crr: RecoveryPointsCrr operations + :vartype recovery_points_crr: azure.mgmt.recoveryservicesbackup.operations.RecoveryPointsCrrOperations + :ivar backup_protected_items_crr: BackupProtectedItemsCrr operations + :vartype backup_protected_items_crr: azure.mgmt.recoveryservicesbackup.operations.BackupProtectedItemsCrrOperations :ivar protection_intent: ProtectionIntent operations :vartype protection_intent: azure.mgmt.recoveryservicesbackup.operations.ProtectionIntentOperations :ivar backup_status: BackupStatus operations @@ -187,6 +211,22 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.operation = OperationOperations( self._client, self.config, self._serialize, self._deserialize) + self.aad_properties = AadPropertiesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.cross_region_restore = CrossRegionRestoreOperations( + self._client, self.config, self._serialize, self._deserialize) + self.backup_crr_job_details = BackupCrrJobDetailsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.backup_crr_jobs = BackupCrrJobsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.crr_operation_results = CrrOperationResultsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.crr_operation_status = CrrOperationStatusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.recovery_points_crr = RecoveryPointsCrrOperations( + self._client, self.config, self._serialize, self._deserialize) + self.backup_protected_items_crr = BackupProtectedItemsCrrOperations( + self._client, self.config, self._serialize, self._deserialize) self.protection_intent = ProtectionIntentOperations( self._client, self.config, self._serialize, self._deserialize) self.backup_status = BackupStatusOperations( diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/__init__.py index 3ae64ab0a5be..074763d52df4 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/__init__.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/__init__.py @@ -10,6 +10,8 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import AADProperties + from ._models_py3 import AADPropertiesResource from ._models_py3 import AzureBackupGoalFeatureSupportRequest from ._models_py3 import AzureBackupServerContainer from ._models_py3 import AzureBackupServerEngine @@ -123,6 +125,10 @@ from ._models_py3 import ClientDiscoveryValueForSingleApi from ._models_py3 import ClientScriptForConnect from ._models_py3 import ContainerIdentityInfo + from ._models_py3 import CrossRegionRestoreRequest + from ._models_py3 import CrossRegionRestoreRequestResource + from ._models_py3 import CrrAccessToken + from ._models_py3 import CrrAccessTokenResource from ._models_py3 import DailyRetentionFormat from ._models_py3 import DailyRetentionSchedule from ._models_py3 import Day @@ -190,6 +196,7 @@ from ._models_py3 import OperationStatusJobExtendedInfo from ._models_py3 import OperationStatusJobsExtendedInfo from ._models_py3 import OperationStatusProvisionILRExtendedInfo + from ._models_py3 import OperationStatusRecoveryPointExtendedInfo from ._models_py3 import OperationWorkerResponse from ._models_py3 import PointInTimeRange from ._models_py3 import PreBackupValidation @@ -243,6 +250,8 @@ from ._models_py3 import WorkloadProtectableItemResource from ._models_py3 import YearlyRetentionSchedule except (SyntaxError, ImportError): + from ._models import AADProperties + from ._models import AADPropertiesResource from ._models import AzureBackupGoalFeatureSupportRequest from ._models import AzureBackupServerContainer from ._models import AzureBackupServerEngine @@ -356,6 +365,10 @@ from ._models import ClientDiscoveryValueForSingleApi from ._models import ClientScriptForConnect from ._models import ContainerIdentityInfo + from ._models import CrossRegionRestoreRequest + from ._models import CrossRegionRestoreRequestResource + from ._models import CrrAccessToken + from ._models import CrrAccessTokenResource from ._models import DailyRetentionFormat from ._models import DailyRetentionSchedule from ._models import Day @@ -423,6 +436,7 @@ from ._models import OperationStatusJobExtendedInfo from ._models import OperationStatusJobsExtendedInfo from ._models import OperationStatusProvisionILRExtendedInfo + from ._models import OperationStatusRecoveryPointExtendedInfo from ._models import OperationWorkerResponse from ._models import PointInTimeRange from ._models import PreBackupValidation @@ -524,6 +538,7 @@ CreateMode, HealthState, ScheduleRunType, + OperationStatusValues, SupportStatus, WorkloadItemType, UsagesUnit, @@ -538,10 +553,11 @@ OperationType, ContainerType, BackupItemType, - OperationStatusValues, ) __all__ = [ + 'AADProperties', + 'AADPropertiesResource', 'AzureBackupGoalFeatureSupportRequest', 'AzureBackupServerContainer', 'AzureBackupServerEngine', @@ -655,6 +671,10 @@ 'ClientDiscoveryValueForSingleApi', 'ClientScriptForConnect', 'ContainerIdentityInfo', + 'CrossRegionRestoreRequest', + 'CrossRegionRestoreRequestResource', + 'CrrAccessToken', + 'CrrAccessTokenResource', 'DailyRetentionFormat', 'DailyRetentionSchedule', 'Day', @@ -722,6 +742,7 @@ 'OperationStatusJobExtendedInfo', 'OperationStatusJobsExtendedInfo', 'OperationStatusProvisionILRExtendedInfo', + 'OperationStatusRecoveryPointExtendedInfo', 'OperationWorkerResponse', 'PointInTimeRange', 'PreBackupValidation', @@ -822,6 +843,7 @@ 'CreateMode', 'HealthState', 'ScheduleRunType', + 'OperationStatusValues', 'SupportStatus', 'WorkloadItemType', 'UsagesUnit', @@ -836,5 +858,4 @@ 'OperationType', 'ContainerType', 'BackupItemType', - 'OperationStatusValues', ] diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_models.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_models.py index 8f6faff98638..acd4a6345ea5 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_models.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_models.py @@ -12,6 +12,128 @@ from msrest.serialization import Model +class AADProperties(Model): + """AADProperties. + + :param service_principal_client_id: + :type service_principal_client_id: str + :param tenant_id: + :type tenant_id: str + :param authority: + :type authority: str + :param audience: + :type audience: str + :param service_principal_object_id: + :type service_principal_object_id: str + """ + + _attribute_map = { + 'service_principal_client_id': {'key': 'servicePrincipalClientId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'authority': {'key': 'authority', 'type': 'str'}, + 'audience': {'key': 'audience', 'type': 'str'}, + 'service_principal_object_id': {'key': 'servicePrincipalObjectId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AADProperties, self).__init__(**kwargs) + self.service_principal_client_id = kwargs.get('service_principal_client_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.authority = kwargs.get('authority', None) + self.audience = kwargs.get('audience', None) + self.service_principal_object_id = kwargs.get('service_principal_object_id', None) + + +class Resource(Model): + """ARM Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id represents the complete path to the resource. + :vartype id: str + :ivar name: Resource name associated with the resource. + :vartype name: str + :ivar type: Resource type represents the complete path of the form + Namespace/ResourceType/ResourceType/... + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.e_tag = kwargs.get('e_tag', None) + + +class AADPropertiesResource(Resource): + """AADPropertiesResource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id represents the complete path to the resource. + :vartype id: str + :ivar name: Resource name associated with the resource. + :vartype name: str + :ivar type: Resource type represents the complete path of the form + Namespace/ResourceType/ResourceType/... + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: AADPropertiesResource properties + :type properties: ~azure.mgmt.recoveryservicesbackup.models.AADProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'AADProperties'}, + } + + def __init__(self, **kwargs): + super(AADPropertiesResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + class FeatureSupportRequest(Model): """Base class for feature request. @@ -5695,52 +5817,6 @@ def __init__(self, **kwargs): self.data_directory_paths = None -class Resource(Model): - """ARM Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id represents the complete path to the resource. - :vartype id: str - :ivar name: Resource name associated with the resource. - :vartype name: str - :ivar type: Resource type represents the complete path of the form - Namespace/ResourceType/ResourceType/... - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param e_tag: Optional ETag. - :type e_tag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - self.e_tag = kwargs.get('e_tag', None) - - class BackupEngineBaseResource(Resource): """The base backup engine class. All workload specific backup engines derive from this class. @@ -6659,6 +6735,211 @@ def __init__(self, **kwargs): self.audience = kwargs.get('audience', None) +class CrossRegionRestoreRequest(Model): + """CrossRegionRestoreRequest. + + :param cross_region_restore_access_details: Access details for cross + region restore + :type cross_region_restore_access_details: + ~azure.mgmt.recoveryservicesbackup.models.CrrAccessToken + :param restore_request: Request object for triggering restore + :type restore_request: + ~azure.mgmt.recoveryservicesbackup.models.RestoreRequest + """ + + _attribute_map = { + 'cross_region_restore_access_details': {'key': 'crossRegionRestoreAccessDetails', 'type': 'CrrAccessToken'}, + 'restore_request': {'key': 'restoreRequest', 'type': 'RestoreRequest'}, + } + + def __init__(self, **kwargs): + super(CrossRegionRestoreRequest, self).__init__(**kwargs) + self.cross_region_restore_access_details = kwargs.get('cross_region_restore_access_details', None) + self.restore_request = kwargs.get('restore_request', None) + + +class CrossRegionRestoreRequestResource(Resource): + """CrossRegionRestoreRequestResource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id represents the complete path to the resource. + :vartype id: str + :ivar name: Resource name associated with the resource. + :vartype name: str + :ivar type: Resource type represents the complete path of the form + Namespace/ResourceType/ResourceType/... + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: CrossRegionRestoreRequestResource properties + :type properties: + ~azure.mgmt.recoveryservicesbackup.models.CrossRegionRestoreRequest + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CrossRegionRestoreRequest'}, + } + + def __init__(self, **kwargs): + super(CrossRegionRestoreRequestResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class CrrAccessToken(Model): + """Container level access token for CRR. + + :param access_token_string: Access token used for authentication + :type access_token_string: str + :param subscription_id: Subscription Id of the source vault + :type subscription_id: str + :param resource_group_name: Resource Group name of the source vault + :type resource_group_name: str + :param resource_name: Resource Name of the source vault + :type resource_name: str + :param resource_id: Resource Id of the source vault + :type resource_id: str + :param recovery_point_id: Recovery Point Id + :type recovery_point_id: str + :param recovery_point_time: Recovery Point Time + :type recovery_point_time: str + :param container_name: Container Unique name + :type container_name: str + :param container_type: Container Type + :type container_type: str + :param backup_management_type: Backup Management Type + :type backup_management_type: str + :param datasource_type: Datasource Type + :type datasource_type: str + :param datasource_name: Datasource Friendly Name + :type datasource_name: str + :param datasource_id: Datasource Id + :type datasource_id: str + :param datasource_container_name: Datasource Container Unique Name + :type datasource_container_name: str + :param coordinator_service_stamp_id: CoordinatorServiceStampId to be used + by BCM in restore call + :type coordinator_service_stamp_id: str + :param coordinator_service_stamp_uri: CoordinatorServiceStampUri to be + used by BCM in restore call + :type coordinator_service_stamp_uri: str + :param protection_service_stamp_id: ProtectionServiceStampId to be used by + BCM in restore call + :type protection_service_stamp_id: str + :param protection_service_stamp_uri: ProtectionServiceStampUri to be used + by BCM in restore call + :type protection_service_stamp_uri: str + :param token_extended_information: Extended Information about the token + like FileSpec etc. + :type token_extended_information: str + """ + + _attribute_map = { + 'access_token_string': {'key': 'accessTokenString', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'datasource_type': {'key': 'datasourceType', 'type': 'str'}, + 'datasource_name': {'key': 'datasourceName', 'type': 'str'}, + 'datasource_id': {'key': 'datasourceId', 'type': 'str'}, + 'datasource_container_name': {'key': 'datasourceContainerName', 'type': 'str'}, + 'coordinator_service_stamp_id': {'key': 'coordinatorServiceStampId', 'type': 'str'}, + 'coordinator_service_stamp_uri': {'key': 'coordinatorServiceStampUri', 'type': 'str'}, + 'protection_service_stamp_id': {'key': 'protectionServiceStampId', 'type': 'str'}, + 'protection_service_stamp_uri': {'key': 'protectionServiceStampUri', 'type': 'str'}, + 'token_extended_information': {'key': 'tokenExtendedInformation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CrrAccessToken, self).__init__(**kwargs) + self.access_token_string = kwargs.get('access_token_string', None) + self.subscription_id = kwargs.get('subscription_id', None) + self.resource_group_name = kwargs.get('resource_group_name', None) + self.resource_name = kwargs.get('resource_name', None) + self.resource_id = kwargs.get('resource_id', None) + self.recovery_point_id = kwargs.get('recovery_point_id', None) + self.recovery_point_time = kwargs.get('recovery_point_time', None) + self.container_name = kwargs.get('container_name', None) + self.container_type = kwargs.get('container_type', None) + self.backup_management_type = kwargs.get('backup_management_type', None) + self.datasource_type = kwargs.get('datasource_type', None) + self.datasource_name = kwargs.get('datasource_name', None) + self.datasource_id = kwargs.get('datasource_id', None) + self.datasource_container_name = kwargs.get('datasource_container_name', None) + self.coordinator_service_stamp_id = kwargs.get('coordinator_service_stamp_id', None) + self.coordinator_service_stamp_uri = kwargs.get('coordinator_service_stamp_uri', None) + self.protection_service_stamp_id = kwargs.get('protection_service_stamp_id', None) + self.protection_service_stamp_uri = kwargs.get('protection_service_stamp_uri', None) + self.token_extended_information = kwargs.get('token_extended_information', None) + + +class CrrAccessTokenResource(Resource): + """Container level access token for CRR. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id represents the complete path to the resource. + :vartype id: str + :ivar name: Resource name associated with the resource. + :vartype name: str + :ivar type: Resource type represents the complete path of the form + Namespace/ResourceType/ResourceType/... + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: CrrAccessTokenResource properties + :type properties: ~azure.mgmt.recoveryservicesbackup.models.CrrAccessToken + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CrrAccessToken'}, + } + + def __init__(self, **kwargs): + super(CrrAccessTokenResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + class DailyRetentionFormat(Model): """Daily retention format. @@ -9042,7 +9323,8 @@ class OperationStatusExtendedInfo(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: OperationStatusJobExtendedInfo, - OperationStatusJobsExtendedInfo, OperationStatusProvisionILRExtendedInfo + OperationStatusJobsExtendedInfo, OperationStatusProvisionILRExtendedInfo, + OperationStatusRecoveryPointExtendedInfo All required parameters must be populated in order to send to Azure. @@ -9059,7 +9341,7 @@ class OperationStatusExtendedInfo(Model): } _subtype_map = { - 'object_type': {'OperationStatusJobExtendedInfo': 'OperationStatusJobExtendedInfo', 'OperationStatusJobsExtendedInfo': 'OperationStatusJobsExtendedInfo', 'OperationStatusProvisionILRExtendedInfo': 'OperationStatusProvisionILRExtendedInfo'} + 'object_type': {'OperationStatusJobExtendedInfo': 'OperationStatusJobExtendedInfo', 'OperationStatusJobsExtendedInfo': 'OperationStatusJobsExtendedInfo', 'OperationStatusProvisionILRExtendedInfo': 'OperationStatusProvisionILRExtendedInfo', 'OperationStatusRecoveryPointExtendedInfo': 'OperationStatusRecoveryPointExtendedInfo'} } def __init__(self, **kwargs): @@ -9151,6 +9433,39 @@ def __init__(self, **kwargs): self.object_type = 'OperationStatusProvisionILRExtendedInfo' +class OperationStatusRecoveryPointExtendedInfo(OperationStatusExtendedInfo): + """Operation status extended info for Updated Recovery Point. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param updated_recovery_point: Recovery Point info with updated source + snapshot URI + :type updated_recovery_point: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPoint + :param deleted_backup_item_version: In case the share is in soft-deleted + state, populate this field with deleted backup item + :type deleted_backup_item_version: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'updated_recovery_point': {'key': 'updatedRecoveryPoint', 'type': 'RecoveryPoint'}, + 'deleted_backup_item_version': {'key': 'deletedBackupItemVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationStatusRecoveryPointExtendedInfo, self).__init__(**kwargs) + self.updated_recovery_point = kwargs.get('updated_recovery_point', None) + self.deleted_backup_item_version = kwargs.get('deleted_backup_item_version', None) + self.object_type = 'OperationStatusRecoveryPointExtendedInfo' + + class PointInTimeRange(Model): """Provides details for log ranges. @@ -10057,12 +10372,16 @@ class TargetRestoreInfo(Model): :param database_name: Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana :type database_name: str + :param target_directory_mapping: This will contain the target folder + mapping for the Full/Diff/Log/Incremental pits. + :type target_directory_mapping: dict[str, str] """ _attribute_map = { 'overwrite_option': {'key': 'overwriteOption', 'type': 'str'}, 'container_id': {'key': 'containerId', 'type': 'str'}, 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'target_directory_mapping': {'key': 'targetDirectoryMapping', 'type': '{str}'}, } def __init__(self, **kwargs): @@ -10070,6 +10389,7 @@ def __init__(self, **kwargs): self.overwrite_option = kwargs.get('overwrite_option', None) self.container_id = kwargs.get('container_id', None) self.database_name = kwargs.get('database_name', None) + self.target_directory_mapping = kwargs.get('target_directory_mapping', None) class TokenInformation(Model): diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_models_py3.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_models_py3.py index 3d88aadfd7da..3b7df6c5686f 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_models_py3.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_models_py3.py @@ -12,6 +12,128 @@ from msrest.serialization import Model +class AADProperties(Model): + """AADProperties. + + :param service_principal_client_id: + :type service_principal_client_id: str + :param tenant_id: + :type tenant_id: str + :param authority: + :type authority: str + :param audience: + :type audience: str + :param service_principal_object_id: + :type service_principal_object_id: str + """ + + _attribute_map = { + 'service_principal_client_id': {'key': 'servicePrincipalClientId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'authority': {'key': 'authority', 'type': 'str'}, + 'audience': {'key': 'audience', 'type': 'str'}, + 'service_principal_object_id': {'key': 'servicePrincipalObjectId', 'type': 'str'}, + } + + def __init__(self, *, service_principal_client_id: str=None, tenant_id: str=None, authority: str=None, audience: str=None, service_principal_object_id: str=None, **kwargs) -> None: + super(AADProperties, self).__init__(**kwargs) + self.service_principal_client_id = service_principal_client_id + self.tenant_id = tenant_id + self.authority = authority + self.audience = audience + self.service_principal_object_id = service_principal_object_id + + +class Resource(Model): + """ARM Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id represents the complete path to the resource. + :vartype id: str + :ivar name: Resource name associated with the resource. + :vartype name: str + :ivar type: Resource type represents the complete path of the form + Namespace/ResourceType/ResourceType/... + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, tags=None, e_tag: str=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.e_tag = e_tag + + +class AADPropertiesResource(Resource): + """AADPropertiesResource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id represents the complete path to the resource. + :vartype id: str + :ivar name: Resource name associated with the resource. + :vartype name: str + :ivar type: Resource type represents the complete path of the form + Namespace/ResourceType/ResourceType/... + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: AADPropertiesResource properties + :type properties: ~azure.mgmt.recoveryservicesbackup.models.AADProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'AADProperties'}, + } + + def __init__(self, *, location: str=None, tags=None, e_tag: str=None, properties=None, **kwargs) -> None: + super(AADPropertiesResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + class FeatureSupportRequest(Model): """Base class for feature request. @@ -5695,52 +5817,6 @@ def __init__(self, **kwargs) -> None: self.data_directory_paths = None -class Resource(Model): - """ARM Resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource Id represents the complete path to the resource. - :vartype id: str - :ivar name: Resource name associated with the resource. - :vartype name: str - :ivar type: Resource type represents the complete path of the form - Namespace/ResourceType/ResourceType/... - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param e_tag: Optional ETag. - :type e_tag: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - } - - def __init__(self, *, location: str=None, tags=None, e_tag: str=None, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - self.e_tag = e_tag - - class BackupEngineBaseResource(Resource): """The base backup engine class. All workload specific backup engines derive from this class. @@ -6659,6 +6735,211 @@ def __init__(self, *, unique_name: str=None, aad_tenant_id: str=None, service_pr self.audience = audience +class CrossRegionRestoreRequest(Model): + """CrossRegionRestoreRequest. + + :param cross_region_restore_access_details: Access details for cross + region restore + :type cross_region_restore_access_details: + ~azure.mgmt.recoveryservicesbackup.models.CrrAccessToken + :param restore_request: Request object for triggering restore + :type restore_request: + ~azure.mgmt.recoveryservicesbackup.models.RestoreRequest + """ + + _attribute_map = { + 'cross_region_restore_access_details': {'key': 'crossRegionRestoreAccessDetails', 'type': 'CrrAccessToken'}, + 'restore_request': {'key': 'restoreRequest', 'type': 'RestoreRequest'}, + } + + def __init__(self, *, cross_region_restore_access_details=None, restore_request=None, **kwargs) -> None: + super(CrossRegionRestoreRequest, self).__init__(**kwargs) + self.cross_region_restore_access_details = cross_region_restore_access_details + self.restore_request = restore_request + + +class CrossRegionRestoreRequestResource(Resource): + """CrossRegionRestoreRequestResource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id represents the complete path to the resource. + :vartype id: str + :ivar name: Resource name associated with the resource. + :vartype name: str + :ivar type: Resource type represents the complete path of the form + Namespace/ResourceType/ResourceType/... + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: CrossRegionRestoreRequestResource properties + :type properties: + ~azure.mgmt.recoveryservicesbackup.models.CrossRegionRestoreRequest + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CrossRegionRestoreRequest'}, + } + + def __init__(self, *, location: str=None, tags=None, e_tag: str=None, properties=None, **kwargs) -> None: + super(CrossRegionRestoreRequestResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + +class CrrAccessToken(Model): + """Container level access token for CRR. + + :param access_token_string: Access token used for authentication + :type access_token_string: str + :param subscription_id: Subscription Id of the source vault + :type subscription_id: str + :param resource_group_name: Resource Group name of the source vault + :type resource_group_name: str + :param resource_name: Resource Name of the source vault + :type resource_name: str + :param resource_id: Resource Id of the source vault + :type resource_id: str + :param recovery_point_id: Recovery Point Id + :type recovery_point_id: str + :param recovery_point_time: Recovery Point Time + :type recovery_point_time: str + :param container_name: Container Unique name + :type container_name: str + :param container_type: Container Type + :type container_type: str + :param backup_management_type: Backup Management Type + :type backup_management_type: str + :param datasource_type: Datasource Type + :type datasource_type: str + :param datasource_name: Datasource Friendly Name + :type datasource_name: str + :param datasource_id: Datasource Id + :type datasource_id: str + :param datasource_container_name: Datasource Container Unique Name + :type datasource_container_name: str + :param coordinator_service_stamp_id: CoordinatorServiceStampId to be used + by BCM in restore call + :type coordinator_service_stamp_id: str + :param coordinator_service_stamp_uri: CoordinatorServiceStampUri to be + used by BCM in restore call + :type coordinator_service_stamp_uri: str + :param protection_service_stamp_id: ProtectionServiceStampId to be used by + BCM in restore call + :type protection_service_stamp_id: str + :param protection_service_stamp_uri: ProtectionServiceStampUri to be used + by BCM in restore call + :type protection_service_stamp_uri: str + :param token_extended_information: Extended Information about the token + like FileSpec etc. + :type token_extended_information: str + """ + + _attribute_map = { + 'access_token_string': {'key': 'accessTokenString', 'type': 'str'}, + 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'recovery_point_id': {'key': 'recoveryPointId', 'type': 'str'}, + 'recovery_point_time': {'key': 'recoveryPointTime', 'type': 'str'}, + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'container_type': {'key': 'containerType', 'type': 'str'}, + 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, + 'datasource_type': {'key': 'datasourceType', 'type': 'str'}, + 'datasource_name': {'key': 'datasourceName', 'type': 'str'}, + 'datasource_id': {'key': 'datasourceId', 'type': 'str'}, + 'datasource_container_name': {'key': 'datasourceContainerName', 'type': 'str'}, + 'coordinator_service_stamp_id': {'key': 'coordinatorServiceStampId', 'type': 'str'}, + 'coordinator_service_stamp_uri': {'key': 'coordinatorServiceStampUri', 'type': 'str'}, + 'protection_service_stamp_id': {'key': 'protectionServiceStampId', 'type': 'str'}, + 'protection_service_stamp_uri': {'key': 'protectionServiceStampUri', 'type': 'str'}, + 'token_extended_information': {'key': 'tokenExtendedInformation', 'type': 'str'}, + } + + def __init__(self, *, access_token_string: str=None, subscription_id: str=None, resource_group_name: str=None, resource_name: str=None, resource_id: str=None, recovery_point_id: str=None, recovery_point_time: str=None, container_name: str=None, container_type: str=None, backup_management_type: str=None, datasource_type: str=None, datasource_name: str=None, datasource_id: str=None, datasource_container_name: str=None, coordinator_service_stamp_id: str=None, coordinator_service_stamp_uri: str=None, protection_service_stamp_id: str=None, protection_service_stamp_uri: str=None, token_extended_information: str=None, **kwargs) -> None: + super(CrrAccessToken, self).__init__(**kwargs) + self.access_token_string = access_token_string + self.subscription_id = subscription_id + self.resource_group_name = resource_group_name + self.resource_name = resource_name + self.resource_id = resource_id + self.recovery_point_id = recovery_point_id + self.recovery_point_time = recovery_point_time + self.container_name = container_name + self.container_type = container_type + self.backup_management_type = backup_management_type + self.datasource_type = datasource_type + self.datasource_name = datasource_name + self.datasource_id = datasource_id + self.datasource_container_name = datasource_container_name + self.coordinator_service_stamp_id = coordinator_service_stamp_id + self.coordinator_service_stamp_uri = coordinator_service_stamp_uri + self.protection_service_stamp_id = protection_service_stamp_id + self.protection_service_stamp_uri = protection_service_stamp_uri + self.token_extended_information = token_extended_information + + +class CrrAccessTokenResource(Resource): + """Container level access token for CRR. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id represents the complete path to the resource. + :vartype id: str + :ivar name: Resource name associated with the resource. + :vartype name: str + :ivar type: Resource type represents the complete path of the form + Namespace/ResourceType/ResourceType/... + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: CrrAccessTokenResource properties + :type properties: ~azure.mgmt.recoveryservicesbackup.models.CrrAccessToken + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CrrAccessToken'}, + } + + def __init__(self, *, location: str=None, tags=None, e_tag: str=None, properties=None, **kwargs) -> None: + super(CrrAccessTokenResource, self).__init__(location=location, tags=tags, e_tag=e_tag, **kwargs) + self.properties = properties + + class DailyRetentionFormat(Model): """Daily retention format. @@ -9042,7 +9323,8 @@ class OperationStatusExtendedInfo(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: OperationStatusJobExtendedInfo, - OperationStatusJobsExtendedInfo, OperationStatusProvisionILRExtendedInfo + OperationStatusJobsExtendedInfo, OperationStatusProvisionILRExtendedInfo, + OperationStatusRecoveryPointExtendedInfo All required parameters must be populated in order to send to Azure. @@ -9059,7 +9341,7 @@ class OperationStatusExtendedInfo(Model): } _subtype_map = { - 'object_type': {'OperationStatusJobExtendedInfo': 'OperationStatusJobExtendedInfo', 'OperationStatusJobsExtendedInfo': 'OperationStatusJobsExtendedInfo', 'OperationStatusProvisionILRExtendedInfo': 'OperationStatusProvisionILRExtendedInfo'} + 'object_type': {'OperationStatusJobExtendedInfo': 'OperationStatusJobExtendedInfo', 'OperationStatusJobsExtendedInfo': 'OperationStatusJobsExtendedInfo', 'OperationStatusProvisionILRExtendedInfo': 'OperationStatusProvisionILRExtendedInfo', 'OperationStatusRecoveryPointExtendedInfo': 'OperationStatusRecoveryPointExtendedInfo'} } def __init__(self, **kwargs) -> None: @@ -9151,6 +9433,39 @@ def __init__(self, *, recovery_target=None, **kwargs) -> None: self.object_type = 'OperationStatusProvisionILRExtendedInfo' +class OperationStatusRecoveryPointExtendedInfo(OperationStatusExtendedInfo): + """Operation status extended info for Updated Recovery Point. + + All required parameters must be populated in order to send to Azure. + + :param object_type: Required. Constant filled by server. + :type object_type: str + :param updated_recovery_point: Recovery Point info with updated source + snapshot URI + :type updated_recovery_point: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPoint + :param deleted_backup_item_version: In case the share is in soft-deleted + state, populate this field with deleted backup item + :type deleted_backup_item_version: str + """ + + _validation = { + 'object_type': {'required': True}, + } + + _attribute_map = { + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'updated_recovery_point': {'key': 'updatedRecoveryPoint', 'type': 'RecoveryPoint'}, + 'deleted_backup_item_version': {'key': 'deletedBackupItemVersion', 'type': 'str'}, + } + + def __init__(self, *, updated_recovery_point=None, deleted_backup_item_version: str=None, **kwargs) -> None: + super(OperationStatusRecoveryPointExtendedInfo, self).__init__(**kwargs) + self.updated_recovery_point = updated_recovery_point + self.deleted_backup_item_version = deleted_backup_item_version + self.object_type = 'OperationStatusRecoveryPointExtendedInfo' + + class PointInTimeRange(Model): """Provides details for log ranges. @@ -10057,19 +10372,24 @@ class TargetRestoreInfo(Model): :param database_name: Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana :type database_name: str + :param target_directory_mapping: This will contain the target folder + mapping for the Full/Diff/Log/Incremental pits. + :type target_directory_mapping: dict[str, str] """ _attribute_map = { 'overwrite_option': {'key': 'overwriteOption', 'type': 'str'}, 'container_id': {'key': 'containerId', 'type': 'str'}, 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'target_directory_mapping': {'key': 'targetDirectoryMapping', 'type': '{str}'}, } - def __init__(self, *, overwrite_option=None, container_id: str=None, database_name: str=None, **kwargs) -> None: + def __init__(self, *, overwrite_option=None, container_id: str=None, database_name: str=None, target_directory_mapping=None, **kwargs) -> None: super(TargetRestoreInfo, self).__init__(**kwargs) self.overwrite_option = overwrite_option self.container_id = container_id self.database_name = database_name + self.target_directory_mapping = target_directory_mapping class TokenInformation(Model): diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_recovery_services_backup_client_enums.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_recovery_services_backup_client_enums.py index ae5858f72a38..91dcf6e96ffd 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_recovery_services_backup_client_enums.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/_recovery_services_backup_client_enums.py @@ -402,6 +402,15 @@ class ScheduleRunType(str, Enum): weekly = "Weekly" +class OperationStatusValues(str, Enum): + + invalid = "Invalid" + in_progress = "InProgress" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + + class SupportStatus(str, Enum): invalid = "Invalid" @@ -534,12 +543,3 @@ class BackupItemType(str, Enum): azure_file_share = "AzureFileShare" sap_hana_database = "SAPHanaDatabase" sap_ase_database = "SAPAseDatabase" - - -class OperationStatusValues(str, Enum): - - invalid = "Invalid" - in_progress = "InProgress" - succeeded = "Succeeded" - failed = "Failed" - canceled = "Canceled" diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/__init__.py index 111256c5d919..629ab81861f5 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/__init__.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/__init__.py @@ -25,6 +25,14 @@ from ._jobs_operations import JobsOperations from ._backup_protected_items_operations import BackupProtectedItemsOperations from ._operation_operations import OperationOperations +from ._aad_properties_operations import AadPropertiesOperations +from ._cross_region_restore_operations import CrossRegionRestoreOperations +from ._backup_crr_job_details_operations import BackupCrrJobDetailsOperations +from ._backup_crr_jobs_operations import BackupCrrJobsOperations +from ._crr_operation_results_operations import CrrOperationResultsOperations +from ._crr_operation_status_operations import CrrOperationStatusOperations +from ._recovery_points_crr_operations import RecoveryPointsCrrOperations +from ._backup_protected_items_crr_operations import BackupProtectedItemsCrrOperations from ._protection_intent_operations import ProtectionIntentOperations from ._backup_status_operations import BackupStatusOperations from ._feature_support_operations import FeatureSupportOperations @@ -65,6 +73,14 @@ 'JobsOperations', 'BackupProtectedItemsOperations', 'OperationOperations', + 'AadPropertiesOperations', + 'CrossRegionRestoreOperations', + 'BackupCrrJobDetailsOperations', + 'BackupCrrJobsOperations', + 'CrrOperationResultsOperations', + 'CrrOperationStatusOperations', + 'RecoveryPointsCrrOperations', + 'BackupProtectedItemsCrrOperations', 'ProtectionIntentOperations', 'BackupStatusOperations', 'FeatureSupportOperations', diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_aad_properties_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_aad_properties_operations.py new file mode 100644 index 000000000000..0305f2dd7933 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_aad_properties_operations.py @@ -0,0 +1,99 @@ +# 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 AadPropertiesOperations(object): + """AadPropertiesOperations 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: "2018-12-20". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-12-20" + + self.config = config + + def get( + self, azure_region, custom_headers=None, raw=False, **operation_config): + """Fetches the AAD properties from target region BCM stamp. + + :param azure_region: Azure region to hit Api + :type azure_region: 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: AADPropertiesResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.recoveryservicesbackup.models.AADPropertiesResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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('AADPropertiesResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupAadProperties/default'} diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_crr_job_details_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_crr_job_details_operations.py new file mode 100644 index 000000000000..caad8ff5af74 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_crr_job_details_operations.py @@ -0,0 +1,98 @@ +# 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 BackupCrrJobDetailsOperations(object): + """BackupCrrJobDetailsOperations 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: "2018-12-20". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-12-20" + + self.config = config + + def get( + self, azure_region, custom_headers=None, raw=False, **operation_config): + """Get CRR job details from target region. + + :param azure_region: Azure region to hit Api + :type azure_region: 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: JobResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.recoveryservicesbackup.models.JobResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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.post(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('JobResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob'} diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_crr_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_crr_jobs_operations.py new file mode 100644 index 000000000000..d90535960676 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_crr_jobs_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class BackupCrrJobsOperations(object): + """BackupCrrJobsOperations 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: "2018-12-20". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-12-20" + + self.config = config + + def list( + self, azure_region, custom_headers=None, raw=False, **operation_config): + """Gets the list of CRR jobs from the target region. + + :param azure_region: Azure region to hit Api + :type azure_region: 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 JobResource + :rtype: + ~azure.mgmt.recoveryservicesbackup.models.JobResourcePaged[~azure.mgmt.recoveryservicesbackup.models.JobResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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.post(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.JobResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJobs'} diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protected_items_crr_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protected_items_crr_operations.py new file mode 100644 index 000000000000..2aaee447ec0e --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_backup_protected_items_crr_operations.py @@ -0,0 +1,122 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class BackupProtectedItemsCrrOperations(object): + """BackupProtectedItemsCrrOperations 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: "2018-12-20". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-12-20" + + self.config = config + + def list( + self, vault_name, resource_group_name, filter=None, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Provides a pageable list of all items that are backed up within a + vault. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + recovery services vault is present. + :type resource_group_name: str + :param filter: OData filter options. + :type filter: str + :param skip_token: skipToken Filter. + :type skip_token: str + :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 ProtectedItemResource + :rtype: + ~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResourcePaged[~azure.mgmt.recoveryservicesbackup.models.ProtectedItemResource] + :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') + 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.ProtectedItemResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems/'} diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_cross_region_restore_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_cross_region_restore_operations.py new file mode 100644 index 000000000000..cc3df5019a74 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_cross_region_restore_operations.py @@ -0,0 +1,98 @@ +# 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 CrossRegionRestoreOperations(object): + """CrossRegionRestoreOperations 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: "2018-12-20". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-12-20" + + self.config = config + + def trigger( + self, azure_region, parameters, custom_headers=None, raw=False, **operation_config): + """Restores the specified backed up data in a different region as compared + to where the data is backed up. + + :param azure_region: Azure region to hit Api + :type azure_region: str + :param parameters: resource cross region restore request + :type parameters: + ~azure.mgmt.recoveryservicesbackup.models.CrossRegionRestoreRequestResource + :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.trigger.metadata['url'] + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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, 'CrossRegionRestoreRequestResource') + + # 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]: + 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 + trigger.metadata = {'url': '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore'} diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_crr_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_crr_operation_results_operations.py new file mode 100644 index 000000000000..d9df69d8ad28 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_crr_operation_results_operations.py @@ -0,0 +1,121 @@ +# 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 CrrOperationResultsOperations(object): + """CrrOperationResultsOperations 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: "2018-12-20". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-12-20" + + self.config = config + + + def _get_initial( + self, azure_region, operation_id, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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.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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def get( + self, azure_region, operation_id, custom_headers=None, raw=False, polling=True, **operation_config): + """ + + :param azure_region: Azure region to hit Api + :type azure_region: str + :param operation_id: + :type operation_id: 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._get_initial( + azure_region=azure_region, + operation_id=operation_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + 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) + get.metadata = {'url': '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationResults/{operationId}'} diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_crr_operation_status_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_crr_operation_status_operations.py new file mode 100644 index 000000000000..d1c7b14f7453 --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_crr_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 CrrOperationStatusOperations(object): + """CrrOperationStatusOperations 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: "2018-12-20". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-12-20" + + self.config = config + + def get( + self, azure_region, operation_id, custom_headers=None, raw=False, **operation_config): + """ + + :param azure_region: Azure region to hit Api + :type azure_region: 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: OperationStatus or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.recoveryservicesbackup.models.OperationStatus or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'azureRegion': self._serialize.url("azure_region", azure_region, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationsStatus/{operationId}'} diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_crr_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_crr_operations.py new file mode 100644 index 000000000000..10e2b275f5ab --- /dev/null +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_crr_operations.py @@ -0,0 +1,128 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RecoveryPointsCrrOperations(object): + """RecoveryPointsCrrOperations 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: "2018-12-20". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-12-20" + + self.config = config + + def list( + self, vault_name, resource_group_name, fabric_name, container_name, protected_item_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the backup copies for the backed up item. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + recovery services vault is present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the backed up item. + :type fabric_name: str + :param container_name: Container name associated with the backed up + item. + :type container_name: str + :param protected_item_name: Backed up item whose backup copies are to + be fetched. + :type protected_item_name: str + :param filter: OData filter options. + :type filter: str + :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 RecoveryPointResource + :rtype: + ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointResourcePaged[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointResource] + :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'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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') + + 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.RecoveryPointResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/'} diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_operations.py index 8241a1b452a2..c12f6bad0c7e 100644 --- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_operations.py +++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/operations/_recovery_points_operations.py @@ -25,7 +25,6 @@ class RecoveryPointsOperations(object): :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: "2019-05-13". """ models = models @@ -35,7 +34,6 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-13" self.config = config @@ -68,6 +66,8 @@ def list( ~azure.mgmt.recoveryservicesbackup.models.RecoveryPointResourcePaged[~azure.mgmt.recoveryservicesbackup.models.RecoveryPointResource] :raises: :class:`CloudError` """ + api_version = "2019-05-13" + def prepare_request(next_link=None): if not next_link: # Construct URL @@ -84,7 +84,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') @@ -160,6 +160,8 @@ def get( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + api_version = "2019-05-13" + # Construct URL url = self.get.metadata['url'] path_format_arguments = { @@ -175,7 +177,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -206,3 +208,81 @@ def get( return deserialized get.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}'} + + def get_access_token( + self, vault_name, resource_group_name, fabric_name, container_name, protected_item_name, recovery_point_id, custom_headers=None, raw=False, **operation_config): + """Returns the Access token for communication between BMS and Protection + service. + + :param vault_name: The name of the recovery services vault. + :type vault_name: str + :param resource_group_name: The name of the resource group where the + recovery services vault is present. + :type resource_group_name: str + :param fabric_name: Fabric name associated with the container. + :type fabric_name: str + :param container_name: Name of the container. + :type container_name: str + :param protected_item_name: Name of the Protected Item. + :type protected_item_name: str + :param recovery_point_id: Recovery Point Id + :type recovery_point_id: str + :param 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: CrrAccessTokenResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.recoveryservicesbackup.models.CrrAccessTokenResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2018-12-20" + + # Construct URL + url = self.get_access_token.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'), + 'fabricName': self._serialize.url("fabric_name", fabric_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'protectedItemName': self._serialize.url("protected_item_name", protected_item_name, 'str'), + 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", 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.post(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('CrrAccessTokenResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_access_token.metadata = {'url': '/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken'}