Skip to content

Commit c39db1c

Browse files
authored
[Key Vault] Add 7.3 API version, prep for stable releases (#23603)
1 parent 82635d7 commit c39db1c

File tree

640 files changed

+144247
-162768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

640 files changed

+144247
-162768
lines changed

sdk/keyvault/azure-keyvault-administration/CHANGELOG.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# Release History
22

3-
## 4.1.0b4 (Unreleased)
3+
## 4.1.0 (2022-03-24)
44

55
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
6+
- Key Vault API version 7.3 is now the default
7+
- Added support for multi-tenant authentication when using `azure-identity`
8+
1.8.0 or newer ([#20698](https://github.com/Azure/azure-sdk-for-python/issues/20698))
109

1110
### Other Changes
1211
- (From 4.1.0b3) Python 2.7 is no longer supported. Please use Python version 3.6 or later.

sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_generated/_key_vault_client.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111

1212
from typing import TYPE_CHECKING
1313

14+
from msrest import Deserializer, Serializer
15+
1416
from azure.core import PipelineClient
1517
from azure.profiles import KnownProfiles, ProfileDefinition
1618
from azure.profiles.multiapiclient import MultiApiClientMixin
17-
from msrest import Deserializer, Serializer
1819

1920
from ._configuration import KeyVaultClientConfiguration
2021
from ._operations_mixin import KeyVaultClientOperationsMixin
@@ -23,8 +24,6 @@
2324
# pylint: disable=unused-import,ungrouped-imports
2425
from typing import Any, Optional
2526

26-
from azure.core.pipeline.transport import HttpRequest, HttpResponse
27-
2827
class _SDKClient(object):
2928
def __init__(self, *args, **kwargs):
3029
"""This is a fake class to support current implemetation of MultiApiClientMixin."
@@ -49,7 +48,7 @@ class KeyVaultClient(KeyVaultClientOperationsMixin, MultiApiClientMixin, _SDKCli
4948
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
5049
"""
5150

52-
DEFAULT_API_VERSION = '7.2'
51+
DEFAULT_API_VERSION = '7.3'
5352
_PROFILE_TAG = "azure.keyvault.KeyVaultClient"
5453
LATEST_PROFILE = ProfileDefinition({
5554
_PROFILE_TAG: {
@@ -64,7 +63,7 @@ def __init__(
6463
profile=KnownProfiles.default, # type: KnownProfiles
6564
**kwargs # type: Any
6665
):
67-
if api_version == '7.2' or api_version == '7.3-preview':
66+
if api_version == '7.2' or api_version == '7.3':
6867
base_url = '{vaultBaseUrl}'
6968
else:
7069
raise ValueError("API version {} is not available".format(api_version))
@@ -84,13 +83,13 @@ def models(cls, api_version=DEFAULT_API_VERSION):
8483
"""Module depends on the API version:
8584
8685
* 7.2: :mod:`v7_2.models<azure.keyvault.v7_2.models>`
87-
* 7.3-preview: :mod:`v7_3_preview.models<azure.keyvault.v7_3_preview.models>`
86+
* 7.3: :mod:`v7_3.models<azure.keyvault.v7_3.models>`
8887
"""
8988
if api_version == '7.2':
9089
from .v7_2 import models
9190
return models
92-
elif api_version == '7.3-preview':
93-
from .v7_3_preview import models
91+
elif api_version == '7.3':
92+
from .v7_3 import models
9493
return models
9594
raise ValueError("API version {} is not available".format(api_version))
9695

@@ -99,13 +98,13 @@ def role_assignments(self):
9998
"""Instance depends on the API version:
10099
101100
* 7.2: :class:`RoleAssignmentsOperations<azure.keyvault.v7_2.operations.RoleAssignmentsOperations>`
102-
* 7.3-preview: :class:`RoleAssignmentsOperations<azure.keyvault.v7_3_preview.operations.RoleAssignmentsOperations>`
101+
* 7.3: :class:`RoleAssignmentsOperations<azure.keyvault.v7_3.operations.RoleAssignmentsOperations>`
103102
"""
104103
api_version = self._get_api_version('role_assignments')
105104
if api_version == '7.2':
106105
from .v7_2.operations import RoleAssignmentsOperations as OperationClass
107-
elif api_version == '7.3-preview':
108-
from .v7_3_preview.operations import RoleAssignmentsOperations as OperationClass
106+
elif api_version == '7.3':
107+
from .v7_3.operations import RoleAssignmentsOperations as OperationClass
109108
else:
110109
raise ValueError("API version {} does not have operation group 'role_assignments'".format(api_version))
111110
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@@ -115,13 +114,13 @@ def role_definitions(self):
115114
"""Instance depends on the API version:
116115
117116
* 7.2: :class:`RoleDefinitionsOperations<azure.keyvault.v7_2.operations.RoleDefinitionsOperations>`
118-
* 7.3-preview: :class:`RoleDefinitionsOperations<azure.keyvault.v7_3_preview.operations.RoleDefinitionsOperations>`
117+
* 7.3: :class:`RoleDefinitionsOperations<azure.keyvault.v7_3.operations.RoleDefinitionsOperations>`
119118
"""
120119
api_version = self._get_api_version('role_definitions')
121120
if api_version == '7.2':
122121
from .v7_2.operations import RoleDefinitionsOperations as OperationClass
123-
elif api_version == '7.3-preview':
124-
from .v7_3_preview.operations import RoleDefinitionsOperations as OperationClass
122+
elif api_version == '7.3':
123+
from .v7_3.operations import RoleDefinitionsOperations as OperationClass
125124
else:
126125
raise ValueError("API version {} does not have operation group 'role_definitions'".format(api_version))
127126
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

sdk/keyvault/azure-keyvault-administration/azure/keyvault/administration/_generated/_operations_mixin.py

Lines changed: 55 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,12 @@
1010
# --------------------------------------------------------------------------
1111
from msrest import Serializer, Deserializer
1212
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
2013

2114
if TYPE_CHECKING:
2215
# 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
2419

2520

2621
class KeyVaultClientOperationsMixin(object):
@@ -31,29 +26,34 @@ def begin_full_backup(
3126
azure_storage_blob_container_uri=None, # type: Optional["_models.SASTokenParameter"]
3227
**kwargs # type: Any
3328
):
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.
3532
3633
:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
3734
:type vault_base_url: str
3835
:param azure_storage_blob_container_uri: Azure blob shared access signature token pointing to a
3936
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
4239
:keyword callable cls: A custom type or function that will be passed the direct response
4340
: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.
4644
: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
5151
"""
5252
api_version = self._get_api_version('begin_full_backup')
5353
if api_version == '7.2':
5454
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
5757
else:
5858
raise ValueError("API version {} does not have operation 'begin_full_backup'".format(api_version))
5959
mixin_instance = OperationClass()
@@ -70,29 +70,33 @@ def begin_full_restore_operation(
7070
restore_blob_details=None, # type: Optional["_models.RestoreOperationParameters"]
7171
**kwargs # type: Any
7272
):
73+
# type: (...) -> LROPoller["_models.RestoreOperation"]
7374
"""Restores all key materials using the SAS token pointing to a previously stored Azure Blob
7475
storage backup folder.
7576
7677
:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
7778
:type vault_base_url: str
7879
: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
8182
:keyword callable cls: A custom type or function that will be passed the direct response
8283
: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.
8587
: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
9094
"""
9195
api_version = self._get_api_version('begin_full_restore_operation')
9296
if api_version == '7.2':
9397
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
96100
else:
97101
raise ValueError("API version {} does not have operation 'begin_full_restore_operation'".format(api_version))
98102
mixin_instance = OperationClass()
@@ -110,6 +114,7 @@ def begin_selective_key_restore_operation(
110114
restore_blob_details=None, # type: Optional["_models.SelectiveKeyRestoreOperationParameters"]
111115
**kwargs # type: Any
112116
):
117+
# type: (...) -> LROPoller["_models.SelectiveKeyRestoreOperation"]
113118
"""Restores all key versions of a given key using user supplied SAS token pointing to a previously
114119
stored Azure Blob storage backup folder.
115120
@@ -118,23 +123,26 @@ def begin_selective_key_restore_operation(
118123
:param key_name: The name of the key to be restored from the user supplied backup.
119124
:type key_name: str
120125
: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
123128
:keyword callable cls: A custom type or function that will be passed the direct response
124129
: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.
127133
: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
132140
"""
133141
api_version = self._get_api_version('begin_selective_key_restore_operation')
134142
if api_version == '7.2':
135143
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
138146
else:
139147
raise ValueError("API version {} does not have operation 'begin_selective_key_restore_operation'".format(api_version))
140148
mixin_instance = OperationClass()
@@ -151,6 +159,7 @@ def full_backup_status(
151159
job_id, # type: str
152160
**kwargs # type: Any
153161
):
162+
# type: (...) -> "_models.FullBackupOperation"
154163
"""Returns the status of full backup operation.
155164
156165
:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
@@ -159,14 +168,14 @@ def full_backup_status(
159168
:type job_id: str
160169
:keyword callable cls: A custom type or function that will be passed the direct response
161170
:return: FullBackupOperation, or the result of cls(response)
162-
:rtype: ~azure.keyvault.v7_2.models.FullBackupOperation
171+
:rtype: ~azure.keyvault.v7_3.models.FullBackupOperation
163172
:raises: ~azure.core.exceptions.HttpResponseError
164173
"""
165174
api_version = self._get_api_version('full_backup_status')
166175
if api_version == '7.2':
167176
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
170179
else:
171180
raise ValueError("API version {} does not have operation 'full_backup_status'".format(api_version))
172181
mixin_instance = OperationClass()
@@ -183,6 +192,7 @@ def restore_status(
183192
job_id, # type: str
184193
**kwargs # type: Any
185194
):
195+
# type: (...) -> "_models.RestoreOperation"
186196
"""Returns the status of restore operation.
187197
188198
:param vault_base_url: The vault name, for example https://myvault.vault.azure.net.
@@ -191,14 +201,14 @@ def restore_status(
191201
:type job_id: str
192202
:keyword callable cls: A custom type or function that will be passed the direct response
193203
:return: RestoreOperation, or the result of cls(response)
194-
:rtype: ~azure.keyvault.v7_2.models.RestoreOperation
204+
:rtype: ~azure.keyvault.v7_3.models.RestoreOperation
195205
:raises: ~azure.core.exceptions.HttpResponseError
196206
"""
197207
api_version = self._get_api_version('restore_status')
198208
if api_version == '7.2':
199209
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
202212
else:
203213
raise ValueError("API version {} does not have operation 'restore_status'".format(api_version))
204214
mixin_instance = OperationClass()

0 commit comments

Comments
 (0)