10
10
# --------------------------------------------------------------------------
11
11
from msrest import Serializer , Deserializer
12
12
from typing import TYPE_CHECKING
13
- import warnings
14
-
15
- from azure .core .exceptions import ClientAuthenticationError , HttpResponseError , ResourceExistsError , ResourceNotFoundError , map_error
16
- from azure .core .pipeline import PipelineResponse
17
- from azure .core .pipeline .transport import HttpRequest , HttpResponse
18
- from azure .core .polling import LROPoller , NoPolling , PollingMethod
19
- from azure .core .polling .base_polling import LROBasePolling
20
13
21
14
if TYPE_CHECKING :
22
15
# pylint: disable=unused-import,ungrouped-imports
23
- from typing import Any , Callable , Dict , Generic , Optional , TypeVar , Union
16
+ from typing import Any , Optional
17
+
18
+ from azure .core .polling import LROPoller
24
19
25
20
26
21
class KeyVaultClientOperationsMixin (object ):
@@ -31,29 +26,34 @@ def begin_full_backup(
31
26
azure_storage_blob_container_uri = None , # type: Optional["_models.SASTokenParameter"]
32
27
** kwargs # type: Any
33
28
):
34
- """Creates a full backup using a user-provided SAS token to an Azure blob storage container.
29
+ # type: (...) -> LROPoller["_models.FullBackupOperation"]
30
+ """Creates a full backup using a user-provided SAS token to an Azure blob storage container. This
31
+ operation is supported only by the Managed HSM service.
35
32
36
33
:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
37
34
:type vault_base_url: str
38
35
:param azure_storage_blob_container_uri: Azure blob shared access signature token pointing to a
39
36
valid Azure blob container where full backup needs to be stored. This token needs to be valid
40
- for at least next 24 hours from the time of making this call.
41
- :type azure_storage_blob_container_uri: ~azure.keyvault.v7_2 .models.SASTokenParameter
37
+ for at least next 24 hours from the time of making this call. Default value is None.
38
+ :type azure_storage_blob_container_uri: ~azure.keyvault.v7_3 .models.SASTokenParameter
42
39
:keyword callable cls: A custom type or function that will be passed the direct response
43
40
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
44
- :keyword polling: By default, your polling method will be LROBasePolling.
45
- Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
41
+ :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for
42
+ this operation to not poll, or pass in your own initialized polling object for a personal
43
+ polling strategy.
46
44
:paramtype polling: bool or ~azure.core.polling.PollingMethod
47
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
48
- :return: An instance of LROPoller that returns either FullBackupOperation or the result of cls(response)
49
- :rtype: ~azure.core.polling.LROPoller[~azure.keyvault.v7_2.models.FullBackupOperation]
50
- :raises ~azure.core.exceptions.HttpResponseError:
45
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
46
+ Retry-After header is present.
47
+ :return: An instance of LROPoller that returns either FullBackupOperation or the result of
48
+ cls(response)
49
+ :rtype: ~azure.core.polling.LROPoller[~azure.keyvault.v7_3.models.FullBackupOperation]
50
+ :raises: ~azure.core.exceptions.HttpResponseError
51
51
"""
52
52
api_version = self ._get_api_version ('begin_full_backup' )
53
53
if api_version == '7.2' :
54
54
from .v7_2 .operations import KeyVaultClientOperationsMixin as OperationClass
55
- elif api_version == '7.3-preview ' :
56
- from .v7_3_preview .operations import KeyVaultClientOperationsMixin as OperationClass
55
+ elif api_version == '7.3' :
56
+ from .v7_3 .operations import KeyVaultClientOperationsMixin as OperationClass
57
57
else :
58
58
raise ValueError ("API version {} does not have operation 'begin_full_backup'" .format (api_version ))
59
59
mixin_instance = OperationClass ()
@@ -70,29 +70,33 @@ def begin_full_restore_operation(
70
70
restore_blob_details = None , # type: Optional["_models.RestoreOperationParameters"]
71
71
** kwargs # type: Any
72
72
):
73
+ # type: (...) -> LROPoller["_models.RestoreOperation"]
73
74
"""Restores all key materials using the SAS token pointing to a previously stored Azure Blob
74
75
storage backup folder.
75
76
76
77
:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
77
78
:type vault_base_url: str
78
79
:param restore_blob_details: The Azure blob SAS token pointing to a folder where the previous
79
- successful full backup was stored.
80
- :type restore_blob_details: ~azure.keyvault.v7_2 .models.RestoreOperationParameters
80
+ successful full backup was stored. Default value is None.
81
+ :type restore_blob_details: ~azure.keyvault.v7_3 .models.RestoreOperationParameters
81
82
:keyword callable cls: A custom type or function that will be passed the direct response
82
83
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
83
- :keyword polling: By default, your polling method will be LROBasePolling.
84
- Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
84
+ :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for
85
+ this operation to not poll, or pass in your own initialized polling object for a personal
86
+ polling strategy.
85
87
:paramtype polling: bool or ~azure.core.polling.PollingMethod
86
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
87
- :return: An instance of LROPoller that returns either RestoreOperation or the result of cls(response)
88
- :rtype: ~azure.core.polling.LROPoller[~azure.keyvault.v7_2.models.RestoreOperation]
89
- :raises ~azure.core.exceptions.HttpResponseError:
88
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
89
+ Retry-After header is present.
90
+ :return: An instance of LROPoller that returns either RestoreOperation or the result of
91
+ cls(response)
92
+ :rtype: ~azure.core.polling.LROPoller[~azure.keyvault.v7_3.models.RestoreOperation]
93
+ :raises: ~azure.core.exceptions.HttpResponseError
90
94
"""
91
95
api_version = self ._get_api_version ('begin_full_restore_operation' )
92
96
if api_version == '7.2' :
93
97
from .v7_2 .operations import KeyVaultClientOperationsMixin as OperationClass
94
- elif api_version == '7.3-preview ' :
95
- from .v7_3_preview .operations import KeyVaultClientOperationsMixin as OperationClass
98
+ elif api_version == '7.3' :
99
+ from .v7_3 .operations import KeyVaultClientOperationsMixin as OperationClass
96
100
else :
97
101
raise ValueError ("API version {} does not have operation 'begin_full_restore_operation'" .format (api_version ))
98
102
mixin_instance = OperationClass ()
@@ -110,6 +114,7 @@ def begin_selective_key_restore_operation(
110
114
restore_blob_details = None , # type: Optional["_models.SelectiveKeyRestoreOperationParameters"]
111
115
** kwargs # type: Any
112
116
):
117
+ # type: (...) -> LROPoller["_models.SelectiveKeyRestoreOperation"]
113
118
"""Restores all key versions of a given key using user supplied SAS token pointing to a previously
114
119
stored Azure Blob storage backup folder.
115
120
@@ -118,23 +123,26 @@ def begin_selective_key_restore_operation(
118
123
:param key_name: The name of the key to be restored from the user supplied backup.
119
124
:type key_name: str
120
125
:param restore_blob_details: The Azure blob SAS token pointing to a folder where the previous
121
- successful full backup was stored.
122
- :type restore_blob_details: ~azure.keyvault.v7_2 .models.SelectiveKeyRestoreOperationParameters
126
+ successful full backup was stored. Default value is None.
127
+ :type restore_blob_details: ~azure.keyvault.v7_3 .models.SelectiveKeyRestoreOperationParameters
123
128
:keyword callable cls: A custom type or function that will be passed the direct response
124
129
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
125
- :keyword polling: By default, your polling method will be LROBasePolling.
126
- Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
130
+ :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for
131
+ this operation to not poll, or pass in your own initialized polling object for a personal
132
+ polling strategy.
127
133
:paramtype polling: bool or ~azure.core.polling.PollingMethod
128
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
129
- :return: An instance of LROPoller that returns either SelectiveKeyRestoreOperation or the result of cls(response)
130
- :rtype: ~azure.core.polling.LROPoller[~azure.keyvault.v7_2.models.SelectiveKeyRestoreOperation]
131
- :raises ~azure.core.exceptions.HttpResponseError:
134
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
135
+ Retry-After header is present.
136
+ :return: An instance of LROPoller that returns either SelectiveKeyRestoreOperation or the
137
+ result of cls(response)
138
+ :rtype: ~azure.core.polling.LROPoller[~azure.keyvault.v7_3.models.SelectiveKeyRestoreOperation]
139
+ :raises: ~azure.core.exceptions.HttpResponseError
132
140
"""
133
141
api_version = self ._get_api_version ('begin_selective_key_restore_operation' )
134
142
if api_version == '7.2' :
135
143
from .v7_2 .operations import KeyVaultClientOperationsMixin as OperationClass
136
- elif api_version == '7.3-preview ' :
137
- from .v7_3_preview .operations import KeyVaultClientOperationsMixin as OperationClass
144
+ elif api_version == '7.3' :
145
+ from .v7_3 .operations import KeyVaultClientOperationsMixin as OperationClass
138
146
else :
139
147
raise ValueError ("API version {} does not have operation 'begin_selective_key_restore_operation'" .format (api_version ))
140
148
mixin_instance = OperationClass ()
@@ -151,6 +159,7 @@ def full_backup_status(
151
159
job_id , # type: str
152
160
** kwargs # type: Any
153
161
):
162
+ # type: (...) -> "_models.FullBackupOperation"
154
163
"""Returns the status of full backup operation.
155
164
156
165
:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
@@ -159,14 +168,14 @@ def full_backup_status(
159
168
:type job_id: str
160
169
:keyword callable cls: A custom type or function that will be passed the direct response
161
170
:return: FullBackupOperation, or the result of cls(response)
162
- :rtype: ~azure.keyvault.v7_2 .models.FullBackupOperation
171
+ :rtype: ~azure.keyvault.v7_3 .models.FullBackupOperation
163
172
:raises: ~azure.core.exceptions.HttpResponseError
164
173
"""
165
174
api_version = self ._get_api_version ('full_backup_status' )
166
175
if api_version == '7.2' :
167
176
from .v7_2 .operations import KeyVaultClientOperationsMixin as OperationClass
168
- elif api_version == '7.3-preview ' :
169
- from .v7_3_preview .operations import KeyVaultClientOperationsMixin as OperationClass
177
+ elif api_version == '7.3' :
178
+ from .v7_3 .operations import KeyVaultClientOperationsMixin as OperationClass
170
179
else :
171
180
raise ValueError ("API version {} does not have operation 'full_backup_status'" .format (api_version ))
172
181
mixin_instance = OperationClass ()
@@ -183,6 +192,7 @@ def restore_status(
183
192
job_id , # type: str
184
193
** kwargs # type: Any
185
194
):
195
+ # type: (...) -> "_models.RestoreOperation"
186
196
"""Returns the status of restore operation.
187
197
188
198
:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
@@ -191,14 +201,14 @@ def restore_status(
191
201
:type job_id: str
192
202
:keyword callable cls: A custom type or function that will be passed the direct response
193
203
:return: RestoreOperation, or the result of cls(response)
194
- :rtype: ~azure.keyvault.v7_2 .models.RestoreOperation
204
+ :rtype: ~azure.keyvault.v7_3 .models.RestoreOperation
195
205
:raises: ~azure.core.exceptions.HttpResponseError
196
206
"""
197
207
api_version = self ._get_api_version ('restore_status' )
198
208
if api_version == '7.2' :
199
209
from .v7_2 .operations import KeyVaultClientOperationsMixin as OperationClass
200
- elif api_version == '7.3-preview ' :
201
- from .v7_3_preview .operations import KeyVaultClientOperationsMixin as OperationClass
210
+ elif api_version == '7.3' :
211
+ from .v7_3 .operations import KeyVaultClientOperationsMixin as OperationClass
202
212
else :
203
213
raise ValueError ("API version {} does not have operation 'restore_status'" .format (api_version ))
204
214
mixin_instance = OperationClass ()
0 commit comments