Skip to content

Commit 7c81b39

Browse files
authored
Generated from f2f595089c0038c9109c3221d2f04f8d0019a04e (#2164)
Plug disks 2018-04-01 for multi api versionning
1 parent c8a4a92 commit 7c81b39

Some content is hidden

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

51 files changed

+3762
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
108108
* 2017-03-30: :mod:`v2017_03_30.models<azure.mgmt.compute.v2017_03_30.models>`
109109
* 2017-09-01: :mod:`v2017_09_01.models<azure.mgmt.compute.v2017_09_01.models>`
110110
* 2017-12-01: :mod:`v2017_12_01.models<azure.mgmt.compute.v2017_12_01.models>`
111+
* 2018-04-01: :mod:`v2018_04_01.models<azure.mgmt.compute.v2018_04_01.models>`
111112
"""
112113
if api_version == '2015-06-15':
113114
from .v2015_06_15 import models
@@ -127,6 +128,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
127128
elif api_version == '2017-12-01':
128129
from .v2017_12_01 import models
129130
return models
131+
elif api_version == '2018-04-01':
132+
from .v2018_04_01 import models
133+
return models
130134
raise NotImplementedError("APIVersion {} is not available".format(api_version))
131135

132136
@property
@@ -160,12 +164,15 @@ def disks(self):
160164
161165
* 2016-04-30-preview: :class:`DisksOperations<azure.mgmt.compute.v2016_04_30_preview.operations.DisksOperations>`
162166
* 2017-03-30: :class:`DisksOperations<azure.mgmt.compute.v2017_03_30.operations.DisksOperations>`
167+
* 2018-04-01: :class:`DisksOperations<azure.mgmt.compute.v2018_04_01.operations.DisksOperations>`
163168
"""
164169
api_version = self.profile.get('disks', self.api_version)
165170
if api_version == '2016-04-30-preview':
166171
from .v2016_04_30_preview.operations import DisksOperations as OperationClass
167172
elif api_version == '2017-03-30':
168173
from .v2017_03_30.operations import DisksOperations as OperationClass
174+
elif api_version == '2018-04-01':
175+
from .v2018_04_01.operations import DisksOperations as OperationClass
169176
else:
170177
raise NotImplementedError("APIVersion {} is not available".format(api_version))
171178
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@@ -224,12 +231,15 @@ def snapshots(self):
224231
225232
* 2016-04-30-preview: :class:`SnapshotsOperations<azure.mgmt.compute.v2016_04_30_preview.operations.SnapshotsOperations>`
226233
* 2017-03-30: :class:`SnapshotsOperations<azure.mgmt.compute.v2017_03_30.operations.SnapshotsOperations>`
234+
* 2018-04-01: :class:`SnapshotsOperations<azure.mgmt.compute.v2018_04_01.operations.SnapshotsOperations>`
227235
"""
228236
api_version = self.profile.get('snapshots', self.api_version)
229237
if api_version == '2016-04-30-preview':
230238
from .v2016_04_30_preview.operations import SnapshotsOperations as OperationClass
231239
elif api_version == '2017-03-30':
232240
from .v2017_03_30.operations import SnapshotsOperations as OperationClass
241+
elif api_version == '2018-04-01':
242+
from .v2018_04_01.operations import SnapshotsOperations as OperationClass
233243
else:
234244
raise NotImplementedError("APIVersion {} is not available".format(api_version))
235245
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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 .compute_management_client import ComputeManagementClient
13+
from .version import VERSION
14+
15+
__all__ = ['ComputeManagementClient']
16+
17+
__version__ = VERSION
18+
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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 ServiceClient
13+
from msrest import Serializer, Deserializer
14+
from msrestazure import AzureConfiguration
15+
from .version import VERSION
16+
from .operations.disks_operations import DisksOperations
17+
from .operations.snapshots_operations import SnapshotsOperations
18+
from . import models
19+
20+
21+
class ComputeManagementClientConfiguration(AzureConfiguration):
22+
"""Configuration for ComputeManagementClient
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(ComputeManagementClientConfiguration, self).__init__(base_url)
47+
48+
self.add_user_agent('azure-mgmt-compute/{}'.format(VERSION))
49+
self.add_user_agent('Azure-SDK-For-Python')
50+
51+
self.credentials = credentials
52+
self.subscription_id = subscription_id
53+
54+
55+
class ComputeManagementClient(object):
56+
"""Compute Client
57+
58+
:ivar config: Configuration for client.
59+
:vartype config: ComputeManagementClientConfiguration
60+
61+
:ivar disks: Disks operations
62+
:vartype disks: azure.mgmt.compute.v2018_04_01.operations.DisksOperations
63+
:ivar snapshots: Snapshots operations
64+
:vartype snapshots: azure.mgmt.compute.v2018_04_01.operations.SnapshotsOperations
65+
66+
:param credentials: Credentials needed for the client to connect to Azure.
67+
:type credentials: :mod:`A msrestazure Credentials
68+
object<msrestazure.azure_active_directory>`
69+
:param subscription_id: Subscription credentials which uniquely identify
70+
Microsoft Azure subscription. The subscription ID forms part of the URI
71+
for every service call.
72+
:type subscription_id: str
73+
:param str base_url: Service URL
74+
"""
75+
76+
def __init__(
77+
self, credentials, subscription_id, base_url=None):
78+
79+
self.config = ComputeManagementClientConfiguration(credentials, subscription_id, base_url)
80+
self._client = ServiceClient(self.config.credentials, self.config)
81+
82+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
83+
self.api_version = '2018-04-01'
84+
self._serialize = Serializer(client_models)
85+
self._deserialize = Deserializer(client_models)
86+
87+
self.disks = DisksOperations(
88+
self._client, self.config, self._serialize, self._deserialize)
89+
self.snapshots = SnapshotsOperations(
90+
self._client, self.config, self._serialize, self._deserialize)
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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+
try:
13+
from .resource_py3 import Resource
14+
from .disk_sku_py3 import DiskSku
15+
from .resource_update_py3 import ResourceUpdate
16+
from .image_disk_reference_py3 import ImageDiskReference
17+
from .creation_data_py3 import CreationData
18+
from .source_vault_py3 import SourceVault
19+
from .key_vault_and_secret_reference_py3 import KeyVaultAndSecretReference
20+
from .key_vault_and_key_reference_py3 import KeyVaultAndKeyReference
21+
from .encryption_settings_py3 import EncryptionSettings
22+
from .disk_py3 import Disk
23+
from .disk_update_py3 import DiskUpdate
24+
from .snapshot_sku_py3 import SnapshotSku
25+
from .grant_access_data_py3 import GrantAccessData
26+
from .access_uri_py3 import AccessUri
27+
from .snapshot_py3 import Snapshot
28+
from .snapshot_update_py3 import SnapshotUpdate
29+
from .api_error_base_py3 import ApiErrorBase
30+
from .inner_error_py3 import InnerError
31+
from .api_error_py3 import ApiError
32+
from .operation_status_response_py3 import OperationStatusResponse
33+
except (SyntaxError, ImportError):
34+
from .resource import Resource
35+
from .disk_sku import DiskSku
36+
from .resource_update import ResourceUpdate
37+
from .image_disk_reference import ImageDiskReference
38+
from .creation_data import CreationData
39+
from .source_vault import SourceVault
40+
from .key_vault_and_secret_reference import KeyVaultAndSecretReference
41+
from .key_vault_and_key_reference import KeyVaultAndKeyReference
42+
from .encryption_settings import EncryptionSettings
43+
from .disk import Disk
44+
from .disk_update import DiskUpdate
45+
from .snapshot_sku import SnapshotSku
46+
from .grant_access_data import GrantAccessData
47+
from .access_uri import AccessUri
48+
from .snapshot import Snapshot
49+
from .snapshot_update import SnapshotUpdate
50+
from .api_error_base import ApiErrorBase
51+
from .inner_error import InnerError
52+
from .api_error import ApiError
53+
from .operation_status_response import OperationStatusResponse
54+
from .disk_paged import DiskPaged
55+
from .snapshot_paged import SnapshotPaged
56+
from .compute_management_client_enums import (
57+
StorageAccountTypes,
58+
OperatingSystemTypes,
59+
DiskCreateOption,
60+
SnapshotStorageAccountTypes,
61+
AccessLevel,
62+
)
63+
64+
__all__ = [
65+
'Resource',
66+
'DiskSku',
67+
'ResourceUpdate',
68+
'ImageDiskReference',
69+
'CreationData',
70+
'SourceVault',
71+
'KeyVaultAndSecretReference',
72+
'KeyVaultAndKeyReference',
73+
'EncryptionSettings',
74+
'Disk',
75+
'DiskUpdate',
76+
'SnapshotSku',
77+
'GrantAccessData',
78+
'AccessUri',
79+
'Snapshot',
80+
'SnapshotUpdate',
81+
'ApiErrorBase',
82+
'InnerError',
83+
'ApiError',
84+
'OperationStatusResponse',
85+
'DiskPaged',
86+
'SnapshotPaged',
87+
'StorageAccountTypes',
88+
'OperatingSystemTypes',
89+
'DiskCreateOption',
90+
'SnapshotStorageAccountTypes',
91+
'AccessLevel',
92+
]
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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.serialization import Model
13+
14+
15+
class AccessUri(Model):
16+
"""A disk access SAS uri.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
:ivar access_sas: A SAS uri for accessing a disk.
22+
:vartype access_sas: str
23+
"""
24+
25+
_validation = {
26+
'access_sas': {'readonly': True},
27+
}
28+
29+
_attribute_map = {
30+
'access_sas': {'key': 'properties.output.accessSAS', 'type': 'str'},
31+
}
32+
33+
def __init__(self, **kwargs):
34+
super(AccessUri, self).__init__(**kwargs)
35+
self.access_sas = None
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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.serialization import Model
13+
14+
15+
class AccessUri(Model):
16+
"""A disk access SAS uri.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
:ivar access_sas: A SAS uri for accessing a disk.
22+
:vartype access_sas: str
23+
"""
24+
25+
_validation = {
26+
'access_sas': {'readonly': True},
27+
}
28+
29+
_attribute_map = {
30+
'access_sas': {'key': 'properties.output.accessSAS', 'type': 'str'},
31+
}
32+
33+
def __init__(self, **kwargs) -> None:
34+
super(AccessUri, self).__init__(**kwargs)
35+
self.access_sas = None
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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.serialization import Model
13+
14+
15+
class ApiError(Model):
16+
"""Api error.
17+
18+
:param details: The Api error details
19+
:type details: list[~azure.mgmt.compute.v2018_04_01.models.ApiErrorBase]
20+
:param innererror: The Api inner error
21+
:type innererror: ~azure.mgmt.compute.v2018_04_01.models.InnerError
22+
:param code: The error code.
23+
:type code: str
24+
:param target: The target of the particular error.
25+
:type target: str
26+
:param message: The error message.
27+
:type message: str
28+
"""
29+
30+
_attribute_map = {
31+
'details': {'key': 'details', 'type': '[ApiErrorBase]'},
32+
'innererror': {'key': 'innererror', 'type': 'InnerError'},
33+
'code': {'key': 'code', 'type': 'str'},
34+
'target': {'key': 'target', 'type': 'str'},
35+
'message': {'key': 'message', 'type': 'str'},
36+
}
37+
38+
def __init__(self, **kwargs):
39+
super(ApiError, self).__init__(**kwargs)
40+
self.details = kwargs.get('details', None)
41+
self.innererror = kwargs.get('innererror', None)
42+
self.code = kwargs.get('code', None)
43+
self.target = kwargs.get('target', None)
44+
self.message = kwargs.get('message', None)

0 commit comments

Comments
 (0)