From 6bc226ad62636e4784c528d394caf7e9db22594c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 10 Dec 2021 03:39:22 +0000 Subject: [PATCH] CodeGen from PR 17002 in Azure/azure-rest-api-specs Merge abaf8f142d1187d2d9e8f691894ff2804f64a953 into 52f9379c7709eb53f15b875b7de9b1abfa17f298 --- sdk/compute/azure-mgmt-avs/_meta.json | 2 +- .../azure/mgmt/avs/_avs_client.py | 12 +- .../azure/mgmt/avs/models/__init__.py | 57 ++ .../mgmt/avs/models/_avs_client_enums.py | 85 ++- .../azure/mgmt/avs/models/_models.py | 499 ++++++++++++++++- .../azure/mgmt/avs/models/_models_py3.py | 519 +++++++++++++++++- .../azure/mgmt/avs/models/_paged_models.py | 26 + .../azure/mgmt/avs/operations/__init__.py | 4 + .../mgmt/avs/operations/_addons_operations.py | 4 +- .../operations/_authorizations_operations.py | 13 +- .../avs/operations/_cloud_links_operations.py | 4 +- .../avs/operations/_clusters_operations.py | 13 +- .../avs/operations/_datastores_operations.py | 4 +- .../_global_reach_connections_operations.py | 23 +- .../_hcx_enterprise_sites_operations.py | 4 +- .../avs/operations/_locations_operations.py | 4 +- .../azure/mgmt/avs/operations/_operations.py | 4 +- .../_placement_policies_operations.py | 504 +++++++++++++++++ .../operations/_private_clouds_operations.py | 4 +- .../operations/_script_cmdlets_operations.py | 8 +- .../_script_executions_operations.py | 10 +- .../operations/_script_packages_operations.py | 9 +- .../_virtual_machines_operations.py | 285 ++++++++++ .../_workload_networks_operations.py | 4 +- 24 files changed, 1990 insertions(+), 111 deletions(-) create mode 100644 sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py create mode 100644 sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py diff --git a/sdk/compute/azure-mgmt-avs/_meta.json b/sdk/compute/azure-mgmt-avs/_meta.json index c5fd11374114..3756c3596a48 100644 --- a/sdk/compute/azure-mgmt-avs/_meta.json +++ b/sdk/compute/azure-mgmt-avs/_meta.json @@ -1,7 +1,7 @@ { "autorest": "V2", "use": "@microsoft.azure/autorest.python@~4.0.71", - "commit": "b91af17cf7e5d480dec66f50fa96b2e2f13a83f0", + "commit": "601c97c947adf51376b48f50294f68ed5602c260", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/vmware/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", "readme": "specification/vmware/resource-manager/readme.md" diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py index e8a8d3b541ba..a292ba1a910d 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py @@ -24,6 +24,8 @@ from .operations import WorkloadNetworksOperations from .operations import CloudLinksOperations from .operations import AddonsOperations +from .operations import VirtualMachinesOperations +from .operations import PlacementPoliciesOperations from .operations import ScriptPackagesOperations from .operations import ScriptCmdletsOperations from .operations import ScriptExecutionsOperations @@ -58,6 +60,10 @@ class AVSClient(SDKClient): :vartype cloud_links: azure.mgmt.avs.operations.CloudLinksOperations :ivar addons: Addons operations :vartype addons: azure.mgmt.avs.operations.AddonsOperations + :ivar virtual_machines: VirtualMachines operations + :vartype virtual_machines: azure.mgmt.avs.operations.VirtualMachinesOperations + :ivar placement_policies: PlacementPolicies operations + :vartype placement_policies: azure.mgmt.avs.operations.PlacementPoliciesOperations :ivar script_packages: ScriptPackages operations :vartype script_packages: azure.mgmt.avs.operations.ScriptPackagesOperations :ivar script_cmdlets: ScriptCmdlets operations @@ -80,7 +86,7 @@ def __init__( super(AVSClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2021-06-01' + self.api_version = '2021-12-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -106,6 +112,10 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.addons = AddonsOperations( self._client, self.config, self._serialize, self._deserialize) + self.virtual_machines = VirtualMachinesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.placement_policies = PlacementPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) self.script_packages = ScriptPackagesOperations( self._client, self.config, self._serialize, self._deserialize) self.script_cmdlets = ScriptCmdletsOperations( diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py index 2753da60813c..6a05693c2fa8 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py @@ -16,6 +16,7 @@ from ._models_py3 import AddonSrmProperties from ._models_py3 import AddonVrProperties from ._models_py3 import AdminCredentials + from ._models_py3 import AvailabilityProperties from ._models_py3 import Circuit from ._models_py3 import CloudLink from ._models_py3 import Cluster @@ -23,6 +24,8 @@ from ._models_py3 import CommonClusterProperties from ._models_py3 import Datastore from ._models_py3 import DiskPoolVolume + from ._models_py3 import Encryption + from ._models_py3 import EncryptionKeyVaultProperties from ._models_py3 import Endpoints from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorResponse @@ -38,7 +41,11 @@ from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationProperties + from ._models_py3 import PlacementPolicy + from ._models_py3 import PlacementPolicyProperties + from ._models_py3 import PlacementPolicyUpdate from ._models_py3 import PrivateCloud + from ._models_py3 import PrivateCloudIdentity from ._models_py3 import PrivateCloudUpdate from ._models_py3 import ProxyResource from ._models_py3 import PSCredentialExecutionParameter @@ -55,6 +62,10 @@ from ._models_py3 import Sku from ._models_py3 import TrackedResource from ._models_py3 import Trial + from ._models_py3 import VirtualMachine + from ._models_py3 import VirtualMachineRestrictMovement + from ._models_py3 import VmHostPlacementPolicyProperties + from ._models_py3 import VmVmPlacementPolicyProperties from ._models_py3 import WorkloadNetworkDhcp from ._models_py3 import WorkloadNetworkDhcpEntity from ._models_py3 import WorkloadNetworkDhcpRelay @@ -76,6 +87,7 @@ from ._models import AddonSrmProperties from ._models import AddonVrProperties from ._models import AdminCredentials + from ._models import AvailabilityProperties from ._models import Circuit from ._models import CloudLink from ._models import Cluster @@ -83,6 +95,8 @@ from ._models import CommonClusterProperties from ._models import Datastore from ._models import DiskPoolVolume + from ._models import Encryption + from ._models import EncryptionKeyVaultProperties from ._models import Endpoints from ._models import ErrorAdditionalInfo from ._models import ErrorResponse @@ -98,7 +112,11 @@ from ._models import Operation from ._models import OperationDisplay from ._models import OperationProperties + from ._models import PlacementPolicy + from ._models import PlacementPolicyProperties + from ._models import PlacementPolicyUpdate from ._models import PrivateCloud + from ._models import PrivateCloudIdentity from ._models import PrivateCloudUpdate from ._models import ProxyResource from ._models import PSCredentialExecutionParameter @@ -115,6 +133,10 @@ from ._models import Sku from ._models import TrackedResource from ._models import Trial + from ._models import VirtualMachine + from ._models import VirtualMachineRestrictMovement + from ._models import VmHostPlacementPolicyProperties + from ._models import VmVmPlacementPolicyProperties from ._models import WorkloadNetworkDhcp from ._models import WorkloadNetworkDhcpEntity from ._models import WorkloadNetworkDhcpRelay @@ -137,10 +159,12 @@ from ._paged_models import GlobalReachConnectionPaged from ._paged_models import HcxEnterpriseSitePaged from ._paged_models import OperationPaged +from ._paged_models import PlacementPolicyPaged from ._paged_models import PrivateCloudPaged from ._paged_models import ScriptCmdletPaged from ._paged_models import ScriptExecutionPaged from ._paged_models import ScriptPackagePaged +from ._paged_models import VirtualMachinePaged from ._paged_models import WorkloadNetworkDhcpPaged from ._paged_models import WorkloadNetworkDnsServicePaged from ._paged_models import WorkloadNetworkDnsZonePaged @@ -154,13 +178,19 @@ TrialStatus, QuotaEnabled, ExpressRouteAuthorizationProvisioningState, + EncryptionKeyStatus, + EncryptionVersionType, + EncryptionState, SslEnum, + AvailabilityStrategy, PrivateCloudProvisioningState, + ResourceIdentityType, InternetEnum, ClusterProvisioningState, AddonProvisioningState, DatastoreProvisioningState, MountOptionEnum, + DatastoreStatus, HcxEnterpriseSiteStatus, GlobalReachConnectionProvisioningState, GlobalReachConnectionStatus, @@ -179,6 +209,10 @@ WorkloadNetworkDnsServiceProvisioningState, WorkloadNetworkDnsZoneProvisioningState, WorkloadNetworkPublicIPProvisioningState, + VirtualMachineRestrictMovementState, + PlacementPolicyState, + PlacementPolicyProvisioningState, + AffinityType, ScriptParameterTypes, VisibilityParameterEnum, OptionalParamEnum, @@ -193,6 +227,7 @@ 'AddonSrmProperties', 'AddonVrProperties', 'AdminCredentials', + 'AvailabilityProperties', 'Circuit', 'CloudLink', 'Cluster', @@ -200,6 +235,8 @@ 'CommonClusterProperties', 'Datastore', 'DiskPoolVolume', + 'Encryption', + 'EncryptionKeyVaultProperties', 'Endpoints', 'ErrorAdditionalInfo', 'ErrorResponse', @@ -215,7 +252,11 @@ 'Operation', 'OperationDisplay', 'OperationProperties', + 'PlacementPolicy', + 'PlacementPolicyProperties', + 'PlacementPolicyUpdate', 'PrivateCloud', + 'PrivateCloudIdentity', 'PrivateCloudUpdate', 'ProxyResource', 'PSCredentialExecutionParameter', @@ -232,6 +273,10 @@ 'Sku', 'TrackedResource', 'Trial', + 'VirtualMachine', + 'VirtualMachineRestrictMovement', + 'VmHostPlacementPolicyProperties', + 'VmVmPlacementPolicyProperties', 'WorkloadNetworkDhcp', 'WorkloadNetworkDhcpEntity', 'WorkloadNetworkDhcpRelay', @@ -264,19 +309,27 @@ 'WorkloadNetworkPublicIPPaged', 'CloudLinkPaged', 'AddonPaged', + 'VirtualMachinePaged', + 'PlacementPolicyPaged', 'ScriptPackagePaged', 'ScriptCmdletPaged', 'ScriptExecutionPaged', 'TrialStatus', 'QuotaEnabled', 'ExpressRouteAuthorizationProvisioningState', + 'EncryptionKeyStatus', + 'EncryptionVersionType', + 'EncryptionState', 'SslEnum', + 'AvailabilityStrategy', 'PrivateCloudProvisioningState', + 'ResourceIdentityType', 'InternetEnum', 'ClusterProvisioningState', 'AddonProvisioningState', 'DatastoreProvisioningState', 'MountOptionEnum', + 'DatastoreStatus', 'HcxEnterpriseSiteStatus', 'GlobalReachConnectionProvisioningState', 'GlobalReachConnectionStatus', @@ -295,6 +348,10 @@ 'WorkloadNetworkDnsServiceProvisioningState', 'WorkloadNetworkDnsZoneProvisioningState', 'WorkloadNetworkPublicIPProvisioningState', + 'VirtualMachineRestrictMovementState', + 'PlacementPolicyState', + 'PlacementPolicyProvisioningState', + 'AffinityType', 'ScriptParameterTypes', 'VisibilityParameterEnum', 'OptionalParamEnum', diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py index aa990cdd6a3c..700016681914 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py @@ -32,12 +32,36 @@ class ExpressRouteAuthorizationProvisioningState(str, Enum): updating = "Updating" +class EncryptionKeyStatus(str, Enum): + + connected = "Connected" + access_denied = "AccessDenied" + + +class EncryptionVersionType(str, Enum): + + fixed = "Fixed" + auto_detected = "AutoDetected" + + +class EncryptionState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + class SslEnum(str, Enum): enabled = "Enabled" disabled = "Disabled" +class AvailabilityStrategy(str, Enum): + + single_zone = "SingleZone" + dual_zone = "DualZone" + + class PrivateCloudProvisioningState(str, Enum): succeeded = "Succeeded" @@ -49,6 +73,12 @@ class PrivateCloudProvisioningState(str, Enum): updating = "Updating" +class ResourceIdentityType(str, Enum): + + system_assigned = "SystemAssigned" + none = "None" + + class InternetEnum(str, Enum): enabled = "Enabled" @@ -91,6 +121,17 @@ class MountOptionEnum(str, Enum): attach = "ATTACH" +class DatastoreStatus(str, Enum): + + unknown = "Unknown" + accessible = "Accessible" + inaccessible = "Inaccessible" + attached = "Attached" + detached = "Detached" + lost_communication = "LostCommunication" + dead_or_error = "DeadOrError" + + class HcxEnterpriseSiteStatus(str, Enum): available = "Available" @@ -124,7 +165,8 @@ class CloudLinkStatus(str, Enum): class SegmentStatusEnum(str, Enum): - successfailure = "SUCCESS, FAILURE" + success = "SUCCESS" + failure = "FAILURE" class WorkloadNetworkSegmentProvisioningState(str, Enum): @@ -147,12 +189,15 @@ class WorkloadNetworkDhcpProvisioningState(str, Enum): class PortMirroringDirectionEnum(str, Enum): - ingressegressbidirectional = "INGRESS, EGRESS, BIDIRECTIONAL" + ingress = "INGRESS" + egress = "EGRESS" + bidirectional = "BIDIRECTIONAL" class PortMirroringStatusEnum(str, Enum): - successfailure = "SUCCESS, FAILURE" + success = "SUCCESS" + failure = "FAILURE" class WorkloadNetworkPortMirroringProvisioningState(str, Enum): @@ -166,7 +211,8 @@ class WorkloadNetworkPortMirroringProvisioningState(str, Enum): class VMGroupStatusEnum(str, Enum): - successfailure = "SUCCESS, FAILURE" + success = "SUCCESS" + failure = "FAILURE" class WorkloadNetworkVMGroupProvisioningState(str, Enum): @@ -180,7 +226,9 @@ class WorkloadNetworkVMGroupProvisioningState(str, Enum): class VMTypeEnum(str, Enum): - regularedgeservice = "REGULAR, EDGE, SERVICE" + regular = "REGULAR" + edge = "EDGE" + service = "SERVICE" class DnsServiceLogLevelEnum(str, Enum): @@ -225,6 +273,33 @@ class WorkloadNetworkPublicIPProvisioningState(str, Enum): updating = "Updating" +class VirtualMachineRestrictMovementState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class PlacementPolicyState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class PlacementPolicyProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + building = "Building" + deleting = "Deleting" + updating = "Updating" + + +class AffinityType(str, Enum): + + affinity = "Affinity" + anti_affinity = "AntiAffinity" + + class ScriptParameterTypes(str, Enum): string = "String" diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py index e46201a2d50d..3c9ba1aca8b5 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py @@ -173,14 +173,13 @@ class AddonSrmProperties(AddonProperties): ~azure.mgmt.avs.models.AddonProvisioningState :param addon_type: Required. Constant filled by server. :type addon_type: str - :param license_key: Required. The Site Recovery Manager (SRM) license + :param license_key: The Site Recovery Manager (SRM) license :type license_key: str """ _validation = { 'provisioning_state': {'readonly': True}, 'addon_type': {'required': True}, - 'license_key': {'required': True}, } _attribute_map = { @@ -270,6 +269,32 @@ def __init__(self, **kwargs): self.vcenter_password = None +class AvailabilityProperties(Model): + """The properties describing private cloud availability zone distribution. + + :param strategy: The availability strategy for the private cloud. Possible + values include: 'SingleZone', 'DualZone' + :type strategy: str or ~azure.mgmt.avs.models.AvailabilityStrategy + :param zone: The primary availability zone for the private cloud + :type zone: int + :param secondary_zone: The secondary availability zone for the private + cloud + :type secondary_zone: int + """ + + _attribute_map = { + 'strategy': {'key': 'strategy', 'type': 'str'}, + 'zone': {'key': 'zone', 'type': 'int'}, + 'secondary_zone': {'key': 'secondaryZone', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AvailabilityProperties, self).__init__(**kwargs) + self.strategy = kwargs.get('strategy', None) + self.zone = kwargs.get('zone', None) + self.secondary_zone = kwargs.get('secondary_zone', None) + + class Circuit(Model): """An ExpressRoute Circuit. @@ -403,8 +428,8 @@ class Cluster(Resource): ~azure.mgmt.avs.models.ClusterProvisioningState :ivar cluster_id: The identity :vartype cluster_id: int - :ivar hosts: The hosts - :vartype hosts: list[str] + :param hosts: The hosts + :type hosts: list[str] """ _validation = { @@ -413,7 +438,6 @@ class Cluster(Resource): 'type': {'readonly': True}, 'sku': {'required': True}, 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, } _attribute_map = { @@ -433,7 +457,7 @@ def __init__(self, **kwargs): self.cluster_size = kwargs.get('cluster_size', None) self.provisioning_state = kwargs.get('provisioning_state', None) self.cluster_id = None - self.hosts = None + self.hosts = kwargs.get('hosts', None) class ClusterUpdate(Model): @@ -441,15 +465,19 @@ class ClusterUpdate(Model): :param cluster_size: The cluster size :type cluster_size: int + :param hosts: The hosts + :type hosts: list[str] """ _attribute_map = { 'cluster_size': {'key': 'properties.clusterSize', 'type': 'int'}, + 'hosts': {'key': 'properties.hosts', 'type': '[str]'}, } def __init__(self, **kwargs): super(ClusterUpdate, self).__init__(**kwargs) self.cluster_size = kwargs.get('cluster_size', None) + self.hosts = kwargs.get('hosts', None) class CommonClusterProperties(Model): @@ -466,13 +494,12 @@ class CommonClusterProperties(Model): ~azure.mgmt.avs.models.ClusterProvisioningState :ivar cluster_id: The identity :vartype cluster_id: int - :ivar hosts: The hosts - :vartype hosts: list[str] + :param hosts: The hosts + :type hosts: list[str] """ _validation = { 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, } _attribute_map = { @@ -487,7 +514,7 @@ def __init__(self, **kwargs): self.cluster_size = kwargs.get('cluster_size', None) self.provisioning_state = kwargs.get('provisioning_state', None) self.cluster_id = None - self.hosts = None + self.hosts = kwargs.get('hosts', None) class Datastore(Resource): @@ -511,6 +538,10 @@ class Datastore(Resource): :type net_app_volume: ~azure.mgmt.avs.models.NetAppVolume :param disk_pool_volume: An iSCSI volume :type disk_pool_volume: ~azure.mgmt.avs.models.DiskPoolVolume + :ivar status: The operational status of the datastore. Possible values + include: 'Unknown', 'Accessible', 'Inaccessible', 'Attached', 'Detached', + 'LostCommunication', 'DeadOrError' + :vartype status: str or ~azure.mgmt.avs.models.DatastoreStatus """ _validation = { @@ -518,6 +549,7 @@ class Datastore(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { @@ -527,6 +559,7 @@ class Datastore(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'net_app_volume': {'key': 'properties.netAppVolume', 'type': 'NetAppVolume'}, 'disk_pool_volume': {'key': 'properties.diskPoolVolume', 'type': 'DiskPoolVolume'}, + 'status': {'key': 'properties.status', 'type': 'str'}, } def __init__(self, **kwargs): @@ -534,6 +567,7 @@ def __init__(self, **kwargs): self.provisioning_state = None self.net_app_volume = kwargs.get('net_app_volume', None) self.disk_pool_volume = kwargs.get('disk_pool_volume', None) + self.status = None class DiskPoolVolume(Model): @@ -577,6 +611,71 @@ def __init__(self, **kwargs): self.path = None +class Encryption(Model): + """The properties of customer managed encryption key. + + :param status: Status of customer managed encryption key. Possible values + include: 'Enabled', 'Disabled' + :type status: str or ~azure.mgmt.avs.models.EncryptionState + :param key_vault_properties: The key vault where the encryption key is + stored + :type key_vault_properties: + ~azure.mgmt.avs.models.EncryptionKeyVaultProperties + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionKeyVaultProperties(Model): + """An Encryption Key. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param key_name: The name of the key. + :type key_name: str + :param key_version: The version of the key. + :type key_version: str + :param key_vault_url: The URL of the vault. + :type key_vault_url: str + :ivar key_state: The state of key provided. Possible values include: + 'Connected', 'AccessDenied' + :vartype key_state: str or ~azure.mgmt.avs.models.EncryptionKeyStatus + :ivar version_type: Property of the key if user provided or auto detected. + Possible values include: 'Fixed', 'AutoDetected' + :vartype version_type: str or ~azure.mgmt.avs.models.EncryptionVersionType + """ + + _validation = { + 'key_state': {'readonly': True}, + 'version_type': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_version': {'key': 'keyVersion', 'type': 'str'}, + 'key_vault_url': {'key': 'keyVaultUrl', 'type': 'str'}, + 'key_state': {'key': 'keyState', 'type': 'str'}, + 'version_type': {'key': 'versionType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EncryptionKeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_url = kwargs.get('key_vault_url', None) + self.key_state = None + self.version_type = None + + class Endpoints(Model): """Endpoint addresses. @@ -708,6 +807,8 @@ class ExpressRouteAuthorization(Resource): :ivar express_route_authorization_key: The key of the ExpressRoute Circuit Authorization :vartype express_route_authorization_key: str + :param express_route_id: The ID of the ExpressRoute Circuit + :type express_route_id: str """ _validation = { @@ -726,6 +827,7 @@ class ExpressRouteAuthorization(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'express_route_authorization_id': {'key': 'properties.expressRouteAuthorizationId', 'type': 'str'}, 'express_route_authorization_key': {'key': 'properties.expressRouteAuthorizationKey', 'type': 'str'}, + 'express_route_id': {'key': 'properties.expressRouteId', 'type': 'str'}, } def __init__(self, **kwargs): @@ -733,6 +835,7 @@ def __init__(self, **kwargs): self.provisioning_state = None self.express_route_authorization_id = None self.express_route_authorization_key = None + self.express_route_id = kwargs.get('express_route_id', None) class GlobalReachConnection(Resource): @@ -766,6 +869,9 @@ class GlobalReachConnection(Resource): :param peer_express_route_circuit: Identifier of the ExpressRoute Circuit to peer with in the global reach connection :type peer_express_route_circuit: str + :param express_route_id: The ID of the Private Cloud's ExpressRoute + Circuit that is participating in the global reach connection + :type express_route_id: str """ _validation = { @@ -786,6 +892,7 @@ class GlobalReachConnection(Resource): 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, 'circuit_connection_status': {'key': 'properties.circuitConnectionStatus', 'type': 'str'}, 'peer_express_route_circuit': {'key': 'properties.peerExpressRouteCircuit', 'type': 'str'}, + 'express_route_id': {'key': 'properties.expressRouteId', 'type': 'str'}, } def __init__(self, **kwargs): @@ -795,6 +902,7 @@ def __init__(self, **kwargs): self.authorization_key = kwargs.get('authorization_key', None) self.circuit_connection_status = None self.peer_express_route_circuit = kwargs.get('peer_express_route_circuit', None) + self.express_route_id = kwargs.get('express_route_id', None) class HcxEnterpriseSite(Resource): @@ -931,13 +1039,12 @@ class ManagementCluster(CommonClusterProperties): ~azure.mgmt.avs.models.ClusterProvisioningState :ivar cluster_id: The identity :vartype cluster_id: int - :ivar hosts: The hosts - :vartype hosts: list[str] + :param hosts: The hosts + :type hosts: list[str] """ _validation = { 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, } _attribute_map = { @@ -1167,6 +1274,114 @@ def __init__(self, **kwargs): self.service_specification = kwargs.get('service_specification', None) +class PlacementPolicy(Resource): + """A vSphere Distributed Resource Scheduler (DRS) placement policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param properties: placement policy properties + :type properties: ~azure.mgmt.avs.models.PlacementPolicyProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PlacementPolicyProperties'}, + } + + def __init__(self, **kwargs): + super(PlacementPolicy, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class PlacementPolicyProperties(Model): + """Abstract placement policy properties. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: VmVmPlacementPolicyProperties, + VmHostPlacementPolicyProperties + + 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. + + :param state: Whether the placement policy is enabled or disabled. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param display_name: Display name of the placement policy + :type display_name: str + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.PlacementPolicyProvisioningState + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'VmVm': 'VmVmPlacementPolicyProperties', 'VmHost': 'VmHostPlacementPolicyProperties'} + } + + def __init__(self, **kwargs): + super(PlacementPolicyProperties, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.display_name = kwargs.get('display_name', None) + self.provisioning_state = None + self.type = None + + +class PlacementPolicyUpdate(Model): + """An update of a DRS placement policy resource. + + :param state: Whether the placement policy is enabled or disabled. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param vm_members: Virtual machine members list + :type vm_members: list[str] + :param host_members: Host members list + :type host_members: list[str] + """ + + _attribute_map = { + 'state': {'key': 'properties.state', 'type': 'str'}, + 'vm_members': {'key': 'properties.vmMembers', 'type': '[str]'}, + 'host_members': {'key': 'properties.hostMembers', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PlacementPolicyUpdate, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.vm_members = kwargs.get('vm_members', None) + self.host_members = kwargs.get('host_members', None) + + class TrackedResource(Resource): """The resource model definition for a ARM tracked top level resource. @@ -1232,6 +1447,12 @@ class PrivateCloud(TrackedResource): :type internet: str or ~azure.mgmt.avs.models.InternetEnum :param identity_sources: vCenter Single Sign On Identity Sources :type identity_sources: list[~azure.mgmt.avs.models.IdentitySource] + :param availability: Properties describing how the cloud is distributed + across availability zones + :type availability: ~azure.mgmt.avs.models.AvailabilityProperties + :param encryption: Customer managed key encryption, can be enabled or + disabled + :type encryption: ~azure.mgmt.avs.models.Encryption :ivar provisioning_state: The provisioning state. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Pending', 'Building', 'Deleting', 'Updating' @@ -1269,6 +1490,11 @@ class PrivateCloud(TrackedResource): :ivar external_cloud_links: Array of cloud link IDs from other clouds that connect to this one :vartype external_cloud_links: list[str] + :param secondary_circuit: A secondary expressRoute circuit from a separate + AZ. Only present in a stretched private cloud + :type secondary_circuit: ~azure.mgmt.avs.models.Circuit + :param identity: The identity of the private cloud, if configured. + :type identity: ~azure.mgmt.avs.models.PrivateCloudIdentity """ _validation = { @@ -1297,6 +1523,8 @@ class PrivateCloud(TrackedResource): 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, 'internet': {'key': 'properties.internet', 'type': 'str'}, 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + 'availability': {'key': 'properties.availability', 'type': 'AvailabilityProperties'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'circuit': {'key': 'properties.circuit', 'type': 'Circuit'}, 'endpoints': {'key': 'properties.endpoints', 'type': 'Endpoints'}, @@ -1309,6 +1537,8 @@ class PrivateCloud(TrackedResource): 'vcenter_certificate_thumbprint': {'key': 'properties.vcenterCertificateThumbprint', 'type': 'str'}, 'nsxt_certificate_thumbprint': {'key': 'properties.nsxtCertificateThumbprint', 'type': 'str'}, 'external_cloud_links': {'key': 'properties.externalCloudLinks', 'type': '[str]'}, + 'secondary_circuit': {'key': 'properties.secondaryCircuit', 'type': 'Circuit'}, + 'identity': {'key': 'identity', 'type': 'PrivateCloudIdentity'}, } def __init__(self, **kwargs): @@ -1317,6 +1547,8 @@ def __init__(self, **kwargs): self.management_cluster = kwargs.get('management_cluster', None) self.internet = kwargs.get('internet', "Disabled") self.identity_sources = kwargs.get('identity_sources', None) + self.availability = kwargs.get('availability', None) + self.encryption = kwargs.get('encryption', None) self.provisioning_state = None self.circuit = kwargs.get('circuit', None) self.endpoints = None @@ -1329,6 +1561,45 @@ def __init__(self, **kwargs): self.vcenter_certificate_thumbprint = None self.nsxt_certificate_thumbprint = None self.external_cloud_links = None + self.secondary_circuit = kwargs.get('secondary_circuit', None) + self.identity = kwargs.get('identity', None) + + +class PrivateCloudIdentity(Model): + """Identity for the virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of private cloud identity. This + property will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID associated with the private cloud. This + property will only be provided for a system assigned identity. + :vartype tenant_id: str + :param type: The type of identity used for the private cloud. The type + 'SystemAssigned' refers to an implicitly created identity. The type 'None' + will remove any identities from the Private Cloud. Possible values + include: 'SystemAssigned', 'None' + :type type: str or ~azure.mgmt.avs.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateCloudIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) class PrivateCloudUpdate(Model): @@ -1343,6 +1614,14 @@ class PrivateCloudUpdate(Model): :type internet: str or ~azure.mgmt.avs.models.InternetEnum :param identity_sources: vCenter Single Sign On Identity Sources :type identity_sources: list[~azure.mgmt.avs.models.IdentitySource] + :param availability: Properties describing how the cloud is distributed + across availability zones + :type availability: ~azure.mgmt.avs.models.AvailabilityProperties + :param encryption: Customer managed key encryption, can be enabled or + disabled + :type encryption: ~azure.mgmt.avs.models.Encryption + :param identity: The identity of the private cloud, if configured. + :type identity: ~azure.mgmt.avs.models.PrivateCloudIdentity """ _attribute_map = { @@ -1350,6 +1629,9 @@ class PrivateCloudUpdate(Model): 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, 'internet': {'key': 'properties.internet', 'type': 'str'}, 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + 'availability': {'key': 'properties.availability', 'type': 'AvailabilityProperties'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'identity': {'key': 'identity', 'type': 'PrivateCloudIdentity'}, } def __init__(self, **kwargs): @@ -1358,6 +1640,9 @@ def __init__(self, **kwargs): self.management_cluster = kwargs.get('management_cluster', None) self.internet = kwargs.get('internet', "Disabled") self.identity_sources = kwargs.get('identity_sources', None) + self.availability = kwargs.get('availability', None) + self.encryption = kwargs.get('encryption', None) + self.identity = kwargs.get('identity', None) class ProxyResource(Resource): @@ -1864,6 +2149,178 @@ def __init__(self, **kwargs): self.available_hosts = None +class VirtualMachine(ProxyResource): + """Virtual Machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: Display name of the VM. + :vartype display_name: str + :ivar mo_ref_id: Virtual machine managed object reference id + :vartype mo_ref_id: str + :ivar folder_path: Path to virtual machine's folder starting from + datacenter virtual machine folder + :vartype folder_path: str + :ivar restrict_movement: Possible values include: 'Enabled', 'Disabled' + :vartype restrict_movement: str or + ~azure.mgmt.avs.models.VirtualMachineRestrictMovementState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'mo_ref_id': {'readonly': True}, + 'folder_path': {'readonly': True}, + 'restrict_movement': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'restrict_movement': {'key': 'properties.restrictMovement', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualMachine, self).__init__(**kwargs) + self.display_name = None + self.mo_ref_id = None + self.folder_path = None + self.restrict_movement = None + + +class VirtualMachineRestrictMovement(Model): + """Set VM DRS-driven movement to restricted (enabled) or not (disabled). + + :param restrict_movement: Possible values include: 'Enabled', 'Disabled' + :type restrict_movement: str or + ~azure.mgmt.avs.models.VirtualMachineRestrictMovementState + """ + + _attribute_map = { + 'restrict_movement': {'key': 'restrictMovement', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineRestrictMovement, self).__init__(**kwargs) + self.restrict_movement = kwargs.get('restrict_movement', None) + + +class VmHostPlacementPolicyProperties(PlacementPolicyProperties): + """VM-Host placement policy properties. + + 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. + + :param state: Whether the placement policy is enabled or disabled. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param display_name: Display name of the placement policy + :type display_name: str + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.PlacementPolicyProvisioningState + :param type: Required. Constant filled by server. + :type type: str + :param vm_members: Required. Virtual machine members list + :type vm_members: list[str] + :param host_members: Required. Host members list + :type host_members: list[str] + :param affinity_type: Required. placement policy affinity type. Possible + values include: 'Affinity', 'AntiAffinity' + :type affinity_type: str or ~azure.mgmt.avs.models.AffinityType + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'type': {'required': True}, + 'vm_members': {'required': True}, + 'host_members': {'required': True}, + 'affinity_type': {'required': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vm_members': {'key': 'vmMembers', 'type': '[str]'}, + 'host_members': {'key': 'hostMembers', 'type': '[str]'}, + 'affinity_type': {'key': 'affinityType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VmHostPlacementPolicyProperties, self).__init__(**kwargs) + self.vm_members = kwargs.get('vm_members', None) + self.host_members = kwargs.get('host_members', None) + self.affinity_type = kwargs.get('affinity_type', None) + self.type = 'VmHost' + + +class VmVmPlacementPolicyProperties(PlacementPolicyProperties): + """VM-VM placement policy properties. + + 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. + + :param state: Whether the placement policy is enabled or disabled. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param display_name: Display name of the placement policy + :type display_name: str + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.PlacementPolicyProvisioningState + :param type: Required. Constant filled by server. + :type type: str + :param vm_members: Required. Virtual machine members list + :type vm_members: list[str] + :param affinity_type: Required. placement policy affinity type. Possible + values include: 'Affinity', 'AntiAffinity' + :type affinity_type: str or ~azure.mgmt.avs.models.AffinityType + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'type': {'required': True}, + 'vm_members': {'required': True}, + 'affinity_type': {'required': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vm_members': {'key': 'vmMembers', 'type': '[str]'}, + 'affinity_type': {'key': 'affinityType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VmVmPlacementPolicyProperties, self).__init__(**kwargs) + self.vm_members = kwargs.get('vm_members', None) + self.affinity_type = kwargs.get('affinity_type', None) + self.type = 'VmVm' + + class WorkloadNetworkDhcp(ProxyResource): """NSX DHCP. @@ -2229,14 +2686,14 @@ class WorkloadNetworkPortMirroring(ProxyResource): :param display_name: Display name of the port mirroring profile. :type display_name: str :param direction: Direction of port mirroring profile. Possible values - include: 'INGRESS, EGRESS, BIDIRECTIONAL' + include: 'INGRESS', 'EGRESS', 'BIDIRECTIONAL' :type direction: str or ~azure.mgmt.avs.models.PortMirroringDirectionEnum :param source: Source VM Group. :type source: str :param destination: Destination VM Group. :type destination: str - :ivar status: Port Mirroring Status. Possible values include: 'SUCCESS, - FAILURE' + :ivar status: Port Mirroring Status. Possible values include: 'SUCCESS', + 'FAILURE' :vartype status: str or ~azure.mgmt.avs.models.PortMirroringStatusEnum :ivar provisioning_state: The provisioning state. Possible values include: 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' @@ -2349,7 +2806,8 @@ class WorkloadNetworkSegment(ProxyResource): :ivar port_vif: Port Vif which segment is associated with. :vartype port_vif: list[~azure.mgmt.avs.models.WorkloadNetworkSegmentPortVif] - :ivar status: Segment status. Possible values include: 'SUCCESS, FAILURE' + :ivar status: Segment status. Possible values include: 'SUCCESS', + 'FAILURE' :vartype status: str or ~azure.mgmt.avs.models.SegmentStatusEnum :ivar provisioning_state: The provisioning state. Possible values include: 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' @@ -2442,8 +2900,8 @@ class WorkloadNetworkVirtualMachine(ProxyResource): :vartype type: str :param display_name: Display name of the VM. :type display_name: str - :ivar vm_type: Virtual machine type. Possible values include: 'REGULAR, - EDGE, SERVICE' + :ivar vm_type: Virtual machine type. Possible values include: 'REGULAR', + 'EDGE', 'SERVICE' :vartype vm_type: str or ~azure.mgmt.avs.models.VMTypeEnum """ @@ -2484,7 +2942,8 @@ class WorkloadNetworkVMGroup(ProxyResource): :type display_name: str :param members: Virtual machine members of this group. :type members: list[str] - :ivar status: VM Group status. Possible values include: 'SUCCESS, FAILURE' + :ivar status: VM Group status. Possible values include: 'SUCCESS', + 'FAILURE' :vartype status: str or ~azure.mgmt.avs.models.VMGroupStatusEnum :ivar provisioning_state: The provisioning state. Possible values include: 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py index ddf114ae228b..94bd6825b812 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py @@ -173,14 +173,13 @@ class AddonSrmProperties(AddonProperties): ~azure.mgmt.avs.models.AddonProvisioningState :param addon_type: Required. Constant filled by server. :type addon_type: str - :param license_key: Required. The Site Recovery Manager (SRM) license + :param license_key: The Site Recovery Manager (SRM) license :type license_key: str """ _validation = { 'provisioning_state': {'readonly': True}, 'addon_type': {'required': True}, - 'license_key': {'required': True}, } _attribute_map = { @@ -189,7 +188,7 @@ class AddonSrmProperties(AddonProperties): 'license_key': {'key': 'licenseKey', 'type': 'str'}, } - def __init__(self, *, license_key: str, **kwargs) -> None: + def __init__(self, *, license_key: str=None, **kwargs) -> None: super(AddonSrmProperties, self).__init__(**kwargs) self.license_key = license_key self.addon_type = 'SRM' @@ -270,6 +269,32 @@ def __init__(self, **kwargs) -> None: self.vcenter_password = None +class AvailabilityProperties(Model): + """The properties describing private cloud availability zone distribution. + + :param strategy: The availability strategy for the private cloud. Possible + values include: 'SingleZone', 'DualZone' + :type strategy: str or ~azure.mgmt.avs.models.AvailabilityStrategy + :param zone: The primary availability zone for the private cloud + :type zone: int + :param secondary_zone: The secondary availability zone for the private + cloud + :type secondary_zone: int + """ + + _attribute_map = { + 'strategy': {'key': 'strategy', 'type': 'str'}, + 'zone': {'key': 'zone', 'type': 'int'}, + 'secondary_zone': {'key': 'secondaryZone', 'type': 'int'}, + } + + def __init__(self, *, strategy=None, zone: int=None, secondary_zone: int=None, **kwargs) -> None: + super(AvailabilityProperties, self).__init__(**kwargs) + self.strategy = strategy + self.zone = zone + self.secondary_zone = secondary_zone + + class Circuit(Model): """An ExpressRoute Circuit. @@ -403,8 +428,8 @@ class Cluster(Resource): ~azure.mgmt.avs.models.ClusterProvisioningState :ivar cluster_id: The identity :vartype cluster_id: int - :ivar hosts: The hosts - :vartype hosts: list[str] + :param hosts: The hosts + :type hosts: list[str] """ _validation = { @@ -413,7 +438,6 @@ class Cluster(Resource): 'type': {'readonly': True}, 'sku': {'required': True}, 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, } _attribute_map = { @@ -427,13 +451,13 @@ class Cluster(Resource): 'hosts': {'key': 'properties.hosts', 'type': '[str]'}, } - def __init__(self, *, sku, cluster_size: int=None, provisioning_state=None, **kwargs) -> None: + def __init__(self, *, sku, cluster_size: int=None, provisioning_state=None, hosts=None, **kwargs) -> None: super(Cluster, self).__init__(**kwargs) self.sku = sku self.cluster_size = cluster_size self.provisioning_state = provisioning_state self.cluster_id = None - self.hosts = None + self.hosts = hosts class ClusterUpdate(Model): @@ -441,15 +465,19 @@ class ClusterUpdate(Model): :param cluster_size: The cluster size :type cluster_size: int + :param hosts: The hosts + :type hosts: list[str] """ _attribute_map = { 'cluster_size': {'key': 'properties.clusterSize', 'type': 'int'}, + 'hosts': {'key': 'properties.hosts', 'type': '[str]'}, } - def __init__(self, *, cluster_size: int=None, **kwargs) -> None: + def __init__(self, *, cluster_size: int=None, hosts=None, **kwargs) -> None: super(ClusterUpdate, self).__init__(**kwargs) self.cluster_size = cluster_size + self.hosts = hosts class CommonClusterProperties(Model): @@ -466,13 +494,12 @@ class CommonClusterProperties(Model): ~azure.mgmt.avs.models.ClusterProvisioningState :ivar cluster_id: The identity :vartype cluster_id: int - :ivar hosts: The hosts - :vartype hosts: list[str] + :param hosts: The hosts + :type hosts: list[str] """ _validation = { 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, } _attribute_map = { @@ -482,12 +509,12 @@ class CommonClusterProperties(Model): 'hosts': {'key': 'hosts', 'type': '[str]'}, } - def __init__(self, *, cluster_size: int=None, provisioning_state=None, **kwargs) -> None: + def __init__(self, *, cluster_size: int=None, provisioning_state=None, hosts=None, **kwargs) -> None: super(CommonClusterProperties, self).__init__(**kwargs) self.cluster_size = cluster_size self.provisioning_state = provisioning_state self.cluster_id = None - self.hosts = None + self.hosts = hosts class Datastore(Resource): @@ -511,6 +538,10 @@ class Datastore(Resource): :type net_app_volume: ~azure.mgmt.avs.models.NetAppVolume :param disk_pool_volume: An iSCSI volume :type disk_pool_volume: ~azure.mgmt.avs.models.DiskPoolVolume + :ivar status: The operational status of the datastore. Possible values + include: 'Unknown', 'Accessible', 'Inaccessible', 'Attached', 'Detached', + 'LostCommunication', 'DeadOrError' + :vartype status: str or ~azure.mgmt.avs.models.DatastoreStatus """ _validation = { @@ -518,6 +549,7 @@ class Datastore(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { @@ -527,6 +559,7 @@ class Datastore(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'net_app_volume': {'key': 'properties.netAppVolume', 'type': 'NetAppVolume'}, 'disk_pool_volume': {'key': 'properties.diskPoolVolume', 'type': 'DiskPoolVolume'}, + 'status': {'key': 'properties.status', 'type': 'str'}, } def __init__(self, *, net_app_volume=None, disk_pool_volume=None, **kwargs) -> None: @@ -534,6 +567,7 @@ def __init__(self, *, net_app_volume=None, disk_pool_volume=None, **kwargs) -> N self.provisioning_state = None self.net_app_volume = net_app_volume self.disk_pool_volume = disk_pool_volume + self.status = None class DiskPoolVolume(Model): @@ -577,6 +611,71 @@ def __init__(self, *, target_id: str, lun_name: str, mount_option="MOUNT", **kwa self.path = None +class Encryption(Model): + """The properties of customer managed encryption key. + + :param status: Status of customer managed encryption key. Possible values + include: 'Enabled', 'Disabled' + :type status: str or ~azure.mgmt.avs.models.EncryptionState + :param key_vault_properties: The key vault where the encryption key is + stored + :type key_vault_properties: + ~azure.mgmt.avs.models.EncryptionKeyVaultProperties + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'EncryptionKeyVaultProperties'}, + } + + def __init__(self, *, status=None, key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.status = status + self.key_vault_properties = key_vault_properties + + +class EncryptionKeyVaultProperties(Model): + """An Encryption Key. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param key_name: The name of the key. + :type key_name: str + :param key_version: The version of the key. + :type key_version: str + :param key_vault_url: The URL of the vault. + :type key_vault_url: str + :ivar key_state: The state of key provided. Possible values include: + 'Connected', 'AccessDenied' + :vartype key_state: str or ~azure.mgmt.avs.models.EncryptionKeyStatus + :ivar version_type: Property of the key if user provided or auto detected. + Possible values include: 'Fixed', 'AutoDetected' + :vartype version_type: str or ~azure.mgmt.avs.models.EncryptionVersionType + """ + + _validation = { + 'key_state': {'readonly': True}, + 'version_type': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_version': {'key': 'keyVersion', 'type': 'str'}, + 'key_vault_url': {'key': 'keyVaultUrl', 'type': 'str'}, + 'key_state': {'key': 'keyState', 'type': 'str'}, + 'version_type': {'key': 'versionType', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_url: str=None, **kwargs) -> None: + super(EncryptionKeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_url = key_vault_url + self.key_state = None + self.version_type = None + + class Endpoints(Model): """Endpoint addresses. @@ -708,6 +807,8 @@ class ExpressRouteAuthorization(Resource): :ivar express_route_authorization_key: The key of the ExpressRoute Circuit Authorization :vartype express_route_authorization_key: str + :param express_route_id: The ID of the ExpressRoute Circuit + :type express_route_id: str """ _validation = { @@ -726,13 +827,15 @@ class ExpressRouteAuthorization(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'express_route_authorization_id': {'key': 'properties.expressRouteAuthorizationId', 'type': 'str'}, 'express_route_authorization_key': {'key': 'properties.expressRouteAuthorizationKey', 'type': 'str'}, + 'express_route_id': {'key': 'properties.expressRouteId', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, express_route_id: str=None, **kwargs) -> None: super(ExpressRouteAuthorization, self).__init__(**kwargs) self.provisioning_state = None self.express_route_authorization_id = None self.express_route_authorization_key = None + self.express_route_id = express_route_id class GlobalReachConnection(Resource): @@ -766,6 +869,9 @@ class GlobalReachConnection(Resource): :param peer_express_route_circuit: Identifier of the ExpressRoute Circuit to peer with in the global reach connection :type peer_express_route_circuit: str + :param express_route_id: The ID of the Private Cloud's ExpressRoute + Circuit that is participating in the global reach connection + :type express_route_id: str """ _validation = { @@ -786,15 +892,17 @@ class GlobalReachConnection(Resource): 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, 'circuit_connection_status': {'key': 'properties.circuitConnectionStatus', 'type': 'str'}, 'peer_express_route_circuit': {'key': 'properties.peerExpressRouteCircuit', 'type': 'str'}, + 'express_route_id': {'key': 'properties.expressRouteId', 'type': 'str'}, } - def __init__(self, *, authorization_key: str=None, peer_express_route_circuit: str=None, **kwargs) -> None: + def __init__(self, *, authorization_key: str=None, peer_express_route_circuit: str=None, express_route_id: str=None, **kwargs) -> None: super(GlobalReachConnection, self).__init__(**kwargs) self.provisioning_state = None self.address_prefix = None self.authorization_key = authorization_key self.circuit_connection_status = None self.peer_express_route_circuit = peer_express_route_circuit + self.express_route_id = express_route_id class HcxEnterpriseSite(Resource): @@ -931,13 +1039,12 @@ class ManagementCluster(CommonClusterProperties): ~azure.mgmt.avs.models.ClusterProvisioningState :ivar cluster_id: The identity :vartype cluster_id: int - :ivar hosts: The hosts - :vartype hosts: list[str] + :param hosts: The hosts + :type hosts: list[str] """ _validation = { 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, } _attribute_map = { @@ -947,8 +1054,8 @@ class ManagementCluster(CommonClusterProperties): 'hosts': {'key': 'hosts', 'type': '[str]'}, } - def __init__(self, *, cluster_size: int=None, provisioning_state=None, **kwargs) -> None: - super(ManagementCluster, self).__init__(cluster_size=cluster_size, provisioning_state=provisioning_state, **kwargs) + def __init__(self, *, cluster_size: int=None, provisioning_state=None, hosts=None, **kwargs) -> None: + super(ManagementCluster, self).__init__(cluster_size=cluster_size, provisioning_state=provisioning_state, hosts=hosts, **kwargs) class MetricDimension(Model): @@ -1167,6 +1274,114 @@ def __init__(self, *, service_specification=None, **kwargs) -> None: self.service_specification = service_specification +class PlacementPolicy(Resource): + """A vSphere Distributed Resource Scheduler (DRS) placement policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param properties: placement policy properties + :type properties: ~azure.mgmt.avs.models.PlacementPolicyProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PlacementPolicyProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(PlacementPolicy, self).__init__(**kwargs) + self.properties = properties + + +class PlacementPolicyProperties(Model): + """Abstract placement policy properties. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: VmVmPlacementPolicyProperties, + VmHostPlacementPolicyProperties + + 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. + + :param state: Whether the placement policy is enabled or disabled. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param display_name: Display name of the placement policy + :type display_name: str + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.PlacementPolicyProvisioningState + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'VmVm': 'VmVmPlacementPolicyProperties', 'VmHost': 'VmHostPlacementPolicyProperties'} + } + + def __init__(self, *, state=None, display_name: str=None, **kwargs) -> None: + super(PlacementPolicyProperties, self).__init__(**kwargs) + self.state = state + self.display_name = display_name + self.provisioning_state = None + self.type = None + + +class PlacementPolicyUpdate(Model): + """An update of a DRS placement policy resource. + + :param state: Whether the placement policy is enabled or disabled. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param vm_members: Virtual machine members list + :type vm_members: list[str] + :param host_members: Host members list + :type host_members: list[str] + """ + + _attribute_map = { + 'state': {'key': 'properties.state', 'type': 'str'}, + 'vm_members': {'key': 'properties.vmMembers', 'type': '[str]'}, + 'host_members': {'key': 'properties.hostMembers', 'type': '[str]'}, + } + + def __init__(self, *, state=None, vm_members=None, host_members=None, **kwargs) -> None: + super(PlacementPolicyUpdate, self).__init__(**kwargs) + self.state = state + self.vm_members = vm_members + self.host_members = host_members + + class TrackedResource(Resource): """The resource model definition for a ARM tracked top level resource. @@ -1232,6 +1447,12 @@ class PrivateCloud(TrackedResource): :type internet: str or ~azure.mgmt.avs.models.InternetEnum :param identity_sources: vCenter Single Sign On Identity Sources :type identity_sources: list[~azure.mgmt.avs.models.IdentitySource] + :param availability: Properties describing how the cloud is distributed + across availability zones + :type availability: ~azure.mgmt.avs.models.AvailabilityProperties + :param encryption: Customer managed key encryption, can be enabled or + disabled + :type encryption: ~azure.mgmt.avs.models.Encryption :ivar provisioning_state: The provisioning state. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Pending', 'Building', 'Deleting', 'Updating' @@ -1269,6 +1490,11 @@ class PrivateCloud(TrackedResource): :ivar external_cloud_links: Array of cloud link IDs from other clouds that connect to this one :vartype external_cloud_links: list[str] + :param secondary_circuit: A secondary expressRoute circuit from a separate + AZ. Only present in a stretched private cloud + :type secondary_circuit: ~azure.mgmt.avs.models.Circuit + :param identity: The identity of the private cloud, if configured. + :type identity: ~azure.mgmt.avs.models.PrivateCloudIdentity """ _validation = { @@ -1297,6 +1523,8 @@ class PrivateCloud(TrackedResource): 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, 'internet': {'key': 'properties.internet', 'type': 'str'}, 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + 'availability': {'key': 'properties.availability', 'type': 'AvailabilityProperties'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'circuit': {'key': 'properties.circuit', 'type': 'Circuit'}, 'endpoints': {'key': 'properties.endpoints', 'type': 'Endpoints'}, @@ -1309,14 +1537,18 @@ class PrivateCloud(TrackedResource): 'vcenter_certificate_thumbprint': {'key': 'properties.vcenterCertificateThumbprint', 'type': 'str'}, 'nsxt_certificate_thumbprint': {'key': 'properties.nsxtCertificateThumbprint', 'type': 'str'}, 'external_cloud_links': {'key': 'properties.externalCloudLinks', 'type': '[str]'}, + 'secondary_circuit': {'key': 'properties.secondaryCircuit', 'type': 'Circuit'}, + 'identity': {'key': 'identity', 'type': 'PrivateCloudIdentity'}, } - def __init__(self, *, sku, network_block: str, location: str=None, tags=None, management_cluster=None, internet="Disabled", identity_sources=None, circuit=None, vcenter_password: str=None, nsxt_password: str=None, **kwargs) -> None: + def __init__(self, *, sku, network_block: str, location: str=None, tags=None, management_cluster=None, internet="Disabled", identity_sources=None, availability=None, encryption=None, circuit=None, vcenter_password: str=None, nsxt_password: str=None, secondary_circuit=None, identity=None, **kwargs) -> None: super(PrivateCloud, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.management_cluster = management_cluster self.internet = internet self.identity_sources = identity_sources + self.availability = availability + self.encryption = encryption self.provisioning_state = None self.circuit = circuit self.endpoints = None @@ -1329,6 +1561,45 @@ def __init__(self, *, sku, network_block: str, location: str=None, tags=None, ma self.vcenter_certificate_thumbprint = None self.nsxt_certificate_thumbprint = None self.external_cloud_links = None + self.secondary_circuit = secondary_circuit + self.identity = identity + + +class PrivateCloudIdentity(Model): + """Identity for the virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The principal ID of private cloud identity. This + property will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID associated with the private cloud. This + property will only be provided for a system assigned identity. + :vartype tenant_id: str + :param type: The type of identity used for the private cloud. The type + 'SystemAssigned' refers to an implicitly created identity. The type 'None' + will remove any identities from the Private Cloud. Possible values + include: 'SystemAssigned', 'None' + :type type: str or ~azure.mgmt.avs.models.ResourceIdentityType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(PrivateCloudIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type class PrivateCloudUpdate(Model): @@ -1343,6 +1614,14 @@ class PrivateCloudUpdate(Model): :type internet: str or ~azure.mgmt.avs.models.InternetEnum :param identity_sources: vCenter Single Sign On Identity Sources :type identity_sources: list[~azure.mgmt.avs.models.IdentitySource] + :param availability: Properties describing how the cloud is distributed + across availability zones + :type availability: ~azure.mgmt.avs.models.AvailabilityProperties + :param encryption: Customer managed key encryption, can be enabled or + disabled + :type encryption: ~azure.mgmt.avs.models.Encryption + :param identity: The identity of the private cloud, if configured. + :type identity: ~azure.mgmt.avs.models.PrivateCloudIdentity """ _attribute_map = { @@ -1350,14 +1629,20 @@ class PrivateCloudUpdate(Model): 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, 'internet': {'key': 'properties.internet', 'type': 'str'}, 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + 'availability': {'key': 'properties.availability', 'type': 'AvailabilityProperties'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'identity': {'key': 'identity', 'type': 'PrivateCloudIdentity'}, } - def __init__(self, *, tags=None, management_cluster=None, internet="Disabled", identity_sources=None, **kwargs) -> None: + def __init__(self, *, tags=None, management_cluster=None, internet="Disabled", identity_sources=None, availability=None, encryption=None, identity=None, **kwargs) -> None: super(PrivateCloudUpdate, self).__init__(**kwargs) self.tags = tags self.management_cluster = management_cluster self.internet = internet self.identity_sources = identity_sources + self.availability = availability + self.encryption = encryption + self.identity = identity class ProxyResource(Resource): @@ -1864,6 +2149,178 @@ def __init__(self, **kwargs) -> None: self.available_hosts = None +class VirtualMachine(ProxyResource): + """Virtual Machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar display_name: Display name of the VM. + :vartype display_name: str + :ivar mo_ref_id: Virtual machine managed object reference id + :vartype mo_ref_id: str + :ivar folder_path: Path to virtual machine's folder starting from + datacenter virtual machine folder + :vartype folder_path: str + :ivar restrict_movement: Possible values include: 'Enabled', 'Disabled' + :vartype restrict_movement: str or + ~azure.mgmt.avs.models.VirtualMachineRestrictMovementState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'mo_ref_id': {'readonly': True}, + 'folder_path': {'readonly': True}, + 'restrict_movement': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'mo_ref_id': {'key': 'properties.moRefId', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'restrict_movement': {'key': 'properties.restrictMovement', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualMachine, self).__init__(**kwargs) + self.display_name = None + self.mo_ref_id = None + self.folder_path = None + self.restrict_movement = None + + +class VirtualMachineRestrictMovement(Model): + """Set VM DRS-driven movement to restricted (enabled) or not (disabled). + + :param restrict_movement: Possible values include: 'Enabled', 'Disabled' + :type restrict_movement: str or + ~azure.mgmt.avs.models.VirtualMachineRestrictMovementState + """ + + _attribute_map = { + 'restrict_movement': {'key': 'restrictMovement', 'type': 'str'}, + } + + def __init__(self, *, restrict_movement=None, **kwargs) -> None: + super(VirtualMachineRestrictMovement, self).__init__(**kwargs) + self.restrict_movement = restrict_movement + + +class VmHostPlacementPolicyProperties(PlacementPolicyProperties): + """VM-Host placement policy properties. + + 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. + + :param state: Whether the placement policy is enabled or disabled. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param display_name: Display name of the placement policy + :type display_name: str + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.PlacementPolicyProvisioningState + :param type: Required. Constant filled by server. + :type type: str + :param vm_members: Required. Virtual machine members list + :type vm_members: list[str] + :param host_members: Required. Host members list + :type host_members: list[str] + :param affinity_type: Required. placement policy affinity type. Possible + values include: 'Affinity', 'AntiAffinity' + :type affinity_type: str or ~azure.mgmt.avs.models.AffinityType + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'type': {'required': True}, + 'vm_members': {'required': True}, + 'host_members': {'required': True}, + 'affinity_type': {'required': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vm_members': {'key': 'vmMembers', 'type': '[str]'}, + 'host_members': {'key': 'hostMembers', 'type': '[str]'}, + 'affinity_type': {'key': 'affinityType', 'type': 'str'}, + } + + def __init__(self, *, vm_members, host_members, affinity_type, state=None, display_name: str=None, **kwargs) -> None: + super(VmHostPlacementPolicyProperties, self).__init__(state=state, display_name=display_name, **kwargs) + self.vm_members = vm_members + self.host_members = host_members + self.affinity_type = affinity_type + self.type = 'VmHost' + + +class VmVmPlacementPolicyProperties(PlacementPolicyProperties): + """VM-VM placement policy properties. + + 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. + + :param state: Whether the placement policy is enabled or disabled. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.avs.models.PlacementPolicyState + :param display_name: Display name of the placement policy + :type display_name: str + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.PlacementPolicyProvisioningState + :param type: Required. Constant filled by server. + :type type: str + :param vm_members: Required. Virtual machine members list + :type vm_members: list[str] + :param affinity_type: Required. placement policy affinity type. Possible + values include: 'Affinity', 'AntiAffinity' + :type affinity_type: str or ~azure.mgmt.avs.models.AffinityType + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'type': {'required': True}, + 'vm_members': {'required': True}, + 'affinity_type': {'required': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'vm_members': {'key': 'vmMembers', 'type': '[str]'}, + 'affinity_type': {'key': 'affinityType', 'type': 'str'}, + } + + def __init__(self, *, vm_members, affinity_type, state=None, display_name: str=None, **kwargs) -> None: + super(VmVmPlacementPolicyProperties, self).__init__(state=state, display_name=display_name, **kwargs) + self.vm_members = vm_members + self.affinity_type = affinity_type + self.type = 'VmVm' + + class WorkloadNetworkDhcp(ProxyResource): """NSX DHCP. @@ -2229,14 +2686,14 @@ class WorkloadNetworkPortMirroring(ProxyResource): :param display_name: Display name of the port mirroring profile. :type display_name: str :param direction: Direction of port mirroring profile. Possible values - include: 'INGRESS, EGRESS, BIDIRECTIONAL' + include: 'INGRESS', 'EGRESS', 'BIDIRECTIONAL' :type direction: str or ~azure.mgmt.avs.models.PortMirroringDirectionEnum :param source: Source VM Group. :type source: str :param destination: Destination VM Group. :type destination: str - :ivar status: Port Mirroring Status. Possible values include: 'SUCCESS, - FAILURE' + :ivar status: Port Mirroring Status. Possible values include: 'SUCCESS', + 'FAILURE' :vartype status: str or ~azure.mgmt.avs.models.PortMirroringStatusEnum :ivar provisioning_state: The provisioning state. Possible values include: 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' @@ -2349,7 +2806,8 @@ class WorkloadNetworkSegment(ProxyResource): :ivar port_vif: Port Vif which segment is associated with. :vartype port_vif: list[~azure.mgmt.avs.models.WorkloadNetworkSegmentPortVif] - :ivar status: Segment status. Possible values include: 'SUCCESS, FAILURE' + :ivar status: Segment status. Possible values include: 'SUCCESS', + 'FAILURE' :vartype status: str or ~azure.mgmt.avs.models.SegmentStatusEnum :ivar provisioning_state: The provisioning state. Possible values include: 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' @@ -2442,8 +2900,8 @@ class WorkloadNetworkVirtualMachine(ProxyResource): :vartype type: str :param display_name: Display name of the VM. :type display_name: str - :ivar vm_type: Virtual machine type. Possible values include: 'REGULAR, - EDGE, SERVICE' + :ivar vm_type: Virtual machine type. Possible values include: 'REGULAR', + 'EDGE', 'SERVICE' :vartype vm_type: str or ~azure.mgmt.avs.models.VMTypeEnum """ @@ -2484,7 +2942,8 @@ class WorkloadNetworkVMGroup(ProxyResource): :type display_name: str :param members: Virtual machine members of this group. :type members: list[str] - :ivar status: VM Group status. Possible values include: 'SUCCESS, FAILURE' + :ivar status: VM Group status. Possible values include: 'SUCCESS', + 'FAILURE' :vartype status: str or ~azure.mgmt.avs.models.VMGroupStatusEnum :ivar provisioning_state: The provisioning state. Possible values include: 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_paged_models.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_paged_models.py index 9cc32b284af1..7dffbc1103fa 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_paged_models.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_paged_models.py @@ -246,6 +246,32 @@ class AddonPaged(Paged): def __init__(self, *args, **kwargs): super(AddonPaged, self).__init__(*args, **kwargs) +class VirtualMachinePaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualMachine ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualMachine]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualMachinePaged, self).__init__(*args, **kwargs) +class PlacementPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`PlacementPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PlacementPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(PlacementPolicyPaged, self).__init__(*args, **kwargs) class ScriptPackagePaged(Paged): """ A paging container for iterating over a list of :class:`ScriptPackage ` object diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py index 99bc4cafde2a..e2f3b93fde04 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py @@ -20,6 +20,8 @@ from ._workload_networks_operations import WorkloadNetworksOperations from ._cloud_links_operations import CloudLinksOperations from ._addons_operations import AddonsOperations +from ._virtual_machines_operations import VirtualMachinesOperations +from ._placement_policies_operations import PlacementPoliciesOperations from ._script_packages_operations import ScriptPackagesOperations from ._script_cmdlets_operations import ScriptCmdletsOperations from ._script_executions_operations import ScriptExecutionsOperations @@ -36,6 +38,8 @@ 'WorkloadNetworksOperations', 'CloudLinksOperations', 'AddonsOperations', + 'VirtualMachinesOperations', + 'PlacementPoliciesOperations', 'ScriptPackagesOperations', 'ScriptCmdletsOperations', 'ScriptExecutionsOperations', diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py index 9027231ea6fe..2c421d5766ac 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py @@ -27,7 +27,7 @@ class AddonsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2021-12-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.config = config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py index 58f1decaf52b..865464f2d625 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py @@ -27,7 +27,7 @@ class AuthorizationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2021-12-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.config = config @@ -182,8 +182,8 @@ def get( def _create_or_update_initial( - self, resource_group_name, private_cloud_name, authorization_name, custom_headers=None, raw=False, **operation_config): - authorization = None + self, resource_group_name, private_cloud_name, authorization_name, express_route_id=None, custom_headers=None, raw=False, **operation_config): + authorization = models.ExpressRouteAuthorization(express_route_id=express_route_id) # Construct URL url = self.create_or_update.metadata['url'] @@ -236,7 +236,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, private_cloud_name, authorization_name, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, private_cloud_name, authorization_name, express_route_id=None, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update an ExpressRoute Circuit Authorization in a private cloud. @@ -248,6 +248,8 @@ def create_or_update( :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud :type authorization_name: str + :param express_route_id: The ID of the ExpressRoute Circuit + :type express_route_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -266,6 +268,7 @@ def create_or_update( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, authorization_name=authorization_name, + express_route_id=express_route_id, custom_headers=custom_headers, raw=True, **operation_config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py index 19b8ff69e378..88e6ce7f1660 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py @@ -27,7 +27,7 @@ class CloudLinksOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2021-12-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.config = config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py index 7dcda4293332..29b3b373460f 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py @@ -27,7 +27,7 @@ class ClustersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2021-12-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.config = config @@ -288,8 +288,8 @@ def get_long_running_output(response): def _update_initial( - self, resource_group_name, private_cloud_name, cluster_name, cluster_size=None, custom_headers=None, raw=False, **operation_config): - cluster_update = models.ClusterUpdate(cluster_size=cluster_size) + self, resource_group_name, private_cloud_name, cluster_name, cluster_size=None, hosts=None, custom_headers=None, raw=False, **operation_config): + cluster_update = models.ClusterUpdate(cluster_size=cluster_size, hosts=hosts) # Construct URL url = self.update.metadata['url'] @@ -342,7 +342,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, private_cloud_name, cluster_name, cluster_size=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, private_cloud_name, cluster_name, cluster_size=None, hosts=None, custom_headers=None, raw=False, polling=True, **operation_config): """Update a cluster in a private cloud. :param resource_group_name: The name of the resource group. The name @@ -354,6 +354,8 @@ def update( :type cluster_name: str :param cluster_size: The cluster size :type cluster_size: int + :param hosts: The hosts + :type hosts: list[str] :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -372,6 +374,7 @@ def update( private_cloud_name=private_cloud_name, cluster_name=cluster_name, cluster_size=cluster_size, + hosts=hosts, custom_headers=custom_headers, raw=True, **operation_config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py index a2b93b46b76c..c2c7ee31d0cb 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py @@ -27,7 +27,7 @@ class DatastoresOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2021-12-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.config = config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py index 48636f647651..6e915ebeeed6 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py @@ -27,7 +27,7 @@ class GlobalReachConnectionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2021-12-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.config = config @@ -182,9 +182,7 @@ def get( def _create_or_update_initial( - self, resource_group_name, private_cloud_name, global_reach_connection_name, authorization_key=None, peer_express_route_circuit=None, custom_headers=None, raw=False, **operation_config): - global_reach_connection = models.GlobalReachConnection(authorization_key=authorization_key, peer_express_route_circuit=peer_express_route_circuit) - + self, resource_group_name, private_cloud_name, global_reach_connection_name, global_reach_connection, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -236,7 +234,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, private_cloud_name, global_reach_connection_name, authorization_key=None, peer_express_route_circuit=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, private_cloud_name, global_reach_connection_name, global_reach_connection, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a global reach connection in a private cloud. :param resource_group_name: The name of the resource group. The name @@ -247,12 +245,10 @@ def create_or_update( :param global_reach_connection_name: Name of the global reach connection in the private cloud :type global_reach_connection_name: str - :param authorization_key: Authorization key from the peer express - route used for the global reach connection - :type authorization_key: str - :param peer_express_route_circuit: Identifier of the ExpressRoute - Circuit to peer with in the global reach connection - :type peer_express_route_circuit: str + :param global_reach_connection: A global reach connection in the + private cloud + :type global_reach_connection: + ~azure.mgmt.avs.models.GlobalReachConnection :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 @@ -270,8 +266,7 @@ def create_or_update( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, global_reach_connection_name=global_reach_connection_name, - authorization_key=authorization_key, - peer_express_route_circuit=peer_express_route_circuit, + global_reach_connection=global_reach_connection, custom_headers=custom_headers, raw=True, **operation_config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py index ecff25b1e1a3..da30a0274891 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py @@ -25,7 +25,7 @@ class HcxEnterpriseSitesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2021-12-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.config = config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py index 35d832dcabc9..89fc2266a499 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py @@ -25,7 +25,7 @@ class LocationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2021-12-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.config = config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py index 263b7ae65ee8..5c9eba0f4179 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py @@ -25,7 +25,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2021-12-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.config = config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py new file mode 100644 index 000000000000..d534597c8d2d --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_placement_policies_operations.py @@ -0,0 +1,504 @@ +# 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 PlacementPoliciesOperations(object): + """PlacementPoliciesOperations 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: The API version to use for this operation. Constant value: "2021-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-12-01" + + self.config = config + + def list( + self, resource_group_name, private_cloud_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """List placement policies in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud + :type cluster_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 PlacementPolicy + :rtype: + ~azure.mgmt.avs.models.PlacementPolicyPaged[~azure.mgmt.avs.models.PlacementPolicy] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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.PlacementPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies'} + + def get( + self, resource_group_name, private_cloud_name, cluster_name, placement_policy_name, custom_headers=None, raw=False, **operation_config): + """Get a placement policy by name in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud + :type cluster_name: str + :param placement_policy_name: Name of the VMware vSphere Distributed + Resource Scheduler (DRS) placement policy + :type placement_policy_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: PlacementPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.PlacementPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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('PlacementPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} + + + def _create_or_update_initial( + self, resource_group_name, private_cloud_name, cluster_name, placement_policy_name, properties=None, custom_headers=None, raw=False, **operation_config): + placement_policy = models.PlacementPolicy(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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(placement_policy, 'PlacementPolicy') + + # 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('PlacementPolicy', response) + if response.status_code == 201: + deserialized = self._deserialize('PlacementPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, private_cloud_name, cluster_name, placement_policy_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a placement policy in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud + :type cluster_name: str + :param placement_policy_name: Name of the VMware vSphere Distributed + Resource Scheduler (DRS) placement policy + :type placement_policy_name: str + :param properties: placement policy properties + :type properties: ~azure.mgmt.avs.models.PlacementPolicyProperties + :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 PlacementPolicy or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.PlacementPolicy] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.PlacementPolicy]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + placement_policy_name=placement_policy_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PlacementPolicy', 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} + + + def _update_initial( + self, resource_group_name, private_cloud_name, cluster_name, placement_policy_name, placement_policy_update, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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(placement_policy_update, 'PlacementPolicyUpdate') + + # 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, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PlacementPolicy', response) + if response.status_code == 202: + deserialized = self._deserialize('PlacementPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, private_cloud_name, cluster_name, placement_policy_name, placement_policy_update, custom_headers=None, raw=False, polling=True, **operation_config): + """Update a placement policy in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud + :type cluster_name: str + :param placement_policy_name: Name of the VMware vSphere Distributed + Resource Scheduler (DRS) placement policy + :type placement_policy_name: str + :param placement_policy_update: The placement policy properties that + may be updated + :type placement_policy_update: + ~azure.mgmt.avs.models.PlacementPolicyUpdate + :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 PlacementPolicy or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.PlacementPolicy] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.PlacementPolicy]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + placement_policy_name=placement_policy_name, + placement_policy_update=placement_policy_update, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PlacementPolicy', 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} + + + def _delete_initial( + self, resource_group_name, private_cloud_name, cluster_name, placement_policy_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'placementPolicyName': self._serialize.url("placement_policy_name", placement_policy_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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, private_cloud_name, cluster_name, placement_policy_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a placement policy in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud + :type cluster_name: str + :param placement_policy_name: Name of the VMware vSphere Distributed + Resource Scheduler (DRS) placement policy + :type placement_policy_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, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + placement_policy_name=placement_policy_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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'} diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py index 8bab26b6b686..e31c9c8f60af 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py @@ -27,7 +27,7 @@ class PrivateCloudsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2021-12-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.config = config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py index 969ed6878d41..acef3d899bce 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py @@ -25,7 +25,7 @@ class ScriptCmdletsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2021-12-01". """ models = models @@ -35,14 +35,14 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.config = config def list( self, resource_group_name, private_cloud_name, script_package_name, custom_headers=None, raw=False, **operation_config): - """Return script cmdlet resources available for a private cloud to create - a script execution resource on their Private Cloud. + """List script cmdlet resources available for a private cloud to create a + script execution resource on a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py index 9afbd32e8969..04007d38fc26 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py @@ -27,7 +27,7 @@ class ScriptExecutionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2021-12-01". """ models = models @@ -37,13 +37,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.config = config def list( self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): - """Get an script execution resource by name in a private cloud. + """List script executions in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -116,7 +116,7 @@ def internal_paging(next_link=None): def get( self, resource_group_name, private_cloud_name, script_execution_name, custom_headers=None, raw=False, **operation_config): - """Get an script execution resource by name in a private cloud. + """Get an script execution by name in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -235,7 +235,7 @@ def _create_or_update_initial( def create_or_update( self, resource_group_name, private_cloud_name, script_execution_name, script_execution, custom_headers=None, raw=False, polling=True, **operation_config): - """Create or update a script execution resource in a private cloud. + """Create or update a script execution in a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py index 109e556bed3a..acdae106ba25 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py @@ -25,7 +25,7 @@ class ScriptPackagesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2021-12-01". """ models = models @@ -35,14 +35,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.config = config def list( self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): - """Return script packages available for a private cloud to run on their - Private Cloud. + """List script packages available to run on the private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -115,7 +114,7 @@ def internal_paging(next_link=None): def get( self, resource_group_name, private_cloud_name, script_package_name, custom_headers=None, raw=False, **operation_config): - """Return script package available to run on an Private Cloud. + """Get a script package available to run on a private cloud. :param resource_group_name: The name of the resource group. The name is case insensitive. diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py new file mode 100644 index 000000000000..c04cc277d0f5 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_virtual_machines_operations.py @@ -0,0 +1,285 @@ +# 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 VirtualMachinesOperations(object): + """VirtualMachinesOperations 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: The API version to use for this operation. Constant value: "2021-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-12-01" + + self.config = config + + def list( + self, resource_group_name, private_cloud_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """List of virtual machines in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud + :type cluster_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 VirtualMachine + :rtype: + ~azure.mgmt.avs.models.VirtualMachinePaged[~azure.mgmt.avs.models.VirtualMachine] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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.VirtualMachinePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines'} + + def get( + self, resource_group_name, private_cloud_name, cluster_name, virtual_machine_id, custom_headers=None, raw=False, **operation_config): + """Get a virtual machine by id in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud + :type cluster_name: str + :param virtual_machine_id: Virtual Machine identifier + :type virtual_machine_id: 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: VirtualMachine or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.VirtualMachine or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'virtualMachineId': self._serialize.url("virtual_machine_id", virtual_machine_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', min_length=1) + + # 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('VirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}'} + + + def _restrict_movement_initial( + self, resource_group_name, private_cloud_name, cluster_name, virtual_machine_id, restrict_movement=None, custom_headers=None, raw=False, **operation_config): + restrict_movement1 = models.VirtualMachineRestrictMovement(restrict_movement=restrict_movement) + + # Construct URL + url = self.restrict_movement.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'virtualMachineId': self._serialize.url("virtual_machine_id", virtual_machine_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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(restrict_movement1, 'VirtualMachineRestrictMovement') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + 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 restrict_movement( + self, resource_group_name, private_cloud_name, cluster_name, virtual_machine_id, restrict_movement=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Enable or disable DRS-driven VM movement restriction. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud + :type cluster_name: str + :param virtual_machine_id: Virtual Machine identifier + :type virtual_machine_id: str + :param restrict_movement: Possible values include: 'Enabled', + 'Disabled' + :type restrict_movement: str or + ~azure.mgmt.avs.models.VirtualMachineRestrictMovementState + :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._restrict_movement_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + virtual_machine_id=virtual_machine_id, + restrict_movement=restrict_movement, + 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) + restrict_movement.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement'} diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py index 6821d4e512a7..e6ee2e94bb5c 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py @@ -27,7 +27,7 @@ class WorkloadNetworksOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + :ivar api_version: The API version to use for this operation. Constant value: "2021-12-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-06-01" + self.api_version = "2021-12-01" self.config = config