Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR compute/resource-manager] Add Disk 2018-09 to Python #4667

Merged
merged 1 commit into from
Mar 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2017-12-01: :mod:`v2017_12_01.models<azure.mgmt.compute.v2017_12_01.models>`
* 2018-04-01: :mod:`v2018_04_01.models<azure.mgmt.compute.v2018_04_01.models>`
* 2018-06-01: :mod:`v2018_06_01.models<azure.mgmt.compute.v2018_06_01.models>`
* 2018-09-30: :mod:`v2018_09_30.models<azure.mgmt.compute.v2018_09_30.models>`
* 2018-10-01: :mod:`v2018_10_01.models<azure.mgmt.compute.v2018_10_01.models>`
"""
if api_version == '2015-06-15':
Expand All @@ -145,6 +146,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2018-06-01':
from .v2018_06_01 import models
return models
elif api_version == '2018-09-30':
from .v2018_09_30 import models
return models
elif api_version == '2018-10-01':
from .v2018_10_01 import models
return models
Expand Down Expand Up @@ -192,6 +196,7 @@ def disks(self):
* 2017-03-30: :class:`DisksOperations<azure.mgmt.compute.v2017_03_30.operations.DisksOperations>`
* 2018-04-01: :class:`DisksOperations<azure.mgmt.compute.v2018_04_01.operations.DisksOperations>`
* 2018-06-01: :class:`DisksOperations<azure.mgmt.compute.v2018_06_01.operations.DisksOperations>`
* 2018-09-30: :class:`DisksOperations<azure.mgmt.compute.v2018_09_30.operations.DisksOperations>`
"""
api_version = self._get_api_version('disks')
if api_version == '2016-04-30-preview':
Expand All @@ -202,6 +207,8 @@ def disks(self):
from .v2018_04_01.operations import DisksOperations as OperationClass
elif api_version == '2018-06-01':
from .v2018_06_01.operations import DisksOperations as OperationClass
elif api_version == '2018-09-30':
from .v2018_09_30.operations import DisksOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down Expand Up @@ -341,6 +348,7 @@ def snapshots(self):
* 2017-03-30: :class:`SnapshotsOperations<azure.mgmt.compute.v2017_03_30.operations.SnapshotsOperations>`
* 2018-04-01: :class:`SnapshotsOperations<azure.mgmt.compute.v2018_04_01.operations.SnapshotsOperations>`
* 2018-06-01: :class:`SnapshotsOperations<azure.mgmt.compute.v2018_06_01.operations.SnapshotsOperations>`
* 2018-09-30: :class:`SnapshotsOperations<azure.mgmt.compute.v2018_09_30.operations.SnapshotsOperations>`
"""
api_version = self._get_api_version('snapshots')
if api_version == '2016-04-30-preview':
Expand All @@ -351,6 +359,8 @@ def snapshots(self):
from .v2018_04_01.operations import SnapshotsOperations as OperationClass
elif api_version == '2018-06-01':
from .v2018_06_01.operations import SnapshotsOperations as OperationClass
elif api_version == '2018-09-30':
from .v2018_09_30.operations import SnapshotsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down
18 changes: 18 additions & 0 deletions azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .compute_management_client import ComputeManagementClient
from .version import VERSION

__all__ = ['ComputeManagementClient']

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.disks_operations import DisksOperations
from .operations.snapshots_operations import SnapshotsOperations
from . import models


class ComputeManagementClientConfiguration(AzureConfiguration):
"""Configuration for ComputeManagementClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(ComputeManagementClientConfiguration, self).__init__(base_url)

