diff --git a/azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py b/azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py index be6b5f8a8cab9..f58de1a8d39a1 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py +++ b/azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py @@ -108,6 +108,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2017-03-30: :mod:`v2017_03_30.models` * 2017-09-01: :mod:`v2017_09_01.models` * 2017-12-01: :mod:`v2017_12_01.models` + * 2018-04-01: :mod:`v2018_04_01.models` """ if api_version == '2015-06-15': from .v2015_06_15 import models @@ -127,6 +128,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2017-12-01': from .v2017_12_01 import models return models + elif api_version == '2018-04-01': + from .v2018_04_01 import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) @property @@ -160,12 +164,15 @@ def disks(self): * 2016-04-30-preview: :class:`DisksOperations` * 2017-03-30: :class:`DisksOperations` + * 2018-04-01: :class:`DisksOperations` """ api_version = self.profile.get('disks', self.api_version) if api_version == '2016-04-30-preview': from .v2016_04_30_preview.operations import DisksOperations as OperationClass elif api_version == '2017-03-30': from .v2017_03_30.operations import DisksOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.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))) @@ -202,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` + """ + 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: @@ -224,12 +244,15 @@ def snapshots(self): * 2016-04-30-preview: :class:`SnapshotsOperations` * 2017-03-30: :class:`SnapshotsOperations` + * 2018-04-01: :class:`SnapshotsOperations` """ api_version = self.profile.get('snapshots', self.api_version) if api_version == '2016-04-30-preview': from .v2016_04_30_preview.operations import SnapshotsOperations as OperationClass elif api_version == '2017-03-30': from .v2017_03_30.operations import SnapshotsOperations as OperationClass + elif api_version == '2018-04-01': + from .v2018_04_01.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))) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/compute_management_client.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/compute_management_client.py index e2e2ae77e2d9c..2666801ff54af 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/compute_management_client.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/compute_management_client.py @@ -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 @@ -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 @@ -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( diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/__init__.py index f243db8f9223a..b8d6e058d1979 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/__init__.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/__init__.py @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -278,10 +287,12 @@ ) __all__ = [ + 'ComputeOperationValue', 'InstanceViewStatus', 'SubResource', 'Sku', 'AvailabilitySet', + 'AvailabilitySetUpdate', 'VirtualMachineSize', 'VirtualMachineExtensionImage', 'VirtualMachineImageResource', @@ -328,12 +339,14 @@ 'MaintenanceRedeployStatus', 'VirtualMachineInstanceView', 'VirtualMachine', + 'VirtualMachineUpdate', 'RollingUpgradePolicy', 'UpgradePolicy', 'ImageOSDisk', 'ImageDataDisk', 'ImageStorageProfile', 'Image', + 'ImageUpdate', 'VirtualMachineScaleSetIdentity', 'VirtualMachineScaleSetOSProfile', 'VirtualMachineScaleSetUpdateOSProfile', @@ -394,6 +407,7 @@ 'RunCommandDocumentBase', 'RunCommandDocument', 'RunCommandResult', + 'ComputeOperationValuePaged', 'AvailabilitySetPaged', 'VirtualMachineSizePaged', 'UsagePaged', diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_update.py new file mode 100644 index 0000000000000..c432a4e85d04f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_update.py @@ -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). +

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) +

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) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_update_py3.py new file mode 100644 index 0000000000000..515ceb56c4d32 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/availability_set_update_py3.py @@ -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). +

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) +

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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value.py new file mode 100644 index 0000000000000..525ef3bbb69ab --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value.py @@ -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 diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value_paged.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value_paged.py new file mode 100644 index 0000000000000..d59724285f2d6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value_paged.py @@ -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 ` 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) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value_py3.py new file mode 100644 index 0000000000000..3c4388f312b9e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/compute_operation_value_py3.py @@ -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) -> None: + super(ComputeOperationValue, self).__init__(**kwargs) + self.origin = None + self.name = None + self.operation = None + self.resource = None + self.description = None + self.provider = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk.py index 41e260cdca7e6..73534d4e8fc79 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk.py @@ -69,7 +69,7 @@ class DataDisk(Model): 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, - 'create_option': {'key': 'createOption', 'type': 'str'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, } diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk_py3.py index b638a05f74a0c..309354384d5ed 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/data_disk_py3.py @@ -69,7 +69,7 @@ class DataDisk(Model): 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, - 'create_option': {'key': 'createOption', 'type': 'str'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, } diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile.py index 44066d92b2908..84aad1c4ee3bf 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile.py @@ -21,56 +21,57 @@ class HardwareProfile(Model):

The available VM sizes depend on region and availability set. For a list of available sizes use these APIs:

[List all available virtual machine sizes in an availability - set](virtualmachines-list-sizes-availability-set.md)

[List all - available virtual machine sizes in a - region](virtualmachines-list-sizes-region.md)

[List all available - virtual machine sizes for - resizing](virtualmachines-list-sizes-for-resizing.md). Possible values - include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', - 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', - 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', - 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', - 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', - 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', - 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', - 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', - 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', - 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', - 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', - 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', - 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', - 'Standard_D32s_v3', 'Standard_D64s_v3', 'Standard_D11_v2', - 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', - 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', - 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', - 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', - 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2', - 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', - 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2', - 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', - 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', - 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', - 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E32s_v3', - 'Standard_E64s_v3', 'Standard_E32-16_v3', 'Standard_E32-8s_v3', - 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', 'Standard_F1', - 'Standard_F2', 'Standard_F4', 'Standard_F8', 'Standard_F16', - 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', - 'Standard_F16s', 'Standard_F2s_v2', 'Standard_F4s_v2', 'Standard_F8s_v2', - 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', - 'Standard_F72s_v2', 'Standard_G1', 'Standard_G2', 'Standard_G3', - 'Standard_G4', 'Standard_G5', 'Standard_GS1', 'Standard_GS2', - 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_GS4-8', - 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', 'Standard_H8', - 'Standard_H16', 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', - 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', - 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', 'Standard_M128s', - 'Standard_M128ms', 'Standard_M64-32ms', 'Standard_M64-16ms', - 'Standard_M128-64ms', 'Standard_M128-32ms', 'Standard_NC6', - 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', 'Standard_NC6s_v2', - 'Standard_NC12s_v2', 'Standard_NC24s_v2', 'Standard_NC24rs_v2', - 'Standard_NC6s_v3', 'Standard_NC12s_v3', 'Standard_NC24s_v3', - 'Standard_NC24rs_v3', 'Standard_ND6s', 'Standard_ND12s', 'Standard_ND24s', - 'Standard_ND24rs', 'Standard_NV6', 'Standard_NV12', 'Standard_NV24' + set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) +

[List all available virtual machine sizes in a + region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) +

