Skip to content

Commit a1598d7

Browse files
lmazuelZim Kalinowski
authored and
Zim Kalinowski
committed
Compute with autorest v4
1 parent 932cf73 commit a1598d7

File tree

2,824 files changed

+177168
-205033
lines changed

Some content is hidden

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

2,824 files changed

+177168
-205033
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
Release History
44
===============
55

6+
6.0.0 (2019-XX-XX)
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+
- ComputeManagementClient cannot be imported from `azure.mgmt.compute.v20xx_yy_zz.compute_management_client` anymore (import from `azure.mgmt.compute.v20xx_yy_zz` works like before)
15+
- ComputeManagementClientConfiguration import has been moved from `azure.mgmt.compute.v20xx_yy_zz.compute_management_client` to `azure.mgmt.compute.v20xx_yy_zz`
16+
- A model `MyClass` from a "models" sub-module cannot be imported anymore using `azure.mgmt.compute.v20xx_yy_zz.models.my_class` (import from `azure.mgmt.compute.v20xx_yy_zz.models` works like before)
17+
- An operation class `MyClassOperations` from an `operations` sub-module cannot be imported anymore using `azure.mgmt.compute.v20xx_yy_zz.operations.my_class_operations` (import from `azure.mgmt.compute.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+
621
5.0.0 (2019-04-26)
722
++++++++++++++++++
823

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
# coding=utf-8
1+
# coding=utf-8
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for
55
# 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.
610
# --------------------------------------------------------------------------
711

8-
from .compute_management_client import ComputeManagementClient
12+
from ._configuration import ComputeManagementClientConfiguration
13+
from ._compute_management_client import ComputeManagementClient
14+
__all__ = ['ComputeManagementClient', 'ComputeManagementClientConfiguration']
15+
916
from .version import VERSION
1017

1118
__version__ = VERSION
12-
__all__ = ['ComputeManagementClient']
19+

sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py

Lines changed: 782 additions & 0 deletions
Large diffs are not rendered by default.
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 ComputeManagementClientConfiguration(AzureConfiguration):
17+
"""Configuration for ComputeManagementClient
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(ComputeManagementClientConfiguration, 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-compute/{}'.format(VERSION))
47+
self.add_user_agent('Azure-SDK-For-Python')
48+
49+
self.credentials = credentials
50+
self.subscription_id = subscription_id

sdk/compute/azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py

Lines changed: 0 additions & 800 deletions
This file was deleted.

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
# coding=utf-8
1+
# coding=utf-8
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for
55
# license information.
66
# --------------------------------------------------------------------------
7-
import warnings
8-
7+
from .v2015_06_15.models import *
8+
from .v2016_03_30.models import *
9+
from .v2016_04_30_preview.models import *
10+
from .v2017_03_30.models import *
11+
from .v2017_09_01.models import *
12+
from .v2017_12_01.models import *
13+
from .v2018_04_01.models import *
14+
from .v2018_06_01.models import *
915
from .v2018_09_30.models import *
10-
from .v2019_03_01.models import * # Note that this line is overriding some models of 2018-09-01. See link below for details.
16+
from .v2018_10_01.models import *
17+
from .v2019_03_01.models import *
1118
from .v2019_04_01.models import *
12-
13-
warnings.warn("Import models from this file is deprecated. See https://aka.ms/pysdkmodels",
14-
DeprecationWarning)

sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/__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 .compute_management_client import ComputeManagementClient
13-
from .version import VERSION
12+
from ._configuration import ComputeManagementClientConfiguration
13+
from ._compute_management_client import ComputeManagementClient
14+
__all__ = ['ComputeManagementClient', 'ComputeManagementClientConfiguration']
1415

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

1718
__version__ = VERSION
1819

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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+
12+
from msrest.service_client import SDKClient
13+
from msrest import Serializer, Deserializer
14+
15+
from ._configuration import ComputeManagementClientConfiguration
16+
from .operations import AvailabilitySetsOperations
17+
from .operations import VirtualMachineExtensionImagesOperations
18+
from .operations import VirtualMachineExtensionsOperations
19+
from .operations import VirtualMachineImagesOperations
20+
from .operations import UsageOperations
21+
from .operations import VirtualMachineSizesOperations
22+
from .operations import VirtualMachinesOperations
23+
from .operations import VirtualMachineScaleSetsOperations
24+
from .operations import VirtualMachineScaleSetVMsOperations
25+
from . import models
26+
27+
28+
class ComputeManagementClient(SDKClient):
29+
"""Compute Client
30+
31+
:ivar config: Configuration for client.
32+
:vartype config: ComputeManagementClientConfiguration
33+
34+
:ivar availability_sets: AvailabilitySets operations
35+
:vartype availability_sets: azure.mgmt.compute.v2015_06_15.operations.AvailabilitySetsOperations
36+
:ivar virtual_machine_extension_images: VirtualMachineExtensionImages operations
37+
:vartype virtual_machine_extension_images: azure.mgmt.compute.v2015_06_15.operations.VirtualMachineExtensionImagesOperations
38+
:ivar virtual_machine_extensions: VirtualMachineExtensions operations
39+
:vartype virtual_machine_extensions: azure.mgmt.compute.v2015_06_15.operations.VirtualMachineExtensionsOperations
40+
:ivar virtual_machine_images: VirtualMachineImages operations
41+
:vartype virtual_machine_images: azure.mgmt.compute.v2015_06_15.operations.VirtualMachineImagesOperations
42+
:ivar usage: Usage operations
43+
:vartype usage: azure.mgmt.compute.v2015_06_15.operations.UsageOperations
44+
:ivar virtual_machine_sizes: VirtualMachineSizes operations
45+
:vartype virtual_machine_sizes: azure.mgmt.compute.v2015_06_15.operations.VirtualMachineSizesOperations
46+
:ivar virtual_machines: VirtualMachines operations
47+
:vartype virtual_machines: azure.mgmt.compute.v2015_06_15.operations.VirtualMachinesOperations
48+
:ivar virtual_machine_scale_sets: VirtualMachineScaleSets operations
49+
:vartype virtual_machine_scale_sets: azure.mgmt.compute.v2015_06_15.operations.VirtualMachineScaleSetsOperations
50+
:ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMs operations
51+
:vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2015_06_15.operations.VirtualMachineScaleSetVMsOperations
52+
53+
:param credentials: Credentials needed for the client to connect to Azure.
54+
:type credentials: :mod:`A msrestazure Credentials
55+
object<msrestazure.azure_active_directory>`
56+
:param subscription_id: Subscription credentials which uniquely identify
57+
Microsoft Azure subscription. The subscription ID forms part of the URI
58+
for every service call.
59+
:type subscription_id: str
60+
:param str base_url: Service URL
61+
"""
62+
63+
def __init__(
64+
self, credentials, subscription_id, base_url=None):
65+
66+
self.config = ComputeManagementClientConfiguration(credentials, subscription_id, base_url)
67+
super(ComputeManagementClient, self).__init__(self.config.credentials, self.config)
68+
69+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
70+
self.api_version = '2015-06-15'
71+
self._serialize = Serializer(client_models)
72+
self._deserialize = Deserializer(client_models)
73+
74+
self.availability_sets = AvailabilitySetsOperations(
75+
self._client, self.config, self._serialize, self._deserialize)
76+
self.virtual_machine_extension_images = VirtualMachineExtensionImagesOperations(
77+
self._client, self.config, self._serialize, self._deserialize)
78+
self.virtual_machine_extensions = VirtualMachineExtensionsOperations(
79+
self._client, self.config, self._serialize, self._deserialize)
80+
self.virtual_machine_images = VirtualMachineImagesOperations(
81+
self._client, self.config, self._serialize, self._deserialize)
82+
self.usage = UsageOperations(
83+
self._client, self.config, self._serialize, self._deserialize)
84+
self.virtual_machine_sizes = VirtualMachineSizesOperations(
85+
self._client, self.config, self._serialize, self._deserialize)
86+
self.virtual_machines = VirtualMachinesOperations(
87+
self._client, self.config, self._serialize, self._deserialize)
88+
self.virtual_machine_scale_sets = VirtualMachineScaleSetsOperations(
89+
self._client, self.config, self._serialize, self._deserialize)
90+
self.virtual_machine_scale_set_vms = VirtualMachineScaleSetVMsOperations(
91+
self._client, self.config, self._serialize, self._deserialize)
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 ComputeManagementClientConfiguration(AzureConfiguration):
17+
"""Configuration for ComputeManagementClient
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(ComputeManagementClientConfiguration, 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-compute/{}'.format(VERSION))
47+
self.add_user_agent('Azure-SDK-For-Python')
48+
49+
self.credentials = credentials
50+
self.subscription_id = subscription_id

0 commit comments

Comments
 (0)