self.add_user_agent('azure-mgmt-compute/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id


class ComputeManagementClient(SDKClient):
"""Compute Client

:ivar config: Configuration for client.
:vartype config: ComputeManagementClientConfiguration

:ivar disks: Disks operations
:vartype disks: azure.mgmt.compute.v2018_09_30.operations.DisksOperations
:ivar snapshots: Snapshots operations
:vartype snapshots: azure.mgmt.compute.v2018_09_30.operations.SnapshotsOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = ComputeManagementClientConfiguration(credentials, subscription_id, base_url)
super(ComputeManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2018-09-30'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.disks = DisksOperations(
self._client, self.config, self._serialize, self._deserialize)
self.snapshots = SnapshotsOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

try:
from .resource_py3 import Resource
from .disk_sku_py3 import DiskSku
from .image_disk_reference_py3 import ImageDiskReference
from .creation_data_py3 import CreationData
from .source_vault_py3 import SourceVault
from .key_vault_and_secret_reference_py3 import KeyVaultAndSecretReference
from .key_vault_and_key_reference_py3 import KeyVaultAndKeyReference
from .encryption_settings_element_py3 import EncryptionSettingsElement
from .encryption_settings_collection_py3 import EncryptionSettingsCollection
from .disk_py3 import Disk
from .disk_update_py3 import DiskUpdate
from .snapshot_sku_py3 import SnapshotSku
from .grant_access_data_py3 import GrantAccessData
from .access_uri_py3 import AccessUri
from .snapshot_py3 import Snapshot
from .snapshot_update_py3 import SnapshotUpdate
except (SyntaxError, ImportError):
from .resource import Resource
from .disk_sku import DiskSku
from .image_disk_reference import ImageDiskReference
from .creation_data import CreationData
from .source_vault import SourceVault
from .key_vault_and_secret_reference import KeyVaultAndSecretReference
from .key_vault_and_key_reference import KeyVaultAndKeyReference
from .encryption_settings_element import EncryptionSettingsElement
from .encryption_settings_collection import EncryptionSettingsCollection
from .disk import Disk
from .disk_update import DiskUpdate
from .snapshot_sku import SnapshotSku
from .grant_access_data import GrantAccessData
from .access_uri import AccessUri
from .snapshot import Snapshot
from .snapshot_update import SnapshotUpdate
from .disk_paged import DiskPaged
from .snapshot_paged import SnapshotPaged
from .compute_management_client_enums import (
DiskStorageAccountTypes,
OperatingSystemTypes,
HyperVGeneration,
DiskCreateOption,
DiskState,
SnapshotStorageAccountTypes,
AccessLevel,
)

__all__ = [
'Resource',
'DiskSku',
'ImageDiskReference',
'CreationData',
'SourceVault',
'KeyVaultAndSecretReference',
'KeyVaultAndKeyReference',
'EncryptionSettingsElement',
'EncryptionSettingsCollection',
'Disk',
'DiskUpdate',
'SnapshotSku',
'GrantAccessData',
'AccessUri',
'Snapshot',
'SnapshotUpdate',
'DiskPaged',
'SnapshotPaged',
'DiskStorageAccountTypes',
'OperatingSystemTypes',
'HyperVGeneration',
'DiskCreateOption',
'DiskState',
'SnapshotStorageAccountTypes',
'AccessLevel',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class AccessUri(Model):
"""A disk access SAS uri.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar access_sas: A SAS uri for accessing a disk.
:vartype access_sas: str
"""

_validation = {
'access_sas': {'readonly': True},
}

_attribute_map = {
'access_sas': {'key': 'accessSAS', 'type': 'str'},
}

def __init__(self, **kwargs):
super(AccessUri, self).__init__(**kwargs)
self.access_sas = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class AccessUri(Model):
"""A disk access SAS uri.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar access_sas: A SAS uri for accessing a disk.
:vartype access_sas: str
"""

_validation = {
'access_sas': {'readonly': True},
}

_attribute_map = {
'access_sas': {'key': 'accessSAS', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
super(AccessUri, self).__init__(**kwargs)
self.access_sas = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from enum import Enum


class DiskStorageAccountTypes(str, Enum):

standard_lrs = "Standard_LRS"
premium_lrs = "Premium_LRS"
standard_ssd_lrs = "StandardSSD_LRS"
ultra_ssd_lrs = "UltraSSD_LRS"


class OperatingSystemTypes(str, Enum):

windows = "Windows"
linux = "Linux"


class HyperVGeneration(str, Enum):

v1 = "V1"
v2 = "V2"


class DiskCreateOption(str, Enum):

empty = "Empty"
attach = "Attach"
from_image = "FromImage"
import_enum = "Import"
copy = "Copy"
restore = "Restore"
upload = "Upload"


class DiskState(str, Enum):

unattached = "Unattached"
attached = "Attached"
reserved = "Reserved"
active_sas = "ActiveSAS"
ready_to_upload = "ReadyToUpload"
active_upload = "ActiveUpload"


class SnapshotStorageAccountTypes(str, Enum):

standard_lrs = "Standard_LRS"
premium_lrs = "Premium_LRS"
standard_zrs = "Standard_ZRS"


class AccessLevel(str, Enum):

none = "None"
read = "Read"
write = "Write"
Loading