[List all available virtual machine sizes for + resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', + 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', + 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', + 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', + 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', + 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', + 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', + 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', + 'Standard_D5_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', + 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', + 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', + 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', + 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', + 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', + 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', + 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', + 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_DS13-4_v2', + 'Standard_DS13-2_v2', 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', + 'Standard_E2_v3', 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', + 'Standard_E32_v3', 'Standard_E64_v3', 'Standard_E2s_v3', + 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', + 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_E32-16_v3', + 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', + 'Standard_F1', 'Standard_F2', 'Standard_F4', 'Standard_F8', + 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', + 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', 'Standard_F4s_v2', + 'Standard_F8s_v2', 'Standard_F16s_v2', 'Standard_F32s_v2', + 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', 'Standard_G2', + 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + 'Standard_NV12', 'Standard_NV24' :type vm_size: str or ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineSizeTypes """ diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile_py3.py index 6b07377ad81df..605f0eb33fad2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/hardware_profile_py3.py @@ -21,56 +21,57 @@ class HardwareProfile(Model):

The available VM sizes depend on region and availability set. For a list of available sizes use these APIs:

[List all available virtual machine sizes in an availability - set](virtualmachines-list-sizes-availability-set.md)

[List all - available virtual machine sizes in a - region](virtualmachines-list-sizes-region.md)

[List all available - virtual machine sizes for - resizing](virtualmachines-list-sizes-for-resizing.md). Possible values - include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', 'Basic_A4', - 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', 'Standard_A4', - 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A9', - 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', 'Standard_A2_v2', - 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', 'Standard_A4m_v2', - 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', 'Standard_B2s', - 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', - 'Standard_D2', 'Standard_D3', 'Standard_D4', 'Standard_D11', - 'Standard_D12', 'Standard_D13', 'Standard_D14', 'Standard_D1_v2', - 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', 'Standard_D5_v2', - 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', 'Standard_D16_v3', - 'Standard_D32_v3', 'Standard_D64_v3', 'Standard_D2s_v3', - 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', - 'Standard_D32s_v3', 'Standard_D64s_v3', 'Standard_D11_v2', - 'Standard_D12_v2', 'Standard_D13_v2', 'Standard_D14_v2', - 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', 'Standard_DS3', - 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', 'Standard_DS13', - 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', 'Standard_DS3_v2', - 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_DS11_v2', - 'Standard_DS12_v2', 'Standard_DS13_v2', 'Standard_DS14_v2', - 'Standard_DS15_v2', 'Standard_DS13-4_v2', 'Standard_DS13-2_v2', - 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', 'Standard_E2_v3', - 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', 'Standard_E32_v3', - 'Standard_E64_v3', 'Standard_E2s_v3', 'Standard_E4s_v3', - 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E32s_v3', - 'Standard_E64s_v3', 'Standard_E32-16_v3', 'Standard_E32-8s_v3', - 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', 'Standard_F1', - 'Standard_F2', 'Standard_F4', 'Standard_F8', 'Standard_F16', - 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', 'Standard_F8s', - 'Standard_F16s', 'Standard_F2s_v2', 'Standard_F4s_v2', 'Standard_F8s_v2', - 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', - 'Standard_F72s_v2', 'Standard_G1', 'Standard_G2', 'Standard_G3', - 'Standard_G4', 'Standard_G5', 'Standard_GS1', 'Standard_GS2', - 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_GS4-8', - 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', 'Standard_H8', - 'Standard_H16', 'Standard_H8m', 'Standard_H16m', 'Standard_H16r', - 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', 'Standard_L16s', - 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', 'Standard_M128s', - 'Standard_M128ms', 'Standard_M64-32ms', 'Standard_M64-16ms', - 'Standard_M128-64ms', 'Standard_M128-32ms', 'Standard_NC6', - 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', 'Standard_NC6s_v2', - 'Standard_NC12s_v2', 'Standard_NC24s_v2', 'Standard_NC24rs_v2', - 'Standard_NC6s_v3', 'Standard_NC12s_v3', 'Standard_NC24s_v3', - 'Standard_NC24rs_v3', 'Standard_ND6s', 'Standard_ND12s', 'Standard_ND24s', - 'Standard_ND24rs', 'Standard_NV6', 'Standard_NV12', 'Standard_NV24' + set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes) +

[List all available virtual machine sizes in a + region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list) +

[List all available virtual machine sizes for + resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). + Possible values include: 'Basic_A0', 'Basic_A1', 'Basic_A2', 'Basic_A3', + 'Basic_A4', 'Standard_A0', 'Standard_A1', 'Standard_A2', 'Standard_A3', + 'Standard_A4', 'Standard_A5', 'Standard_A6', 'Standard_A7', 'Standard_A8', + 'Standard_A9', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + 'Standard_A2_v2', 'Standard_A4_v2', 'Standard_A8_v2', 'Standard_A2m_v2', + 'Standard_A4m_v2', 'Standard_A8m_v2', 'Standard_B1s', 'Standard_B1ms', + 'Standard_B2s', 'Standard_B2ms', 'Standard_B4ms', 'Standard_B8ms', + 'Standard_D1', 'Standard_D2', 'Standard_D3', 'Standard_D4', + 'Standard_D11', 'Standard_D12', 'Standard_D13', 'Standard_D14', + 'Standard_D1_v2', 'Standard_D2_v2', 'Standard_D3_v2', 'Standard_D4_v2', + 'Standard_D5_v2', 'Standard_D2_v3', 'Standard_D4_v3', 'Standard_D8_v3', + 'Standard_D16_v3', 'Standard_D32_v3', 'Standard_D64_v3', + 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_D13_v2', + 'Standard_D14_v2', 'Standard_D15_v2', 'Standard_DS1', 'Standard_DS2', + 'Standard_DS3', 'Standard_DS4', 'Standard_DS11', 'Standard_DS12', + 'Standard_DS13', 'Standard_DS14', 'Standard_DS1_v2', 'Standard_DS2_v2', + 'Standard_DS3_v2', 'Standard_DS4_v2', 'Standard_DS5_v2', + 'Standard_DS11_v2', 'Standard_DS12_v2', 'Standard_DS13_v2', + 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_DS13-4_v2', + 'Standard_DS13-2_v2', 'Standard_DS14-8_v2', 'Standard_DS14-4_v2', + 'Standard_E2_v3', 'Standard_E4_v3', 'Standard_E8_v3', 'Standard_E16_v3', + 'Standard_E32_v3', 'Standard_E64_v3', 'Standard_E2s_v3', + 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', + 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_E32-16_v3', + 'Standard_E32-8s_v3', 'Standard_E64-32s_v3', 'Standard_E64-16s_v3', + 'Standard_F1', 'Standard_F2', 'Standard_F4', 'Standard_F8', + 'Standard_F16', 'Standard_F1s', 'Standard_F2s', 'Standard_F4s', + 'Standard_F8s', 'Standard_F16s', 'Standard_F2s_v2', 'Standard_F4s_v2', + 'Standard_F8s_v2', 'Standard_F16s_v2', 'Standard_F32s_v2', + 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_G1', 'Standard_G2', + 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', + 'Standard_GS4-8', 'Standard_GS4-4', 'Standard_GS5-16', 'Standard_GS5-8', + 'Standard_H8', 'Standard_H16', 'Standard_H8m', 'Standard_H16m', + 'Standard_H16r', 'Standard_H16mr', 'Standard_L4s', 'Standard_L8s', + 'Standard_L16s', 'Standard_L32s', 'Standard_M64s', 'Standard_M64ms', + 'Standard_M128s', 'Standard_M128ms', 'Standard_M64-32ms', + 'Standard_M64-16ms', 'Standard_M128-64ms', 'Standard_M128-32ms', + 'Standard_NC6', 'Standard_NC12', 'Standard_NC24', 'Standard_NC24r', + 'Standard_NC6s_v2', 'Standard_NC12s_v2', 'Standard_NC24s_v2', + 'Standard_NC24rs_v2', 'Standard_NC6s_v3', 'Standard_NC12s_v3', + 'Standard_NC24s_v3', 'Standard_NC24rs_v3', 'Standard_ND6s', + 'Standard_ND12s', 'Standard_ND24s', 'Standard_ND24rs', 'Standard_NV6', + 'Standard_NV12', 'Standard_NV24' :type vm_size: str or ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineSizeTypes """ diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk.py index f5f5c009b54e5..e76e41cca6d8f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk.py @@ -54,7 +54,7 @@ class ImageDataDisk(Model): 'blob_uri': {'key': 'blobUri', 'type': 'str'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } def __init__(self, **kwargs): diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk_py3.py index fa6eb1bdd30b9..35a0d4d0c2585 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_data_disk_py3.py @@ -54,7 +54,7 @@ class ImageDataDisk(Model): 'blob_uri': {'key': 'blobUri', 'type': 'str'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } def __init__(self, *, lun: int, snapshot=None, managed_disk=None, blob_uri: str=None, caching=None, disk_size_gb: int=None, storage_account_type=None, **kwargs) -> None: diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk.py index afb4cfee8502e..db6617085242e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk.py @@ -62,7 +62,7 @@ class ImageOSDisk(Model): 'blob_uri': {'key': 'blobUri', 'type': 'str'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } def __init__(self, **kwargs): diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk_py3.py index 82cf4bc8a8ffc..c38df84775fb0 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_os_disk_py3.py @@ -62,7 +62,7 @@ class ImageOSDisk(Model): 'blob_uri': {'key': 'blobUri', 'type': 'str'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } def __init__(self, *, os_type, os_state, snapshot=None, managed_disk=None, blob_uri: str=None, caching=None, disk_size_gb: int=None, storage_account_type=None, **kwargs) -> None: diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile.py index 38ddf6bf59270..e6979e05df271 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile.py @@ -28,10 +28,6 @@ class ImageStorageProfile(Model): machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). :type data_disks: list[~azure.mgmt.compute.v2017_12_01.models.ImageDataDisk] - :param zone_resilient: Specifies whether an image is zone resilient or - not. Default is false. Zone resilient images can be created only in - regions that provide Zone Redundant Storage (ZRS). - :type zone_resilient: bool """ _validation = { @@ -41,11 +37,9 @@ class ImageStorageProfile(Model): _attribute_map = { 'os_disk': {'key': 'osDisk', 'type': 'ImageOSDisk'}, 'data_disks': {'key': 'dataDisks', 'type': '[ImageDataDisk]'}, - 'zone_resilient': {'key': 'zoneResilient', 'type': 'bool'}, } def __init__(self, **kwargs): super(ImageStorageProfile, self).__init__(**kwargs) self.os_disk = kwargs.get('os_disk', None) self.data_disks = kwargs.get('data_disks', None) - self.zone_resilient = kwargs.get('zone_resilient', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile_py3.py index 39e3c9892e389..e8b4ebcf371df 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_storage_profile_py3.py @@ -28,10 +28,6 @@ class ImageStorageProfile(Model): machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). :type data_disks: list[~azure.mgmt.compute.v2017_12_01.models.ImageDataDisk] - :param zone_resilient: Specifies whether an image is zone resilient or - not. Default is false. Zone resilient images can be created only in - regions that provide Zone Redundant Storage (ZRS). - :type zone_resilient: bool """ _validation = { @@ -41,11 +37,9 @@ class ImageStorageProfile(Model): _attribute_map = { 'os_disk': {'key': 'osDisk', 'type': 'ImageOSDisk'}, 'data_disks': {'key': 'dataDisks', 'type': '[ImageDataDisk]'}, - 'zone_resilient': {'key': 'zoneResilient', 'type': 'bool'}, } - def __init__(self, *, os_disk, data_disks=None, zone_resilient: bool=None, **kwargs) -> None: + def __init__(self, *, os_disk, data_disks=None, **kwargs) -> None: super(ImageStorageProfile, self).__init__(**kwargs) self.os_disk = os_disk self.data_disks = data_disks - self.zone_resilient = zone_resilient diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_update.py new file mode 100644 index 0000000000000..0bf42c8181e21 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_update.py @@ -0,0 +1,52 @@ +# 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 ImageUpdate(UpdateResource): + """The source user image virtual hard disk. The virtual hard disk will be + copied before being attached to the virtual machine. If SourceImage is + provided, the destination virtual hard drive must not exist. + + 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 source_virtual_machine: The source virtual machine from which Image + is created. + :type source_virtual_machine: + ~azure.mgmt.compute.v2017_12_01.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_12_01.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source_virtual_machine': {'key': 'properties.sourceVirtualMachine', 'type': 'SubResource'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'ImageStorageProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImageUpdate, self).__init__(**kwargs) + self.source_virtual_machine = kwargs.get('source_virtual_machine', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_update_py3.py new file mode 100644 index 0000000000000..0638ddf354e4f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/image_update_py3.py @@ -0,0 +1,52 @@ +# 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 ImageUpdate(UpdateResource): + """The source user image virtual hard disk. The virtual hard disk will be + copied before being attached to the virtual machine. If SourceImage is + provided, the destination virtual hard drive must not exist. + + 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 source_virtual_machine: The source virtual machine from which Image + is created. + :type source_virtual_machine: + ~azure.mgmt.compute.v2017_12_01.models.SubResource + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_12_01.models.ImageStorageProfile + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'source_virtual_machine': {'key': 'properties.sourceVirtualMachine', 'type': 'SubResource'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'ImageStorageProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, tags=None, source_virtual_machine=None, storage_profile=None, **kwargs) -> None: + super(ImageUpdate, self).__init__(tags=tags, **kwargs) + self.source_virtual_machine = source_virtual_machine + self.storage_profile = storage_profile + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters.py index 508b95430415f..079a2fcdb0df8 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters.py @@ -26,7 +26,7 @@ class ManagedDiskParameters(SubResource): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } def __init__(self, **kwargs): diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters_py3.py index cd11679f5f8d9..8ee2f1827b117 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/managed_disk_parameters_py3.py @@ -26,7 +26,7 @@ class ManagedDiskParameters(SubResource): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } def __init__(self, *, id: str=None, storage_account_type=None, **kwargs) -> None: diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk.py index a81c8e1fec5e1..07d1b88be3823 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk.py @@ -78,7 +78,7 @@ class OSDisk(Model): 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, - 'create_option': {'key': 'createOption', 'type': 'str'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, } diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk_py3.py index edfcc1b27230c..d391d8cdd710a 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/os_disk_py3.py @@ -78,7 +78,7 @@ class OSDisk(Model): 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, - 'create_option': {'key': 'createOption', 'type': 'str'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, 'managed_disk': {'key': 'managedDisk', 'type': 'ManagedDiskParameters'}, } diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set.py index 44cd8f8685abc..4a0e417501e7f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set.py @@ -57,12 +57,6 @@ class VirtualMachineScaleSet(Resource): :param single_placement_group: When true this limits the scale set to a single placement group, of max size 100 virtual machines. :type single_placement_group: bool - :param zone_balance: Whether to force stictly even Virtual Machine - distribution cross x-zones in case there is zone outage. - :type zone_balance: bool - :param platform_fault_domain_count: Fault Domain count for each placement - group. - :type platform_fault_domain_count: int :param identity: The identity of the virtual machine scale set, if configured. :type identity: @@ -94,8 +88,6 @@ class VirtualMachineScaleSet(Resource): 'overprovision': {'key': 'properties.overprovision', 'type': 'bool'}, 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, 'single_placement_group': {'key': 'properties.singlePlacementGroup', 'type': 'bool'}, - 'zone_balance': {'key': 'properties.zoneBalance', 'type': 'bool'}, - 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, 'zones': {'key': 'zones', 'type': '[str]'}, } @@ -110,7 +102,5 @@ def __init__(self, **kwargs): self.overprovision = kwargs.get('overprovision', None) self.unique_id = None self.single_placement_group = kwargs.get('single_placement_group', None) - self.zone_balance = kwargs.get('zone_balance', None) - self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) self.identity = kwargs.get('identity', None) self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk.py index fc62cb57fc02d..5f37f4f580094 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk.py @@ -54,7 +54,7 @@ class VirtualMachineScaleSetDataDisk(Model): 'lun': {'key': 'lun', 'type': 'int'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, - 'create_option': {'key': 'createOption', 'type': 'str'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, } diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk_py3.py index 51ebc8cdd38a4..eb7e15d66afcf 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_data_disk_py3.py @@ -54,7 +54,7 @@ class VirtualMachineScaleSetDataDisk(Model): 'lun': {'key': 'lun', 'type': 'int'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, - 'create_option': {'key': 'createOption', 'type': 'str'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, 'disk_size_gb': {'key': 'diskSizeGB', 'type': 'int'}, 'managed_disk': {'key': 'managedDisk', 'type': 'VirtualMachineScaleSetManagedDiskParameters'}, } diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters.py index 44d6a698cc437..4914dfaa9c26d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters.py @@ -23,7 +23,7 @@ class VirtualMachineScaleSetManagedDiskParameters(Model): """ _attribute_map = { - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } def __init__(self, **kwargs): diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters_py3.py index b385ed7af268e..992f4a4489ca2 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_managed_disk_parameters_py3.py @@ -23,7 +23,7 @@ class VirtualMachineScaleSetManagedDiskParameters(Model): """ _attribute_map = { - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } def __init__(self, *, storage_account_type=None, **kwargs) -> None: diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk.py index 24fa8103eef7e..8eb1e19ab30dc 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk.py @@ -61,7 +61,7 @@ class VirtualMachineScaleSetOSDisk(Model): 'name': {'key': 'name', 'type': 'str'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, - 'create_option': {'key': 'createOption', 'type': 'str'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk_py3.py index cd6f8e0254fd3..38fd29ff931fb 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_os_disk_py3.py @@ -61,7 +61,7 @@ class VirtualMachineScaleSetOSDisk(Model): 'name': {'key': 'name', 'type': 'str'}, 'caching': {'key': 'caching', 'type': 'CachingTypes'}, 'write_accelerator_enabled': {'key': 'writeAcceleratorEnabled', 'type': 'bool'}, - 'create_option': {'key': 'createOption', 'type': 'str'}, + 'create_option': {'key': 'createOption', 'type': 'DiskCreateOptionTypes'}, 'os_type': {'key': 'osType', 'type': 'OperatingSystemTypes'}, 'image': {'key': 'image', 'type': 'VirtualHardDisk'}, 'vhd_containers': {'key': 'vhdContainers', 'type': '[str]'}, diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_py3.py index 6894911e1e4ba..5bde5456c2c15 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_py3.py @@ -57,12 +57,6 @@ class VirtualMachineScaleSet(Resource): :param single_placement_group: When true this limits the scale set to a single placement group, of max size 100 virtual machines. :type single_placement_group: bool - :param zone_balance: Whether to force stictly even Virtual Machine - distribution cross x-zones in case there is zone outage. - :type zone_balance: bool - :param platform_fault_domain_count: Fault Domain count for each placement - group. - :type platform_fault_domain_count: int :param identity: The identity of the virtual machine scale set, if configured. :type identity: @@ -94,13 +88,11 @@ class VirtualMachineScaleSet(Resource): 'overprovision': {'key': 'properties.overprovision', 'type': 'bool'}, 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, 'single_placement_group': {'key': 'properties.singlePlacementGroup', 'type': 'bool'}, - 'zone_balance': {'key': 'properties.zoneBalance', 'type': 'bool'}, - 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, *, location: str, tags=None, sku=None, plan=None, upgrade_policy=None, virtual_machine_profile=None, overprovision: bool=None, single_placement_group: bool=None, zone_balance: bool=None, platform_fault_domain_count: int=None, identity=None, zones=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, sku=None, plan=None, upgrade_policy=None, virtual_machine_profile=None, overprovision: bool=None, single_placement_group: bool=None, identity=None, zones=None, **kwargs) -> None: super(VirtualMachineScaleSet, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.plan = plan @@ -110,7 +102,5 @@ def __init__(self, *, location: str, tags=None, sku=None, plan=None, upgrade_pol self.overprovision = overprovision self.unique_id = None self.single_placement_group = single_placement_group - self.zone_balance = zone_balance - self.platform_fault_domain_count = platform_fault_domain_count self.identity = identity self.zones = zones diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view.py index b5b91ca14be96..f07a8a977208e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view.py @@ -27,10 +27,6 @@ class VirtualMachineScaleSetVMInstanceView(Model): :param vm_agent: The VM Agent running on the virtual machine. :type vm_agent: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineAgentInstanceView - :param maintenance_redeploy_status: The Maintenance Operation status on - the virtual machine. - :type maintenance_redeploy_status: - ~azure.mgmt.compute.v2017_12_01.models.MaintenanceRedeployStatus :param disks: The disks information. :type disks: list[~azure.mgmt.compute.v2017_12_01.models.DiskInstanceView] :param extensions: The extensions information. @@ -63,7 +59,6 @@ class VirtualMachineScaleSetVMInstanceView(Model): 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, - 'maintenance_redeploy_status': {'key': 'maintenanceRedeployStatus', 'type': 'MaintenanceRedeployStatus'}, 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, 'vm_health': {'key': 'vmHealth', 'type': 'VirtualMachineHealthStatus'}, @@ -78,7 +73,6 @@ def __init__(self, **kwargs): self.platform_fault_domain = kwargs.get('platform_fault_domain', None) self.rdp_thumb_print = kwargs.get('rdp_thumb_print', None) self.vm_agent = kwargs.get('vm_agent', None) - self.maintenance_redeploy_status = kwargs.get('maintenance_redeploy_status', None) self.disks = kwargs.get('disks', None) self.extensions = kwargs.get('extensions', None) self.vm_health = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view_py3.py index 61fbe15427fa8..619d1c06b3538 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm_instance_view_py3.py @@ -27,10 +27,6 @@ class VirtualMachineScaleSetVMInstanceView(Model): :param vm_agent: The VM Agent running on the virtual machine. :type vm_agent: ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineAgentInstanceView - :param maintenance_redeploy_status: The Maintenance Operation status on - the virtual machine. - :type maintenance_redeploy_status: - ~azure.mgmt.compute.v2017_12_01.models.MaintenanceRedeployStatus :param disks: The disks information. :type disks: list[~azure.mgmt.compute.v2017_12_01.models.DiskInstanceView] :param extensions: The extensions information. @@ -63,7 +59,6 @@ class VirtualMachineScaleSetVMInstanceView(Model): 'platform_fault_domain': {'key': 'platformFaultDomain', 'type': 'int'}, 'rdp_thumb_print': {'key': 'rdpThumbPrint', 'type': 'str'}, 'vm_agent': {'key': 'vmAgent', 'type': 'VirtualMachineAgentInstanceView'}, - 'maintenance_redeploy_status': {'key': 'maintenanceRedeployStatus', 'type': 'MaintenanceRedeployStatus'}, 'disks': {'key': 'disks', 'type': '[DiskInstanceView]'}, 'extensions': {'key': 'extensions', 'type': '[VirtualMachineExtensionInstanceView]'}, 'vm_health': {'key': 'vmHealth', 'type': 'VirtualMachineHealthStatus'}, @@ -72,13 +67,12 @@ class VirtualMachineScaleSetVMInstanceView(Model): 'placement_group_id': {'key': 'placementGroupId', 'type': 'str'}, } - def __init__(self, *, platform_update_domain: int=None, platform_fault_domain: int=None, rdp_thumb_print: str=None, vm_agent=None, maintenance_redeploy_status=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, placement_group_id: str=None, **kwargs) -> None: + def __init__(self, *, platform_update_domain: int=None, platform_fault_domain: int=None, rdp_thumb_print: str=None, vm_agent=None, disks=None, extensions=None, boot_diagnostics=None, statuses=None, placement_group_id: str=None, **kwargs) -> None: super(VirtualMachineScaleSetVMInstanceView, self).__init__(**kwargs) self.platform_update_domain = platform_update_domain self.platform_fault_domain = platform_fault_domain self.rdp_thumb_print = rdp_thumb_print self.vm_agent = vm_agent - self.maintenance_redeploy_status = maintenance_redeploy_status self.disks = disks self.extensions = extensions self.vm_health = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_update.py new file mode 100644 index 0000000000000..6c929e30f167a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_update.py @@ -0,0 +1,126 @@ +# 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 VirtualMachineUpdate(UpdateResource): + """Describes a Virtual Machine. + + 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 plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2017_12_01.models.Plan + :param hardware_profile: Specifies the hardware settings for the virtual + machine. + :type hardware_profile: + ~azure.mgmt.compute.v2017_12_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_12_01.models.StorageProfile + :param os_profile: Specifies the operating system settings for the virtual + machine. + :type os_profile: ~azure.mgmt.compute.v2017_12_01.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual + machine. + :type network_profile: + ~azure.mgmt.compute.v2017_12_01.models.NetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2017_12_01.models.DiagnosticsProfile + :param availability_set: 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). +

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) +

Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: ~azure.mgmt.compute.v2017_12_01.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

