Skip to content

Commit 1da805c

Browse files
authored
Kv mgmt 2.0.0 (Azure#5929)
* Regenerate KV Mgmt with Autorest v4 + full multiapi * Delete deprecated file * ChangeLog
1 parent d9b60b4 commit 1da805c

File tree

65 files changed

+1985
-2451
lines changed

Some content is hidden

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

65 files changed

+1985
-2451
lines changed

sdk/keyvault/azure-mgmt-keyvault/HISTORY.rst

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,30 @@
22
33
Release History
44
===============
5-
1.1.0 (2018-08-07)
6-
++++++++++++++++++++
5+
6+
2.0.0 (2019-06-18)
7+
++++++++++++++++++
8+
9+
**General Breaking changes**
10+
11+
This version uses a next-generation code generator that *might* introduce breaking changes if you were importing from the v20xx_yy_zz API folders.
12+
In summary, some modules were incorrectly visible/importable and have been renamed. This fixed several issues caused by usage of classes that were not supposed to be used in the first place.
13+
14+
- KeyVaultManagementClient cannot be imported from `azure.mgmt.key_vault.v20xx_yy_zz.key_vault_management_client` anymore (import from `azure.mgmt.key_vault.v20xx_yy_zz` works like before)
15+
- KeyVaultManagementClientConfiguration import has been moved from `azure.mgmt.key_vault.v20xx_yy_zz.key_vault_management_client` to `azure.mgmt.key_vault.v20xx_yy_zz`
16+
- A model `MyClass` from a "models" sub-module cannot be imported anymore using `azure.mgmt.key_vault.v20xx_yy_zz.models.my_class` (import from `azure.mgmt.key_vault.v20xx_yy_zz.models` works like before)
17+
- An operation class `MyClassOperations` from an `operations` sub-module cannot be imported anymore using `azure.mgmt.key_vault.v20xx_yy_zz.operations.my_class_operations` (import from `azure.mgmt.key_vault.v20xx_yy_zz.operations` works like before)
18+
19+
Last but not least, HTTP connection pooling is now enabled by default. You should always use a client as a context manager, or call close(), or use no more than one client per process.
20+
21+
22+
1.1.0 (2018-08-07)
23+
++++++++++++++++++
724

825
* Adding support for multi-api and API profiles
926

10-
1.0.0 (2018-06-27)
11-
++++++++++++++++++++
27+
1.0.0 (2018-06-27)
28+
++++++++++++++++++
1229

1330
* Moving azure-mgmt-keyvault to stable API version 2018-02-14
1431

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from .key_vault_management_client import KeyVaultManagementClient
13-
from .version import VERSION
12+
from ._configuration import KeyVaultManagementClientConfiguration
13+
from ._key_vault_management_client import KeyVaultManagementClient
14+
__all__ = ['KeyVaultManagementClient', 'KeyVaultManagementClientConfiguration']
1415

15-
__all__ = ['KeyVaultManagementClient']
16+
from .version import VERSION
1617

1718
__version__ = VERSION
1819

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
from msrestazure import AzureConfiguration
12+
13+
from .version import VERSION
14+
15+
16+
class KeyVaultManagementClientConfiguration(AzureConfiguration):
17+
"""Configuration for KeyVaultManagementClient
18+
Note that all parameters used to create this instance are saved as instance
19+
attributes.
20+
21+
:param credentials: Credentials needed for the client to connect to Azure.
22+
:type credentials: :mod:`A msrestazure Credentials
23+
object<msrestazure.azure_active_directory>`
24+
:param subscription_id: Subscription credentials which uniquely identify
25+
Microsoft Azure subscription. The subscription ID forms part of the URI
26+
for every service call.
27+
:type subscription_id: str
28+
:param str base_url: Service URL
29+
"""
30+
31+
def __init__(
32+
self, credentials, subscription_id, base_url=None):
33+
34+
if credentials is None:
35+
raise ValueError("Parameter 'credentials' must not be None.")
36+
if subscription_id is None:
37+
raise ValueError("Parameter 'subscription_id' must not be None.")
38+
if not base_url:
39+
base_url = 'https://management.azure.com'
40+
41+
super(KeyVaultManagementClientConfiguration, self).__init__(base_url)
42+
43+
# Starting Autorest.Python 4.0.64, make connection pool activated by default
44+
self.keep_alive = True
45+
46+
self.add_user_agent('azure-mgmt-keyvault/{}'.format(VERSION))
47+
self.add_user_agent('Azure-SDK-For-Python')
48+
49+
self.credentials = credentials
50+
self.subscription_id = subscription_id

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/key_vault_management_client.py renamed to sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/_key_vault_management_client.py

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,50 +11,24 @@
1111

1212
from msrest.service_client import SDKClient
1313
from msrest import Serializer, Deserializer
14-
from msrestazure import AzureConfiguration
1514

1615
from azure.profiles import KnownProfiles, ProfileDefinition
1716
from azure.profiles.multiapiclient import MultiApiClientMixin
18-
from .version import VERSION
17+
from ._configuration import KeyVaultManagementClientConfiguration
1918

2019

21-
class KeyVaultManagementClientConfiguration(AzureConfiguration):
22-
"""Configuration for KeyVaultManagementClient
23-
Note that all parameters used to create this instance are saved as instance
24-
attributes.
25-
26-
:param credentials: Credentials needed for the client to connect to Azure.
27-
:type credentials: :mod:`A msrestazure Credentials
28-
object<msrestazure.azure_active_directory>`
29-
:param subscription_id: Subscription credentials which uniquely identify
30-
Microsoft Azure subscription. The subscription ID forms part of the URI
31-
for every service call.
32-
:type subscription_id: str
33-
:param str base_url: Service URL
34-
"""
35-
36-
def __init__(
37-
self, credentials, subscription_id, base_url=None):
38-
39-
if credentials is None:
40-
raise ValueError("Parameter 'credentials' must not be None.")
41-
if subscription_id is None:
42-
raise ValueError("Parameter 'subscription_id' must not be None.")
43-
if not base_url:
44-
base_url = 'https://management.azure.com'
45-
46-
super(KeyVaultManagementClientConfiguration, self).__init__(base_url)
47-
48-
self.add_user_agent('azure-mgmt-keyvault/{}'.format(VERSION))
49-
self.add_user_agent('Azure-SDK-For-Python')
50-
51-
self.credentials = credentials
52-
self.subscription_id = subscription_id
53-
5420

5521
class KeyVaultManagementClient(MultiApiClientMixin, SDKClient):
5622
"""The Azure management API provides a RESTful set of web services that interact with Azure Key Vault.
5723
24+
This ready contains multiple API versions, to help you deal with all Azure clouds
25+
(Azure Stack, Azure Government, Azure China, etc.).
26+
By default, uses latest API version available on public Azure.
27+
For production, you should stick a particular api-version and/or profile.
28+
The profile sets a mapping between the operation group and an API version.
29+
The api-version parameter sets the default API version if the operation
30+
group is not described in the profile.
31+
5832
:ivar config: Configuration for client.
5933
:vartype config: KeyVaultManagementClientConfiguration
6034
@@ -76,7 +50,7 @@ class KeyVaultManagementClient(MultiApiClientMixin, SDKClient):
7650
_PROFILE_TAG = "azure.mgmt.keyvault.KeyVaultManagementClient"
7751
LATEST_PROFILE = ProfileDefinition({
7852
_PROFILE_TAG: {
79-
None: DEFAULT_API_VERSION
53+
None: DEFAULT_API_VERSION,
8054
}},
8155
_PROFILE_TAG + " latest"
8256
)
@@ -90,8 +64,6 @@ def __init__(self, credentials, subscription_id, api_version=None, base_url=None
9064
profile=profile
9165
)
9266

93-
############ Generated from here ############
94-
9567
@classmethod
9668
def _models_dict(cls, api_version):
9769
return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/models.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44
# Licensed under the MIT License. See License.txt in the project root for
55
# license information.
66
# --------------------------------------------------------------------------
7-
import warnings
8-
97
from .v2018_02_14.models import *

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from .key_vault_management_client import KeyVaultManagementClient
13-
from .version import VERSION
12+
from ._configuration import KeyVaultManagementClientConfiguration
13+
from ._key_vault_management_client import KeyVaultManagementClient
14+
__all__ = ['KeyVaultManagementClient', 'KeyVaultManagementClientConfiguration']
1415

15-
__all__ = ['KeyVaultManagementClient']
16+
from .version import VERSION
1617

1718
__version__ = VERSION
1819

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
from msrestazure import AzureConfiguration
12+
13+
from .version import VERSION
14+
15+
16+
class KeyVaultManagementClientConfiguration(AzureConfiguration):
17+
"""Configuration for KeyVaultManagementClient
18+
Note that all parameters used to create this instance are saved as instance
19+
attributes.
20+
21+
:param credentials: Credentials needed for the client to connect to Azure.
22+
:type credentials: :mod:`A msrestazure Credentials
23+
object<msrestazure.azure_active_directory>`
24+
:param subscription_id: Subscription credentials which uniquely identify
25+
Microsoft Azure subscription. The subscription ID forms part of the URI
26+
for every service call.
27+
:type subscription_id: str
28+
:param str base_url: Service URL
29+
"""
30+
31+
def __init__(
32+
self, credentials, subscription_id, base_url=None):
33+
34+
if credentials is None:
35+
raise ValueError("Parameter 'credentials' must not be None.")
36+
if subscription_id is None:
37+
raise ValueError("Parameter 'subscription_id' must not be None.")
38+
if not base_url:
39+
base_url = 'https://management.azure.com'
40+
41+
super(KeyVaultManagementClientConfiguration, self).__init__(base_url)
42+
43+
# Starting Autorest.Python 4.0.64, make connection pool activated by default
44+
self.keep_alive = True
45+
46+
self.add_user_agent('azure-mgmt-keyvault/{}'.format(VERSION))
47+
self.add_user_agent('Azure-SDK-For-Python')
48+
49+
self.credentials = credentials
50+
self.subscription_id = subscription_id

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/key_vault_management_client.py renamed to sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/_key_vault_management_client.py

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,11 @@
1111

1212
from msrest.service_client import SDKClient
1313
from msrest import Serializer, Deserializer
14-
from msrestazure import AzureConfiguration
15-
from .version import VERSION
16-
from .operations.vaults_operations import VaultsOperations
17-
from .operations.operations import Operations
18-
from . import models
19-
20-
21-
class KeyVaultManagementClientConfiguration(AzureConfiguration):
22-
"""Configuration for KeyVaultManagementClient
23-
Note that all parameters used to create this instance are saved as instance
24-
attributes.
25-
26-
:param credentials: Credentials needed for the client to connect to Azure.
27-
:type credentials: :mod:`A msrestazure Credentials
28-
object<msrestazure.azure_active_directory>`
29-
:param subscription_id: Subscription credentials which uniquely identify
30-
Microsoft Azure subscription. The subscription ID forms part of the URI
31-
for every service call.
32-
:type subscription_id: str
33-
:param str base_url: Service URL
34-
"""
35-
36-
def __init__(
37-
self, credentials, subscription_id, base_url=None):
38-
39-
if credentials is None:
40-
raise ValueError("Parameter 'credentials' must not be None.")
41-
if subscription_id is None:
42-
raise ValueError("Parameter 'subscription_id' must not be None.")
43-
if not base_url:
44-
base_url = 'https://management.azure.com'
45-
46-
super(KeyVaultManagementClientConfiguration, self).__init__(base_url)
4714

48-
self.add_user_agent('azure-mgmt-keyvault/{}'.format(VERSION))
49-
self.add_user_agent('Azure-SDK-For-Python')
50-
51-
self.credentials = credentials
52-
self.subscription_id = subscription_id
15+
from ._configuration import KeyVaultManagementClientConfiguration
16+
from .operations import VaultsOperations
17+
from .operations import Operations
18+
from . import models
5319

5420

5521
class KeyVaultManagementClient(SDKClient):

0 commit comments

Comments
 (0)