diff --git a/sdk/compute/azure-mgmt-compute/README.rst b/sdk/compute/azure-mgmt-compute/README.rst index 9b6c3e976102..58dcf230377b 100644 --- a/sdk/compute/azure-mgmt-compute/README.rst +++ b/sdk/compute/azure-mgmt-compute/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Compute Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. +This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py index a7c795cf1eba..8c511c8e9d8f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py @@ -52,6 +52,8 @@ class ComputeManagementClient(MultiApiClientMixin, SDKClient): _PROFILE_TAG: { None: DEFAULT_API_VERSION, 'availability_sets': '2019-03-01', + 'dedicated_host_groups': '2019-03-01', + 'dedicated_hosts': '2019-03-01', 'disks': '2018-09-30', 'galleries': '2019-03-01', 'gallery_image_versions': '2019-03-01', @@ -181,6 +183,32 @@ def availability_sets(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 dedicated_host_groups(self): + """Instance depends on the API version: + + * 2019-03-01: :class:`DedicatedHostGroupsOperations` + """ + api_version = self._get_api_version('dedicated_host_groups') + if api_version == '2019-03-01': + from .v2019_03_01.operations import DedicatedHostGroupsOperations 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 dedicated_hosts(self): + """Instance depends on the API version: + + * 2019-03-01: :class:`DedicatedHostsOperations` + """ + api_version = self._get_api_version('dedicated_hosts') + if api_version == '2019-03-01': + from .v2019_03_01.operations import DedicatedHostsOperations 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 disks(self): """Instance depends on the API version: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py index efabb4e32e30..4475b04fd8b7 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py @@ -16,6 +16,8 @@ from .operations import Operations from .operations import AvailabilitySetsOperations from .operations import ProximityPlacementGroupsOperations +from .operations import DedicatedHostGroupsOperations +from .operations import DedicatedHostsOperations from .operations import VirtualMachineExtensionImagesOperations from .operations import VirtualMachineExtensionsOperations from .operations import VirtualMachineImagesOperations @@ -47,6 +49,10 @@ class ComputeManagementClient(SDKClient): :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 dedicated_host_groups: DedicatedHostGroups operations + :vartype dedicated_host_groups: azure.mgmt.compute.v2019_03_01.operations.DedicatedHostGroupsOperations + :ivar dedicated_hosts: DedicatedHosts operations + :vartype dedicated_hosts: azure.mgmt.compute.v2019_03_01.operations.DedicatedHostsOperations :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 @@ -107,6 +113,10 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.proximity_placement_groups = ProximityPlacementGroupsOperations( self._client, self.config, self._serialize, self._deserialize) + self.dedicated_host_groups = DedicatedHostGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.dedicated_hosts = DedicatedHostsOperations( + 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/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py index 73b7eeaaba37..0bce11e698dd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py @@ -24,6 +24,14 @@ from ._models_py3 import ComputeOperationValue from ._models_py3 import DataDisk from ._models_py3 import DataDiskImage + from ._models_py3 import DedicatedHost + from ._models_py3 import DedicatedHostAllocatableVM + from ._models_py3 import DedicatedHostAvailableCapacity + from ._models_py3 import DedicatedHostCapacity + from ._models_py3 import DedicatedHostGroup + from ._models_py3 import DedicatedHostGroupUpdate + from ._models_py3 import DedicatedHostInstanceView + from ._models_py3 import DedicatedHostUpdate from ._models_py3 import DiagnosticsProfile from ._models_py3 import DiffDiskSettings from ._models_py3 import Disallowed @@ -184,6 +192,14 @@ from ._models import ComputeOperationValue from ._models import DataDisk from ._models import DataDiskImage + from ._models import DedicatedHost + from ._models import DedicatedHostAllocatableVM + from ._models import DedicatedHostAvailableCapacity + from ._models import DedicatedHostCapacity + from ._models import DedicatedHostGroup + from ._models import DedicatedHostGroupUpdate + from ._models import DedicatedHostInstanceView + from ._models import DedicatedHostUpdate from ._models import DiagnosticsProfile from ._models import DiffDiskSettings from ._models import Disallowed @@ -331,6 +347,8 @@ from ._models import WinRMListener from ._paged_models import AvailabilitySetPaged from ._paged_models import ComputeOperationValuePaged +from ._paged_models import DedicatedHostGroupPaged +from ._paged_models import DedicatedHostPaged from ._paged_models import GalleryImagePaged from ._paged_models import GalleryImageVersionPaged from ._paged_models import GalleryPaged @@ -350,6 +368,7 @@ StatusLevelTypes, AvailabilitySetSkuTypes, ProximityPlacementGroupType, + DedicatedHostLicenseTypes, OperatingSystemTypes, VirtualMachineSizeTypes, CachingTypes, @@ -397,6 +416,14 @@ 'ComputeOperationValue', 'DataDisk', 'DataDiskImage', + 'DedicatedHost', + 'DedicatedHostAllocatableVM', + 'DedicatedHostAvailableCapacity', + 'DedicatedHostCapacity', + 'DedicatedHostGroup', + 'DedicatedHostGroupUpdate', + 'DedicatedHostInstanceView', + 'DedicatedHostUpdate', 'DiagnosticsProfile', 'DiffDiskSettings', 'Disallowed', @@ -546,6 +573,8 @@ 'AvailabilitySetPaged', 'VirtualMachineSizePaged', 'ProximityPlacementGroupPaged', + 'DedicatedHostGroupPaged', + 'DedicatedHostPaged', 'UsagePaged', 'VirtualMachinePaged', 'ImagePaged', @@ -562,6 +591,7 @@ 'StatusLevelTypes', 'AvailabilitySetSkuTypes', 'ProximityPlacementGroupType', + 'DedicatedHostLicenseTypes', 'OperatingSystemTypes', 'VirtualMachineSizeTypes', 'CachingTypes', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py index 9b493ead5315..5f392df31f9c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py @@ -37,6 +37,13 @@ class ProximityPlacementGroupType(str, Enum): ultra = "Ultra" +class DedicatedHostLicenseTypes(str, Enum): + + none = "None" + windows_server_hybrid = "Windows_Server_Hybrid" + windows_server_perpetual = "Windows_Server_Perpetual" + + class OperatingSystemTypes(str, Enum): windows = "Windows" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py index 1fc31941ed58..6241e93d03fc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py @@ -633,6 +633,380 @@ def __init__(self, **kwargs): self.lun = None +class DedicatedHost(Resource): + """Specifies information about the Dedicated host. + + 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 platform_fault_domain: Fault domain of the host within a group. + Supported values 0,1,2. + :type platform_fault_domain: int + :param auto_replace_on_failure: Whether the host should be replaced + automatically in case of a failure. The value is defaulted to true when + not provided. + :type auto_replace_on_failure: bool + :ivar host_id: A unique id generated and assigned to the dedicated host by + the platform. + :vartype host_id: str + :ivar virtual_machines: A list of references to all virtual machines in + the Dedicated Host. + :vartype virtual_machines: + list[~azure.mgmt.compute.v2019_03_01.models.SubResourceReadOnly] + :param license_type: Specifies the software license type that will be + applied to the VMs deployed on the dedicated host.

Possible + values are:

**None**

**Windows_Server_Hybrid**

+ **Windows_Server_Perpetual**

Default: **None**. Possible values + include: 'None', 'Windows_Server_Hybrid', 'Windows_Server_Perpetual' + :type license_type: str or + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostLicenseTypes + :ivar provisioning_time: The date when the host was first created. + :vartype provisioning_time: datetime + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar instance_view: The dedicated host instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostInstanceView + :param sku: Sku of the dedicated host for Hardware Generation and VM + family, The only name is required to be set. See DedicatedHostSkuTypes for + possible set of values. + :type sku: ~azure.mgmt.compute.v2019_03_01.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'host_id': {'readonly': True}, + 'virtual_machines': {'readonly': True}, + 'provisioning_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'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}'}, + 'platform_fault_domain': {'key': 'properties.platformFaultDomain', 'type': 'int'}, + 'auto_replace_on_failure': {'key': 'properties.autoReplaceOnFailure', 'type': 'bool'}, + 'host_id': {'key': 'properties.hostId', 'type': 'str'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResourceReadOnly]'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'DedicatedHostLicenseTypes'}, + 'provisioning_time': {'key': 'properties.provisioningTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'DedicatedHostInstanceView'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(DedicatedHost, self).__init__(**kwargs) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.auto_replace_on_failure = kwargs.get('auto_replace_on_failure', None) + self.host_id = None + self.virtual_machines = None + self.license_type = kwargs.get('license_type', None) + self.provisioning_time = None + self.provisioning_state = None + self.instance_view = None + self.sku = kwargs.get('sku', None) + + +class DedicatedHostAllocatableVM(Model): + """Represents the dedicated host unutilized capacity in terms of a specific VM + size. + + :param vm_size: VM size in terms of which the unutilized capacity is + represented. + :type vm_size: str + :param count: Maximum number of VMs of size vmSize that can fit in the + dedicated host's remaining capacity. + :type count: float + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(DedicatedHostAllocatableVM, self).__init__(**kwargs) + self.vm_size = kwargs.get('vm_size', None) + self.count = kwargs.get('count', None) + + +class DedicatedHostAvailableCapacity(Model): + """Dedicated host unutilized capacity. + + :param available_vcpus: The total number of CPUs. + :type available_vcpus: float + :param allocatable_vms: The unutilized capacity of the dedicated host + represented in terms of each VM size that is allowed to be deployed to the + dedicated host. + :type allocatable_vms: + list[~azure.mgmt.compute.v2019_03_01.models.DedicatedHostAllocatableVM] + """ + + _attribute_map = { + 'available_vcpus': {'key': 'availableVCpus', 'type': 'float'}, + 'allocatable_vms': {'key': 'allocatableVMs', 'type': '[DedicatedHostAllocatableVM]'}, + } + + def __init__(self, **kwargs): + super(DedicatedHostAvailableCapacity, self).__init__(**kwargs) + self.available_vcpus = kwargs.get('available_vcpus', None) + self.allocatable_vms = kwargs.get('allocatable_vms', None) + + +class DedicatedHostCapacity(Model): + """Dedicated host total capacity. + + :param total_cores: The total number of cores. + :type total_cores: float + :param total_vcpus: The total number of CPUs. + :type total_vcpus: float + """ + + _attribute_map = { + 'total_cores': {'key': 'totalCores', 'type': 'float'}, + 'total_vcpus': {'key': 'totalVCpus', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(DedicatedHostCapacity, self).__init__(**kwargs) + self.total_cores = kwargs.get('total_cores', None) + self.total_vcpus = kwargs.get('total_vcpus', None) + + +class DedicatedHostGroup(Resource): + """Specifies information about the dedicated host group that the dedicated + hosts should be assigned to.

Currently, a Dedicated host can only + be added to Dedicated Host Group at creation time. An existing Dedicated + Host cannot be added to a dedicated host 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 platform_fault_domain_count: Number of fault domains that the host + group can span. Supported values 1,2,3. + :type platform_fault_domain_count: int + :ivar hosts: A list of references to all dedicated hosts in the dedicated + host group. + :vartype hosts: + list[~azure.mgmt.compute.v2019_03_01.models.SubResourceReadOnly] + :param zones: Availability Zone to use for this host group � only single + zone is supported. The zone can be assigned only during creation. If not + provided, the group supports all zones in the region. If provided, enforce + each host in the group is in the same zone. + :type zones: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'hosts': {'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}'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'hosts': {'key': 'properties.hosts', 'type': '[SubResourceReadOnly]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(DedicatedHostGroup, self).__init__(**kwargs) + self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) + self.hosts = None + self.zones = kwargs.get('zones', None) + + +class DedicatedHostGroupUpdate(UpdateResource): + """Specifies information about the dedicated host group that the dedicated + host should be assigned to. Only tags may be updated. + + 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_fault_domain_count: Number of fault domains that the host + group can span. Supported values 1,2,3. + :type platform_fault_domain_count: int + :ivar hosts: A list of references to all dedicated hosts in the dedicated + host group. + :vartype hosts: + list[~azure.mgmt.compute.v2019_03_01.models.SubResourceReadOnly] + :param zones: Availability Zone to use for this host group � only single + zone is supported. The zone can be assigned only during creation. If not + provided, the group supports all zones in the region. If provided, enforce + each host in the group is in the same zone. + :type zones: list[str] + """ + + _validation = { + 'hosts': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'hosts': {'key': 'properties.hosts', 'type': '[SubResourceReadOnly]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(DedicatedHostGroupUpdate, self).__init__(**kwargs) + self.platform_fault_domain_count = kwargs.get('platform_fault_domain_count', None) + self.hosts = None + self.zones = kwargs.get('zones', None) + + +class DedicatedHostInstanceView(Model): + """The instance view of a dedicated host. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar asset_id: Specifies the unique of the dedicated physical machine on + which the dedicated host resides. + :vartype asset_id: str + :param capacity: The total capacity of the dedicated host. + :type capacity: + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostCapacity + :param available_capacity: Unutilized capacity of the dedicated host. + :type available_capacity: + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostAvailableCapacity + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2019_03_01.models.InstanceViewStatus] + """ + + _validation = { + 'asset_id': {'readonly': True}, + } + + _attribute_map = { + 'asset_id': {'key': 'assetId', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'DedicatedHostCapacity'}, + 'available_capacity': {'key': 'availableCapacity', 'type': 'DedicatedHostAvailableCapacity'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, **kwargs): + super(DedicatedHostInstanceView, self).__init__(**kwargs) + self.asset_id = None + self.capacity = kwargs.get('capacity', None) + self.available_capacity = kwargs.get('available_capacity', None) + self.statuses = kwargs.get('statuses', None) + + +class DedicatedHostUpdate(UpdateResource): + """Specifies information about the dedicated host. Only tags, + autoReplaceOnFailure and licenseType may be updated. + + 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_fault_domain: Fault domain of the host within a group. + Supported values 0,1,2. + :type platform_fault_domain: int + :param auto_replace_on_failure: Whether the host should be replaced + automatically in case of a failure. The value is defaulted to true when + not provided. + :type auto_replace_on_failure: bool + :ivar host_id: A unique id generated and assigned to the dedicated host by + the platform. + :vartype host_id: str + :ivar virtual_machines: A list of references to all virtual machines in + the Dedicated Host. + :vartype virtual_machines: + list[~azure.mgmt.compute.v2019_03_01.models.SubResourceReadOnly] + :param license_type: Specifies the software license type that will be + applied to the VMs deployed on the dedicated host.

Possible + values are:

**None**

**Windows_Server_Hybrid**

+ **Windows_Server_Perpetual**

Default: **None**. Possible values + include: 'None', 'Windows_Server_Hybrid', 'Windows_Server_Perpetual' + :type license_type: str or + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostLicenseTypes + :ivar provisioning_time: The date when the host was first created. + :vartype provisioning_time: datetime + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar instance_view: The dedicated host instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostInstanceView + """ + + _validation = { + 'host_id': {'readonly': True}, + 'virtual_machines': {'readonly': True}, + 'provisioning_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'platform_fault_domain': {'key': 'properties.platformFaultDomain', 'type': 'int'}, + 'auto_replace_on_failure': {'key': 'properties.autoReplaceOnFailure', 'type': 'bool'}, + 'host_id': {'key': 'properties.hostId', 'type': 'str'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResourceReadOnly]'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'DedicatedHostLicenseTypes'}, + 'provisioning_time': {'key': 'properties.provisioningTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'DedicatedHostInstanceView'}, + } + + def __init__(self, **kwargs): + super(DedicatedHostUpdate, self).__init__(**kwargs) + self.platform_fault_domain = kwargs.get('platform_fault_domain', None) + self.auto_replace_on_failure = kwargs.get('auto_replace_on_failure', None) + self.host_id = None + self.virtual_machines = None + self.license_type = kwargs.get('license_type', None) + self.provisioning_time = None + self.provisioning_state = None + self.instance_view = None + + class DiagnosticsProfile(Model): """Specifies the boot diagnostic settings state.

Minimum api-version: 2015-06-15. @@ -3621,6 +3995,9 @@ class VirtualMachine(Resource):

Minimum api-version: 2018-04-01. :type proximity_placement_group: ~azure.mgmt.compute.v2019_03_01.models.SubResource + :param host: Specifies information about the dedicated host that the + virtual machine resides in.

Minimum api-version: 2018-10-01. + :type host: ~azure.mgmt.compute.v2019_03_01.models.SubResource :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -3677,6 +4054,7 @@ class VirtualMachine(Resource): 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + 'host': {'key': 'properties.host', 'type': 'SubResource'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, @@ -3697,6 +4075,7 @@ def __init__(self, **kwargs): 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.host = kwargs.get('host', None) self.provisioning_state = None self.instance_view = None self.license_type = kwargs.get('license_type', None) @@ -6303,6 +6682,9 @@ class VirtualMachineUpdate(UpdateResource):

Minimum api-version: 2018-04-01. :type proximity_placement_group: ~azure.mgmt.compute.v2019_03_01.models.SubResource + :param host: Specifies information about the dedicated host that the + virtual machine resides in.

Minimum api-version: 2018-10-01. + :type host: ~azure.mgmt.compute.v2019_03_01.models.SubResource :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -6347,6 +6729,7 @@ class VirtualMachineUpdate(UpdateResource): 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + 'host': {'key': 'properties.host', 'type': 'SubResource'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, @@ -6366,6 +6749,7 @@ def __init__(self, **kwargs): 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.host = kwargs.get('host', None) self.provisioning_state = None self.instance_view = None self.license_type = kwargs.get('license_type', None) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py index e7b8b71a085a..ae0a36286ed9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py @@ -633,6 +633,380 @@ def __init__(self, **kwargs) -> None: self.lun = None +class DedicatedHost(Resource): + """Specifies information about the Dedicated host. + + 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 platform_fault_domain: Fault domain of the host within a group. + Supported values 0,1,2. + :type platform_fault_domain: int + :param auto_replace_on_failure: Whether the host should be replaced + automatically in case of a failure. The value is defaulted to true when + not provided. + :type auto_replace_on_failure: bool + :ivar host_id: A unique id generated and assigned to the dedicated host by + the platform. + :vartype host_id: str + :ivar virtual_machines: A list of references to all virtual machines in + the Dedicated Host. + :vartype virtual_machines: + list[~azure.mgmt.compute.v2019_03_01.models.SubResourceReadOnly] + :param license_type: Specifies the software license type that will be + applied to the VMs deployed on the dedicated host.

Possible + values are:

**None**

**Windows_Server_Hybrid**

+ **Windows_Server_Perpetual**

Default: **None**. Possible values + include: 'None', 'Windows_Server_Hybrid', 'Windows_Server_Perpetual' + :type license_type: str or + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostLicenseTypes + :ivar provisioning_time: The date when the host was first created. + :vartype provisioning_time: datetime + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar instance_view: The dedicated host instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostInstanceView + :param sku: Sku of the dedicated host for Hardware Generation and VM + family, The only name is required to be set. See DedicatedHostSkuTypes for + possible set of values. + :type sku: ~azure.mgmt.compute.v2019_03_01.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'host_id': {'readonly': True}, + 'virtual_machines': {'readonly': True}, + 'provisioning_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'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}'}, + 'platform_fault_domain': {'key': 'properties.platformFaultDomain', 'type': 'int'}, + 'auto_replace_on_failure': {'key': 'properties.autoReplaceOnFailure', 'type': 'bool'}, + 'host_id': {'key': 'properties.hostId', 'type': 'str'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResourceReadOnly]'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'DedicatedHostLicenseTypes'}, + 'provisioning_time': {'key': 'properties.provisioningTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'DedicatedHostInstanceView'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, location: str, tags=None, platform_fault_domain: int=None, auto_replace_on_failure: bool=None, license_type=None, sku=None, **kwargs) -> None: + super(DedicatedHost, self).__init__(location=location, tags=tags, **kwargs) + self.platform_fault_domain = platform_fault_domain + self.auto_replace_on_failure = auto_replace_on_failure + self.host_id = None + self.virtual_machines = None + self.license_type = license_type + self.provisioning_time = None + self.provisioning_state = None + self.instance_view = None + self.sku = sku + + +class DedicatedHostAllocatableVM(Model): + """Represents the dedicated host unutilized capacity in terms of a specific VM + size. + + :param vm_size: VM size in terms of which the unutilized capacity is + represented. + :type vm_size: str + :param count: Maximum number of VMs of size vmSize that can fit in the + dedicated host's remaining capacity. + :type count: float + """ + + _attribute_map = { + 'vm_size': {'key': 'vmSize', 'type': 'str'}, + 'count': {'key': 'count', 'type': 'float'}, + } + + def __init__(self, *, vm_size: str=None, count: float=None, **kwargs) -> None: + super(DedicatedHostAllocatableVM, self).__init__(**kwargs) + self.vm_size = vm_size + self.count = count + + +class DedicatedHostAvailableCapacity(Model): + """Dedicated host unutilized capacity. + + :param available_vcpus: The total number of CPUs. + :type available_vcpus: float + :param allocatable_vms: The unutilized capacity of the dedicated host + represented in terms of each VM size that is allowed to be deployed to the + dedicated host. + :type allocatable_vms: + list[~azure.mgmt.compute.v2019_03_01.models.DedicatedHostAllocatableVM] + """ + + _attribute_map = { + 'available_vcpus': {'key': 'availableVCpus', 'type': 'float'}, + 'allocatable_vms': {'key': 'allocatableVMs', 'type': '[DedicatedHostAllocatableVM]'}, + } + + def __init__(self, *, available_vcpus: float=None, allocatable_vms=None, **kwargs) -> None: + super(DedicatedHostAvailableCapacity, self).__init__(**kwargs) + self.available_vcpus = available_vcpus + self.allocatable_vms = allocatable_vms + + +class DedicatedHostCapacity(Model): + """Dedicated host total capacity. + + :param total_cores: The total number of cores. + :type total_cores: float + :param total_vcpus: The total number of CPUs. + :type total_vcpus: float + """ + + _attribute_map = { + 'total_cores': {'key': 'totalCores', 'type': 'float'}, + 'total_vcpus': {'key': 'totalVCpus', 'type': 'float'}, + } + + def __init__(self, *, total_cores: float=None, total_vcpus: float=None, **kwargs) -> None: + super(DedicatedHostCapacity, self).__init__(**kwargs) + self.total_cores = total_cores + self.total_vcpus = total_vcpus + + +class DedicatedHostGroup(Resource): + """Specifies information about the dedicated host group that the dedicated + hosts should be assigned to.

Currently, a Dedicated host can only + be added to Dedicated Host Group at creation time. An existing Dedicated + Host cannot be added to a dedicated host 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 platform_fault_domain_count: Number of fault domains that the host + group can span. Supported values 1,2,3. + :type platform_fault_domain_count: int + :ivar hosts: A list of references to all dedicated hosts in the dedicated + host group. + :vartype hosts: + list[~azure.mgmt.compute.v2019_03_01.models.SubResourceReadOnly] + :param zones: Availability Zone to use for this host group � only single + zone is supported. The zone can be assigned only during creation. If not + provided, the group supports all zones in the region. If provided, enforce + each host in the group is in the same zone. + :type zones: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'hosts': {'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}'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'hosts': {'key': 'properties.hosts', 'type': '[SubResourceReadOnly]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, location: str, tags=None, platform_fault_domain_count: int=None, zones=None, **kwargs) -> None: + super(DedicatedHostGroup, self).__init__(location=location, tags=tags, **kwargs) + self.platform_fault_domain_count = platform_fault_domain_count + self.hosts = None + self.zones = zones + + +class DedicatedHostGroupUpdate(UpdateResource): + """Specifies information about the dedicated host group that the dedicated + host should be assigned to. Only tags may be updated. + + 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_fault_domain_count: Number of fault domains that the host + group can span. Supported values 1,2,3. + :type platform_fault_domain_count: int + :ivar hosts: A list of references to all dedicated hosts in the dedicated + host group. + :vartype hosts: + list[~azure.mgmt.compute.v2019_03_01.models.SubResourceReadOnly] + :param zones: Availability Zone to use for this host group � only single + zone is supported. The zone can be assigned only during creation. If not + provided, the group supports all zones in the region. If provided, enforce + each host in the group is in the same zone. + :type zones: list[str] + """ + + _validation = { + 'hosts': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'platform_fault_domain_count': {'key': 'properties.platformFaultDomainCount', 'type': 'int'}, + 'hosts': {'key': 'properties.hosts', 'type': '[SubResourceReadOnly]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, tags=None, platform_fault_domain_count: int=None, zones=None, **kwargs) -> None: + super(DedicatedHostGroupUpdate, self).__init__(tags=tags, **kwargs) + self.platform_fault_domain_count = platform_fault_domain_count + self.hosts = None + self.zones = zones + + +class DedicatedHostInstanceView(Model): + """The instance view of a dedicated host. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar asset_id: Specifies the unique of the dedicated physical machine on + which the dedicated host resides. + :vartype asset_id: str + :param capacity: The total capacity of the dedicated host. + :type capacity: + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostCapacity + :param available_capacity: Unutilized capacity of the dedicated host. + :type available_capacity: + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostAvailableCapacity + :param statuses: The resource status information. + :type statuses: + list[~azure.mgmt.compute.v2019_03_01.models.InstanceViewStatus] + """ + + _validation = { + 'asset_id': {'readonly': True}, + } + + _attribute_map = { + 'asset_id': {'key': 'assetId', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'DedicatedHostCapacity'}, + 'available_capacity': {'key': 'availableCapacity', 'type': 'DedicatedHostAvailableCapacity'}, + 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, + } + + def __init__(self, *, capacity=None, available_capacity=None, statuses=None, **kwargs) -> None: + super(DedicatedHostInstanceView, self).__init__(**kwargs) + self.asset_id = None + self.capacity = capacity + self.available_capacity = available_capacity + self.statuses = statuses + + +class DedicatedHostUpdate(UpdateResource): + """Specifies information about the dedicated host. Only tags, + autoReplaceOnFailure and licenseType may be updated. + + 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_fault_domain: Fault domain of the host within a group. + Supported values 0,1,2. + :type platform_fault_domain: int + :param auto_replace_on_failure: Whether the host should be replaced + automatically in case of a failure. The value is defaulted to true when + not provided. + :type auto_replace_on_failure: bool + :ivar host_id: A unique id generated and assigned to the dedicated host by + the platform. + :vartype host_id: str + :ivar virtual_machines: A list of references to all virtual machines in + the Dedicated Host. + :vartype virtual_machines: + list[~azure.mgmt.compute.v2019_03_01.models.SubResourceReadOnly] + :param license_type: Specifies the software license type that will be + applied to the VMs deployed on the dedicated host.

Possible + values are:

**None**

**Windows_Server_Hybrid**

+ **Windows_Server_Perpetual**

Default: **None**. Possible values + include: 'None', 'Windows_Server_Hybrid', 'Windows_Server_Perpetual' + :type license_type: str or + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostLicenseTypes + :ivar provisioning_time: The date when the host was first created. + :vartype provisioning_time: datetime + :ivar provisioning_state: The provisioning state, which only appears in + the response. + :vartype provisioning_state: str + :ivar instance_view: The dedicated host instance view. + :vartype instance_view: + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostInstanceView + """ + + _validation = { + 'host_id': {'readonly': True}, + 'virtual_machines': {'readonly': True}, + 'provisioning_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'instance_view': {'readonly': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'platform_fault_domain': {'key': 'properties.platformFaultDomain', 'type': 'int'}, + 'auto_replace_on_failure': {'key': 'properties.autoReplaceOnFailure', 'type': 'bool'}, + 'host_id': {'key': 'properties.hostId', 'type': 'str'}, + 'virtual_machines': {'key': 'properties.virtualMachines', 'type': '[SubResourceReadOnly]'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'DedicatedHostLicenseTypes'}, + 'provisioning_time': {'key': 'properties.provisioningTime', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'instance_view': {'key': 'properties.instanceView', 'type': 'DedicatedHostInstanceView'}, + } + + def __init__(self, *, tags=None, platform_fault_domain: int=None, auto_replace_on_failure: bool=None, license_type=None, **kwargs) -> None: + super(DedicatedHostUpdate, self).__init__(tags=tags, **kwargs) + self.platform_fault_domain = platform_fault_domain + self.auto_replace_on_failure = auto_replace_on_failure + self.host_id = None + self.virtual_machines = None + self.license_type = license_type + self.provisioning_time = None + self.provisioning_state = None + self.instance_view = None + + class DiagnosticsProfile(Model): """Specifies the boot diagnostic settings state.

Minimum api-version: 2015-06-15. @@ -3621,6 +3995,9 @@ class VirtualMachine(Resource):

Minimum api-version: 2018-04-01. :type proximity_placement_group: ~azure.mgmt.compute.v2019_03_01.models.SubResource + :param host: Specifies information about the dedicated host that the + virtual machine resides in.

Minimum api-version: 2018-10-01. + :type host: ~azure.mgmt.compute.v2019_03_01.models.SubResource :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -3677,6 +4054,7 @@ class VirtualMachine(Resource): 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + 'host': {'key': 'properties.host', 'type': 'SubResource'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, @@ -3686,7 +4064,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, proximity_placement_group=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, host=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 @@ -3697,6 +4075,7 @@ def __init__(self, *, location: str, tags=None, plan=None, hardware_profile=None self.diagnostics_profile = diagnostics_profile self.availability_set = availability_set self.proximity_placement_group = proximity_placement_group + self.host = host self.provisioning_state = None self.instance_view = None self.license_type = license_type @@ -6303,6 +6682,9 @@ class VirtualMachineUpdate(UpdateResource):

Minimum api-version: 2018-04-01. :type proximity_placement_group: ~azure.mgmt.compute.v2019_03_01.models.SubResource + :param host: Specifies information about the dedicated host that the + virtual machine resides in.

Minimum api-version: 2018-10-01. + :type host: ~azure.mgmt.compute.v2019_03_01.models.SubResource :ivar provisioning_state: The provisioning state, which only appears in the response. :vartype provisioning_state: str @@ -6347,6 +6729,7 @@ class VirtualMachineUpdate(UpdateResource): 'diagnostics_profile': {'key': 'properties.diagnosticsProfile', 'type': 'DiagnosticsProfile'}, 'availability_set': {'key': 'properties.availabilitySet', 'type': 'SubResource'}, 'proximity_placement_group': {'key': 'properties.proximityPlacementGroup', 'type': 'SubResource'}, + 'host': {'key': 'properties.host', 'type': 'SubResource'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'instance_view': {'key': 'properties.instanceView', 'type': 'VirtualMachineInstanceView'}, 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, @@ -6355,7 +6738,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, proximity_placement_group=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, host=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 @@ -6366,6 +6749,7 @@ def __init__(self, *, tags=None, plan=None, hardware_profile=None, storage_profi self.diagnostics_profile = diagnostics_profile self.availability_set = availability_set self.proximity_placement_group = proximity_placement_group + self.host = host self.provisioning_state = None self.instance_view = None self.license_type = license_type diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_paged_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_paged_models.py index e5da9bb4fa65..d271039fee93 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_paged_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_paged_models.py @@ -64,6 +64,32 @@ class ProximityPlacementGroupPaged(Paged): def __init__(self, *args, **kwargs): super(ProximityPlacementGroupPaged, self).__init__(*args, **kwargs) +class DedicatedHostGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`DedicatedHostGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DedicatedHostGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(DedicatedHostGroupPaged, self).__init__(*args, **kwargs) +class DedicatedHostPaged(Paged): + """ + A paging container for iterating over a list of :class:`DedicatedHost ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DedicatedHost]'} + } + + def __init__(self, *args, **kwargs): + + super(DedicatedHostPaged, self).__init__(*args, **kwargs) class UsagePaged(Paged): """ A paging container for iterating over a list of :class:`Usage ` object diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/__init__.py index 84fa14fc7cc4..bf3e9ddb67f9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/__init__.py @@ -12,6 +12,8 @@ from ._operations import Operations from ._availability_sets_operations import AvailabilitySetsOperations from ._proximity_placement_groups_operations import ProximityPlacementGroupsOperations +from ._dedicated_host_groups_operations import DedicatedHostGroupsOperations +from ._dedicated_hosts_operations import DedicatedHostsOperations from ._virtual_machine_extension_images_operations import VirtualMachineExtensionImagesOperations from ._virtual_machine_extensions_operations import VirtualMachineExtensionsOperations from ._virtual_machine_images_operations import VirtualMachineImagesOperations @@ -33,6 +35,8 @@ 'Operations', 'AvailabilitySetsOperations', 'ProximityPlacementGroupsOperations', + 'DedicatedHostGroupsOperations', + 'DedicatedHostsOperations', 'VirtualMachineExtensionImagesOperations', 'VirtualMachineExtensionsOperations', 'VirtualMachineImagesOperations', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py new file mode 100644 index 000000000000..397b09d872e3 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_host_groups_operations.py @@ -0,0 +1,435 @@ +# 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 DedicatedHostGroupsOperations(object): + """DedicatedHostGroupsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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, host_group_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update a dedicated host group. For details of Dedicated Host + and Dedicated Host Groups please see [Dedicated Host Documentation] + (https://go.microsoft.com/fwlink/?linkid=2082596). + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param parameters: Parameters supplied to the Create Dedicated Host + Group. + :type parameters: + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroup + :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: DedicatedHostGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroup 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'), + 'hostGroupName': self._serialize.url("host_group_name", host_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, 'DedicatedHostGroup') + + # 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('DedicatedHostGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('DedicatedHostGroup', 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/hostGroups/{hostGroupName}'} + + def update( + self, resource_group_name, host_group_name, parameters, custom_headers=None, raw=False, **operation_config): + """Update an dedicated host group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param parameters: Parameters supplied to the Update Dedicated Host + Group operation. + :type parameters: + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroupUpdate + :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: DedicatedHostGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroup 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'), + 'hostGroupName': self._serialize.url("host_group_name", host_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, 'DedicatedHostGroupUpdate') + + # 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('DedicatedHostGroup', 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/hostGroups/{hostGroupName}'} + + def delete( + self, resource_group_name, host_group_name, custom_headers=None, raw=False, **operation_config): + """Delete a dedicated host group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_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'), + 'hostGroupName': self._serialize.url("host_group_name", host_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, 204]: + 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/hostGroups/{hostGroupName}'} + + def get( + self, resource_group_name, host_group_name, custom_headers=None, raw=False, **operation_config): + """Retrieves information about a dedicated host group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_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: DedicatedHostGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroup 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'), + 'hostGroupName': self._serialize.url("host_group_name", host_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('DedicatedHostGroup', 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/hostGroups/{hostGroupName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all of the dedicated host groups in the specified resource group. + Use the nextLink property in the response to get the next page of + dedicated host groups. + + :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 DedicatedHostGroup + :rtype: + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroupPaged[~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroup] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.DedicatedHostGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the dedicated host groups in the subscription. Use the + nextLink property in the response to get the next page of dedicated + host groups. + + :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 DedicatedHostGroup + :rtype: + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroupPaged[~azure.mgmt.compute.v2019_03_01.models.DedicatedHostGroup] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.DedicatedHostGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups'} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py new file mode 100644 index 000000000000..11f38331ff79 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py @@ -0,0 +1,481 @@ +# 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 DedicatedHostsOperations(object): + """DedicatedHostsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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_initial( + self, resource_group_name, host_group_name, host_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_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, 'DedicatedHost') + + # 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('DedicatedHost', response) + if response.status_code == 201: + deserialized = self._deserialize('DedicatedHost', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, host_group_name, host_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a dedicated host . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param host_name: The name of the dedicated host . + :type host_name: str + :param parameters: Parameters supplied to the Create Dedicated Host . + :type parameters: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHost + :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 DedicatedHost or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2019_03_01.models.DedicatedHost] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2019_03_01.models.DedicatedHost]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + host_group_name=host_group_name, + host_name=host_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DedicatedHost', 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/hostGroups/{hostGroupName}/hosts/{hostName}'} + + + def _update_initial( + self, resource_group_name, host_group_name, host_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'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_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, 'DedicatedHostUpdate') + + # 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('DedicatedHost', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, host_group_name, host_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Update an dedicated host . + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param host_name: The name of the dedicated host . + :type host_name: str + :param parameters: Parameters supplied to the Update Dedicated Host + operation. + :type parameters: + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostUpdate + :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 DedicatedHost or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2019_03_01.models.DedicatedHost] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2019_03_01.models.DedicatedHost]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + host_group_name=host_group_name, + host_name=host_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DedicatedHost', 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/hostGroups/{hostGroupName}/hosts/{hostName}'} + + + def _delete_initial( + self, resource_group_name, host_group_name, host_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_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, 202, 204]: + 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 + + def delete( + self, resource_group_name, host_group_name, host_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a dedicated host. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param host_name: The name of the dedicated host. + :type host_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 None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + host_group_name=host_group_name, + host_name=host_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + 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/hostGroups/{hostGroupName}/hosts/{hostName}'} + + def get( + self, resource_group_name, host_group_name, host_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Retrieves information about a dedicated host. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_group_name: str + :param host_name: The name of the dedicated host. + :type host_name: str + :param expand: The expand expression to apply on the operation. + Possible values include: 'instanceView' + :type expand: str or + ~azure.mgmt.compute.v2019_03_01.models.InstanceViewTypes + :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: DedicatedHost or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHost 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'), + 'hostGroupName': self._serialize.url("host_group_name", host_group_name, 'str'), + 'hostName': self._serialize.url("host_name", host_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 = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'InstanceViewTypes') + 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('DedicatedHost', 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/hostGroups/{hostGroupName}/hosts/{hostName}'} + + def list_by_host_group( + self, resource_group_name, host_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all of the dedicated hosts in the specified dedicated host group. + Use the nextLink property in the response to get the next page of + dedicated hosts. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param host_group_name: The name of the dedicated host group. + :type host_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 DedicatedHost + :rtype: + ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostPaged[~azure.mgmt.compute.v2019_03_01.models.DedicatedHost] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_host_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'hostGroupName': self._serialize.url("host_group_name", host_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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.DedicatedHostPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_host_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts'} diff --git a/sdk/compute/azure-mgmt-compute/setup.py b/sdk/compute/azure-mgmt-compute/setup.py index d2d3ea9fb728..0b35e538c888 100644 --- a/sdk/compute/azure-mgmt-compute/setup.py +++ b/sdk/compute/azure-mgmt-compute/setup.py @@ -64,7 +64,6 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7',