Possible values are: +

Windows_Client

Windows_Server

If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

Minimum api-version: 2015-06-15 + :type license_type: str + :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier + that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read + using platform BIOS commands. + :vartype vm_id: str + :param identity: The identity of the virtual machine, if configured. + :type identity: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineIdentity + :param zones: The virtual machine zones. + :type zones: list[str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'vm_id': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineUpdate, self).__init__(**kwargs) + self.plan = kwargs.get('plan', None) + self.hardware_profile = kwargs.get('hardware_profile', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.os_profile = kwargs.get('os_profile', None) + self.network_profile = kwargs.get('network_profile', None) + self.diagnostics_profile = kwargs.get('diagnostics_profile', None) + self.availability_set = kwargs.get('availability_set', None) + self.provisioning_state = None + self.instance_view = None + self.license_type = kwargs.get('license_type', None) + self.vm_id = None + self.identity = kwargs.get('identity', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_update_py3.py new file mode 100644 index 0000000000000..750c42bc18934 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_update_py3.py @@ -0,0 +1,126 @@ +# 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 VirtualMachineUpdate(UpdateResource): + """Describes a Virtual Machine. + + 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 plan: Specifies information about the marketplace image used to + create the virtual machine. This element is only used for marketplace + images. Before you can use a marketplace image from an API, you must + enable the image for programmatic use. In the Azure portal, find the + marketplace image that you want to use and then click **Want to deploy + programmatically, Get Started ->**. Enter any required information and + then click **Save**. + :type plan: ~azure.mgmt.compute.v2017_12_01.models.Plan + :param hardware_profile: Specifies the hardware settings for the virtual + machine. + :type hardware_profile: + ~azure.mgmt.compute.v2017_12_01.models.HardwareProfile + :param storage_profile: Specifies the storage settings for the virtual + machine disks. + :type storage_profile: + ~azure.mgmt.compute.v2017_12_01.models.StorageProfile + :param os_profile: Specifies the operating system settings for the virtual + machine. + :type os_profile: ~azure.mgmt.compute.v2017_12_01.models.OSProfile + :param network_profile: Specifies the network interfaces of the virtual + machine. + :type network_profile: + ~azure.mgmt.compute.v2017_12_01.models.NetworkProfile + :param diagnostics_profile: Specifies the boot diagnostic settings state. +

Minimum api-version: 2015-06-15. + :type diagnostics_profile: + ~azure.mgmt.compute.v2017_12_01.models.DiagnosticsProfile + :param availability_set: 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). +

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) +

