Skip to content

Commit

Permalink
Content from #2163
Browse files Browse the repository at this point in the history
  • Loading branch information
lmazuel committed Mar 21, 2018
1 parent f37a0d4 commit e446c59
Show file tree
Hide file tree
Showing 19 changed files with 1,148 additions and 100 deletions.
13 changes: 13 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 @@ -209,6 +209,19 @@ def log_analytics(self):
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)))

@property
def operations(self):
"""Instance depends on the API version:
* 2017-12-01: :class:`Operations<azure.mgmt.compute.v2017_12_01.operations.Operations>`
"""
api_version = self.profile.get('operations', self.api_version)
if api_version == '2017-12-01':
from .v2017_12_01.operations import Operations 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)))

@property
def resource_skus(self):
"""Instance depends on the API version:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.operations import Operations
from .operations.availability_sets_operations import AvailabilitySetsOperations
from .operations.virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations
from .operations.virtual_machine_extensions_operations import VirtualMachineExtensionsOperations
Expand Down Expand Up @@ -70,6 +71,8 @@ class ComputeManagementClient(object):
:ivar config: Configuration for client.
:vartype config: ComputeManagementClientConfiguration
:ivar operations: Operations operations
:vartype operations: azure.mgmt.compute.v2017_12_01.operations.Operations
:ivar availability_sets: AvailabilitySets operations
:vartype availability_sets: azure.mgmt.compute.v2017_12_01.operations.AvailabilitySetsOperations
:ivar virtual_machine_extension_images: VirtualMachineExtensionImages operations
Expand Down Expand Up @@ -120,6 +123,8 @@ def __init__(
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.availability_sets = AvailabilitySetsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.virtual_machine_extension_images = VirtualMachineExtensionImagesOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
# --------------------------------------------------------------------------

try:
from .compute_operation_value_py3 import ComputeOperationValue
from .instance_view_status_py3 import InstanceViewStatus
from .sub_resource_py3 import SubResource
from .sku_py3 import Sku
from .availability_set_py3 import AvailabilitySet
from .availability_set_update_py3 import AvailabilitySetUpdate
from .virtual_machine_size_py3 import VirtualMachineSize
from .virtual_machine_extension_image_py3 import VirtualMachineExtensionImage
from .virtual_machine_image_resource_py3 import VirtualMachineImageResource
Expand Down Expand Up @@ -60,12 +62,14 @@
from .maintenance_redeploy_status_py3 import MaintenanceRedeployStatus
from .virtual_machine_instance_view_py3 import VirtualMachineInstanceView
from .virtual_machine_py3 import VirtualMachine
from .virtual_machine_update_py3 import VirtualMachineUpdate
from .rolling_upgrade_policy_py3 import RollingUpgradePolicy
from .upgrade_policy_py3 import UpgradePolicy
from .image_os_disk_py3 import ImageOSDisk
from .image_data_disk_py3 import ImageDataDisk
from .image_storage_profile_py3 import ImageStorageProfile
from .image_py3 import Image
from .image_update_py3 import ImageUpdate
from .virtual_machine_scale_set_identity_py3 import VirtualMachineScaleSetIdentity
from .virtual_machine_scale_set_os_profile_py3 import VirtualMachineScaleSetOSProfile
from .virtual_machine_scale_set_update_os_profile_py3 import VirtualMachineScaleSetUpdateOSProfile
Expand Down Expand Up @@ -127,10 +131,12 @@
from .run_command_document_py3 import RunCommandDocument
from .run_command_result_py3 import RunCommandResult
except (SyntaxError, ImportError):
from .compute_operation_value import ComputeOperationValue
from .instance_view_status import InstanceViewStatus
from .sub_resource import SubResource
from .sku import Sku
from .availability_set import AvailabilitySet
from .availability_set_update import AvailabilitySetUpdate
from .virtual_machine_size import VirtualMachineSize
from .virtual_machine_extension_image import VirtualMachineExtensionImage
from .virtual_machine_image_resource import VirtualMachineImageResource
Expand Down Expand Up @@ -177,12 +183,14 @@
from .maintenance_redeploy_status import MaintenanceRedeployStatus
from .virtual_machine_instance_view import VirtualMachineInstanceView
from .virtual_machine import VirtualMachine
from .virtual_machine_update import VirtualMachineUpdate
from .rolling_upgrade_policy import RollingUpgradePolicy
from .upgrade_policy import UpgradePolicy
from .image_os_disk import ImageOSDisk
from .image_data_disk import ImageDataDisk
from .image_storage_profile import ImageStorageProfile
from .image import Image
from .image_update import ImageUpdate
from .virtual_machine_scale_set_identity import VirtualMachineScaleSetIdentity
from .virtual_machine_scale_set_os_profile import VirtualMachineScaleSetOSProfile
from .virtual_machine_scale_set_update_os_profile import VirtualMachineScaleSetUpdateOSProfile
Expand Down Expand Up @@ -243,6 +251,7 @@
from .run_command_document_base import RunCommandDocumentBase
from .run_command_document import RunCommandDocument
from .run_command_result import RunCommandResult
from .compute_operation_value_paged import ComputeOperationValuePaged
from .availability_set_paged import AvailabilitySetPaged
from .virtual_machine_size_paged import VirtualMachineSizePaged
from .usage_paged import UsagePaged
Expand Down Expand Up @@ -278,10 +287,12 @@
)

__all__ = [
'ComputeOperationValue',
'InstanceViewStatus',
'SubResource',
'Sku',
'AvailabilitySet',
'AvailabilitySetUpdate',
'VirtualMachineSize',
'VirtualMachineExtensionImage',
'VirtualMachineImageResource',
Expand Down Expand Up @@ -328,12 +339,14 @@
'MaintenanceRedeployStatus',
'VirtualMachineInstanceView',
'VirtualMachine',
'VirtualMachineUpdate',
'RollingUpgradePolicy',
'UpgradePolicy',
'ImageOSDisk',
'ImageDataDisk',
'ImageStorageProfile',
'Image',
'ImageUpdate',
'VirtualMachineScaleSetIdentity',
'VirtualMachineScaleSetOSProfile',
'VirtualMachineScaleSetUpdateOSProfile',
Expand Down Expand Up @@ -394,6 +407,7 @@
'RunCommandDocumentBase',
'RunCommandDocument',
'RunCommandResult',
'ComputeOperationValuePaged',
'AvailabilitySetPaged',
'VirtualMachineSizePaged',
'UsagePaged',
Expand Down
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 .update_resource import UpdateResource


class AvailabilitySetUpdate(UpdateResource):
"""Specifies information about the availability set that the virtual machine
should be assigned to. Virtual machines specified in the same availability
set are allocated to different nodes to maximize availability. For more
information about availability sets, see [Manage the availability of
virtual
machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
<br><br> For more information on Azure planned maintainance, see [Planned
maintenance for virtual machines in
Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
<br><br> Currently, a VM can only be added to availability set at creation
time. An existing VM cannot be added to an availability set.
Variables are only populated by the server, and will be ignored when
sending a request.
:param tags: Resource tags
:type tags: dict[str, str]
:param platform_update_domain_count: Update Domain count.
:type platform_update_domain_count: int
:param platform_fault_domain_count: Fault Domain count.
:type platform_fault_domain_count: int
:param virtual_machines: A list of references to all virtual machines in
the availability set.
:type virtual_machines:
list[~azure.mgmt.compute.v2017_12_01.models.SubResource]
:ivar statuses: The resource status information.
:vartype statuses:
list[~azure.mgmt.compute.v2017_12_01.models.InstanceViewStatus]
:param sku: Sku of the availability set
:type sku: ~azure.mgmt.compute.v2017_12_01.models.Sku
"""

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

_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
'platform_update_domain_count': {'key': 'properties.platformUpdateDomainCount', 'type': 'int'},
'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'},
'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'},
'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'},
'sku': {'key': 'sku', 'type': 'Sku'},
}

def __init__(self, **kwargs):
super(AvailabilitySetUpdate, self).__init__(**kwargs)
self.platform_update_domain_count = kwargs.get('platform_update_domain_count', None)
self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None)
self.virtual_machines = kwargs.get('virtual_machines', None)
self.statuses = None
self.sku = kwargs.get('sku', 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 .update_resource import UpdateResource


class AvailabilitySetUpdate(UpdateResource):
"""Specifies information about the availability set that the virtual machine
should be assigned to. Virtual machines specified in the same availability
set are allocated to different nodes to maximize availability. For more
information about availability sets, see [Manage the availability of
virtual
machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
<br><br> For more information on Azure planned maintainance, see [Planned
maintenance for virtual machines in
Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
<br><br> Currently, a VM can only be added to availability set at creation
time. An existing VM cannot be added to an availability set.
Variables are only populated by the server, and will be ignored when
sending a request.
:param tags: Resource tags
:type tags: dict[str, str]
:param platform_update_domain_count: Update Domain count.
:type platform_update_domain_count: int
:param platform_fault_domain_count: Fault Domain count.
:type platform_fault_domain_count: int
:param virtual_machines: A list of references to all virtual machines in
the availability set.
:type virtual_machines:
list[~azure.mgmt.compute.v2017_12_01.models.SubResource]
:ivar statuses: The resource status information.
:vartype statuses:
list[~azure.mgmt.compute.v2017_12_01.models.InstanceViewStatus]
:param sku: Sku of the availability set
:type sku: ~azure.mgmt.compute.v2017_12_01.models.Sku
"""

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

_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
'platform_update_domain_count': {'key': 'properties.platformUpdateDomainCount', 'type': 'int'},
'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'},
'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'},
'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'},
'sku': {'key': 'sku', 'type': 'Sku'},
}

def __init__(self, *, tags=None, platform_update_domain_count: int=None, platform_fault_domain_count: int=None, virtual_machines=None, sku=None, **kwargs) -> None:
super(AvailabilitySetUpdate, self).__init__(tags=tags, **kwargs)
self.platform_update_domain_count = platform_update_domain_count
self.platform_fault_domain_count = platform_fault_domain_count
self.virtual_machines = virtual_machines
self.statuses = None
self.sku = sku
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# 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 ComputeOperationValue(Model):
"""Describes the properties of a Compute Operation value.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar origin: The origin of the compute operation.
:vartype origin: str
:ivar name: The name of the compute operation.
:vartype name: str
:ivar operation: The display name of the compute operation.
:vartype operation: str
:ivar resource: The display name of the resource the operation applies to.
:vartype resource: str
:ivar description: The description of the operation.
:vartype description: str
:ivar provider: The resource provider for the operation.
:vartype provider: str
"""

_validation = {
'origin': {'readonly': True},
'name': {'readonly': True},
'operation': {'readonly': True},
'resource': {'readonly': True},
'description': {'readonly': True},
'provider': {'readonly': True},
}

_attribute_map = {
'origin': {'key': 'origin', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'operation': {'key': 'display.operation', 'type': 'str'},
'resource': {'key': 'display.resource', 'type': 'str'},
'description': {'key': 'display.description', 'type': 'str'},
'provider': {'key': 'display.provider', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ComputeOperationValue, self).__init__(**kwargs)
self.origin = None
self.name = None
self.operation = None
self.resource = None
self.description = None
self.provider = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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.paging import Paged


class ComputeOperationValuePaged(Paged):
"""
A paging container for iterating over a list of :class:`ComputeOperationValue <azure.mgmt.compute.v2017_12_01.models.ComputeOperationValue>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[ComputeOperationValue]'}
}

def __init__(self, *args, **kwargs):

super(ComputeOperationValuePaged, self).__init__(*args, **kwargs)
Loading

0 comments on commit e446c59

Please sign in to comment.