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 9d55d22a4796..03490742110c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py +++ b/azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py @@ -357,6 +357,7 @@ def proximity_placement_groups(self): * 2018-04-01: :class:`ProximityPlacementGroupsOperations` * 2018-06-01: :class:`ProximityPlacementGroupsOperations` * 2018-10-01: :class:`ProximityPlacementGroupsOperations` + * 2019-03-01: :class:`ProximityPlacementGroupsOperations` """ api_version = self._get_api_version('proximity_placement_groups') if api_version == '2018-04-01': @@ -365,6 +366,8 @@ def proximity_placement_groups(self): from .v2018_06_01.operations import ProximityPlacementGroupsOperations as OperationClass elif api_version == '2018-10-01': from .v2018_10_01.operations import ProximityPlacementGroupsOperations as OperationClass + elif api_version == '2019-03-01': + from .v2019_03_01.operations import ProximityPlacementGroupsOperations 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/v2018_09_30/models/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/models/__init__.py index e8a71aaf255f..4a1cc092e224 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/models/__init__.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/models/__init__.py @@ -54,8 +54,6 @@ SnapshotStorageAccountTypes, AccessLevel, ) -# Manual change to avoid major release until the next major release -StorageAccountTypes = DiskStorageAccountTypes __all__ = [ 'Resource', @@ -77,7 +75,6 @@ 'DiskPaged', 'SnapshotPaged', 'DiskStorageAccountTypes', - 'StorageAccountTypes', 'OperatingSystemTypes', 'HyperVGeneration', 'DiskCreateOption', diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/compute_management_client.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/compute_management_client.py index f0641446c374..f0573fcd0b13 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/compute_management_client.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/compute_management_client.py @@ -15,6 +15,7 @@ from .version import VERSION from .operations.operations import Operations from .operations.availability_sets_operations import AvailabilitySetsOperations +from .operations.proximity_placement_groups_operations import ProximityPlacementGroupsOperations from .operations.virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations from .operations.virtual_machine_extensions_operations import VirtualMachineExtensionsOperations from .operations.virtual_machine_images_operations import VirtualMachineImagesOperations @@ -78,6 +79,8 @@ class ComputeManagementClient(SDKClient): :vartype operations: azure.mgmt.compute.v2019_03_01.operations.Operations :ivar availability_sets: AvailabilitySets operations :vartype availability_sets: azure.mgmt.compute.v2019_03_01.operations.AvailabilitySetsOperations + :ivar proximity_placement_groups: ProximityPlacementGroups operations + :vartype proximity_placement_groups: azure.mgmt.compute.v2019_03_01.operations.ProximityPlacementGroupsOperations :ivar virtual_machine_extension_images: VirtualMachineExtensionImages operations :vartype virtual_machine_extension_images: azure.mgmt.compute.v2019_03_01.operations.VirtualMachineExtensionImagesOperations :ivar virtual_machine_extensions: VirtualMachineExtensions operations @@ -136,6 +139,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.availability_sets = AvailabilitySetsOperations( self._client, self.config, self._serialize, self._deserialize) + self.proximity_placement_groups = ProximityPlacementGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) self.virtual_machine_extension_images = VirtualMachineExtensionImagesOperations( self._client, self.config, self._serialize, self._deserialize) self.virtual_machine_extensions = VirtualMachineExtensionsOperations( diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py index ef6f131d696d..ee1c01893eb7 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py @@ -16,6 +16,8 @@ from .sku_py3 import Sku from .availability_set_py3 import AvailabilitySet from .availability_set_update_py3 import AvailabilitySetUpdate + from .proximity_placement_group_py3 import ProximityPlacementGroup + from .proximity_placement_group_update_py3 import ProximityPlacementGroupUpdate from .virtual_machine_size_py3 import VirtualMachineSize from .virtual_machine_extension_image_py3 import VirtualMachineExtensionImage from .virtual_machine_image_resource_py3 import VirtualMachineImageResource @@ -174,6 +176,8 @@ from .sku import Sku from .availability_set import AvailabilitySet from .availability_set_update import AvailabilitySetUpdate + from .proximity_placement_group import ProximityPlacementGroup + from .proximity_placement_group_update import ProximityPlacementGroupUpdate from .virtual_machine_size import VirtualMachineSize from .virtual_machine_extension_image import VirtualMachineExtensionImage from .virtual_machine_image_resource import VirtualMachineImageResource @@ -328,6 +332,7 @@ from .compute_operation_value_paged import ComputeOperationValuePaged from .availability_set_paged import AvailabilitySetPaged from .virtual_machine_size_paged import VirtualMachineSizePaged +from .proximity_placement_group_paged import ProximityPlacementGroupPaged from .usage_paged import UsagePaged from .virtual_machine_paged import VirtualMachinePaged from .image_paged import ImagePaged @@ -343,6 +348,7 @@ from .compute_management_client_enums import ( StatusLevelTypes, AvailabilitySetSkuTypes, + ProximityPlacementGroupType, OperatingSystemTypes, VirtualMachineSizeTypes, CachingTypes, @@ -381,6 +387,8 @@ 'Sku', 'AvailabilitySet', 'AvailabilitySetUpdate', + 'ProximityPlacementGroup', + 'ProximityPlacementGroupUpdate', 'VirtualMachineSize', 'VirtualMachineExtensionImage', 'VirtualMachineImageResource', @@ -535,6 +543,7 @@ 'ComputeOperationValuePaged', 'AvailabilitySetPaged', 'VirtualMachineSizePaged', + 'ProximityPlacementGroupPaged', 'UsagePaged', 'VirtualMachinePaged', 'ImagePaged', @@ -549,6 +558,7 @@ 'GalleryImageVersionPaged', 'StatusLevelTypes', 'AvailabilitySetSkuTypes', + 'ProximityPlacementGroupType', 'OperatingSystemTypes', 'VirtualMachineSizeTypes', 'CachingTypes', diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set.py index 2cbebf496c06..7e3970fc130f 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set.py @@ -48,6 +48,11 @@ class AvailabilitySet(Resource): the availability set. :type virtual_machines: list[~azure.mgmt.compute.v2019_03_01.models.SubResource] + :param proximity_placement_group: Specifies information about the + proximity placement group that the availability set should be assigned to. +

Minimum api-version: 2018-04-01. + :type proximity_placement_group: + ~azure.mgmt.compute.v2019_03_01.models.SubResource :ivar statuses: The resource status information. :vartype statuses: list[~azure.mgmt.compute.v2019_03_01.models.InstanceViewStatus] @@ -75,6 +80,7 @@ class AvailabilitySet(Resource): '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]'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, 'sku': {'key': 'sku', 'type': 'Sku'}, } @@ -84,5 +90,6 @@ def __init__(self, **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.proximity_placement_group = kwargs.get('proximity_placement_group', None) self.statuses = None self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set_py3.py index 62339d47548c..cd941cfb2480 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set_py3.py @@ -48,6 +48,11 @@ class AvailabilitySet(Resource): the availability set. :type virtual_machines: list[~azure.mgmt.compute.v2019_03_01.models.SubResource] + :param proximity_placement_group: Specifies information about the + proximity placement group that the availability set should be assigned to. +

Minimum api-version: 2018-04-01. + :type proximity_placement_group: + ~azure.mgmt.compute.v2019_03_01.models.SubResource :ivar statuses: The resource status information. :vartype statuses: list[~azure.mgmt.compute.v2019_03_01.models.InstanceViewStatus] @@ -75,14 +80,16 @@ class AvailabilitySet(Resource): '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]'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, *, location: str, tags=None, platform_update_domain_count: int=None, platform_fault_domain_count: int=None, virtual_machines=None, sku=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, platform_update_domain_count: int=None, platform_fault_domain_count: int=None, virtual_machines=None, proximity_placement_group=None, sku=None, **kwargs) -> None: super(AvailabilitySet, self).__init__(location=location, 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.proximity_placement_group = proximity_placement_group self.statuses = None self.sku = sku diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set_update.py index dc8011932177..13ff09b9a953 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set_update.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set_update.py @@ -29,6 +29,11 @@ class AvailabilitySetUpdate(UpdateResource): the availability set. :type virtual_machines: list[~azure.mgmt.compute.v2019_03_01.models.SubResource] + :param proximity_placement_group: Specifies information about the + proximity placement group that the availability set should be assigned to. +

Minimum api-version: 2018-04-01. + :type proximity_placement_group: + ~azure.mgmt.compute.v2019_03_01.models.SubResource :ivar statuses: The resource status information. :vartype statuses: list[~azure.mgmt.compute.v2019_03_01.models.InstanceViewStatus] @@ -45,6 +50,7 @@ class AvailabilitySetUpdate(UpdateResource): '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]'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, 'statuses': {'key': 'properties.statuses', 'type': '[InstanceViewStatus]'}, 'sku': {'key': 'sku', 'type': 'Sku'}, } @@ -54,5 +60,6 @@ def __init__(self, **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.proximity_placement_group = kwargs.get('proximity_placement_group', None) self.statuses = None self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set_update_py3.py index 7c0851ff8287..ef2a0c1558b9 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set_update_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/availability_set_update_py3.py @@ -29,6 +29,11 @@ class AvailabilitySetUpdate(UpdateResource): the availability set. :type virtual_machines: list[~azure.mgmt.compute.v2019_03_01.models.SubResource] + :param proximity_placement_group: Specifies information about the + proximity placement group that the availability set should be assigned to. +

Minimum api-version: 2018-04-01. + :type proximity_placement_group: + ~azure.mgmt.compute.v2019_03_01.models.SubResource :ivar statuses: The resource status information. :vartype statuses: list[~azure.mgmt.compute.v2019_03_01.models.InstanceViewStatus] @@ -45,14 +50,16 @@ class AvailabilitySetUpdate(UpdateResource): '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]'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', '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: + def __init__(self, *, tags=None, platform_update_domain_count: int=None, platform_fault_domain_count: int=None, virtual_machines=None, proximity_placement_group=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.proximity_placement_group = proximity_placement_group self.statuses = None self.sku = sku diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/compute_management_client_enums.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/compute_management_client_enums.py index ed0870380e6f..a7b1cae77648 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/compute_management_client_enums.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/compute_management_client_enums.py @@ -25,6 +25,12 @@ class AvailabilitySetSkuTypes(str, Enum): aligned = "Aligned" +class ProximityPlacementGroupType(str, Enum): + + standard = "Standard" + ultra = "Ultra" + + class OperatingSystemTypes(str, Enum): windows = "Windows" diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group.py new file mode 100644 index 000000000000..ead044ed120e --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group.py @@ -0,0 +1,79 @@ +# 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 ProximityPlacementGroup(Resource): + """Specifies information about the proximity placement group. + + 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] + :param proximity_placement_group_type: Specifies the type of the proximity + placement group.