Currently, a VM can only be added to availability set at creation + time. An existing VM cannot be added to an availability set. + :type availability_set: ~azure.mgmt.compute.v2017_12_01.models.SubResource + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineInstanceView + :param license_type: Specifies that the image or disk that is being used + was licensed on-premises. This element is only used for images that + contain the Windows Server operating system.

Possible values are: +

Windows_Client

Windows_Server

If this element + is included in a request for an update, the value must match the initial + value. This value cannot be updated.

For more information, see + [Azure Hybrid Use Benefit for Windows + Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) +

Minimum api-version: 2015-06-15 + :type license_type: str + :ivar vm_id: Specifies the VM unique ID which is a 128-bits identifier + that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read + using platform BIOS commands. + :vartype vm_id: str + :param identity: The identity of the virtual machine, if configured. + :type identity: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineIdentity + :param zones: The virtual machine zones. + :type zones: list[str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + 'vm_id': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'plan': {'key': 'plan', 'type': 'Plan'}, + 'hardware_profile': {'key': 'properties.hardwareProfile', 'type': 'HardwareProfile'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'os_profile': {'key': 'properties.osProfile', 'type': 'OSProfile'}, + 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, + 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, + 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'VirtualMachineIdentity'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, tags=None, plan=None, hardware_profile=None, storage_profile=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type: str=None, identity=None, zones=None, **kwargs) -> None: + super(VirtualMachineUpdate, self).__init__(tags=tags, **kwargs) + self.plan = plan + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.os_profile = os_profile + self.network_profile = network_profile + self.diagnostics_profile = diagnostics_profile + self.availability_set = availability_set + self.provisioning_state = None + self.instance_view = None + self.license_type = license_type + self.vm_id = None + self.identity = identity + self.zones = zones diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/__init__.py index 85d1b249d0f0b..bd63cedf0141f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/__init__.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/__init__.py @@ -9,6 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- +from .operations import Operations from .availability_sets_operations import AvailabilitySetsOperations from .virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations from .virtual_machine_extensions_operations import VirtualMachineExtensionsOperations @@ -25,6 +26,7 @@ from .virtual_machine_run_commands_operations import VirtualMachineRunCommandsOperations __all__ = [ + 'Operations', 'AvailabilitySetsOperations', 'VirtualMachineExtensionImagesOperations', 'VirtualMachineExtensionsOperations', diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/availability_sets_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/availability_sets_operations.py index f352b530b7bd0..5e2cc0d7f1162 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/availability_sets_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/availability_sets_operations.py @@ -107,6 +107,76 @@ def create_or_update( return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} + def update( + self, resource_group_name, availability_set_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update an availability set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param availability_set_name: The name of the availability set. + :type availability_set_name: str + :param parameters: Parameters supplied to the Update Availability Set + operation. + :type parameters: + ~azure.mgmt.compute.v2017_12_01.models.AvailabilitySetUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AvailabilitySet or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2017_12_01.models.AvailabilitySet or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'availabilitySetName': self._serialize.url("availability_set_name", availability_set_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AvailabilitySetUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AvailabilitySet', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}'} + def delete( self, resource_group_name, availability_set_name, custom_headers=None, raw=False, **operation_config): """Delete an availability set. diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/images_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/images_operations.py index 86ee8d072b58b..34a376803fc1e 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/images_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/images_operations.py @@ -142,6 +142,108 @@ def get_long_running_output(response): create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} + def _update_initial( + self, resource_group_name, image_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'imageName': self._serialize.url("image_name", image_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ImageUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Image', response) + if response.status_code == 201: + deserialized = self._deserialize('Image', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, image_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Update an image. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param image_name: The name of the image. + :type image_name: str + :param parameters: Parameters supplied to the Update Image operation. + :type parameters: ~azure.mgmt.compute.v2017_12_01.models.ImageUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Image or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.Image] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.Image]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + image_name=image_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Image', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}'} + + def _delete_initial( self, resource_group_name, image_name, custom_headers=None, raw=False, **operation_config): # Construct URL diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/operations.py new file mode 100644 index 0000000000000..5681f620623e9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/operations.py @@ -0,0 +1,99 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2017-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-12-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of compute operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ComputeOperationValue + :rtype: + ~azure.mgmt.compute.v2017_12_01.models.ComputeOperationValuePaged[~azure.mgmt.compute.v2017_12_01.models.ComputeOperationValue] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ComputeOperationValuePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ComputeOperationValuePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Compute/operations'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_vms_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_vms_operations.py index 6682590a37818..2cf7213a0b2c1 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_vms_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_set_vms_operations.py @@ -1052,197 +1052,3 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start'} - - - def _redeploy_initial( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.redeploy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), - 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('OperationStatusResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def redeploy( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): - """Redeploys a virtual machine in a VM scale set. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param vm_scale_set_name: The name of the VM scale set. - :type vm_scale_set_name: str - :param instance_id: The instance ID of the virtual machine. - :type instance_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns OperationStatusResponse - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] - :raises: :class:`CloudError` - """ - raw_result = self._redeploy_initial( - resource_group_name=resource_group_name, - vm_scale_set_name=vm_scale_set_name, - instance_id=instance_id, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('OperationStatusResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy'} - - - def _perform_maintenance_initial( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.perform_maintenance.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), - 'instanceId': self._serialize.url("instance_id", instance_id, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('OperationStatusResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def perform_maintenance( - self, resource_group_name, vm_scale_set_name, instance_id, custom_headers=None, raw=False, polling=True, **operation_config): - """Performs maintenance on a virtual machine in a VM scale set. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param vm_scale_set_name: The name of the VM scale set. - :type vm_scale_set_name: str - :param instance_id: The instance ID of the virtual machine. - :type instance_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns OperationStatusResponse - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] - :raises: :class:`CloudError` - """ - raw_result = self._perform_maintenance_initial( - resource_group_name=resource_group_name, - vm_scale_set_name=vm_scale_set_name, - instance_id=instance_id, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('OperationStatusResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - perform_maintenance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_sets_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_sets_operations.py index d90905df725b4..e8201b63099e3 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_sets_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machine_scale_sets_operations.py @@ -1221,226 +1221,6 @@ def get_long_running_output(response): start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start'} - def _redeploy_initial( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): - vm_instance_ids = None - if instance_ids is not None: - vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) - - # Construct URL - url = self.redeploy.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - if vm_instance_ids is not None: - body_content = self._serialize.body(vm_instance_ids, 'VirtualMachineScaleSetVMInstanceIDs') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('OperationStatusResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def redeploy( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Redeploy one or more virtual machines in a VM scale set. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param vm_scale_set_name: The name of the VM scale set. - :type vm_scale_set_name: str - :param instance_ids: The virtual machine scale set instance ids. - Omitting the virtual machine scale set instance ids will result in the - operation being performed on all virtual machines in the virtual - machine scale set. - :type instance_ids: list[str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns OperationStatusResponse - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] - :raises: :class:`CloudError` - """ - raw_result = self._redeploy_initial( - resource_group_name=resource_group_name, - vm_scale_set_name=vm_scale_set_name, - instance_ids=instance_ids, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('OperationStatusResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - redeploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy'} - - - def _perform_maintenance_initial( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, **operation_config): - vm_instance_ids = None - if instance_ids is not None: - vm_instance_ids = models.VirtualMachineScaleSetVMInstanceIDs(instance_ids=instance_ids) - - # Construct URL - url = self.perform_maintenance.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'vmScaleSetName': self._serialize.url("vm_scale_set_name", vm_scale_set_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - if vm_instance_ids is not None: - body_content = self._serialize.body(vm_instance_ids, 'VirtualMachineScaleSetVMInstanceIDs') - else: - body_content = None - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('OperationStatusResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def perform_maintenance( - self, resource_group_name, vm_scale_set_name, instance_ids=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Perform maintenance on one or more virtual machines in a VM scale set. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param vm_scale_set_name: The name of the VM scale set. - :type vm_scale_set_name: str - :param instance_ids: The virtual machine scale set instance ids. - Omitting the virtual machine scale set instance ids will result in the - operation being performed on all virtual machines in the virtual - machine scale set. - :type instance_ids: list[str] - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns OperationStatusResponse - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.OperationStatusResponse]] - :raises: :class:`CloudError` - """ - raw_result = self._perform_maintenance_initial( - resource_group_name=resource_group_name, - vm_scale_set_name=vm_scale_set_name, - instance_ids=instance_ids, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('OperationStatusResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - perform_maintenance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance'} - - def _update_instances_initial( self, resource_group_name, vm_scale_set_name, instance_ids, custom_headers=None, raw=False, **operation_config): vm_instance_ids = models.VirtualMachineScaleSetVMInstanceRequiredIDs(instance_ids=instance_ids) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machines_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machines_operations.py index 6d65f5ca9e489..bcb4e2034ef23 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machines_operations.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/virtual_machines_operations.py @@ -248,6 +248,110 @@ def get_long_running_output(response): create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} + def _update_initial( + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vmName': self._serialize.url("vm_name", vm_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'VirtualMachineUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachine', response) + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, vm_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """The operation to update a virtual machine. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param vm_name: The name of the virtual machine. + :type vm_name: str + :param parameters: Parameters supplied to the Update Virtual Machine + operation. + :type parameters: + ~azure.mgmt.compute.v2017_12_01.models.VirtualMachineUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns VirtualMachine or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2017_12_01.models.VirtualMachine] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2017_12_01.models.VirtualMachine]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + vm_name=vm_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('VirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}'} + + def _delete_initial( self, resource_group_name, vm_name, custom_headers=None, raw=False, **operation_config): # Construct URL diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py new file mode 100644 index 0000000000000..88ded2f640dee --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/__init__.py @@ -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 + diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/compute_management_client.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/compute_management_client.py new file mode 100644 index 0000000000000..382bad2d0135f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/compute_management_client.py @@ -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 ServiceClient +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` + :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(object): + """Compute Client + + :ivar config: Configuration for client. + :vartype config: ComputeManagementClientConfiguration + + :ivar disks: Disks operations + :vartype disks: azure.mgmt.compute.v2018_04_01.operations.DisksOperations + :ivar snapshots: Snapshots operations + :vartype snapshots: azure.mgmt.compute.v2018_04_01.operations.SnapshotsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :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) + self._client = ServiceClient(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-04-01' + 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) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/__init__.py new file mode 100644 index 0000000000000..e9b76b3dc97d0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/__init__.py @@ -0,0 +1,92 @@ +# 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 .resource_update_py3 import ResourceUpdate + 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_py3 import EncryptionSettings + 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 + from .api_error_base_py3 import ApiErrorBase + from .inner_error_py3 import InnerError + from .api_error_py3 import ApiError + from .operation_status_response_py3 import OperationStatusResponse +except (SyntaxError, ImportError): + from .resource import Resource + from .disk_sku import DiskSku + from .resource_update import ResourceUpdate + 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 import EncryptionSettings + 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 .api_error_base import ApiErrorBase + from .inner_error import InnerError + from .api_error import ApiError + from .operation_status_response import OperationStatusResponse +from .disk_paged import DiskPaged +from .snapshot_paged import SnapshotPaged +from .compute_management_client_enums import ( + StorageAccountTypes, + OperatingSystemTypes, + DiskCreateOption, + SnapshotStorageAccountTypes, + AccessLevel, +) + +__all__ = [ + 'Resource', + 'DiskSku', + 'ResourceUpdate', + 'ImageDiskReference', + 'CreationData', + 'SourceVault', + 'KeyVaultAndSecretReference', + 'KeyVaultAndKeyReference', + 'EncryptionSettings', + 'Disk', + 'DiskUpdate', + 'SnapshotSku', + 'GrantAccessData', + 'AccessUri', + 'Snapshot', + 'SnapshotUpdate', + 'ApiErrorBase', + 'InnerError', + 'ApiError', + 'OperationStatusResponse', + 'DiskPaged', + 'SnapshotPaged', + 'StorageAccountTypes', + 'OperatingSystemTypes', + 'DiskCreateOption', + 'SnapshotStorageAccountTypes', + 'AccessLevel', +] diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/access_uri.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/access_uri.py new file mode 100644 index 0000000000000..9ee6b01de1e17 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/access_uri.py @@ -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': 'properties.output.accessSAS', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccessUri, self).__init__(**kwargs) + self.access_sas = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/access_uri_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/access_uri_py3.py new file mode 100644 index 0000000000000..bb9e56aa42216 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/access_uri_py3.py @@ -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': 'properties.output.accessSAS', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AccessUri, self).__init__(**kwargs) + self.access_sas = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error.py new file mode 100644 index 0000000000000..6c3ce23571f71 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error.py @@ -0,0 +1,44 @@ +# 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 ApiError(Model): + """Api error. + + :param details: The Api error details + :type details: list[~azure.mgmt.compute.v2018_04_01.models.ApiErrorBase] + :param innererror: The Api inner error + :type innererror: ~azure.mgmt.compute.v2018_04_01.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiError, self).__init__(**kwargs) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_base.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_base.py new file mode 100644 index 0000000000000..655c086389054 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_base.py @@ -0,0 +1,36 @@ +# 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 ApiErrorBase(Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApiErrorBase, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_base_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_base_py3.py new file mode 100644 index 0000000000000..5ba95aa0283e8 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_base_py3.py @@ -0,0 +1,36 @@ +# 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 ApiErrorBase(Model): + """Api error base. + + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ApiErrorBase, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_py3.py new file mode 100644 index 0000000000000..ad665ba385991 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/api_error_py3.py @@ -0,0 +1,44 @@ +# 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 ApiError(Model): + """Api error. + + :param details: The Api error details + :type details: list[~azure.mgmt.compute.v2018_04_01.models.ApiErrorBase] + :param innererror: The Api inner error + :type innererror: ~azure.mgmt.compute.v2018_04_01.models.InnerError + :param code: The error code. + :type code: str + :param target: The target of the particular error. + :type target: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'details': {'key': 'details', 'type': '[ApiErrorBase]'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, details=None, innererror=None, code: str=None, target: str=None, message: str=None, **kwargs) -> None: + super(ApiError, self).__init__(**kwargs) + self.details = details + self.innererror = innererror + self.code = code + self.target = target + self.message = message diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/compute_management_client_enums.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/compute_management_client_enums.py new file mode 100644 index 0000000000000..94796a92c7936 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/compute_management_client_enums.py @@ -0,0 +1,47 @@ +# 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 StorageAccountTypes(str, Enum): + + standard_lrs = "Standard_LRS" + premium_lrs = "Premium_LRS" + + +class OperatingSystemTypes(str, Enum): + + windows = "Windows" + linux = "Linux" + + +class DiskCreateOption(str, Enum): + + empty = "Empty" + attach = "Attach" + from_image = "FromImage" + import_enum = "Import" + copy = "Copy" + restore = "Restore" + + +class SnapshotStorageAccountTypes(str, Enum): + + standard_lrs = "Standard_LRS" + premium_lrs = "Premium_LRS" + standard_zrs = "Standard_ZRS" + + +class AccessLevel(str, Enum): + + none = "None" + read = "Read" diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/creation_data.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/creation_data.py new file mode 100644 index 0000000000000..a7abd1cfe8c86 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/creation_data.py @@ -0,0 +1,58 @@ +# 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 CreationData(Model): + """Data used when creating a disk. + + All required parameters must be populated in order to send to Azure. + + :param create_option: Required. This enumerates the possible sources of a + disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', + 'Import', 'Copy', 'Restore' + :type create_option: str or + ~azure.mgmt.compute.v2018_04_01.models.DiskCreateOption + :param storage_account_id: If createOption is Import, the Azure Resource + Manager identifier of the storage account containing the blob to import as + a disk. Required only if the blob is in a different subscription + :type storage_account_id: str + :param image_reference: Disk source information. + :type image_reference: + ~azure.mgmt.compute.v2018_04_01.models.ImageDiskReference + :param source_uri: If createOption is Import, this is the URI of a blob to + be imported into a managed disk. + :type source_uri: str + :param source_resource_id: If createOption is Copy, this is the ARM id of + the source snapshot or disk. + :type source_resource_id: str + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'image_reference': {'key': 'imageReference', 'type': 'ImageDiskReference'}, + 'source_uri': {'key': 'sourceUri', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CreationData, self).__init__(**kwargs) + self.create_option = kwargs.get('create_option', None) + self.storage_account_id = kwargs.get('storage_account_id', None) + self.image_reference = kwargs.get('image_reference', None) + self.source_uri = kwargs.get('source_uri', None) + self.source_resource_id = kwargs.get('source_resource_id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/creation_data_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/creation_data_py3.py new file mode 100644 index 0000000000000..c4486c7da81b5 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/creation_data_py3.py @@ -0,0 +1,58 @@ +# 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 CreationData(Model): + """Data used when creating a disk. + + All required parameters must be populated in order to send to Azure. + + :param create_option: Required. This enumerates the possible sources of a + disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', + 'Import', 'Copy', 'Restore' + :type create_option: str or + ~azure.mgmt.compute.v2018_04_01.models.DiskCreateOption + :param storage_account_id: If createOption is Import, the Azure Resource + Manager identifier of the storage account containing the blob to import as + a disk. Required only if the blob is in a different subscription + :type storage_account_id: str + :param image_reference: Disk source information. + :type image_reference: + ~azure.mgmt.compute.v2018_04_01.models.ImageDiskReference + :param source_uri: If createOption is Import, this is the URI of a blob to + be imported into a managed disk. + :type source_uri: str + :param source_resource_id: If createOption is Copy, this is the ARM id of + the source snapshot or disk. + :type source_resource_id: str + """ + + _validation = { + 'create_option': {'required': True}, + } + + _attribute_map = { + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'image_reference': {'key': 'imageReference', 'type': 'ImageDiskReference'}, + 'source_uri': {'key': 'sourceUri', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + } + + def __init__(self, *, create_option, storage_account_id: str=None, image_reference=None, source_uri: str=None, source_resource_id: str=None, **kwargs) -> None: + super(CreationData, self).__init__(**kwargs) + self.create_option = create_option + self.storage_account_id = storage_account_id + self.image_reference = image_reference + self.source_uri = source_uri + self.source_resource_id = source_resource_id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk.py new file mode 100644 index 0000000000000..eed027e0056fe --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk.py @@ -0,0 +1,100 @@ +# 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 .resource import Resource + + +class Disk(Resource): + """Disk resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar managed_by: A relative URI containing the ID of the VM that has the + disk attached. + :vartype managed_by: str + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + :param zones: The Logical zone list for Disk. + :type zones: list[str] + :ivar time_created: The time when the disk was created. + :vartype time_created: datetime + :param os_type: The Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2018_04_01.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'time_created': {'readonly': True}, + 'creation_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Disk, self).__init__(**kwargs) + self.managed_by = None + self.sku = kwargs.get('sku', None) + self.zones = kwargs.get('zones', None) + self.time_created = None + self.os_type = kwargs.get('os_type', None) + self.creation_data = kwargs.get('creation_data', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_paged.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_paged.py new file mode 100644 index 0000000000000..aa6febc82f16f --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_paged.py @@ -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 DiskPaged(Paged): + """ + A paging container for iterating over a list of :class:`Disk ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Disk]'} + } + + def __init__(self, *args, **kwargs): + + super(DiskPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_py3.py new file mode 100644 index 0000000000000..34dd0febdc772 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_py3.py @@ -0,0 +1,100 @@ +# 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 .resource import Resource + + +class Disk(Resource): + """Disk resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar managed_by: A relative URI containing the ID of the VM that has the + disk attached. + :vartype managed_by: str + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + :param zones: The Logical zone list for Disk. + :type zones: list[str] + :ivar time_created: The time when the disk was created. + :vartype time_created: datetime + :param os_type: The Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2018_04_01.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'time_created': {'readonly': True}, + 'creation_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, creation_data, tags=None, sku=None, zones=None, os_type=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(Disk, self).__init__(location=location, tags=tags, **kwargs) + self.managed_by = None + self.sku = sku + self.zones = zones + self.time_created = None + self.os_type = os_type + self.creation_data = creation_data + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_sku.py new file mode 100644 index 0000000000000..f0bbc41f21e1a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_sku.py @@ -0,0 +1,41 @@ +# 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 DiskSku(Model): + """The disks sku name. Can be Standard_LRS or Premium_LRS. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The sku name. Possible values include: 'Standard_LRS', + 'Premium_LRS' + :type name: str or + ~azure.mgmt.compute.v2018_04_01.models.StorageAccountTypes + :ivar tier: The sku tier. Default value: "Standard" . + :vartype tier: str + """ + + _validation = { + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DiskSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_sku_py3.py new file mode 100644 index 0000000000000..99a2821b0aebc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_sku_py3.py @@ -0,0 +1,41 @@ +# 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 DiskSku(Model): + """The disks sku name. Can be Standard_LRS or Premium_LRS. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The sku name. Possible values include: 'Standard_LRS', + 'Premium_LRS' + :type name: str or + ~azure.mgmt.compute.v2018_04_01.models.StorageAccountTypes + :ivar tier: The sku tier. Default value: "Standard" . + :vartype tier: str + """ + + _validation = { + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(DiskSku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_update.py new file mode 100644 index 0000000000000..7364769892bfd --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_update.py @@ -0,0 +1,49 @@ +# 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 .resource_update import ResourceUpdate + + +class DiskUpdate(ResourceUpdate): + """Disk update resource. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + :param os_type: the Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + } + + def __init__(self, **kwargs): + super(DiskUpdate, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_update_py3.py new file mode 100644 index 0000000000000..0764da0e7f0cb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/disk_update_py3.py @@ -0,0 +1,49 @@ +# 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 .resource_update import ResourceUpdate + + +class DiskUpdate(ResourceUpdate): + """Disk update resource. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + :param os_type: the Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + } + + def __init__(self, *, tags=None, sku=None, os_type=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(DiskUpdate, self).__init__(tags=tags, sku=sku, **kwargs) + self.os_type = os_type + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/encryption_settings.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/encryption_settings.py new file mode 100644 index 0000000000000..5a17496c81b2b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/encryption_settings.py @@ -0,0 +1,44 @@ +# 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 EncryptionSettings(Model): + """Encryption settings for disk or snapshot. + + :param enabled: Set this flag to true and provide DiskEncryptionKey and + optional KeyEncryptionKey to enable encryption. Set this flag to false and + remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If + EncryptionSettings is null in the request object, the existing settings + remain unchanged. + :type enabled: bool + :param disk_encryption_key: Key Vault Secret Url and vault id of the disk + encryption key + :type disk_encryption_key: + ~azure.mgmt.compute.v2018_04_01.models.KeyVaultAndSecretReference + :param key_encryption_key: Key Vault Key Url and vault id of the key + encryption key + :type key_encryption_key: + ~azure.mgmt.compute.v2018_04_01.models.KeyVaultAndKeyReference + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultAndSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultAndKeyReference'}, + } + + def __init__(self, **kwargs): + super(EncryptionSettings, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.disk_encryption_key = kwargs.get('disk_encryption_key', None) + self.key_encryption_key = kwargs.get('key_encryption_key', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/encryption_settings_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/encryption_settings_py3.py new file mode 100644 index 0000000000000..f3ac5a66cb84b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/encryption_settings_py3.py @@ -0,0 +1,44 @@ +# 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 EncryptionSettings(Model): + """Encryption settings for disk or snapshot. + + :param enabled: Set this flag to true and provide DiskEncryptionKey and + optional KeyEncryptionKey to enable encryption. Set this flag to false and + remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If + EncryptionSettings is null in the request object, the existing settings + remain unchanged. + :type enabled: bool + :param disk_encryption_key: Key Vault Secret Url and vault id of the disk + encryption key + :type disk_encryption_key: + ~azure.mgmt.compute.v2018_04_01.models.KeyVaultAndSecretReference + :param key_encryption_key: Key Vault Key Url and vault id of the key + encryption key + :type key_encryption_key: + ~azure.mgmt.compute.v2018_04_01.models.KeyVaultAndKeyReference + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultAndSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultAndKeyReference'}, + } + + def __init__(self, *, enabled: bool=None, disk_encryption_key=None, key_encryption_key=None, **kwargs) -> None: + super(EncryptionSettings, self).__init__(**kwargs) + self.enabled = enabled + self.disk_encryption_key = disk_encryption_key + self.key_encryption_key = key_encryption_key diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/grant_access_data.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/grant_access_data.py new file mode 100644 index 0000000000000..30f3229efa0b5 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/grant_access_data.py @@ -0,0 +1,40 @@ +# 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 GrantAccessData(Model): + """Data used for requesting a SAS. + + All required parameters must be populated in order to send to Azure. + + :param access: Required. Possible values include: 'None', 'Read' + :type access: str or ~azure.mgmt.compute.v2018_04_01.models.AccessLevel + :param duration_in_seconds: Required. Time duration in seconds until the + SAS access expires. + :type duration_in_seconds: int + """ + + _validation = { + 'access': {'required': True}, + 'duration_in_seconds': {'required': True}, + } + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(GrantAccessData, self).__init__(**kwargs) + self.access = kwargs.get('access', None) + self.duration_in_seconds = kwargs.get('duration_in_seconds', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/grant_access_data_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/grant_access_data_py3.py new file mode 100644 index 0000000000000..0e6cf91e26cff --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/grant_access_data_py3.py @@ -0,0 +1,40 @@ +# 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 GrantAccessData(Model): + """Data used for requesting a SAS. + + All required parameters must be populated in order to send to Azure. + + :param access: Required. Possible values include: 'None', 'Read' + :type access: str or ~azure.mgmt.compute.v2018_04_01.models.AccessLevel + :param duration_in_seconds: Required. Time duration in seconds until the + SAS access expires. + :type duration_in_seconds: int + """ + + _validation = { + 'access': {'required': True}, + 'duration_in_seconds': {'required': True}, + } + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'int'}, + } + + def __init__(self, *, access, duration_in_seconds: int, **kwargs) -> None: + super(GrantAccessData, self).__init__(**kwargs) + self.access = access + self.duration_in_seconds = duration_in_seconds diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/image_disk_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/image_disk_reference.py new file mode 100644 index 0000000000000..247d532379fcb --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/image_disk_reference.py @@ -0,0 +1,41 @@ +# 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 ImageDiskReference(Model): + """The source image used for creating the disk. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. A relative uri containing either a Platform Imgage + Repository or user image reference. + :type id: str + :param lun: If the disk is created from an image's data disk, this is an + index that indicates which of the data disks in the image to use. For OS + disks, this field is null. + :type lun: int + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ImageDiskReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.lun = kwargs.get('lun', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/image_disk_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/image_disk_reference_py3.py new file mode 100644 index 0000000000000..191563557acb8 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/image_disk_reference_py3.py @@ -0,0 +1,41 @@ +# 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 ImageDiskReference(Model): + """The source image used for creating the disk. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. A relative uri containing either a Platform Imgage + Repository or user image reference. + :type id: str + :param lun: If the disk is created from an image's data disk, this is an + index that indicates which of the data disks in the image to use. For OS + disks, this field is null. + :type lun: int + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__(self, *, id: str, lun: int=None, **kwargs) -> None: + super(ImageDiskReference, self).__init__(**kwargs) + self.id = id + self.lun = lun diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/inner_error.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/inner_error.py new file mode 100644 index 0000000000000..6324249d7c19e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/inner_error.py @@ -0,0 +1,32 @@ +# 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 InnerError(Model): + """Inner error details. + + :param exceptiontype: The exception type. + :type exceptiontype: str + :param errordetail: The internal error message or exception dump. + :type errordetail: str + """ + + _attribute_map = { + 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, + 'errordetail': {'key': 'errordetail', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = kwargs.get('exceptiontype', None) + self.errordetail = kwargs.get('errordetail', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/inner_error_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/inner_error_py3.py new file mode 100644 index 0000000000000..ccec30d7b53f5 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/inner_error_py3.py @@ -0,0 +1,32 @@ +# 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 InnerError(Model): + """Inner error details. + + :param exceptiontype: The exception type. + :type exceptiontype: str + :param errordetail: The internal error message or exception dump. + :type errordetail: str + """ + + _attribute_map = { + 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, + 'errordetail': {'key': 'errordetail', 'type': 'str'}, + } + + def __init__(self, *, exceptiontype: str=None, errordetail: str=None, **kwargs) -> None: + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = exceptiontype + self.errordetail = errordetail diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_key_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_key_reference.py new file mode 100644 index 0000000000000..12c3b3b5516d9 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_key_reference.py @@ -0,0 +1,41 @@ +# 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 KeyVaultAndKeyReference(Model): + """Key Vault Key Url and vault id of KeK, KeK is optional and when provided is + used to unwrap the encryptionKey. + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret + :type source_vault: ~azure.mgmt.compute.v2018_04_01.models.SourceVault + :param key_url: Required. Url pointing to a key or secret in KeyVault + :type key_url: str + """ + + _validation = { + 'source_vault': {'required': True}, + 'key_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultAndKeyReference, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.key_url = kwargs.get('key_url', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_key_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_key_reference_py3.py new file mode 100644 index 0000000000000..ba330572235f0 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_key_reference_py3.py @@ -0,0 +1,41 @@ +# 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 KeyVaultAndKeyReference(Model): + """Key Vault Key Url and vault id of KeK, KeK is optional and when provided is + used to unwrap the encryptionKey. + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret + :type source_vault: ~azure.mgmt.compute.v2018_04_01.models.SourceVault + :param key_url: Required. Url pointing to a key or secret in KeyVault + :type key_url: str + """ + + _validation = { + 'source_vault': {'required': True}, + 'key_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + } + + def __init__(self, *, source_vault, key_url: str, **kwargs) -> None: + super(KeyVaultAndKeyReference, self).__init__(**kwargs) + self.source_vault = source_vault + self.key_url = key_url diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_secret_reference.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_secret_reference.py new file mode 100644 index 0000000000000..0e13cba0e3fd1 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_secret_reference.py @@ -0,0 +1,40 @@ +# 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 KeyVaultAndSecretReference(Model): + """Key Vault Secret Url and vault id of the encryption key . + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret + :type source_vault: ~azure.mgmt.compute.v2018_04_01.models.SourceVault + :param secret_url: Required. Url pointing to a key or secret in KeyVault + :type secret_url: str + """ + + _validation = { + 'source_vault': {'required': True}, + 'secret_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'secret_url': {'key': 'secretUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultAndSecretReference, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.secret_url = kwargs.get('secret_url', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_secret_reference_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_secret_reference_py3.py new file mode 100644 index 0000000000000..d342cfb37a142 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_secret_reference_py3.py @@ -0,0 +1,40 @@ +# 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 KeyVaultAndSecretReference(Model): + """Key Vault Secret Url and vault id of the encryption key . + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the + key or secret + :type source_vault: ~azure.mgmt.compute.v2018_04_01.models.SourceVault + :param secret_url: Required. Url pointing to a key or secret in KeyVault + :type secret_url: str + """ + + _validation = { + 'source_vault': {'required': True}, + 'secret_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'secret_url': {'key': 'secretUrl', 'type': 'str'}, + } + + def __init__(self, *, source_vault, secret_url: str, **kwargs) -> None: + super(KeyVaultAndSecretReference, self).__init__(**kwargs) + self.source_vault = source_vault + self.secret_url = secret_url diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/operation_status_response.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/operation_status_response.py new file mode 100644 index 0000000000000..3fc201f5913a6 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/operation_status_response.py @@ -0,0 +1,55 @@ +# 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 OperationStatusResponse(Model): + """Operation status response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation ID + :vartype name: str + :ivar status: Operation status + :vartype status: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar end_time: End time of the operation + :vartype end_time: datetime + :ivar error: Api error + :vartype error: ~azure.mgmt.compute.v2018_04_01.models.ApiError + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__(self, **kwargs): + super(OperationStatusResponse, self).__init__(**kwargs) + self.name = None + self.status = None + self.start_time = None + self.end_time = None + self.error = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/operation_status_response_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/operation_status_response_py3.py new file mode 100644 index 0000000000000..914868a019547 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/operation_status_response_py3.py @@ -0,0 +1,55 @@ +# 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 OperationStatusResponse(Model): + """Operation status response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Operation ID + :vartype name: str + :ivar status: Operation status + :vartype status: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar end_time: End time of the operation + :vartype end_time: datetime + :ivar error: Api error + :vartype error: ~azure.mgmt.compute.v2018_04_01.models.ApiError + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'ApiError'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationStatusResponse, self).__init__(**kwargs) + self.name = None + self.status = None + self.start_time = None + self.end_time = None + self.error = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource.py new file mode 100644 index 0000000000000..5dd7d481c685c --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource.py @@ -0,0 +1,56 @@ +# 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 Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_py3.py new file mode 100644 index 0000000000000..2f3702caf609a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_py3.py @@ -0,0 +1,56 @@ +# 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 Resource(Model): + """The Resource model definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_update.py new file mode 100644 index 0000000000000..1ab6fb273f491 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_update.py @@ -0,0 +1,32 @@ +# 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 ResourceUpdate(Model): + """The Resource model definition. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + } + + def __init__(self, **kwargs): + super(ResourceUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_update_py3.py new file mode 100644 index 0000000000000..1074982f93412 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/resource_update_py3.py @@ -0,0 +1,32 @@ +# 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 ResourceUpdate(Model): + """The Resource model definition. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + } + + def __init__(self, *, tags=None, sku=None, **kwargs) -> None: + super(ResourceUpdate, self).__init__(**kwargs) + self.tags = tags + self.sku = sku diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot.py new file mode 100644 index 0000000000000..31299f4758247 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot.py @@ -0,0 +1,95 @@ +# 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 .resource import Resource + + +class Snapshot(Resource): + """Snapshot resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar managed_by: Unused. Always Null. + :vartype managed_by: str + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.SnapshotSku + :ivar time_created: The time when the disk was created. + :vartype time_created: datetime + :param os_type: The Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2018_04_01.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'time_created': {'readonly': True}, + 'creation_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SnapshotSku'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Snapshot, self).__init__(**kwargs) + self.managed_by = None + self.sku = kwargs.get('sku', None) + self.time_created = None + self.os_type = kwargs.get('os_type', None) + self.creation_data = kwargs.get('creation_data', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_paged.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_paged.py new file mode 100644 index 0000000000000..5ff7a760fa0c3 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_paged.py @@ -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 SnapshotPaged(Paged): + """ + A paging container for iterating over a list of :class:`Snapshot ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Snapshot]'} + } + + def __init__(self, *args, **kwargs): + + super(SnapshotPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_py3.py new file mode 100644 index 0000000000000..ac1163f8980ff --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_py3.py @@ -0,0 +1,95 @@ +# 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 .resource import Resource + + +class Snapshot(Resource): + """Snapshot resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar managed_by: Unused. Always Null. + :vartype managed_by: str + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.SnapshotSku + :ivar time_created: The time when the disk was created. + :vartype time_created: datetime + :param os_type: The Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param creation_data: Required. Disk source information. CreationData + information cannot be changed after the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2018_04_01.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'time_created': {'readonly': True}, + 'creation_data': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SnapshotSku'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, creation_data, tags=None, sku=None, os_type=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(Snapshot, self).__init__(location=location, tags=tags, **kwargs) + self.managed_by = None + self.sku = sku + self.time_created = None + self.os_type = os_type + self.creation_data = creation_data + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings + self.provisioning_state = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_sku.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_sku.py new file mode 100644 index 0000000000000..91efbc68afa5a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_sku.py @@ -0,0 +1,41 @@ +# 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 SnapshotSku(Model): + """The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The sku name. Possible values include: 'Standard_LRS', + 'Premium_LRS', 'Standard_ZRS' + :type name: str or + ~azure.mgmt.compute.v2018_04_01.models.SnapshotStorageAccountTypes + :ivar tier: The sku tier. Default value: "Standard" . + :vartype tier: str + """ + + _validation = { + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SnapshotSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_sku_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_sku_py3.py new file mode 100644 index 0000000000000..9975abf7d6944 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_sku_py3.py @@ -0,0 +1,41 @@ +# 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 SnapshotSku(Model): + """The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The sku name. Possible values include: 'Standard_LRS', + 'Premium_LRS', 'Standard_ZRS' + :type name: str or + ~azure.mgmt.compute.v2018_04_01.models.SnapshotStorageAccountTypes + :ivar tier: The sku tier. Default value: "Standard" . + :vartype tier: str + """ + + _validation = { + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(SnapshotSku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_update.py new file mode 100644 index 0000000000000..6483ca6dd9819 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_update.py @@ -0,0 +1,49 @@ +# 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 .resource_update import ResourceUpdate + + +class SnapshotUpdate(ResourceUpdate): + """Snapshot update resource. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + :param os_type: the Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + } + + def __init__(self, **kwargs): + super(SnapshotUpdate, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings = kwargs.get('encryption_settings', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_update_py3.py new file mode 100644 index 0000000000000..f4d48cddbd677 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/snapshot_update_py3.py @@ -0,0 +1,49 @@ +# 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 .resource_update import ResourceUpdate + + +class SnapshotUpdate(ResourceUpdate): + """Snapshot update resource. + + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: + :type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku + :param os_type: the Operating System type. Possible values include: + 'Windows', 'Linux' + :type os_type: str or + ~azure.mgmt.compute.v2018_04_01.models.OperatingSystemTypes + :param disk_size_gb: If creationData.createOption is Empty, this field is + mandatory and it indicates the size of the VHD to create. If this field is + present for updates or creation with other options, it indicates a resize. + Resizes are only allowed if the disk is not attached to a running VM, and + can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings: Encryption settings for disk or snapshot + :type encryption_settings: + ~azure.mgmt.compute.v2018_04_01.models.EncryptionSettings + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings': {'key': 'properties.encryptionSettings', 'type': 'EncryptionSettings'}, + } + + def __init__(self, *, tags=None, sku=None, os_type=None, disk_size_gb: int=None, encryption_settings=None, **kwargs) -> None: + super(SnapshotUpdate, self).__init__(tags=tags, sku=sku, **kwargs) + self.os_type = os_type + self.disk_size_gb = disk_size_gb + self.encryption_settings = encryption_settings diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/source_vault.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/source_vault.py new file mode 100644 index 0000000000000..9b16302ebbfba --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/source_vault.py @@ -0,0 +1,29 @@ +# 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 SourceVault(Model): + """The vault id is an Azure Resource Manager Resoure id in the form + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SourceVault, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/source_vault_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/source_vault_py3.py new file mode 100644 index 0000000000000..13eea54613907 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/source_vault_py3.py @@ -0,0 +1,29 @@ +# 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 SourceVault(Model): + """The vault id is an Azure Resource Manager Resoure id in the form + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}. + + :param id: Resource Id + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SourceVault, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/__init__.py new file mode 100644 index 0000000000000..aceddf83543cc --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/__init__.py @@ -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 .disks_operations import DisksOperations +from .snapshots_operations import SnapshotsOperations + +__all__ = [ + 'DisksOperations', + 'SnapshotsOperations', +] diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/disks_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/disks_operations.py new file mode 100644 index 0000000000000..c066a21959334 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/disks_operations.py @@ -0,0 +1,752 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DisksOperations(object): + """DisksOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-04-01" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(disk, 'Disk') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Disk', response) + if response.status_code == 202: + deserialized = self._deserialize('Disk', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. + The name can't be changed after the disk is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The maximum name + length is 80 characters. + :type disk_name: str + :param disk: Disk object supplied in the body of the Put disk + operation. + :type disk: ~azure.mgmt.compute.v2018_04_01.models.Disk + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Disk or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.Disk] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.Disk]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + disk=disk, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Disk', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} + + + def _update_initial( + self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(disk, 'DiskUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Disk', response) + if response.status_code == 202: + deserialized = self._deserialize('Disk', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, disk_name, disk, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates (patches) a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. + The name can't be changed after the disk is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The maximum name + length is 80 characters. + :type disk_name: str + :param disk: Disk object supplied in the body of the Patch disk + operation. + :type disk: ~azure.mgmt.compute.v2018_04_01.models.DiskUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Disk or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.Disk] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.Disk]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + disk=disk, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Disk', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} + + def get( + self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. + The name can't be changed after the disk is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The maximum name + length is 80 characters. + :type disk_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Disk or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2018_04_01.models.Disk or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Disk', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} + + + def _delete_initial( + self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, disk_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. + The name can't be changed after the disk is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The maximum name + length is 80 characters. + :type disk_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the disks under a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Disk + :rtype: + ~azure.mgmt.compute.v2018_04_01.models.DiskPaged[~azure.mgmt.compute.v2018_04_01.models.Disk] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DiskPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DiskPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the disks under a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Disk + :rtype: + ~azure.mgmt.compute.v2018_04_01.models.DiskPaged[~azure.mgmt.compute.v2018_04_01.models.Disk] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DiskPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DiskPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks'} + + + def _grant_access_initial( + self, resource_group_name, disk_name, access, duration_in_seconds, custom_headers=None, raw=False, **operation_config): + grant_access_data = models.GrantAccessData(access=access, duration_in_seconds=duration_in_seconds) + + # Construct URL + url = self.grant_access.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(grant_access_data, 'GrantAccessData') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AccessUri', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def grant_access( + self, resource_group_name, disk_name, access, duration_in_seconds, custom_headers=None, raw=False, polling=True, **operation_config): + """Grants access to a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. + The name can't be changed after the disk is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The maximum name + length is 80 characters. + :type disk_name: str + :param access: Possible values include: 'None', 'Read' + :type access: str or + ~azure.mgmt.compute.v2018_04_01.models.AccessLevel + :param duration_in_seconds: Time duration in seconds until the SAS + access expires. + :type duration_in_seconds: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AccessUri or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.AccessUri] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.AccessUri]] + :raises: :class:`CloudError` + """ + raw_result = self._grant_access_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + access=access, + duration_in_seconds=duration_in_seconds, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AccessUri', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + grant_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess'} + + + def _revoke_access_initial( + self, resource_group_name, disk_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.revoke_access.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def revoke_access( + self, resource_group_name, disk_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Revokes access to a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. + The name can't be changed after the disk is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The maximum name + length is 80 characters. + :type disk_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse]] + :raises: :class:`CloudError` + """ + raw_result = self._revoke_access_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + revoke_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/snapshots_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/snapshots_operations.py new file mode 100644 index 0000000000000..b6c4d1bf4b746 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/snapshots_operations.py @@ -0,0 +1,752 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class SnapshotsOperations(object): + """SnapshotsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-04-01" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(snapshot, 'Snapshot') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', response) + if response.status_code == 202: + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. + The name can't be changed after the snapshot is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The max name length + is 80 characters. + :type snapshot_name: str + :param snapshot: Snapshot object supplied in the body of the Put disk + operation. + :type snapshot: ~azure.mgmt.compute.v2018_04_01.models.Snapshot + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Snapshot or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.Snapshot] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.Snapshot]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + snapshot=snapshot, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} + + + def _update_initial( + self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(snapshot, 'SnapshotUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', response) + if response.status_code == 202: + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, snapshot_name, snapshot, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates (patches) a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. + The name can't be changed after the snapshot is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The max name length + is 80 characters. + :type snapshot_name: str + :param snapshot: Snapshot object supplied in the body of the Patch + snapshot operation. + :type snapshot: ~azure.mgmt.compute.v2018_04_01.models.SnapshotUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Snapshot or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.Snapshot] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.Snapshot]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + snapshot=snapshot, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} + + def get( + self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. + The name can't be changed after the snapshot is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The max name length + is 80 characters. + :type snapshot_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Snapshot or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2018_04_01.models.Snapshot or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} + + + def _delete_initial( + self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. + The name can't be changed after the snapshot is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The max name length + is 80 characters. + :type snapshot_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists snapshots under a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Snapshot + :rtype: + ~azure.mgmt.compute.v2018_04_01.models.SnapshotPaged[~azure.mgmt.compute.v2018_04_01.models.Snapshot] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SnapshotPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SnapshotPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists snapshots under a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Snapshot + :rtype: + ~azure.mgmt.compute.v2018_04_01.models.SnapshotPaged[~azure.mgmt.compute.v2018_04_01.models.Snapshot] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SnapshotPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SnapshotPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots'} + + + def _grant_access_initial( + self, resource_group_name, snapshot_name, access, duration_in_seconds, custom_headers=None, raw=False, **operation_config): + grant_access_data = models.GrantAccessData(access=access, duration_in_seconds=duration_in_seconds) + + # Construct URL + url = self.grant_access.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(grant_access_data, 'GrantAccessData') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AccessUri', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def grant_access( + self, resource_group_name, snapshot_name, access, duration_in_seconds, custom_headers=None, raw=False, polling=True, **operation_config): + """Grants access to a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. + The name can't be changed after the snapshot is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The max name length + is 80 characters. + :type snapshot_name: str + :param access: Possible values include: 'None', 'Read' + :type access: str or + ~azure.mgmt.compute.v2018_04_01.models.AccessLevel + :param duration_in_seconds: Time duration in seconds until the SAS + access expires. + :type duration_in_seconds: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AccessUri or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.AccessUri] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.AccessUri]] + :raises: :class:`CloudError` + """ + raw_result = self._grant_access_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + access=access, + duration_in_seconds=duration_in_seconds, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AccessUri', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + grant_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess'} + + + def _revoke_access_initial( + self, resource_group_name, snapshot_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.revoke_access.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def revoke_access( + self, resource_group_name, snapshot_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Revokes access to a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. + The name can't be changed after the snapshot is created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The max name length + is 80 characters. + :type snapshot_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OperationStatusResponse + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2018_04_01.models.OperationStatusResponse]] + :raises: :class:`CloudError` + """ + raw_result = self._revoke_access_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + revoke_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess'} diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/version.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/version.py new file mode 100644 index 0000000000000..b04095332b31b --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "2018-04-01" +