66
77from azure .core .polling .base_polling import LROBasePolling
88
9- from ._models import BackupOperation , RestoreOperation , SelectiveKeyRestoreOperation
9+ from ._models import KeyVaultBackupOperation , KeyVaultRestoreOperation , KeyVaultSelectiveKeyRestoreOperation
1010from ._internal import KeyVaultClientBase , parse_folder_url
1111from ._internal .polling import KeyVaultBackupClientPolling
1212
@@ -26,36 +26,37 @@ class KeyVaultBackupClient(KeyVaultClientBase):
2626
2727 # pylint:disable=protected-access
2828 def begin_backup (self , blob_storage_url , sas_token , ** kwargs ):
29- # type: (str, str, **Any) -> LROPoller[BackupOperation ]
29+ # type: (str, str, **Any) -> LROPoller[KeyVaultBackupOperation ]
3030 """Begin a full backup of the Key Vault.
3131
3232 :param str blob_storage_url: URL of the blob storage container in which the backup will be stored, for example
3333 https://<account>.blob.core.windows.net/backup
3434 :param str sas_token: a Shared Access Signature (SAS) token authorizing access to the blob storage resource
3535 :keyword str continuation_token: a continuation token to restart polling from a saved state
36- :returns: An instance of an LROPoller. Call `result()` on the poller object to get a :class:`BackupOperation`.
37- :rtype: ~azure.core.polling.LROPoller[BackupOperation]
36+ :returns: An instance of an LROPoller. Call `result()` on the poller object to get a
37+ :class:`KeyVaultBackupOperation`.
38+ :rtype: ~azure.core.polling.LROPoller[~azure.keyvault.administration.KeyVaultBackupOperation]
3839 """
3940 polling_interval = kwargs .pop ("_polling_interval" , 5 )
4041 sas_parameter = self ._models .SASTokenParameter (storage_resource_uri = blob_storage_url , token = sas_token )
4142 return self ._client .begin_full_backup (
4243 vault_base_url = self ._vault_url ,
4344 azure_storage_blob_container_uri = sas_parameter ,
44- cls = BackupOperation ._wrap_generated ,
45+ cls = KeyVaultBackupOperation ._wrap_generated ,
4546 continuation_token = kwargs .pop ("continuation_token" , None ),
4647 polling = LROBasePolling (lro_algorithms = [KeyVaultBackupClientPolling ()], timeout = polling_interval , ** kwargs ),
4748 ** kwargs
4849 )
4950
5051 def begin_restore (self , folder_url , sas_token , ** kwargs ):
51- # type: (str, str, **Any) -> LROPoller[RestoreOperation ]
52+ # type: (str, str, **Any) -> LROPoller[KeyVaultRestoreOperation ]
5253 """Restore a full backup of a Key Vault.
5354
5455 :param str folder_url: URL of the blob holding the backup. This would be the `folder_url` of a
55- :class:`BackupOperation ` returned by :func:`begin_backup` or :func:`get_backup_status`, for example
56+ :class:`KeyVaultBackupOperation ` returned by :func:`begin_backup` or :func:`get_backup_status`, for example
5657 https://<account>.blob.core.windows.net/backup/mhsm-account-2020090117323313
5758 :param str sas_token: a Shared Access Signature (SAS) token authorizing access to the blob storage resource
58- :rtype: ~azure.core.polling.LROPoller[RestoreOperation ]
59+ :rtype: ~azure.core.polling.LROPoller[~azure.keyvault.administration.KeyVaultRestoreOperation ]
5960 """
6061 polling_interval = kwargs .pop ("_polling_interval" , 5 )
6162 container_url , folder_name = parse_folder_url (folder_url )
@@ -66,23 +67,23 @@ def begin_restore(self, folder_url, sas_token, **kwargs):
6667 return self ._client .begin_full_restore_operation (
6768 vault_base_url = self ._vault_url ,
6869 restore_blob_details = restore_details ,
69- cls = RestoreOperation ._wrap_generated ,
70+ cls = KeyVaultRestoreOperation ._wrap_generated ,
7071 continuation_token = kwargs .pop ("continuation_token" , None ),
7172 polling = LROBasePolling (lro_algorithms = [KeyVaultBackupClientPolling ()], timeout = polling_interval , ** kwargs ),
7273 ** kwargs
7374 )
7475
75- def begin_selective_restore (self , folder_url , sas_token , key_name , ** kwargs ):
76- # type: (str, str, str, **Any) -> LROPoller[SelectiveKeyRestoreOperation ]
76+ def begin_selective_key_restore (self , key_name , folder_url , sas_token , ** kwargs ):
77+ # type: (str, str, str, **Any) -> LROPoller[KeyVaultSelectiveKeyRestoreOperation ]
7778 """Restore a single key from a full Key Vault backup.
7879
80+ :param str key_name: name of the key to restore from the backup
7981 :param str folder_url: URL for the blob storage resource, including the path to the blob holding the
80- backup. This would be the `folder_url` of a :class:`BackupOperation ` returned by
82+ backup. This would be the `folder_url` of a :class:`KeyVaultBackupOperation ` returned by
8183 :func:`begin_backup` or :func:`get_backup_status`, for example
8284 https://<account>.blob.core.windows.net/backup/mhsm-account-2020090117323313
8385 :param str sas_token: a Shared Access Signature (SAS) token authorizing access to the blob storage resource
84- :param str key_name: name of the key to restore from the backup
85- :rtype: ~azure.core.polling.LROPoller[RestoreOperation]
86+ :rtype: ~azure.core.polling.LROPoller[~azure.keyvault.administration.KeyVaultSelectiveKeyRestoreOperation]
8687 """
8788 polling_interval = kwargs .pop ("_polling_interval" , 5 )
8889 container_url , folder_name = parse_folder_url (folder_url )
@@ -94,34 +95,34 @@ def begin_selective_restore(self, folder_url, sas_token, key_name, **kwargs):
9495 vault_base_url = self ._vault_url ,
9596 key_name = key_name ,
9697 restore_blob_details = restore_details ,
97- cls = SelectiveKeyRestoreOperation ._wrap_generated ,
98+ cls = KeyVaultSelectiveKeyRestoreOperation ._wrap_generated ,
9899 continuation_token = kwargs .pop ("continuation_token" , None ),
99100 polling = LROBasePolling (lro_algorithms = [KeyVaultBackupClientPolling ()], timeout = polling_interval , ** kwargs ),
100101 ** kwargs
101102 )
102103
103104 def get_backup_status (self , job_id , ** kwargs ):
104- # type: (str, **Any) -> BackupOperation
105+ # type: (str, **Any) -> KeyVaultBackupOperation
105106 """Returns the status of a full backup operation.
106107
107108 :param job_id: The job ID returned as part of the backup request
108109 :type job_id: str
109- :return: The full backup operation status as a :class:`BackupOperation `
110- :rtype: BackupOperation
110+ :return: The full backup operation status as a :class:`KeyVaultBackupOperation `
111+ :rtype: ~azure.keyvault.administration.KeyVaultBackupOperation
111112 """
112113 return self ._client .full_backup_status (
113- vault_base_url = self ._vault_url , job_id = job_id , cls = BackupOperation ._wrap_generated , ** kwargs
114+ vault_base_url = self ._vault_url , job_id = job_id , cls = KeyVaultBackupOperation ._wrap_generated , ** kwargs
114115 )
115116
116117 def get_restore_status (self , job_id , ** kwargs ):
117- # type: (str, **Any) -> RestoreOperation
118+ # type: (str, **Any) -> KeyVaultRestoreOperation
118119 """Returns the status of a restore operation.
119120
120121 :param job_id: The job ID returned as part of the restore request
121122 :type job_id: str
122- :return: The restore operation status as a :class:`RestoreOperation `
123- :rtype: RestoreOperation
123+ :return: The restore operation status as a :class:`KeyVaultRestoreOperation `
124+ :rtype: ~azure.keyvault.administration.KeyVaultRestoreOperation
124125 """
125126 return self ._client .restore_status (
126- vault_base_url = self .vault_url , job_id = job_id , cls = RestoreOperation ._wrap_generated , ** kwargs
127+ vault_base_url = self .vault_url , job_id = job_id , cls = KeyVaultRestoreOperation ._wrap_generated , ** kwargs
127128 )
0 commit comments