Possible values are:

**Standard** +

**Ultra**. Possible values include: 'Standard', 'Ultra' + :type proximity_placement_group_type: str or + ~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroupType + :ivar virtual_machines: A list of references to all virtual machines in + the proximity placement group. + :vartype virtual_machines: + list[~azure.mgmt.compute.v2019_03_01.models.SubResource] + :ivar virtual_machine_scale_sets: A list of references to all virtual + machine scale sets in the proximity placement group. + :vartype virtual_machine_scale_sets: + list[~azure.mgmt.compute.v2019_03_01.models.SubResource] + :ivar availability_sets: A list of references to all availability sets in + the proximity placement group. + :vartype availability_sets: + list[~azure.mgmt.compute.v2019_03_01.models.SubResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'virtual_machines': {'readonly': True}, + 'virtual_machine_scale_sets': {'readonly': True}, + 'availability_sets': {'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}'}, + 'proximity_placement_group_type': {'key': 'properties.proximityPlacementGroupType', 'type': 'str'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'}, + 'virtual_machine_scale_sets': {'key': 'properties.virtualMachineScaleSets', 'type': '[SubResource]'}, + 'availability_sets': {'key': 'properties.availabilitySets', 'type': '[SubResource]'}, + } + + def __init__(self, **kwargs): + super(ProximityPlacementGroup, self).__init__(**kwargs) + self.proximity_placement_group_type = kwargs.get('proximity_placement_group_type', None) + self.virtual_machines = None + self.virtual_machine_scale_sets = None + self.availability_sets = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group_paged.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group_paged.py new file mode 100644 index 000000000000..e8f58305138a --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group_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 ProximityPlacementGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`ProximityPlacementGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ProximityPlacementGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(ProximityPlacementGroupPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group_py3.py new file mode 100644 index 000000000000..d46cf8d279af --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group_py3.py @@ -0,0 +1,79 @@ +# 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_py3 import Resource + + +class ProximityPlacementGroup(Resource): + """Specifies information about the proximity placement group. + + 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] + :param proximity_placement_group_type: Specifies the type of the proximity + placement group.

Possible values are:

**Standard** +

**Ultra**. Possible values include: 'Standard', 'Ultra' + :type proximity_placement_group_type: str or + ~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroupType + :ivar virtual_machines: A list of references to all virtual machines in + the proximity placement group. + :vartype virtual_machines: + list[~azure.mgmt.compute.v2019_03_01.models.SubResource] + :ivar virtual_machine_scale_sets: A list of references to all virtual + machine scale sets in the proximity placement group. + :vartype virtual_machine_scale_sets: + list[~azure.mgmt.compute.v2019_03_01.models.SubResource] + :ivar availability_sets: A list of references to all availability sets in + the proximity placement group. + :vartype availability_sets: + list[~azure.mgmt.compute.v2019_03_01.models.SubResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'virtual_machines': {'readonly': True}, + 'virtual_machine_scale_sets': {'readonly': True}, + 'availability_sets': {'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}'}, + 'proximity_placement_group_type': {'key': 'properties.proximityPlacementGroupType', 'type': 'str'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResource]'}, + 'virtual_machine_scale_sets': {'key': 'properties.virtualMachineScaleSets', 'type': '[SubResource]'}, + 'availability_sets': {'key': 'properties.availabilitySets', 'type': '[SubResource]'}, + } + + def __init__(self, *, location: str, tags=None, proximity_placement_group_type=None, **kwargs) -> None: + super(ProximityPlacementGroup, self).__init__(location=location, tags=tags, **kwargs) + self.proximity_placement_group_type = proximity_placement_group_type + self.virtual_machines = None + self.virtual_machine_scale_sets = None + self.availability_sets = None diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group_update.py new file mode 100644 index 000000000000..cf795d53b0c1 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group_update.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 .update_resource import UpdateResource + + +class ProximityPlacementGroupUpdate(UpdateResource): + """Specifies information about the proximity placement group. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ProximityPlacementGroupUpdate, self).__init__(**kwargs) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group_update_py3.py new file mode 100644 index 000000000000..9d60be7ba9ed --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/proximity_placement_group_update_py3.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 .update_resource_py3 import UpdateResource + + +class ProximityPlacementGroupUpdate(UpdateResource): + """Specifies information about the proximity placement group. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ProximityPlacementGroupUpdate, self).__init__(tags=tags, **kwargs) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine.py index 0c871cc2b1fb..5b31426289ff 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine.py @@ -73,6 +73,11 @@ class VirtualMachine(Resource):

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.v2019_03_01.models.SubResource + :param proximity_placement_group: Specifies information about the + proximity placement group that the virtual machine should be assigned to. +

Minimum api-version: 2018-04-01. + :type proximity_placement_group: + ~azure.mgmt.compute.v2019_03_01.models.SubResource :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -128,6 +133,7 @@ class VirtualMachine(Resource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, @@ -147,6 +153,7 @@ def __init__(self, **kwargs): 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.proximity_placement_group = kwargs.get('proximity_placement_group', None) self.provisioning_state = None self.instance_view = None self.license_type = kwargs.get('license_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_py3.py index b686e126f2cb..c9f5bad89e8c 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_py3.py @@ -73,6 +73,11 @@ class VirtualMachine(Resource):

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.v2019_03_01.models.SubResource + :param proximity_placement_group: Specifies information about the + proximity placement group that the virtual machine should be assigned to. +

Minimum api-version: 2018-04-01. + :type proximity_placement_group: + ~azure.mgmt.compute.v2019_03_01.models.SubResource :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -128,6 +133,7 @@ class VirtualMachine(Resource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, @@ -137,7 +143,7 @@ class VirtualMachine(Resource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, *, location: str, tags=None, plan=None, hardware_profile=None, storage_profile=None, additional_capabilities=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type: str=None, identity=None, zones=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, plan=None, hardware_profile=None, storage_profile=None, additional_capabilities=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, proximity_placement_group=None, license_type: str=None, identity=None, zones=None, **kwargs) -> None: super(VirtualMachine, self).__init__(location=location, tags=tags, **kwargs) self.plan = plan self.hardware_profile = hardware_profile @@ -147,6 +153,7 @@ def __init__(self, *, location: str, tags=None, plan=None, hardware_profile=None self.network_profile = network_profile self.diagnostics_profile = diagnostics_profile self.availability_set = availability_set + self.proximity_placement_group = proximity_placement_group self.provisioning_state = None self.instance_view = None self.license_type = license_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_scale_set.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_scale_set.py index 4c4ac553f237..694139fb163d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_scale_set.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_scale_set.py @@ -68,6 +68,11 @@ class VirtualMachineScaleSet(Resource): :param platform_fault_domain_count: Fault Domain count for each placement group. :type platform_fault_domain_count: int + :param proximity_placement_group: Specifies information about the + proximity placement group that the virtual machine scale set should be + assigned to.

Minimum api-version: 2018-04-01. + :type proximity_placement_group: + ~azure.mgmt.compute.v2019_03_01.models.SubResource :param identity: The identity of the virtual machine scale set, if configured. :type identity: @@ -102,6 +107,7 @@ class VirtualMachineScaleSet(Resource): 'single_placement_group': {'key': 'properties.singlePlacementGroup', 'type': 'bool'}, 'zone_balance': {'key': 'properties.zoneBalance', 'type': 'bool'}, 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, 'identity': {'key': 'identity', 'type': 'VirtualMachineScaleSetIdentity'}, 'zones': {'key': 'zones', 'type': '[str]'}, } @@ -119,5 +125,6 @@ def __init__(self, **kwargs): 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.proximity_placement_group = kwargs.get('proximity_placement_group', None) self.identity = kwargs.get('identity', None) self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_scale_set_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_scale_set_py3.py index 31ba0c6cb46c..a570d7f24a83 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_scale_set_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_scale_set_py3.py @@ -68,6 +68,11 @@ class VirtualMachineScaleSet(Resource): :param platform_fault_domain_count: Fault Domain count for each placement group. :type platform_fault_domain_count: int + :param proximity_placement_group: Specifies information about the + proximity placement group that the virtual machine scale set should be + assigned to.

Minimum api-version: 2018-04-01. + :type proximity_placement_group: + ~azure.mgmt.compute.v2019_03_01.models.SubResource :param identity: The identity of the virtual machine scale set, if configured. :type identity: @@ -102,11 +107,12 @@ class VirtualMachineScaleSet(Resource): 'single_placement_group': {'key': 'properties.singlePlacementGroup', 'type': 'bool'}, 'zone_balance': {'key': 'properties.zoneBalance', 'type': 'bool'}, 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, '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, do_not_run_extensions_on_overprovisioned_vms: 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, do_not_run_extensions_on_overprovisioned_vms: bool=None, single_placement_group: bool=None, zone_balance: bool=None, platform_fault_domain_count: int=None, proximity_placement_group=None, identity=None, zones=None, **kwargs) -> None: super(VirtualMachineScaleSet, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.plan = plan @@ -119,5 +125,6 @@ def __init__(self, *, location: str, tags=None, sku=None, plan=None, upgrade_pol self.single_placement_group = single_placement_group self.zone_balance = zone_balance self.platform_fault_domain_count = platform_fault_domain_count + self.proximity_placement_group = proximity_placement_group self.identity = identity self.zones = zones diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_update.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_update.py index 754d39d74ab3..a47cb35ff29d 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_update.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_update.py @@ -63,6 +63,11 @@ class VirtualMachineUpdate(UpdateResource):

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.v2019_03_01.models.SubResource + :param proximity_placement_group: Specifies information about the + proximity placement group that the virtual machine should be assigned to. +

Minimum api-version: 2018-04-01. + :type proximity_placement_group: + ~azure.mgmt.compute.v2019_03_01.models.SubResource :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -106,6 +111,7 @@ class VirtualMachineUpdate(UpdateResource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, @@ -124,6 +130,7 @@ def __init__(self, **kwargs): 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.proximity_placement_group = kwargs.get('proximity_placement_group', None) self.provisioning_state = None self.instance_view = None self.license_type = kwargs.get('license_type', None) diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_update_py3.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_update_py3.py index dd7f3e73e8ee..96cbe2fc923b 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_update_py3.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_update_py3.py @@ -63,6 +63,11 @@ class VirtualMachineUpdate(UpdateResource):

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.v2019_03_01.models.SubResource + :param proximity_placement_group: Specifies information about the + proximity placement group that the virtual machine should be assigned to. +

Minimum api-version: 2018-04-01. + :type proximity_placement_group: + ~azure.mgmt.compute.v2019_03_01.models.SubResource :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -106,6 +111,7 @@ class VirtualMachineUpdate(UpdateResource): 'network_profile': {'key': 'properties.networkProfile', 'type': 'NetworkProfile'}, 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, + 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, @@ -114,7 +120,7 @@ class VirtualMachineUpdate(UpdateResource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, *, tags=None, plan=None, hardware_profile=None, storage_profile=None, additional_capabilities=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, license_type: str=None, identity=None, zones=None, **kwargs) -> None: + def __init__(self, *, tags=None, plan=None, hardware_profile=None, storage_profile=None, additional_capabilities=None, os_profile=None, network_profile=None, diagnostics_profile=None, availability_set=None, proximity_placement_group=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 @@ -124,6 +130,7 @@ def __init__(self, *, tags=None, plan=None, hardware_profile=None, storage_profi self.network_profile = network_profile self.diagnostics_profile = diagnostics_profile self.availability_set = availability_set + self.proximity_placement_group = proximity_placement_group self.provisioning_state = None self.instance_view = None self.license_type = license_type diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/__init__.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/__init__.py index b5dd84c8bc05..f07e4b2e8c43 100644 --- a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/__init__.py +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/__init__.py @@ -11,6 +11,7 @@ from .operations import Operations from .availability_sets_operations import AvailabilitySetsOperations +from .proximity_placement_groups_operations import ProximityPlacementGroupsOperations from .virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations from .virtual_machine_extensions_operations import VirtualMachineExtensionsOperations from .virtual_machine_images_operations import VirtualMachineImagesOperations @@ -31,6 +32,7 @@ __all__ = [ 'Operations', 'AvailabilitySetsOperations', + 'ProximityPlacementGroupsOperations', 'VirtualMachineExtensionImagesOperations', 'VirtualMachineExtensionsOperations', 'VirtualMachineImagesOperations', diff --git a/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/proximity_placement_groups_operations.py b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/proximity_placement_groups_operations.py new file mode 100644 index 000000000000..a42c4e11f4c7 --- /dev/null +++ b/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/proximity_placement_groups_operations.py @@ -0,0 +1,430 @@ +# 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 ProximityPlacementGroupsOperations(object): + """ProximityPlacementGroupsOperations 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: "2019-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01" + + self.config = config + + def create_or_update( + self, resource_group_name, proximity_placement_group_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update a proximity placement group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param proximity_placement_group_name: The name of the proximity + placement group. + :type proximity_placement_group_name: str + :param parameters: Parameters supplied to the Create Proximity + Placement Group operation. + :type parameters: + ~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroup + :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: ProximityPlacementGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroup + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'proximityPlacementGroupName': self._serialize.url("proximity_placement_group_name", proximity_placement_group_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['Accept'] = 'application/json' + 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, 'ProximityPlacementGroup') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ProximityPlacementGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('ProximityPlacementGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}'} + + def update( + self, resource_group_name, proximity_placement_group_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Update a proximity placement group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param proximity_placement_group_name: The name of the proximity + placement group. + :type proximity_placement_group_name: str + :param tags: Resource tags + :type tags: dict[str, 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: ProximityPlacementGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroup + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.ProximityPlacementGroupUpdate(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'proximityPlacementGroupName': self._serialize.url("proximity_placement_group_name", proximity_placement_group_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['Accept'] = 'application/json' + 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, 'ProximityPlacementGroupUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('ProximityPlacementGroup', 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/proximityPlacementGroups/{proximityPlacementGroupName}'} + + def delete( + self, resource_group_name, proximity_placement_group_name, custom_headers=None, raw=False, **operation_config): + """Delete a proximity placement group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param proximity_placement_group_name: The name of the proximity + placement group. + :type proximity_placement_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'proximityPlacementGroupName': self._serialize.url("proximity_placement_group_name", proximity_placement_group_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 = {} + 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, header_parameters) + response = self._client.send(request, 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}'} + + def get( + self, resource_group_name, proximity_placement_group_name, custom_headers=None, raw=False, **operation_config): + """Retrieves information about a proximity placement group . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param proximity_placement_group_name: The name of the proximity + placement group. + :type proximity_placement_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: ProximityPlacementGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroup + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'proximityPlacementGroupName': self._serialize.url("proximity_placement_group_name", proximity_placement_group_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('ProximityPlacementGroup', 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/proximityPlacementGroups/{proximityPlacementGroupName}'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Lists all proximity placement groups in 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 ProximityPlacementGroup + :rtype: + ~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroupPaged[~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroup] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.ProximityPlacementGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProximityPlacementGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all proximity placement groups in 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 ProximityPlacementGroup + :rtype: + ~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroupPaged[~azure.mgmt.compute.v2019_03_01.models.ProximityPlacementGroup] + :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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_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') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.ProximityPlacementGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ProximityPlacementGroupPaged(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/proximityPlacementGroups'}