Skip to content

Commit

Permalink
Add backup/restore status methods to KeyVaultBackupClient + tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mccoyp committed Oct 2, 2020
1 parent 733fa85 commit 0305d06
Show file tree
Hide file tree
Showing 8 changed files with 1,219 additions and 296 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,29 +95,33 @@ def begin_selective_restore(self, blob_storage_uri, sas_token, folder_name, key_
)

def full_backup_status(self, job_id, **kwargs):
# type: (str, **Any) -> BackupOperation
"""Returns the status of a full backup operation.
:param job_id: The job ID returned as part of the backup request.
:param job_id: The job ID returned as part of the backup request
:type job_id: str
:return: The full backup operation status as a :class:`BackupOperation`
:rtype: ~azure.keyvault.v7_2.models.FullBackupOperation
:rtype: BackupOperation
"""
return self._client.full_backup_status(
vault_base_url=self._vault_url,
job_id=job_id,
vault_base_url=self._vault_url,
job_id=job_id,
cls=BackupOperation._wrap_generated,
**kwargs
)

def restore_status(self, job_id, **kwargs):
# type: (str, **Any) -> RestoreOperation
"""Returns the status of a restore operation.
:param job_id: The job ID returned as part of the restore operation.
:param job_id: The job ID returned as part of the restore request
:type job_id: str
:return: The restore operation status as a :class:`RestoreOperation`
:rtype: ~azure.keyvault.v7_2.models.RestoreOperation
:rtype: RestoreOperation
"""
return self._client.restore_status(
vault_base_url=self.vault_url,
job_id=job_id,
cls=RestoreOperation._wrap_generated,
**kwargs
)
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,35 @@ async def begin_selective_restore(
),
**kwargs
)

async def full_backup_status(
self, job_id: str, **kwargs: "Any"
) -> "BackupOperation":
"""Returns the status of a full backup operation.
:param str job_id: The job ID returned as part of the backup request
:returns: The full backup operation status as a :class:`BackupOperation`
:rtype: BackupOperation
"""
return await self._client.full_backup_status(
vault_base_url=self._vault_url,
job_id=job_id,
cls=BackupOperation._wrap_generated,
**kwargs
)

async def restore_status(
self, job_id: str, **kwargs: "Any"
) -> "RestoreOperation":
"""Returns the status of a restore operation.
:param str job_id: The ID returned as part of the restore request
:returns: The restore operation status as a :class:`RestoreOperation`
:rtype: RestoreOperation
"""
return await self._client.restore_status(
vault_base_url=self._vault_url,
job_id=job_id,
cls=RestoreOperation._wrap_generated,
**kwargs
)
Loading

0 comments on commit 0305d06

Please sign in to comment.