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 e2c4967248372..b815f28a8022c 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 @@ -14,11 +14,14 @@ from ._configuration import AVSClientConfiguration from .operations import Operations +from .operations import DefaultStoragePoliciesOperations from .operations import LocationsOperations from .operations import PrivateCloudsOperations from .operations import ClustersOperations from .operations import HcxEnterpriseSitesOperations from .operations import AuthorizationsOperations +from .operations import GlobalReachConnectionsOperations +from .operations import WorkloadNetworksOperations from . import models @@ -30,6 +33,8 @@ class AVSClient(SDKClient): :ivar operations: Operations operations :vartype operations: azure.mgmt.avs.operations.Operations + :ivar default_storage_policies: DefaultStoragePolicies operations + :vartype default_storage_policies: azure.mgmt.avs.operations.DefaultStoragePoliciesOperations :ivar locations: Locations operations :vartype locations: azure.mgmt.avs.operations.LocationsOperations :ivar private_clouds: PrivateClouds operations @@ -40,6 +45,10 @@ class AVSClient(SDKClient): :vartype hcx_enterprise_sites: azure.mgmt.avs.operations.HcxEnterpriseSitesOperations :ivar authorizations: Authorizations operations :vartype authorizations: azure.mgmt.avs.operations.AuthorizationsOperations + :ivar global_reach_connections: GlobalReachConnections operations + :vartype global_reach_connections: azure.mgmt.avs.operations.GlobalReachConnectionsOperations + :ivar workload_networks: WorkloadNetworks operations + :vartype workload_networks: azure.mgmt.avs.operations.WorkloadNetworksOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -56,12 +65,14 @@ 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 = '2020-03-20' + self.api_version = '2020-07-17-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + self.default_storage_policies = DefaultStoragePoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) self.locations = LocationsOperations( self._client, self.config, self._serialize, self._deserialize) self.private_clouds = PrivateCloudsOperations( @@ -72,3 +83,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.authorizations = AuthorizationsOperations( self._client, self.config, self._serialize, self._deserialize) + self.global_reach_connections = GlobalReachConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.workload_networks = WorkloadNetworksOperations( + self._client, self.config, self._serialize, self._deserialize) 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 c9859074da49a..ca2ce52e2e320 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 @@ -14,11 +14,11 @@ from ._models_py3 import Circuit from ._models_py3 import Cluster from ._models_py3 import ClusterUpdate - from ._models_py3 import ClusterUpdateProperties from ._models_py3 import Endpoints from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorResponse from ._models_py3 import ExpressRouteAuthorization + from ._models_py3 import GlobalReachConnection from ._models_py3 import HcxEnterpriseSite from ._models_py3 import IdentitySource from ._models_py3 import ManagementCluster @@ -26,21 +26,35 @@ from ._models_py3 import OperationDisplay from ._models_py3 import PrivateCloud from ._models_py3 import PrivateCloudUpdate + from ._models_py3 import ProxyResource from ._models_py3 import Quota from ._models_py3 import Resource from ._models_py3 import Sku + from ._models_py3 import StoragePolicy from ._models_py3 import TrackedResource from ._models_py3 import Trial + from ._models_py3 import WorkloadNetworkDhcp + from ._models_py3 import WorkloadNetworkDhcpEntity + from ._models_py3 import WorkloadNetworkDhcpRelay + from ._models_py3 import WorkloadNetworkDhcpServer + from ._models_py3 import WorkloadNetworkGateway + from ._models_py3 import WorkloadNetworkGatewayProperties + from ._models_py3 import WorkloadNetworkPortMirroring + from ._models_py3 import WorkloadNetworkSegment + from ._models_py3 import WorkloadNetworkSegmentPortVif + from ._models_py3 import WorkloadNetworkSegmentSubnet + from ._models_py3 import WorkloadNetworkVirtualMachine + from ._models_py3 import WorkloadNetworkVMGroup except (SyntaxError, ImportError): from ._models import AdminCredentials from ._models import Circuit from ._models import Cluster from ._models import ClusterUpdate - from ._models import ClusterUpdateProperties from ._models import Endpoints from ._models import ErrorAdditionalInfo from ._models import ErrorResponse from ._models import ExpressRouteAuthorization + from ._models import GlobalReachConnection from ._models import HcxEnterpriseSite from ._models import IdentitySource from ._models import ManagementCluster @@ -48,16 +62,38 @@ from ._models import OperationDisplay from ._models import PrivateCloud from ._models import PrivateCloudUpdate + from ._models import ProxyResource from ._models import Quota from ._models import Resource from ._models import Sku + from ._models import StoragePolicy from ._models import TrackedResource from ._models import Trial + from ._models import WorkloadNetworkDhcp + from ._models import WorkloadNetworkDhcpEntity + from ._models import WorkloadNetworkDhcpRelay + from ._models import WorkloadNetworkDhcpServer + from ._models import WorkloadNetworkGateway + from ._models import WorkloadNetworkGatewayProperties + from ._models import WorkloadNetworkPortMirroring + from ._models import WorkloadNetworkSegment + from ._models import WorkloadNetworkSegmentPortVif + from ._models import WorkloadNetworkSegmentSubnet + from ._models import WorkloadNetworkVirtualMachine + from ._models import WorkloadNetworkVMGroup from ._paged_models import ClusterPaged from ._paged_models import ExpressRouteAuthorizationPaged +from ._paged_models import GlobalReachConnectionPaged from ._paged_models import HcxEnterpriseSitePaged from ._paged_models import OperationPaged from ._paged_models import PrivateCloudPaged +from ._paged_models import StoragePolicyPaged +from ._paged_models import WorkloadNetworkDhcpPaged +from ._paged_models import WorkloadNetworkGatewayPaged +from ._paged_models import WorkloadNetworkPortMirroringPaged +from ._paged_models import WorkloadNetworkSegmentPaged +from ._paged_models import WorkloadNetworkVirtualMachinePaged +from ._paged_models import WorkloadNetworkVMGroupPaged from ._avs_client_enums import ( TrialStatus, QuotaEnabled, @@ -67,6 +103,17 @@ InternetEnum, ClusterProvisioningState, HcxEnterpriseSiteStatus, + GlobalReachConnectionProvisioningState, + GlobalReachConnectionStatus, + SegmentStatusEnum, + WorkloadNetworkSegmentProvisioningState, + WorkloadNetworkDhcpProvisioningState, + PortMirroringDirectionEnum, + PortMirroringStatusEnum, + WorkloadNetworkPortMirroringProvisioningState, + VMGroupStatusEnum, + WorkloadNetworkVMGroupProvisioningState, + VMTypeEnum, ) __all__ = [ @@ -74,11 +121,11 @@ 'Circuit', 'Cluster', 'ClusterUpdate', - 'ClusterUpdateProperties', 'Endpoints', 'ErrorAdditionalInfo', 'ErrorResponse', 'ExpressRouteAuthorization', + 'GlobalReachConnection', 'HcxEnterpriseSite', 'IdentitySource', 'ManagementCluster', @@ -86,16 +133,38 @@ 'OperationDisplay', 'PrivateCloud', 'PrivateCloudUpdate', + 'ProxyResource', 'Quota', 'Resource', 'Sku', + 'StoragePolicy', 'TrackedResource', 'Trial', + 'WorkloadNetworkDhcp', + 'WorkloadNetworkDhcpEntity', + 'WorkloadNetworkDhcpRelay', + 'WorkloadNetworkDhcpServer', + 'WorkloadNetworkGateway', + 'WorkloadNetworkGatewayProperties', + 'WorkloadNetworkPortMirroring', + 'WorkloadNetworkSegment', + 'WorkloadNetworkSegmentPortVif', + 'WorkloadNetworkSegmentSubnet', + 'WorkloadNetworkVirtualMachine', + 'WorkloadNetworkVMGroup', 'OperationPaged', + 'StoragePolicyPaged', 'PrivateCloudPaged', 'ClusterPaged', 'HcxEnterpriseSitePaged', 'ExpressRouteAuthorizationPaged', + 'GlobalReachConnectionPaged', + 'WorkloadNetworkSegmentPaged', + 'WorkloadNetworkDhcpPaged', + 'WorkloadNetworkGatewayPaged', + 'WorkloadNetworkPortMirroringPaged', + 'WorkloadNetworkVMGroupPaged', + 'WorkloadNetworkVirtualMachinePaged', 'TrialStatus', 'QuotaEnabled', 'ExpressRouteAuthorizationProvisioningState', @@ -104,4 +173,15 @@ 'InternetEnum', 'ClusterProvisioningState', 'HcxEnterpriseSiteStatus', + 'GlobalReachConnectionProvisioningState', + 'GlobalReachConnectionStatus', + 'SegmentStatusEnum', + 'WorkloadNetworkSegmentProvisioningState', + 'WorkloadNetworkDhcpProvisioningState', + 'PortMirroringDirectionEnum', + 'PortMirroringStatusEnum', + 'WorkloadNetworkPortMirroringProvisioningState', + 'VMGroupStatusEnum', + 'WorkloadNetworkVMGroupProvisioningState', + 'VMTypeEnum', ] 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 dfda35df47487..c61974c5721ab 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 @@ -70,3 +70,78 @@ class HcxEnterpriseSiteStatus(str, Enum): consumed = "Consumed" deactivated = "Deactivated" deleted = "Deleted" + + +class GlobalReachConnectionProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + updating = "Updating" + + +class GlobalReachConnectionStatus(str, Enum): + + connected = "Connected" + connecting = "Connecting" + disconnected = "Disconnected" + + +class SegmentStatusEnum(str, Enum): + + successfailure = "SUCCESS, FAILURE" + + +class WorkloadNetworkSegmentProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + building = "Building" + deleting = "Deleting" + updating = "Updating" + + +class WorkloadNetworkDhcpProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + building = "Building" + deleting = "Deleting" + updating = "Updating" + + +class PortMirroringDirectionEnum(str, Enum): + + ingressegressbidirectional = "INGRESS, EGRESS, BIDIRECTIONAL" + + +class PortMirroringStatusEnum(str, Enum): + + successfailure = "SUCCESS, FAILURE" + + +class WorkloadNetworkPortMirroringProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + building = "Building" + deleting = "Deleting" + updating = "Updating" + + +class VMGroupStatusEnum(str, Enum): + + successfailure = "SUCCESS, FAILURE" + + +class WorkloadNetworkVMGroupProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + building = "Building" + deleting = "Deleting" + updating = "Updating" + + +class VMTypeEnum(str, Enum): + + regularedgeservice = "REGULAR, EDGE, SERVICE" 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 f268da2f0a807..03797c2588da1 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 @@ -168,7 +168,7 @@ class Cluster(Resource): :vartype type: str :param sku: Required. The cluster SKU :type sku: ~azure.mgmt.avs.models.Sku - :param cluster_size: The cluster size + :param cluster_size: Required. The cluster size :type cluster_size: int :ivar cluster_id: The identity :vartype cluster_id: int @@ -178,6 +178,8 @@ class Cluster(Resource): values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' :vartype provisioning_state: str or ~azure.mgmt.avs.models.ClusterProvisioningState + :param storage_policy: The storage policy of the cluster + :type storage_policy: ~azure.mgmt.avs.models.StoragePolicy """ _validation = { @@ -185,6 +187,7 @@ class Cluster(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'sku': {'required': True}, + 'cluster_size': {'required': True}, 'cluster_id': {'readonly': True}, 'hosts': {'readonly': True}, 'provisioning_state': {'readonly': True}, @@ -199,6 +202,7 @@ class Cluster(Resource): 'cluster_id': {'key': 'properties.clusterId', 'type': 'int'}, 'hosts': {'key': 'properties.hosts', 'type': '[str]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_policy': {'key': 'properties.storagePolicy', 'type': 'StoragePolicy'}, } def __init__(self, **kwargs): @@ -208,6 +212,7 @@ def __init__(self, **kwargs): self.cluster_id = None self.hosts = None self.provisioning_state = None + self.storage_policy = kwargs.get('storage_policy', None) class ClusterUpdate(Model): @@ -215,31 +220,19 @@ class ClusterUpdate(Model): :param cluster_size: The cluster size :type cluster_size: int + :param storage_policy: The storage policy of the cluster + :type storage_policy: ~azure.mgmt.avs.models.StoragePolicy """ _attribute_map = { 'cluster_size': {'key': 'properties.clusterSize', 'type': 'int'}, + 'storage_policy': {'key': 'properties.storagePolicy', 'type': 'StoragePolicy'}, } def __init__(self, **kwargs): super(ClusterUpdate, self).__init__(**kwargs) self.cluster_size = kwargs.get('cluster_size', None) - - -class ClusterUpdateProperties(Model): - """The properties of a cluster that may be updated. - - :param cluster_size: The cluster size - :type cluster_size: int - """ - - _attribute_map = { - 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(ClusterUpdateProperties, self).__init__(**kwargs) - self.cluster_size = kwargs.get('cluster_size', None) + self.storage_policy = kwargs.get('storage_policy', None) class Endpoints(Model): @@ -396,6 +389,68 @@ def __init__(self, **kwargs): self.express_route_authorization_key = None +class GlobalReachConnection(Resource): + """A global reach connection resource. + + 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 provisioning_state: The state of the ExpressRoute Circuit + Authorization provisioning. Possible values include: 'Succeeded', + 'Failed', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.GlobalReachConnectionProvisioningState + :ivar address_prefix: The network used for global reach carved out from + the original network block provided for the private cloud + :vartype address_prefix: str + :param authorization_key: Authorization key from the peer express route + used for the global reach connection + :type authorization_key: str + :ivar circuit_connection_status: The connection status of the global reach + connection. Possible values include: 'Connected', 'Connecting', + 'Disconnected' + :vartype circuit_connection_status: str or + ~azure.mgmt.avs.models.GlobalReachConnectionStatus + :param peer_express_route_circuit: Identifier of the ExpressRoute Circuit + to peer with in the global reach connection + :type peer_express_route_circuit: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'address_prefix': {'readonly': True}, + 'circuit_connection_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'circuit_connection_status': {'key': 'properties.circuitConnectionStatus', 'type': 'str'}, + 'peer_express_route_circuit': {'key': 'properties.peerExpressRouteCircuit', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GlobalReachConnection, self).__init__(**kwargs) + self.provisioning_state = None + self.address_prefix = None + 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) + + class HcxEnterpriseSite(Resource): """An HCX Enterprise Site resource. @@ -492,13 +547,15 @@ def __init__(self, **kwargs): self.password = kwargs.get('password', None) -class ManagementCluster(ClusterUpdateProperties): +class ManagementCluster(Model): """The properties of a default cluster. Variables are only populated by the server, and will be ignored when sending a request. - :param cluster_size: The cluster size + All required parameters must be populated in order to send to Azure. + + :param cluster_size: Required. The cluster size :type cluster_size: int :ivar cluster_id: The identity :vartype cluster_id: int @@ -507,6 +564,7 @@ class ManagementCluster(ClusterUpdateProperties): """ _validation = { + 'cluster_size': {'required': True}, 'cluster_id': {'readonly': True}, 'hosts': {'readonly': True}, } @@ -519,6 +577,7 @@ class ManagementCluster(ClusterUpdateProperties): def __init__(self, **kwargs): super(ManagementCluster, self).__init__(**kwargs) + self.cluster_size = kwargs.get('cluster_size', None) self.cluster_id = None self.hosts = None @@ -656,6 +715,11 @@ 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 vcenter_password: Reset the vCenter admin password for the private + cloud + :type vcenter_password: str + :param nsxt_password: Reset the NSX-T admin password for the private cloud + :type nsxt_password: str :ivar provisioning_state: The provisioning state. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Pending', 'Building', 'Deleting', 'Updating' @@ -678,12 +742,6 @@ class PrivateCloud(TrackedResource): :vartype provisioning_network: str :ivar vmotion_network: Used for live migration of virtual machines :vartype vmotion_network: str - :param vcenter_password: Optionally, set the vCenter admin password when - the private cloud is created - :type vcenter_password: str - :param nsxt_password: Optionally, set the NSX-T Manager password when the - private cloud is created - :type nsxt_password: str :ivar vcenter_certificate_thumbprint: Thumbprint of the vCenter Server SSL certificate :vartype vcenter_certificate_thumbprint: str @@ -717,6 +775,8 @@ class PrivateCloud(TrackedResource): 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, 'internet': {'key': 'properties.internet', 'type': 'str'}, 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + 'vcenter_password': {'key': 'properties.vcenterPassword', 'type': 'str'}, + 'nsxt_password': {'key': 'properties.nsxtPassword', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'circuit': {'key': 'properties.circuit', 'type': 'Circuit'}, 'endpoints': {'key': 'properties.endpoints', 'type': 'Endpoints'}, @@ -724,8 +784,6 @@ class PrivateCloud(TrackedResource): 'management_network': {'key': 'properties.managementNetwork', 'type': 'str'}, 'provisioning_network': {'key': 'properties.provisioningNetwork', 'type': 'str'}, 'vmotion_network': {'key': 'properties.vmotionNetwork', 'type': 'str'}, - 'vcenter_password': {'key': 'properties.vcenterPassword', 'type': 'str'}, - 'nsxt_password': {'key': 'properties.nsxtPassword', 'type': 'str'}, 'vcenter_certificate_thumbprint': {'key': 'properties.vcenterCertificateThumbprint', 'type': 'str'}, 'nsxt_certificate_thumbprint': {'key': 'properties.nsxtCertificateThumbprint', 'type': 'str'}, } @@ -736,6 +794,8 @@ def __init__(self, **kwargs): self.management_cluster = kwargs.get('management_cluster', None) self.internet = kwargs.get('internet', None) self.identity_sources = kwargs.get('identity_sources', None) + self.vcenter_password = kwargs.get('vcenter_password', None) + self.nsxt_password = kwargs.get('nsxt_password', None) self.provisioning_state = None self.circuit = kwargs.get('circuit', None) self.endpoints = None @@ -743,8 +803,6 @@ def __init__(self, **kwargs): self.management_network = None self.provisioning_network = None self.vmotion_network = None - self.vcenter_password = kwargs.get('vcenter_password', None) - self.nsxt_password = kwargs.get('nsxt_password', None) self.vcenter_certificate_thumbprint = None self.nsxt_certificate_thumbprint = None @@ -752,8 +810,6 @@ def __init__(self, **kwargs): class PrivateCloudUpdate(Model): """An update to a private cloud resource. - :param tags: Resource tags. - :type tags: dict[str, str] :param management_cluster: The default cluster used for management :type management_cluster: ~azure.mgmt.avs.models.ManagementCluster :param internet: Connectivity to internet is enabled or disabled. Possible @@ -761,21 +817,58 @@ 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 vcenter_password: Reset the vCenter admin password for the private + cloud + :type vcenter_password: str + :param nsxt_password: Reset the NSX-T admin password for the private cloud + :type nsxt_password: str """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, 'internet': {'key': 'properties.internet', 'type': 'str'}, 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + 'vcenter_password': {'key': 'properties.vcenterPassword', 'type': 'str'}, + 'nsxt_password': {'key': 'properties.nsxtPassword', 'type': 'str'}, } def __init__(self, **kwargs): super(PrivateCloudUpdate, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) self.management_cluster = kwargs.get('management_cluster', None) self.internet = kwargs.get('internet', None) self.identity_sources = kwargs.get('identity_sources', None) + self.vcenter_password = kwargs.get('vcenter_password', None) + self.nsxt_password = kwargs.get('nsxt_password', None) + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) class Quota(Model): @@ -829,6 +922,37 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', None) +class StoragePolicy(Model): + """The resource model definition representing a default storage policy for a + cluster. + + 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 name: Required. The name of the storage policy. + :type name: str + :ivar min_hosts: The minimum number of hosts to use this storage policy + :vartype min_hosts: int + """ + + _validation = { + 'name': {'required': True}, + 'min_hosts': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'min_hosts': {'key': 'minHosts', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(StoragePolicy, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.min_hosts = None + + class Trial(Model): """Subscription trial availability. @@ -856,3 +980,520 @@ def __init__(self, **kwargs): super(Trial, self).__init__(**kwargs) self.status = None self.available_hosts = None + + +class WorkloadNetworkDhcp(ProxyResource): + """NSX DHCP. + + 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 display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'segments': {'readonly': True}, + 'provisioning_state': {'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'}, + 'segments': {'key': 'properties.segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkDhcp, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.segments = None + self.provisioning_state = None + self.revision = kwargs.get('revision', None) + + +class WorkloadNetworkDhcpEntity(Model): + """Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to + inherit from. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: WorkloadNetworkDhcpServer, WorkloadNetworkDhcpRelay + + 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 display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + :param dhcp_type: Required. Constant filled by server. + :type dhcp_type: str + """ + + _validation = { + 'segments': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'dhcp_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'segments': {'key': 'segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'long'}, + 'dhcp_type': {'key': 'dhcpType', 'type': 'str'}, + } + + _subtype_map = { + 'dhcp_type': {'SERVER': 'WorkloadNetworkDhcpServer', 'RELAY': 'WorkloadNetworkDhcpRelay'} + } + + def __init__(self, **kwargs): + super(WorkloadNetworkDhcpEntity, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.segments = None + self.provisioning_state = None + self.revision = kwargs.get('revision', None) + self.dhcp_type = None + + +class WorkloadNetworkDhcpRelay(WorkloadNetworkDhcpEntity): + """NSX DHCP Relay. + + 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 display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + :param dhcp_type: Required. Constant filled by server. + :type dhcp_type: str + :param server_addresses: DHCP Relay Addresses. Max 3. + :type server_addresses: list[str] + """ + + _validation = { + 'segments': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'dhcp_type': {'required': True}, + 'server_addresses': {'max_items': 3, 'min_items': 1}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'segments': {'key': 'segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'long'}, + 'dhcp_type': {'key': 'dhcpType', 'type': 'str'}, + 'server_addresses': {'key': 'serverAddresses', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkDhcpRelay, self).__init__(**kwargs) + self.server_addresses = kwargs.get('server_addresses', None) + self.dhcp_type = 'RELAY' + + +class WorkloadNetworkDhcpServer(WorkloadNetworkDhcpEntity): + """NSX DHCP Server. + + 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 display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + :param dhcp_type: Required. Constant filled by server. + :type dhcp_type: str + :param server_address: DHCP Server Address. + :type server_address: str + :param lease_time: DHCP Server Lease Time. + :type lease_time: long + """ + + _validation = { + 'segments': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'dhcp_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'segments': {'key': 'segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'long'}, + 'dhcp_type': {'key': 'dhcpType', 'type': 'str'}, + 'server_address': {'key': 'serverAddress', 'type': 'str'}, + 'lease_time': {'key': 'leaseTime', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkDhcpServer, self).__init__(**kwargs) + self.server_address = kwargs.get('server_address', None) + self.lease_time = kwargs.get('lease_time', None) + self.dhcp_type = 'SERVER' + + +class WorkloadNetworkGateway(ProxyResource): + """NSX Gateway. + + 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: + :type properties: ~azure.mgmt.avs.models.WorkloadNetworkGatewayProperties + """ + + _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': 'WorkloadNetworkGatewayProperties'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkGateway, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class WorkloadNetworkGatewayProperties(Model): + """Properties of a NSX Gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param display_name: Display name of the DHCP entity. + :type display_name: str + :ivar path: NSX Gateway Path. + :vartype path: str + """ + + _validation = { + 'path': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkGatewayProperties, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.path = None + + +class WorkloadNetworkPortMirroring(ProxyResource): + """NSX Port Mirroring. + + 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 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' + :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' + :vartype status: str or ~azure.mgmt.avs.models.PortMirroringStatusEnum + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroringProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'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'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'destination': {'key': 'properties.destination', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkPortMirroring, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.direction = kwargs.get('direction', None) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.status = None + self.provisioning_state = None + self.revision = kwargs.get('revision', None) + + +class WorkloadNetworkSegment(ProxyResource): + """NSX Segment. + + 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 display_name: Display name of the segment. + :type display_name: str + :param connected_gateway: Gateway which to connect segment to. + :type connected_gateway: str + :param subnet: + :type subnet: ~azure.mgmt.avs.models.WorkloadNetworkSegmentSubnet + :ivar port_vif: + :vartype port_vif: + list[~azure.mgmt.avs.models.WorkloadNetworkSegmentPortVif] + :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' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkSegmentProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'port_vif': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'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'}, + 'connected_gateway': {'key': 'properties.connectedGateway', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'WorkloadNetworkSegmentSubnet'}, + 'port_vif': {'key': 'properties.portVif', 'type': '[WorkloadNetworkSegmentPortVif]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkSegment, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.connected_gateway = kwargs.get('connected_gateway', None) + self.subnet = kwargs.get('subnet', None) + self.port_vif = None + self.status = None + self.provisioning_state = None + self.revision = kwargs.get('revision', None) + + +class WorkloadNetworkSegmentPortVif(Model): + """Ports and any VIF attached to segment. + + :param port_name: Name of port or VIF attached to segment. + :type port_name: str + """ + + _attribute_map = { + 'port_name': {'key': 'portName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkSegmentPortVif, self).__init__(**kwargs) + self.port_name = kwargs.get('port_name', None) + + +class WorkloadNetworkSegmentSubnet(Model): + """Subnet configuration for segment. + + :param dhcp_ranges: DHCP Range assigned for subnet. + :type dhcp_ranges: list[str] + :param gateway_address: Gateway address. + :type gateway_address: str + """ + + _attribute_map = { + 'dhcp_ranges': {'key': 'dhcpRanges', 'type': '[str]'}, + 'gateway_address': {'key': 'gatewayAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkSegmentSubnet, self).__init__(**kwargs) + self.dhcp_ranges = kwargs.get('dhcp_ranges', None) + self.gateway_address = kwargs.get('gateway_address', None) + + +class WorkloadNetworkVirtualMachine(ProxyResource): + """NSX 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 + :param display_name: Display name of the VM. + :type display_name: str + :ivar vm_type: Virtual machine type. Possible values include: 'REGULAR, + EDGE, SERVICE' + :vartype vm_type: str or ~azure.mgmt.avs.models.VMTypeEnum + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'vm_type': {'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'}, + 'vm_type': {'key': 'properties.vmType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkVirtualMachine, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.vm_type = None + + +class WorkloadNetworkVMGroup(ProxyResource): + """NSX VM Group. + + 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 display_name: Display name of the VM group. + :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' + :vartype status: str or ~azure.mgmt.avs.models.VMGroupStatusEnum + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkVMGroupProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'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'}, + 'members': {'key': 'properties.members', 'type': '[str]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkVMGroup, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.members = kwargs.get('members', None) + self.status = None + self.provisioning_state = None + self.revision = kwargs.get('revision', None) 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 dd91b09cdb617..259ed64099753 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 @@ -168,7 +168,7 @@ class Cluster(Resource): :vartype type: str :param sku: Required. The cluster SKU :type sku: ~azure.mgmt.avs.models.Sku - :param cluster_size: The cluster size + :param cluster_size: Required. The cluster size :type cluster_size: int :ivar cluster_id: The identity :vartype cluster_id: int @@ -178,6 +178,8 @@ class Cluster(Resource): values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' :vartype provisioning_state: str or ~azure.mgmt.avs.models.ClusterProvisioningState + :param storage_policy: The storage policy of the cluster + :type storage_policy: ~azure.mgmt.avs.models.StoragePolicy """ _validation = { @@ -185,6 +187,7 @@ class Cluster(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'sku': {'required': True}, + 'cluster_size': {'required': True}, 'cluster_id': {'readonly': True}, 'hosts': {'readonly': True}, 'provisioning_state': {'readonly': True}, @@ -199,15 +202,17 @@ class Cluster(Resource): 'cluster_id': {'key': 'properties.clusterId', 'type': 'int'}, 'hosts': {'key': 'properties.hosts', 'type': '[str]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_policy': {'key': 'properties.storagePolicy', 'type': 'StoragePolicy'}, } - def __init__(self, *, sku, cluster_size: int=None, **kwargs) -> None: + def __init__(self, *, sku, cluster_size: int, storage_policy=None, **kwargs) -> None: super(Cluster, self).__init__(**kwargs) self.sku = sku self.cluster_size = cluster_size self.cluster_id = None self.hosts = None self.provisioning_state = None + self.storage_policy = storage_policy class ClusterUpdate(Model): @@ -215,31 +220,19 @@ class ClusterUpdate(Model): :param cluster_size: The cluster size :type cluster_size: int + :param storage_policy: The storage policy of the cluster + :type storage_policy: ~azure.mgmt.avs.models.StoragePolicy """ _attribute_map = { 'cluster_size': {'key': 'properties.clusterSize', 'type': 'int'}, + 'storage_policy': {'key': 'properties.storagePolicy', 'type': 'StoragePolicy'}, } - def __init__(self, *, cluster_size: int=None, **kwargs) -> None: + def __init__(self, *, cluster_size: int=None, storage_policy=None, **kwargs) -> None: super(ClusterUpdate, self).__init__(**kwargs) self.cluster_size = cluster_size - - -class ClusterUpdateProperties(Model): - """The properties of a cluster that may be updated. - - :param cluster_size: The cluster size - :type cluster_size: int - """ - - _attribute_map = { - 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, - } - - def __init__(self, *, cluster_size: int=None, **kwargs) -> None: - super(ClusterUpdateProperties, self).__init__(**kwargs) - self.cluster_size = cluster_size + self.storage_policy = storage_policy class Endpoints(Model): @@ -396,6 +389,68 @@ def __init__(self, **kwargs) -> None: self.express_route_authorization_key = None +class GlobalReachConnection(Resource): + """A global reach connection resource. + + 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 provisioning_state: The state of the ExpressRoute Circuit + Authorization provisioning. Possible values include: 'Succeeded', + 'Failed', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.GlobalReachConnectionProvisioningState + :ivar address_prefix: The network used for global reach carved out from + the original network block provided for the private cloud + :vartype address_prefix: str + :param authorization_key: Authorization key from the peer express route + used for the global reach connection + :type authorization_key: str + :ivar circuit_connection_status: The connection status of the global reach + connection. Possible values include: 'Connected', 'Connecting', + 'Disconnected' + :vartype circuit_connection_status: str or + ~azure.mgmt.avs.models.GlobalReachConnectionStatus + :param peer_express_route_circuit: Identifier of the ExpressRoute Circuit + to peer with in the global reach connection + :type peer_express_route_circuit: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'address_prefix': {'readonly': True}, + 'circuit_connection_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'circuit_connection_status': {'key': 'properties.circuitConnectionStatus', 'type': 'str'}, + 'peer_express_route_circuit': {'key': 'properties.peerExpressRouteCircuit', 'type': 'str'}, + } + + def __init__(self, *, authorization_key: str=None, peer_express_route_circuit: 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 + + class HcxEnterpriseSite(Resource): """An HCX Enterprise Site resource. @@ -492,13 +547,15 @@ def __init__(self, *, name: str=None, alias: str=None, domain: str=None, base_us self.password = password -class ManagementCluster(ClusterUpdateProperties): +class ManagementCluster(Model): """The properties of a default cluster. Variables are only populated by the server, and will be ignored when sending a request. - :param cluster_size: The cluster size + All required parameters must be populated in order to send to Azure. + + :param cluster_size: Required. The cluster size :type cluster_size: int :ivar cluster_id: The identity :vartype cluster_id: int @@ -507,6 +564,7 @@ class ManagementCluster(ClusterUpdateProperties): """ _validation = { + 'cluster_size': {'required': True}, 'cluster_id': {'readonly': True}, 'hosts': {'readonly': True}, } @@ -517,8 +575,9 @@ class ManagementCluster(ClusterUpdateProperties): 'hosts': {'key': 'hosts', 'type': '[str]'}, } - def __init__(self, *, cluster_size: int=None, **kwargs) -> None: - super(ManagementCluster, self).__init__(cluster_size=cluster_size, **kwargs) + def __init__(self, *, cluster_size: int, **kwargs) -> None: + super(ManagementCluster, self).__init__(**kwargs) + self.cluster_size = cluster_size self.cluster_id = None self.hosts = None @@ -656,6 +715,11 @@ 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 vcenter_password: Reset the vCenter admin password for the private + cloud + :type vcenter_password: str + :param nsxt_password: Reset the NSX-T admin password for the private cloud + :type nsxt_password: str :ivar provisioning_state: The provisioning state. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Pending', 'Building', 'Deleting', 'Updating' @@ -678,12 +742,6 @@ class PrivateCloud(TrackedResource): :vartype provisioning_network: str :ivar vmotion_network: Used for live migration of virtual machines :vartype vmotion_network: str - :param vcenter_password: Optionally, set the vCenter admin password when - the private cloud is created - :type vcenter_password: str - :param nsxt_password: Optionally, set the NSX-T Manager password when the - private cloud is created - :type nsxt_password: str :ivar vcenter_certificate_thumbprint: Thumbprint of the vCenter Server SSL certificate :vartype vcenter_certificate_thumbprint: str @@ -717,6 +775,8 @@ class PrivateCloud(TrackedResource): 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, 'internet': {'key': 'properties.internet', 'type': 'str'}, 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + 'vcenter_password': {'key': 'properties.vcenterPassword', 'type': 'str'}, + 'nsxt_password': {'key': 'properties.nsxtPassword', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'circuit': {'key': 'properties.circuit', 'type': 'Circuit'}, 'endpoints': {'key': 'properties.endpoints', 'type': 'Endpoints'}, @@ -724,18 +784,18 @@ class PrivateCloud(TrackedResource): 'management_network': {'key': 'properties.managementNetwork', 'type': 'str'}, 'provisioning_network': {'key': 'properties.provisioningNetwork', 'type': 'str'}, 'vmotion_network': {'key': 'properties.vmotionNetwork', 'type': 'str'}, - 'vcenter_password': {'key': 'properties.vcenterPassword', 'type': 'str'}, - 'nsxt_password': {'key': 'properties.nsxtPassword', 'type': 'str'}, 'vcenter_certificate_thumbprint': {'key': 'properties.vcenterCertificateThumbprint', 'type': 'str'}, 'nsxt_certificate_thumbprint': {'key': 'properties.nsxtCertificateThumbprint', 'type': 'str'}, } - def __init__(self, *, sku, network_block: str, location: str=None, tags=None, management_cluster=None, internet=None, 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=None, identity_sources=None, vcenter_password: str=None, nsxt_password: str=None, circuit=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.vcenter_password = vcenter_password + self.nsxt_password = nsxt_password self.provisioning_state = None self.circuit = circuit self.endpoints = None @@ -743,8 +803,6 @@ def __init__(self, *, sku, network_block: str, location: str=None, tags=None, ma self.management_network = None self.provisioning_network = None self.vmotion_network = None - self.vcenter_password = vcenter_password - self.nsxt_password = nsxt_password self.vcenter_certificate_thumbprint = None self.nsxt_certificate_thumbprint = None @@ -752,8 +810,6 @@ def __init__(self, *, sku, network_block: str, location: str=None, tags=None, ma class PrivateCloudUpdate(Model): """An update to a private cloud resource. - :param tags: Resource tags. - :type tags: dict[str, str] :param management_cluster: The default cluster used for management :type management_cluster: ~azure.mgmt.avs.models.ManagementCluster :param internet: Connectivity to internet is enabled or disabled. Possible @@ -761,21 +817,58 @@ 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 vcenter_password: Reset the vCenter admin password for the private + cloud + :type vcenter_password: str + :param nsxt_password: Reset the NSX-T admin password for the private cloud + :type nsxt_password: str """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, 'internet': {'key': 'properties.internet', 'type': 'str'}, 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + 'vcenter_password': {'key': 'properties.vcenterPassword', 'type': 'str'}, + 'nsxt_password': {'key': 'properties.nsxtPassword', 'type': 'str'}, } - def __init__(self, *, tags=None, management_cluster=None, internet=None, identity_sources=None, **kwargs) -> None: + def __init__(self, *, management_cluster=None, internet=None, identity_sources=None, vcenter_password: str=None, nsxt_password: str=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.vcenter_password = vcenter_password + self.nsxt_password = nsxt_password + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) class Quota(Model): @@ -829,6 +922,37 @@ def __init__(self, *, name: str, **kwargs) -> None: self.name = name +class StoragePolicy(Model): + """The resource model definition representing a default storage policy for a + cluster. + + 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 name: Required. The name of the storage policy. + :type name: str + :ivar min_hosts: The minimum number of hosts to use this storage policy + :vartype min_hosts: int + """ + + _validation = { + 'name': {'required': True}, + 'min_hosts': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'min_hosts': {'key': 'minHosts', 'type': 'int'}, + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(StoragePolicy, self).__init__(**kwargs) + self.name = name + self.min_hosts = None + + class Trial(Model): """Subscription trial availability. @@ -856,3 +980,520 @@ def __init__(self, **kwargs) -> None: super(Trial, self).__init__(**kwargs) self.status = None self.available_hosts = None + + +class WorkloadNetworkDhcp(ProxyResource): + """NSX DHCP. + + 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 display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'segments': {'readonly': True}, + 'provisioning_state': {'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'}, + 'segments': {'key': 'properties.segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, *, display_name: str=None, revision: int=None, **kwargs) -> None: + super(WorkloadNetworkDhcp, self).__init__(**kwargs) + self.display_name = display_name + self.segments = None + self.provisioning_state = None + self.revision = revision + + +class WorkloadNetworkDhcpEntity(Model): + """Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to + inherit from. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: WorkloadNetworkDhcpServer, WorkloadNetworkDhcpRelay + + 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 display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + :param dhcp_type: Required. Constant filled by server. + :type dhcp_type: str + """ + + _validation = { + 'segments': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'dhcp_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'segments': {'key': 'segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'long'}, + 'dhcp_type': {'key': 'dhcpType', 'type': 'str'}, + } + + _subtype_map = { + 'dhcp_type': {'SERVER': 'WorkloadNetworkDhcpServer', 'RELAY': 'WorkloadNetworkDhcpRelay'} + } + + def __init__(self, *, display_name: str=None, revision: int=None, **kwargs) -> None: + super(WorkloadNetworkDhcpEntity, self).__init__(**kwargs) + self.display_name = display_name + self.segments = None + self.provisioning_state = None + self.revision = revision + self.dhcp_type = None + + +class WorkloadNetworkDhcpRelay(WorkloadNetworkDhcpEntity): + """NSX DHCP Relay. + + 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 display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + :param dhcp_type: Required. Constant filled by server. + :type dhcp_type: str + :param server_addresses: DHCP Relay Addresses. Max 3. + :type server_addresses: list[str] + """ + + _validation = { + 'segments': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'dhcp_type': {'required': True}, + 'server_addresses': {'max_items': 3, 'min_items': 1}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'segments': {'key': 'segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'long'}, + 'dhcp_type': {'key': 'dhcpType', 'type': 'str'}, + 'server_addresses': {'key': 'serverAddresses', 'type': '[str]'}, + } + + def __init__(self, *, display_name: str=None, revision: int=None, server_addresses=None, **kwargs) -> None: + super(WorkloadNetworkDhcpRelay, self).__init__(display_name=display_name, revision=revision, **kwargs) + self.server_addresses = server_addresses + self.dhcp_type = 'RELAY' + + +class WorkloadNetworkDhcpServer(WorkloadNetworkDhcpEntity): + """NSX DHCP Server. + + 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 display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + :param dhcp_type: Required. Constant filled by server. + :type dhcp_type: str + :param server_address: DHCP Server Address. + :type server_address: str + :param lease_time: DHCP Server Lease Time. + :type lease_time: long + """ + + _validation = { + 'segments': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'dhcp_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'segments': {'key': 'segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'long'}, + 'dhcp_type': {'key': 'dhcpType', 'type': 'str'}, + 'server_address': {'key': 'serverAddress', 'type': 'str'}, + 'lease_time': {'key': 'leaseTime', 'type': 'long'}, + } + + def __init__(self, *, display_name: str=None, revision: int=None, server_address: str=None, lease_time: int=None, **kwargs) -> None: + super(WorkloadNetworkDhcpServer, self).__init__(display_name=display_name, revision=revision, **kwargs) + self.server_address = server_address + self.lease_time = lease_time + self.dhcp_type = 'SERVER' + + +class WorkloadNetworkGateway(ProxyResource): + """NSX Gateway. + + 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: + :type properties: ~azure.mgmt.avs.models.WorkloadNetworkGatewayProperties + """ + + _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': 'WorkloadNetworkGatewayProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(WorkloadNetworkGateway, self).__init__(**kwargs) + self.properties = properties + + +class WorkloadNetworkGatewayProperties(Model): + """Properties of a NSX Gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param display_name: Display name of the DHCP entity. + :type display_name: str + :ivar path: NSX Gateway Path. + :vartype path: str + """ + + _validation = { + 'path': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, **kwargs) -> None: + super(WorkloadNetworkGatewayProperties, self).__init__(**kwargs) + self.display_name = display_name + self.path = None + + +class WorkloadNetworkPortMirroring(ProxyResource): + """NSX Port Mirroring. + + 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 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' + :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' + :vartype status: str or ~azure.mgmt.avs.models.PortMirroringStatusEnum + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroringProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'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'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'destination': {'key': 'properties.destination', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, *, display_name: str=None, direction=None, source: str=None, destination: str=None, revision: int=None, **kwargs) -> None: + super(WorkloadNetworkPortMirroring, self).__init__(**kwargs) + self.display_name = display_name + self.direction = direction + self.source = source + self.destination = destination + self.status = None + self.provisioning_state = None + self.revision = revision + + +class WorkloadNetworkSegment(ProxyResource): + """NSX Segment. + + 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 display_name: Display name of the segment. + :type display_name: str + :param connected_gateway: Gateway which to connect segment to. + :type connected_gateway: str + :param subnet: + :type subnet: ~azure.mgmt.avs.models.WorkloadNetworkSegmentSubnet + :ivar port_vif: + :vartype port_vif: + list[~azure.mgmt.avs.models.WorkloadNetworkSegmentPortVif] + :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' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkSegmentProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'port_vif': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'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'}, + 'connected_gateway': {'key': 'properties.connectedGateway', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'WorkloadNetworkSegmentSubnet'}, + 'port_vif': {'key': 'properties.portVif', 'type': '[WorkloadNetworkSegmentPortVif]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, *, display_name: str=None, connected_gateway: str=None, subnet=None, revision: int=None, **kwargs) -> None: + super(WorkloadNetworkSegment, self).__init__(**kwargs) + self.display_name = display_name + self.connected_gateway = connected_gateway + self.subnet = subnet + self.port_vif = None + self.status = None + self.provisioning_state = None + self.revision = revision + + +class WorkloadNetworkSegmentPortVif(Model): + """Ports and any VIF attached to segment. + + :param port_name: Name of port or VIF attached to segment. + :type port_name: str + """ + + _attribute_map = { + 'port_name': {'key': 'portName', 'type': 'str'}, + } + + def __init__(self, *, port_name: str=None, **kwargs) -> None: + super(WorkloadNetworkSegmentPortVif, self).__init__(**kwargs) + self.port_name = port_name + + +class WorkloadNetworkSegmentSubnet(Model): + """Subnet configuration for segment. + + :param dhcp_ranges: DHCP Range assigned for subnet. + :type dhcp_ranges: list[str] + :param gateway_address: Gateway address. + :type gateway_address: str + """ + + _attribute_map = { + 'dhcp_ranges': {'key': 'dhcpRanges', 'type': '[str]'}, + 'gateway_address': {'key': 'gatewayAddress', 'type': 'str'}, + } + + def __init__(self, *, dhcp_ranges=None, gateway_address: str=None, **kwargs) -> None: + super(WorkloadNetworkSegmentSubnet, self).__init__(**kwargs) + self.dhcp_ranges = dhcp_ranges + self.gateway_address = gateway_address + + +class WorkloadNetworkVirtualMachine(ProxyResource): + """NSX 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 + :param display_name: Display name of the VM. + :type display_name: str + :ivar vm_type: Virtual machine type. Possible values include: 'REGULAR, + EDGE, SERVICE' + :vartype vm_type: str or ~azure.mgmt.avs.models.VMTypeEnum + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'vm_type': {'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'}, + 'vm_type': {'key': 'properties.vmType', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, **kwargs) -> None: + super(WorkloadNetworkVirtualMachine, self).__init__(**kwargs) + self.display_name = display_name + self.vm_type = None + + +class WorkloadNetworkVMGroup(ProxyResource): + """NSX VM Group. + + 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 display_name: Display name of the VM group. + :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' + :vartype status: str or ~azure.mgmt.avs.models.VMGroupStatusEnum + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkVMGroupProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'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'}, + 'members': {'key': 'properties.members', 'type': '[str]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, *, display_name: str=None, members=None, revision: int=None, **kwargs) -> None: + super(WorkloadNetworkVMGroup, self).__init__(**kwargs) + self.display_name = display_name + self.members = members + self.status = None + self.provisioning_state = None + self.revision = revision 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 874c91b84a94e..365f5d8e9b52d 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 @@ -25,6 +25,19 @@ class OperationPaged(Paged): def __init__(self, *args, **kwargs): super(OperationPaged, self).__init__(*args, **kwargs) +class StoragePolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`StoragePolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StoragePolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(StoragePolicyPaged, self).__init__(*args, **kwargs) class PrivateCloudPaged(Paged): """ A paging container for iterating over a list of :class:`PrivateCloud ` object @@ -77,3 +90,94 @@ class ExpressRouteAuthorizationPaged(Paged): def __init__(self, *args, **kwargs): super(ExpressRouteAuthorizationPaged, self).__init__(*args, **kwargs) +class GlobalReachConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`GlobalReachConnection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[GlobalReachConnection]'} + } + + def __init__(self, *args, **kwargs): + + super(GlobalReachConnectionPaged, self).__init__(*args, **kwargs) +class WorkloadNetworkSegmentPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkSegment ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkSegment]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkSegmentPaged, self).__init__(*args, **kwargs) +class WorkloadNetworkDhcpPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkDhcp ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkDhcp]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkDhcpPaged, self).__init__(*args, **kwargs) +class WorkloadNetworkGatewayPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkGateway ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkGateway]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkGatewayPaged, self).__init__(*args, **kwargs) +class WorkloadNetworkPortMirroringPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkPortMirroring ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkPortMirroring]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkPortMirroringPaged, self).__init__(*args, **kwargs) +class WorkloadNetworkVMGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkVMGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkVMGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkVMGroupPaged, self).__init__(*args, **kwargs) +class WorkloadNetworkVirtualMachinePaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkVirtualMachine ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkVirtualMachine]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkVirtualMachinePaged, self).__init__(*args, **kwargs) 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 f8c122b9ef0c5..56069e1ce5aa6 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 @@ -10,17 +10,23 @@ # -------------------------------------------------------------------------- from ._operations import Operations +from ._default_storage_policies_operations import DefaultStoragePoliciesOperations from ._locations_operations import LocationsOperations from ._private_clouds_operations import PrivateCloudsOperations from ._clusters_operations import ClustersOperations from ._hcx_enterprise_sites_operations import HcxEnterpriseSitesOperations from ._authorizations_operations import AuthorizationsOperations +from ._global_reach_connections_operations import GlobalReachConnectionsOperations +from ._workload_networks_operations import WorkloadNetworksOperations __all__ = [ 'Operations', + 'DefaultStoragePoliciesOperations', 'LocationsOperations', 'PrivateCloudsOperations', 'ClustersOperations', 'HcxEnterpriseSitesOperations', 'AuthorizationsOperations', + 'GlobalReachConnectionsOperations', + 'WorkloadNetworksOperations', ] 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 ae761e630faaf..a642ad4f4f348 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: "2020-03-20". + :ivar api_version: The API version to use for this operation. Constant value: "2020-07-17-preview". """ 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 = "2020-03-20" + self.api_version = "2020-07-17-preview" 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 3d9a15ab9ec84..57fee184d1adf 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: "2020-03-20". + :ivar api_version: The API version to use for this operation. Constant value: "2020-07-17-preview". """ 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 = "2020-03-20" + self.api_version = "2020-07-17-preview" self.config = config @@ -181,9 +181,7 @@ def get( def _create_or_update_initial( - self, resource_group_name, private_cloud_name, cluster_name, sku, cluster_size=None, custom_headers=None, raw=False, **operation_config): - cluster = models.Cluster(sku=sku, cluster_size=cluster_size) - + self, resource_group_name, private_cloud_name, cluster_name, cluster, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -235,7 +233,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, private_cloud_name, cluster_name, sku, cluster_size=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, private_cloud_name, cluster_name, cluster, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a cluster in a private cloud. :param resource_group_name: The name of the resource group. The name @@ -245,10 +243,8 @@ def create_or_update( :type private_cloud_name: str :param cluster_name: Name of the cluster in the private cloud :type cluster_name: str - :param sku: The cluster SKU - :type sku: ~azure.mgmt.avs.models.Sku - :param cluster_size: The cluster size - :type cluster_size: int + :param cluster: A cluster in the private cloud + :type cluster: ~azure.mgmt.avs.models.Cluster :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,8 +262,7 @@ def create_or_update( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, cluster_name=cluster_name, - sku=sku, - cluster_size=cluster_size, + cluster=cluster, custom_headers=custom_headers, raw=True, **operation_config @@ -293,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, storage_policy=None, custom_headers=None, raw=False, **operation_config): + cluster_update = models.ClusterUpdate(cluster_size=cluster_size, storage_policy=storage_policy) # Construct URL url = self.update.metadata['url'] @@ -347,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, storage_policy=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 @@ -359,6 +354,8 @@ def update( :type cluster_name: str :param cluster_size: The cluster size :type cluster_size: int + :param storage_policy: The storage policy of the cluster + :type storage_policy: ~azure.mgmt.avs.models.StoragePolicy :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 @@ -377,6 +374,7 @@ def update( private_cloud_name=private_cloud_name, cluster_name=cluster_name, cluster_size=cluster_size, + storage_policy=storage_policy, custom_headers=custom_headers, raw=True, **operation_config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_default_storage_policies_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_default_storage_policies_operations.py new file mode 100644 index 0000000000000..aaf38b2a6266e --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_default_storage_policies_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DefaultStoragePoliciesOperations(object): + """DefaultStoragePoliciesOperations 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: "2020-07-17-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-17-preview" + + self.config = config + + def list( + self, location, custom_headers=None, raw=False, **operation_config): + """Lists all of the available storage policies. + + :param location: Azure region + :type location: 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 StoragePolicy + :rtype: + ~azure.mgmt.avs.models.StoragePolicyPaged[~azure.mgmt.avs.models.StoragePolicy] + :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), + 'location': self._serialize.url("location", location, '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.post(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.StoragePolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/defaultStoragePolicies'} 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 new file mode 100644 index 0000000000000..e0de4630e3e89 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py @@ -0,0 +1,381 @@ +# 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 GlobalReachConnectionsOperations(object): + """GlobalReachConnectionsOperations 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: "2020-07-17-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-17-preview" + + self.config = config + + def list( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List global reach connections in a private cloud. + + :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 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 GlobalReachConnection + :rtype: + ~azure.mgmt.avs.models.GlobalReachConnectionPaged[~azure.mgmt.avs.models.GlobalReachConnection] + :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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_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.GlobalReachConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections'} + + def get( + self, resource_group_name, private_cloud_name, global_reach_connection_name, custom_headers=None, raw=False, **operation_config): + """Get a global reach connection by name in a private cloud. + + :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 global_reach_connection_name: Name of the global reach + connection in the private cloud + :type global_reach_connection_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: GlobalReachConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.GlobalReachConnection 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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'globalReachConnectionName': self._serialize.url("global_reach_connection_name", global_reach_connection_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('GlobalReachConnection', 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}/globalReachConnections/{globalReachConnectionName}'} + + + 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) + + # 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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'globalReachConnectionName': self._serialize.url("global_reach_connection_name", global_reach_connection_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(global_reach_connection, 'GlobalReachConnection') + + # 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('GlobalReachConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('GlobalReachConnection', 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, global_reach_connection_name, authorization_key=None, peer_express_route_circuit=None, 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 + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: The name of the private cloud. + :type private_cloud_name: str + :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 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 GlobalReachConnection + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.GlobalReachConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.GlobalReachConnection]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + 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, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GlobalReachConnection', 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}/globalReachConnections/{globalReachConnectionName}'} + + + def _delete_initial( + self, resource_group_name, private_cloud_name, global_reach_connection_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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'globalReachConnectionName': self._serialize.url("global_reach_connection_name", global_reach_connection_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, global_reach_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a global reach connection in a private cloud. + + :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 global_reach_connection_name: Name of the global reach + connection in the private cloud + :type global_reach_connection_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, + global_reach_connection_name=global_reach_connection_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}/globalReachConnections/{globalReachConnectionName}'} 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 2a6b139c72e35..a1746c8ae5d12 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: "2020-03-20". + :ivar api_version: The API version to use for this operation. Constant value: "2020-07-17-preview". """ 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 = "2020-03-20" + self.api_version = "2020-07-17-preview" 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 6d8d140021c9b..7d96e4b723111 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: "2020-03-20". + :ivar api_version: The API version to use for this operation. Constant value: "2020-07-17-preview". """ 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 = "2020-03-20" + self.api_version = "2020-07-17-preview" 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 2e02064516c05..fdafc20e1d947 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: "2020-03-20". + :ivar api_version: The API version to use for this operation. Constant value: "2020-07-17-preview". """ 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 = "2020-03-20" + self.api_version = "2020-07-17-preview" self.config = config 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 128a4596f79ba..f5fcf3ec3f021 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: "2020-03-20". + :ivar api_version: The API version to use for this operation. Constant value: "2020-07-17-preview". """ 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 = "2020-03-20" + self.api_version = "2020-07-17-preview" self.config = config 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 new file mode 100644 index 0000000000000..0ccd974310dca --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py @@ -0,0 +1,1961 @@ +# 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 WorkloadNetworksOperations(object): + """WorkloadNetworksOperations 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: "2020-07-17-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-17-preview" + + self.config = config + + def list_segments( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List of segments in a private cloud workload network. + + :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 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 WorkloadNetworkSegment + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkSegmentPaged[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_segments.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_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.WorkloadNetworkSegmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_segments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments'} + + def get_segment( + self, resource_group_name, private_cloud_name, segment_id, custom_headers=None, raw=False, **operation_config): + """Get a segment by id in a private cloud workload network. + + :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 segment_id: NSX Segment identifier. Generally the same as the + Segment's display name + :type segment_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: WorkloadNetworkSegment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkSegment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_segment.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'segmentId': self._serialize.url("segment_id", segment_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('WorkloadNetworkSegment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_segment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'} + + + def _create_segments_initial( + self, resource_group_name, private_cloud_name, segment_id, workload_network_segment, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_segments.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'segmentId': self._serialize.url("segment_id", segment_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' + 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(workload_network_segment, 'WorkloadNetworkSegment') + + # 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('WorkloadNetworkSegment', response) + if response.status_code == 201: + deserialized = self._deserialize('WorkloadNetworkSegment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_segments( + self, resource_group_name, private_cloud_name, segment_id, workload_network_segment, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a segment by id in a private cloud workload network. + + :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 segment_id: NSX Segment identifier. Generally the same as the + Segment's display name + :type segment_id: str + :param workload_network_segment: NSX Segment + :type workload_network_segment: + ~azure.mgmt.avs.models.WorkloadNetworkSegment + :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 WorkloadNetworkSegment + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkSegment]] + :raises: :class:`CloudError` + """ + raw_result = self._create_segments_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + segment_id=segment_id, + workload_network_segment=workload_network_segment, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkSegment', 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_segments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'} + + + def _update_segments_initial( + self, resource_group_name, private_cloud_name, segment_id, workload_network_segment, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update_segments.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'segmentId': self._serialize.url("segment_id", segment_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' + 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(workload_network_segment, 'WorkloadNetworkSegment') + + # 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('WorkloadNetworkSegment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_segments( + self, resource_group_name, private_cloud_name, segment_id, workload_network_segment, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a segment by id in a private cloud workload network. + + :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 segment_id: NSX Segment identifier. Generally the same as the + Segment's display name + :type segment_id: str + :param workload_network_segment: NSX Segment + :type workload_network_segment: + ~azure.mgmt.avs.models.WorkloadNetworkSegment + :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 WorkloadNetworkSegment + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkSegment]] + :raises: :class:`CloudError` + """ + raw_result = self._update_segments_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + segment_id=segment_id, + workload_network_segment=workload_network_segment, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkSegment', 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_segments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'} + + + def _delete_segment_initial( + self, resource_group_name, private_cloud_name, segment_id, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_segment.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'segmentId': self._serialize.url("segment_id", segment_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 = {} + 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_segment( + self, resource_group_name, private_cloud_name, segment_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a segment by id in a private cloud workload network. + + :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 segment_id: NSX Segment identifier. Generally the same as the + Segment's display name + :type segment_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns 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_segment_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + segment_id=segment_id, + 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_segment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'} + + def list_dhcp( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List dhcp in a private cloud workload network. + + :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 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 WorkloadNetworkDhcp + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkDhcpPaged[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_dhcp.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_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.WorkloadNetworkDhcpPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_dhcp.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations'} + + def get_dhcp( + self, resource_group_name, dhcp_id, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """Get dhcp by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP + display name + :type dhcp_id: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_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: WorkloadNetworkDhcp or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDhcp or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_dhcp.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, pattern=r'^[-\w\._\(\)]+$'), + 'dhcpId': self._serialize.url("dhcp_id", dhcp_id, 'str'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_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('WorkloadNetworkDhcp', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_dhcp.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'} + + + def _create_dhcp_initial( + self, resource_group_name, private_cloud_name, dhcp_id, display_name=None, revision=None, custom_headers=None, raw=False, **operation_config): + workload_network_dhcp = models.WorkloadNetworkDhcp(display_name=display_name, revision=revision) + + # Construct URL + url = self.create_dhcp.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'dhcpId': self._serialize.url("dhcp_id", dhcp_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' + 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(workload_network_dhcp, 'WorkloadNetworkDhcp') + + # 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('WorkloadNetworkDhcp', response) + if response.status_code == 201: + deserialized = self._deserialize('WorkloadNetworkDhcp', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_dhcp( + self, resource_group_name, private_cloud_name, dhcp_id, display_name=None, revision=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create dhcp by id in a private cloud workload network. + + :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 dhcp_id: NSX DHCP identifier. Generally the same as the DHCP + display name + :type dhcp_id: str + :param display_name: Display name of the DHCP entity. + :type display_name: str + :param revision: NSX revision number. + :type revision: long + :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 WorkloadNetworkDhcp or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkDhcp]] + :raises: :class:`CloudError` + """ + raw_result = self._create_dhcp_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + dhcp_id=dhcp_id, + display_name=display_name, + revision=revision, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkDhcp', 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_dhcp.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'} + + + def _update_dhcp_initial( + self, resource_group_name, private_cloud_name, dhcp_id, display_name=None, revision=None, custom_headers=None, raw=False, **operation_config): + workload_network_dhcp = models.WorkloadNetworkDhcp(display_name=display_name, revision=revision) + + # Construct URL + url = self.update_dhcp.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'dhcpId': self._serialize.url("dhcp_id", dhcp_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' + 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(workload_network_dhcp, 'WorkloadNetworkDhcp') + + # 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('WorkloadNetworkDhcp', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_dhcp( + self, resource_group_name, private_cloud_name, dhcp_id, display_name=None, revision=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update dhcp by id in a private cloud workload network. + + :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 dhcp_id: NSX DHCP identifier. Generally the same as the DHCP + display name + :type dhcp_id: str + :param display_name: Display name of the DHCP entity. + :type display_name: str + :param revision: NSX revision number. + :type revision: long + :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 WorkloadNetworkDhcp or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkDhcp]] + :raises: :class:`CloudError` + """ + raw_result = self._update_dhcp_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + dhcp_id=dhcp_id, + display_name=display_name, + revision=revision, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkDhcp', 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_dhcp.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'} + + + def _delete_dhcp_initial( + self, resource_group_name, private_cloud_name, dhcp_id, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_dhcp.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'dhcpId': self._serialize.url("dhcp_id", dhcp_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 = {} + 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_dhcp( + self, resource_group_name, private_cloud_name, dhcp_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete dhcp by id in a private cloud workload network. + + :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 dhcp_id: NSX DHCP identifier. Generally the same as the DHCP + display name + :type dhcp_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns 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_dhcp_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + dhcp_id=dhcp_id, + 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_dhcp.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'} + + def list_gateways( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List of gateways in a private cloud workload network. + + :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 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 WorkloadNetworkGateway + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkGatewayPaged[~azure.mgmt.avs.models.WorkloadNetworkGateway] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_gateways.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_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.WorkloadNetworkGatewayPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_gateways.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways'} + + def list_port_mirroring( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List of port mirroring profiles in a private cloud workload network. + + :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 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 WorkloadNetworkPortMirroring + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroringPaged[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_port_mirroring.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_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.WorkloadNetworkPortMirroringPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_port_mirroring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles'} + + def get_port_mirroring( + self, resource_group_name, private_cloud_name, port_mirroring_id, custom_headers=None, raw=False, **operation_config): + """Get a port mirroring profile by id in a private cloud workload network. + + :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 port_mirroring_id: NSX Port Mirroring identifier. Generally the + same as the Port Mirroring display name + :type port_mirroring_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: WorkloadNetworkPortMirroring or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_port_mirroring.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'portMirroringId': self._serialize.url("port_mirroring_id", port_mirroring_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('WorkloadNetworkPortMirroring', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_port_mirroring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'} + + + def _create_port_mirroring_initial( + self, resource_group_name, private_cloud_name, port_mirroring_id, workload_network_port_mirroring, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_port_mirroring.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'portMirroringId': self._serialize.url("port_mirroring_id", port_mirroring_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' + 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(workload_network_port_mirroring, 'WorkloadNetworkPortMirroring') + + # 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('WorkloadNetworkPortMirroring', response) + if response.status_code == 201: + deserialized = self._deserialize('WorkloadNetworkPortMirroring', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_port_mirroring( + self, resource_group_name, private_cloud_name, port_mirroring_id, workload_network_port_mirroring, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a port mirroring profile by id in a private cloud workload + network. + + :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 port_mirroring_id: NSX Port Mirroring identifier. Generally the + same as the Port Mirroring display name + :type port_mirroring_id: str + :param workload_network_port_mirroring: NSX port mirroring + :type workload_network_port_mirroring: + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring + :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 + WorkloadNetworkPortMirroring or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring]] + :raises: :class:`CloudError` + """ + raw_result = self._create_port_mirroring_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + port_mirroring_id=port_mirroring_id, + workload_network_port_mirroring=workload_network_port_mirroring, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkPortMirroring', 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_port_mirroring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'} + + + def _update_port_mirroring_initial( + self, resource_group_name, private_cloud_name, port_mirroring_id, workload_network_port_mirroring, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update_port_mirroring.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'portMirroringId': self._serialize.url("port_mirroring_id", port_mirroring_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' + 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(workload_network_port_mirroring, 'WorkloadNetworkPortMirroring') + + # 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('WorkloadNetworkPortMirroring', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_port_mirroring( + self, resource_group_name, private_cloud_name, port_mirroring_id, workload_network_port_mirroring, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a port mirroring profile by id in a private cloud + workload network. + + :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 port_mirroring_id: NSX Port Mirroring identifier. Generally the + same as the Port Mirroring display name + :type port_mirroring_id: str + :param workload_network_port_mirroring: NSX port mirroring + :type workload_network_port_mirroring: + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring + :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 + WorkloadNetworkPortMirroring or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring]] + :raises: :class:`CloudError` + """ + raw_result = self._update_port_mirroring_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + port_mirroring_id=port_mirroring_id, + workload_network_port_mirroring=workload_network_port_mirroring, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkPortMirroring', 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_port_mirroring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'} + + + def _delete_port_mirroring_initial( + self, resource_group_name, port_mirroring_id, private_cloud_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_port_mirroring.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, pattern=r'^[-\w\._\(\)]+$'), + 'portMirroringId': self._serialize.url("port_mirroring_id", port_mirroring_id, 'str'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_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_port_mirroring( + self, resource_group_name, port_mirroring_id, private_cloud_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a port mirroring profile by id in a private cloud workload + network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param port_mirroring_id: NSX Port Mirroring identifier. Generally the + same as the Port Mirroring display name + :type port_mirroring_id: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_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_port_mirroring_initial( + resource_group_name=resource_group_name, + port_mirroring_id=port_mirroring_id, + private_cloud_name=private_cloud_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_port_mirroring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'} + + def list_vm_groups( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List of vm groups in a private cloud workload network. + + :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 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 WorkloadNetworkVMGroup + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkVMGroupPaged[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_vm_groups.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_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.WorkloadNetworkVMGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_vm_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups'} + + def get_vm_group( + self, resource_group_name, private_cloud_name, vm_group_id, custom_headers=None, raw=False, **operation_config): + """Get a vm group by id in a private cloud workload network. + + :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 vm_group_id: NSX VM Group identifier. Generally the same as the + VM Group's display name + :type vm_group_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: WorkloadNetworkVMGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_vm_group.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'vmGroupId': self._serialize.url("vm_group_id", vm_group_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('WorkloadNetworkVMGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_vm_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'} + + + def _create_vm_group_initial( + self, resource_group_name, private_cloud_name, vm_group_id, workload_network_vm_group, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_vm_group.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'vmGroupId': self._serialize.url("vm_group_id", vm_group_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' + 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(workload_network_vm_group, 'WorkloadNetworkVMGroup') + + # 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('WorkloadNetworkVMGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('WorkloadNetworkVMGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_vm_group( + self, resource_group_name, private_cloud_name, vm_group_id, workload_network_vm_group, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a vm group by id in a private cloud workload network. + + :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 vm_group_id: NSX VM Group identifier. Generally the same as the + VM Group's display name + :type vm_group_id: str + :param workload_network_vm_group: NSX VM Group + :type workload_network_vm_group: + ~azure.mgmt.avs.models.WorkloadNetworkVMGroup + :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 WorkloadNetworkVMGroup + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkVMGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._create_vm_group_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + vm_group_id=vm_group_id, + workload_network_vm_group=workload_network_vm_group, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkVMGroup', 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_vm_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'} + + + def _update_vm_group_initial( + self, resource_group_name, private_cloud_name, vm_group_id, workload_network_vm_group, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update_vm_group.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'vmGroupId': self._serialize.url("vm_group_id", vm_group_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' + 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(workload_network_vm_group, 'WorkloadNetworkVMGroup') + + # 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('WorkloadNetworkVMGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_vm_group( + self, resource_group_name, private_cloud_name, vm_group_id, workload_network_vm_group, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a vm group by id in a private cloud workload network. + + :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 vm_group_id: NSX VM Group identifier. Generally the same as the + VM Group's display name + :type vm_group_id: str + :param workload_network_vm_group: NSX VM Group + :type workload_network_vm_group: + ~azure.mgmt.avs.models.WorkloadNetworkVMGroup + :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 WorkloadNetworkVMGroup + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkVMGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._update_vm_group_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + vm_group_id=vm_group_id, + workload_network_vm_group=workload_network_vm_group, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkVMGroup', 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_vm_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'} + + + def _delete_vm_group_initial( + self, resource_group_name, vm_group_id, private_cloud_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_vm_group.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, pattern=r'^[-\w\._\(\)]+$'), + 'vmGroupId': self._serialize.url("vm_group_id", vm_group_id, 'str'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_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_vm_group( + self, resource_group_name, vm_group_id, private_cloud_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a vm group by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param vm_group_id: NSX VM Group identifier. Generally the same as the + VM Group's display name + :type vm_group_id: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_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_vm_group_initial( + resource_group_name=resource_group_name, + vm_group_id=vm_group_id, + private_cloud_name=private_cloud_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_vm_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'} + + def list_virtual_machines( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List of virtual machines in a private cloud workload network. + + :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 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 WorkloadNetworkVirtualMachine + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkVirtualMachinePaged[~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_virtual_machines.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, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_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.WorkloadNetworkVirtualMachinePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_virtual_machines.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines'}