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 e2c496724837..2a3f6763e709 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 @@ -19,6 +19,9 @@ from .operations import ClustersOperations from .operations import HcxEnterpriseSitesOperations from .operations import AuthorizationsOperations +from .operations import GlobalReachConnectionsOperations +from .operations import WorkloadNetworksOperations +from .operations import AddonsOperations from . import models @@ -40,6 +43,12 @@ 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 + :ivar addons: Addons operations + :vartype addons: azure.mgmt.avs.operations.AddonsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -56,7 +65,7 @@ def __init__( super(AVSClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2020-03-20' + self.api_version = '2020-07-17-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -72,3 +81,9 @@ 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) + self.addons = AddonsOperations( + 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 b17c4c0b6fef..9076cffb1bbd 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 @@ -10,15 +10,19 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import Addon + from ._models_py3 import AddonSrmProperties + from ._models_py3 import AddonUpdate from ._models_py3 import AdminCredentials from ._models_py3 import Circuit from ._models_py3 import Cluster from ._models_py3 import ClusterUpdate - from ._models_py3 import ClusterUpdateProperties + from ._models_py3 import CommonClusterProperties 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 LogSpecification @@ -30,22 +34,40 @@ from ._models_py3 import OperationProperties 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 ServiceSpecification from ._models_py3 import Sku 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 WorkloadNetworkDnsService + from ._models_py3 import WorkloadNetworkDnsZone + from ._models_py3 import WorkloadNetworkGateway + 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 Addon + from ._models import AddonSrmProperties + from ._models import AddonUpdate from ._models import AdminCredentials from ._models import Circuit from ._models import Cluster from ._models import ClusterUpdate - from ._models import ClusterUpdateProperties + from ._models import CommonClusterProperties 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 LogSpecification @@ -57,38 +79,83 @@ from ._models import OperationProperties from ._models import PrivateCloud from ._models import PrivateCloudUpdate + from ._models import ProxyResource from ._models import Quota from ._models import Resource from ._models import ServiceSpecification from ._models import Sku 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 WorkloadNetworkDnsService + from ._models import WorkloadNetworkDnsZone + from ._models import WorkloadNetworkGateway + 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 AddonPaged 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 WorkloadNetworkDhcpPaged +from ._paged_models import WorkloadNetworkDnsServicePaged +from ._paged_models import WorkloadNetworkDnsZonePaged +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, ExpressRouteAuthorizationProvisioningState, SslEnum, PrivateCloudProvisioningState, - ClusterProvisioningState, InternetEnum, + ClusterProvisioningState, + AddonType, + AddonProvisioningState, HcxEnterpriseSiteStatus, + GlobalReachConnectionProvisioningState, + GlobalReachConnectionStatus, + SegmentStatusEnum, + WorkloadNetworkSegmentProvisioningState, + WorkloadNetworkDhcpProvisioningState, + PortMirroringDirectionEnum, + PortMirroringStatusEnum, + WorkloadNetworkPortMirroringProvisioningState, + VMGroupStatusEnum, + WorkloadNetworkVMGroupProvisioningState, + VMTypeEnum, + DnsServiceLogLevelEnum, + DnsServiceStatusEnum, + WorkloadNetworkDnsServiceProvisioningState, + WorkloadNetworkDnsZoneProvisioningState, ) __all__ = [ + 'Addon', + 'AddonSrmProperties', + 'AddonUpdate', 'AdminCredentials', 'Circuit', 'Cluster', 'ClusterUpdate', - 'ClusterUpdateProperties', + 'CommonClusterProperties', 'Endpoints', 'ErrorAdditionalInfo', 'ErrorResponse', 'ExpressRouteAuthorization', + 'GlobalReachConnection', 'HcxEnterpriseSite', 'IdentitySource', 'LogSpecification', @@ -100,23 +167,64 @@ 'OperationProperties', 'PrivateCloud', 'PrivateCloudUpdate', + 'ProxyResource', 'Quota', 'Resource', 'ServiceSpecification', 'Sku', 'TrackedResource', 'Trial', + 'WorkloadNetworkDhcp', + 'WorkloadNetworkDhcpEntity', + 'WorkloadNetworkDhcpRelay', + 'WorkloadNetworkDhcpServer', + 'WorkloadNetworkDnsService', + 'WorkloadNetworkDnsZone', + 'WorkloadNetworkGateway', + 'WorkloadNetworkPortMirroring', + 'WorkloadNetworkSegment', + 'WorkloadNetworkSegmentPortVif', + 'WorkloadNetworkSegmentSubnet', + 'WorkloadNetworkVirtualMachine', + 'WorkloadNetworkVMGroup', 'OperationPaged', 'PrivateCloudPaged', 'ClusterPaged', 'HcxEnterpriseSitePaged', 'ExpressRouteAuthorizationPaged', + 'GlobalReachConnectionPaged', + 'WorkloadNetworkSegmentPaged', + 'WorkloadNetworkDhcpPaged', + 'WorkloadNetworkGatewayPaged', + 'WorkloadNetworkPortMirroringPaged', + 'WorkloadNetworkVMGroupPaged', + 'WorkloadNetworkVirtualMachinePaged', + 'WorkloadNetworkDnsServicePaged', + 'WorkloadNetworkDnsZonePaged', + 'AddonPaged', 'TrialStatus', 'QuotaEnabled', 'ExpressRouteAuthorizationProvisioningState', 'SslEnum', 'PrivateCloudProvisioningState', - 'ClusterProvisioningState', 'InternetEnum', + 'ClusterProvisioningState', + 'AddonType', + 'AddonProvisioningState', 'HcxEnterpriseSiteStatus', + 'GlobalReachConnectionProvisioningState', + 'GlobalReachConnectionStatus', + 'SegmentStatusEnum', + 'WorkloadNetworkSegmentProvisioningState', + 'WorkloadNetworkDhcpProvisioningState', + 'PortMirroringDirectionEnum', + 'PortMirroringStatusEnum', + 'WorkloadNetworkPortMirroringProvisioningState', + 'VMGroupStatusEnum', + 'WorkloadNetworkVMGroupProvisioningState', + 'VMTypeEnum', + 'DnsServiceLogLevelEnum', + 'DnsServiceStatusEnum', + 'WorkloadNetworkDnsServiceProvisioningState', + 'WorkloadNetworkDnsZoneProvisioningState', ] 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 153fc821f5f8..5df2f9413e18 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 @@ -49,6 +49,12 @@ class PrivateCloudProvisioningState(str, Enum): updating = "Updating" +class InternetEnum(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + class ClusterProvisioningState(str, Enum): succeeded = "Succeeded" @@ -58,10 +64,19 @@ class ClusterProvisioningState(str, Enum): updating = "Updating" -class InternetEnum(str, Enum): +class AddonType(str, Enum): - enabled = "Enabled" - disabled = "Disabled" + srm = "SRM" + vr = "VR" + + +class AddonProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + cancelled = "Cancelled" + deleting = "Deleting" + updating = "Updating" class HcxEnterpriseSiteStatus(str, Enum): @@ -70,3 +85,111 @@ 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" + + +class DnsServiceLogLevelEnum(str, Enum): + + debug = "DEBUG" + info = "INFO" + warning = "WARNING" + error = "ERROR" + fatal = "FATAL" + + +class DnsServiceStatusEnum(str, Enum): + + success = "SUCCESS" + failure = "FAILURE" + + +class WorkloadNetworkDnsServiceProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + building = "Building" + deleting = "Deleting" + updating = "Updating" + + +class WorkloadNetworkDnsZoneProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + building = "Building" + deleting = "Deleting" + updating = "Updating" 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 6c6c812af272..0cdffbdd37f8 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 @@ -13,6 +13,135 @@ from msrest.exceptions import HttpOperationError +class Resource(Model): + """The core properties of ARM resources. + + 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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Addon(Resource): + """An addon 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 + :param license_key: The SRM license + :type license_key: str + :param addon_type: The type of private cloud addon. Possible values + include: 'SRM', 'VR' + :type addon_type: str or ~azure.mgmt.avs.models.AddonType + :ivar provisioning_state: The state of the addon provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.AddonProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'license_key': {'key': 'properties.licenseKey', 'type': 'str'}, + 'addon_type': {'key': 'properties.addonType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Addon, self).__init__(**kwargs) + self.license_key = kwargs.get('license_key', None) + self.addon_type = kwargs.get('addon_type', None) + self.provisioning_state = None + + +class AddonSrmProperties(Model): + """The properties of an SRM addon that may be updated. + + :param license_key: The SRM license + :type license_key: str + """ + + _attribute_map = { + 'license_key': {'key': 'licenseKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AddonSrmProperties, self).__init__(**kwargs) + self.license_key = kwargs.get('license_key', None) + + +class AddonUpdate(Model): + """An update of an addon resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param license_key: The SRM license + :type license_key: str + :param addon_type: The type of private cloud addon. Possible values + include: 'SRM', 'VR' + :type addon_type: str or ~azure.mgmt.avs.models.AddonType + :ivar provisioning_state: The state of the addon provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.AddonProvisioningState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'license_key': {'key': 'properties.properties.licenseKey', 'type': 'str'}, + 'addon_type': {'key': 'properties.properties.addonType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AddonUpdate, self).__init__(**kwargs) + self.license_key = kwargs.get('license_key', None) + self.addon_type = kwargs.get('addon_type', None) + self.provisioning_state = None + + class AdminCredentials(Model): """Administrative credentials for accessing vCenter and NSX-T. @@ -119,39 +248,6 @@ def __init__(self, deserialize, response, *args): super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) -class Resource(Model): - """The core properties of ARM resources. - - 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(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - class Cluster(Resource): """A cluster resource. @@ -168,12 +264,12 @@ 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 - :type cluster_size: int - :param provisioning_state: The state of the cluster provisioning. Possible + :ivar provisioning_state: The state of the cluster provisioning. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' - :type provisioning_state: str or + :vartype provisioning_state: str or ~azure.mgmt.avs.models.ClusterProvisioningState + :param cluster_size: The cluster size + :type cluster_size: int :ivar cluster_id: The identity :vartype cluster_id: int :ivar hosts: The hosts @@ -185,6 +281,7 @@ class Cluster(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'sku': {'required': True}, + 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, 'hosts': {'readonly': True}, } @@ -194,8 +291,8 @@ class Cluster(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, - 'cluster_size': {'key': 'properties.clusterSize', 'type': 'int'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'cluster_size': {'key': 'properties.clusterSize', 'type': 'int'}, 'cluster_id': {'key': 'properties.clusterId', 'type': 'int'}, 'hosts': {'key': 'properties.hosts', 'type': '[str]'}, } @@ -203,8 +300,8 @@ class Cluster(Resource): def __init__(self, **kwargs): super(Cluster, self).__init__(**kwargs) self.sku = kwargs.get('sku', None) + self.provisioning_state = None self.cluster_size = kwargs.get('cluster_size', None) - self.provisioning_state = kwargs.get('provisioning_state', None) self.cluster_id = None self.hosts = None @@ -225,20 +322,43 @@ def __init__(self, **kwargs): self.cluster_size = kwargs.get('cluster_size', None) -class ClusterUpdateProperties(Model): - """The properties of a cluster that may be updated. +class CommonClusterProperties(Model): + """The common properties of a cluster. + + Variables are only populated by the server, and will be ignored when + sending a request. + :ivar provisioning_state: The state of the cluster provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.ClusterProvisioningState :param cluster_size: The cluster size :type cluster_size: int + :ivar cluster_id: The identity + :vartype cluster_id: int + :ivar hosts: The hosts + :vartype hosts: list[str] """ + _validation = { + 'provisioning_state': {'readonly': True}, + 'cluster_id': {'readonly': True}, + 'hosts': {'readonly': True}, + } + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, + 'cluster_id': {'key': 'clusterId', 'type': 'int'}, + 'hosts': {'key': 'hosts', 'type': '[str]'}, } def __init__(self, **kwargs): - super(ClusterUpdateProperties, self).__init__(**kwargs) + super(CommonClusterProperties, self).__init__(**kwargs) + self.provisioning_state = None self.cluster_size = kwargs.get('cluster_size', None) + self.cluster_id = None + self.hosts = None class Endpoints(Model): @@ -399,6 +519,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. @@ -519,18 +701,18 @@ def __init__(self, **kwargs): self.blob_duration = kwargs.get('blob_duration', None) -class ManagementCluster(ClusterUpdateProperties): - """The properties of a default cluster. +class ManagementCluster(CommonClusterProperties): + """The properties of a management cluster. Variables are only populated by the server, and will be ignored when sending a request. - :param cluster_size: The cluster size - :type cluster_size: int - :param provisioning_state: The state of the cluster provisioning. Possible + :ivar provisioning_state: The state of the cluster provisioning. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' - :type provisioning_state: str or + :vartype provisioning_state: str or ~azure.mgmt.avs.models.ClusterProvisioningState + :param cluster_size: The cluster size + :type cluster_size: int :ivar cluster_id: The identity :vartype cluster_id: int :ivar hosts: The hosts @@ -538,22 +720,20 @@ class ManagementCluster(ClusterUpdateProperties): """ _validation = { + 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, 'hosts': {'readonly': True}, } _attribute_map = { - 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, 'cluster_id': {'key': 'clusterId', 'type': 'int'}, 'hosts': {'key': 'hosts', 'type': '[str]'}, } def __init__(self, **kwargs): super(ManagementCluster, self).__init__(**kwargs) - self.provisioning_state = kwargs.get('provisioning_state', None) - self.cluster_id = None - self.hosts = None class MetricDimension(Model): @@ -563,17 +743,26 @@ class MetricDimension(Model): :type name: str :param display_name: Localized friendly display name of the dimension :type display_name: str + :param internal_name: Name of the dimension as it appears in MDM + :type internal_name: str + :param to_be_exported_for_shoebox: A boolean flag indicating whether this + dimension should be included for the shoebox export scenario + :type to_be_exported_for_shoebox: bool """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, } def __init__(self, **kwargs): super(MetricDimension, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.display_name = kwargs.get('display_name', None) + self.internal_name = kwargs.get('internal_name', None) + self.to_be_exported_for_shoebox = kwargs.get('to_be_exported_for_shoebox', None) class MetricSpecification(Model): @@ -802,7 +991,7 @@ class PrivateCloud(TrackedResource): :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 - values include: 'Enabled', 'Disabled' + values include: 'Enabled', 'Disabled'. Default value: "Disabled" . :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] @@ -884,7 +1073,7 @@ def __init__(self, **kwargs): super(PrivateCloud, self).__init__(**kwargs) self.sku = kwargs.get('sku', None) self.management_cluster = kwargs.get('management_cluster', None) - self.internet = kwargs.get('internet', None) + self.internet = kwargs.get('internet', "Disabled") self.identity_sources = kwargs.get('identity_sources', None) self.provisioning_state = None self.circuit = kwargs.get('circuit', None) @@ -902,12 +1091,12 @@ def __init__(self, **kwargs): class PrivateCloudUpdate(Model): """An update to a private cloud resource. - :param tags: Resource tags. + :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 - values include: 'Enabled', 'Disabled' + values include: 'Enabled', 'Disabled'. Default value: "Disabled" . :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] @@ -924,10 +1113,40 @@ 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.internet = kwargs.get('internet', "Disabled") self.identity_sources = kwargs.get('identity_sources', 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): """Subscription quotas. @@ -1028,3 +1247,627 @@ 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 WorkloadNetworkDnsService(ProxyResource): + """NSX DNS Service. + + 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 DNS Service. + :type display_name: str + :param dns_service_ip: DNS service IP of the DNS Service. + :type dns_service_ip: str + :param default_dns_zone: Default DNS zone of the DNS Service. + :type default_dns_zone: str + :param fqdn_zones: FQDN zones of the DNS Service. + :type fqdn_zones: list[str] + :param log_level: DNS Service log level. Possible values include: 'DEBUG', + 'INFO', 'WARNING', 'ERROR', 'FATAL' + :type log_level: str or ~azure.mgmt.avs.models.DnsServiceLogLevelEnum + :ivar status: DNS Service status. Possible values include: 'SUCCESS', + 'FAILURE' + :vartype status: str or ~azure.mgmt.avs.models.DnsServiceStatusEnum + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDnsServiceProvisioningState + :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'}, + 'dns_service_ip': {'key': 'properties.dnsServiceIp', 'type': 'str'}, + 'default_dns_zone': {'key': 'properties.defaultDnsZone', 'type': 'str'}, + 'fqdn_zones': {'key': 'properties.fqdnZones', 'type': '[str]'}, + 'log_level': {'key': 'properties.logLevel', '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(WorkloadNetworkDnsService, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.dns_service_ip = kwargs.get('dns_service_ip', None) + self.default_dns_zone = kwargs.get('default_dns_zone', None) + self.fqdn_zones = kwargs.get('fqdn_zones', None) + self.log_level = kwargs.get('log_level', None) + self.status = None + self.provisioning_state = None + self.revision = kwargs.get('revision', None) + + +class WorkloadNetworkDnsZone(ProxyResource): + """NSX DNS Zone. + + 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 DNS Zone. + :type display_name: str + :param domain: Domain names of the DNS Zone. + :type domain: list[str] + :param dns_server_ips: DNS Server IP array of the DNS Zone. + :type dns_server_ips: list[str] + :param source_ip: Source IP of the DNS Zone. + :type source_ip: str + :param dns_services: Number of DNS Services using the DNS zone. + :type dns_services: long + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDnsZoneProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'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'}, + 'domain': {'key': 'properties.domain', 'type': '[str]'}, + 'dns_server_ips': {'key': 'properties.dnsServerIps', 'type': '[str]'}, + 'source_ip': {'key': 'properties.sourceIp', 'type': 'str'}, + 'dns_services': {'key': 'properties.dnsServices', 'type': 'long'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkDnsZone, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.domain = kwargs.get('domain', None) + self.dns_server_ips = kwargs.get('dns_server_ips', None) + self.source_ip = kwargs.get('source_ip', None) + self.dns_services = kwargs.get('dns_services', None) + self.provisioning_state = None + self.revision = kwargs.get('revision', None) + + +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 display_name: Display name of the DHCP entity. + :type display_name: str + :ivar path: NSX Gateway Path. + :vartype path: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'path': {'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'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkGateway, 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: Subnet which to connect segment to. + :type subnet: ~azure.mgmt.avs.models.WorkloadNetworkSegmentSubnet + :ivar port_vif: Port Vif which segment is associated with. + :vartype port_vif: + list[~azure.mgmt.avs.models.WorkloadNetworkSegmentPortVif] + :ivar status: Segment status. Possible values include: 'SUCCESS, FAILURE' + :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 4fbfc42e0f42..a0be9abdfd3b 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 @@ -13,6 +13,135 @@ from msrest.exceptions import HttpOperationError +class Resource(Model): + """The core properties of ARM resources. + + 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(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Addon(Resource): + """An addon 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 + :param license_key: The SRM license + :type license_key: str + :param addon_type: The type of private cloud addon. Possible values + include: 'SRM', 'VR' + :type addon_type: str or ~azure.mgmt.avs.models.AddonType + :ivar provisioning_state: The state of the addon provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.AddonProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'license_key': {'key': 'properties.licenseKey', 'type': 'str'}, + 'addon_type': {'key': 'properties.addonType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, license_key: str=None, addon_type=None, **kwargs) -> None: + super(Addon, self).__init__(**kwargs) + self.license_key = license_key + self.addon_type = addon_type + self.provisioning_state = None + + +class AddonSrmProperties(Model): + """The properties of an SRM addon that may be updated. + + :param license_key: The SRM license + :type license_key: str + """ + + _attribute_map = { + 'license_key': {'key': 'licenseKey', 'type': 'str'}, + } + + def __init__(self, *, license_key: str=None, **kwargs) -> None: + super(AddonSrmProperties, self).__init__(**kwargs) + self.license_key = license_key + + +class AddonUpdate(Model): + """An update of an addon resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param license_key: The SRM license + :type license_key: str + :param addon_type: The type of private cloud addon. Possible values + include: 'SRM', 'VR' + :type addon_type: str or ~azure.mgmt.avs.models.AddonType + :ivar provisioning_state: The state of the addon provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.AddonProvisioningState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'license_key': {'key': 'properties.properties.licenseKey', 'type': 'str'}, + 'addon_type': {'key': 'properties.properties.addonType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, license_key: str=None, addon_type=None, **kwargs) -> None: + super(AddonUpdate, self).__init__(**kwargs) + self.license_key = license_key + self.addon_type = addon_type + self.provisioning_state = None + + class AdminCredentials(Model): """Administrative credentials for accessing vCenter and NSX-T. @@ -119,39 +248,6 @@ def __init__(self, deserialize, response, *args): super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) -class Resource(Model): - """The core properties of ARM resources. - - 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(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - class Cluster(Resource): """A cluster resource. @@ -168,12 +264,12 @@ 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 - :type cluster_size: int - :param provisioning_state: The state of the cluster provisioning. Possible + :ivar provisioning_state: The state of the cluster provisioning. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' - :type provisioning_state: str or + :vartype provisioning_state: str or ~azure.mgmt.avs.models.ClusterProvisioningState + :param cluster_size: The cluster size + :type cluster_size: int :ivar cluster_id: The identity :vartype cluster_id: int :ivar hosts: The hosts @@ -185,6 +281,7 @@ class Cluster(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'sku': {'required': True}, + 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, 'hosts': {'readonly': True}, } @@ -194,17 +291,17 @@ class Cluster(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, - 'cluster_size': {'key': 'properties.clusterSize', 'type': 'int'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'cluster_size': {'key': 'properties.clusterSize', 'type': 'int'}, 'cluster_id': {'key': 'properties.clusterId', 'type': 'int'}, 'hosts': {'key': 'properties.hosts', 'type': '[str]'}, } - def __init__(self, *, sku, cluster_size: int=None, provisioning_state=None, **kwargs) -> None: + def __init__(self, *, sku, cluster_size: int=None, **kwargs) -> None: super(Cluster, self).__init__(**kwargs) self.sku = sku + self.provisioning_state = None self.cluster_size = cluster_size - self.provisioning_state = provisioning_state self.cluster_id = None self.hosts = None @@ -225,20 +322,43 @@ def __init__(self, *, cluster_size: int=None, **kwargs) -> None: self.cluster_size = cluster_size -class ClusterUpdateProperties(Model): - """The properties of a cluster that may be updated. +class CommonClusterProperties(Model): + """The common properties of a cluster. + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the cluster provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.ClusterProvisioningState :param cluster_size: The cluster size :type cluster_size: int + :ivar cluster_id: The identity + :vartype cluster_id: int + :ivar hosts: The hosts + :vartype hosts: list[str] """ + _validation = { + 'provisioning_state': {'readonly': True}, + 'cluster_id': {'readonly': True}, + 'hosts': {'readonly': True}, + } + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, + 'cluster_id': {'key': 'clusterId', 'type': 'int'}, + 'hosts': {'key': 'hosts', 'type': '[str]'}, } def __init__(self, *, cluster_size: int=None, **kwargs) -> None: - super(ClusterUpdateProperties, self).__init__(**kwargs) + super(CommonClusterProperties, self).__init__(**kwargs) + self.provisioning_state = None self.cluster_size = cluster_size + self.cluster_id = None + self.hosts = None class Endpoints(Model): @@ -399,6 +519,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. @@ -519,18 +701,18 @@ def __init__(self, *, name: str=None, display_name: str=None, blob_duration: str self.blob_duration = blob_duration -class ManagementCluster(ClusterUpdateProperties): - """The properties of a default cluster. +class ManagementCluster(CommonClusterProperties): + """The properties of a management cluster. Variables are only populated by the server, and will be ignored when sending a request. - :param cluster_size: The cluster size - :type cluster_size: int - :param provisioning_state: The state of the cluster provisioning. Possible + :ivar provisioning_state: The state of the cluster provisioning. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' - :type provisioning_state: str or + :vartype provisioning_state: str or ~azure.mgmt.avs.models.ClusterProvisioningState + :param cluster_size: The cluster size + :type cluster_size: int :ivar cluster_id: The identity :vartype cluster_id: int :ivar hosts: The hosts @@ -538,22 +720,20 @@ class ManagementCluster(ClusterUpdateProperties): """ _validation = { + 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, 'hosts': {'readonly': True}, } _attribute_map = { - 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, 'cluster_id': {'key': 'clusterId', 'type': 'int'}, 'hosts': {'key': 'hosts', 'type': '[str]'}, } - def __init__(self, *, cluster_size: int=None, provisioning_state=None, **kwargs) -> None: + def __init__(self, *, cluster_size: int=None, **kwargs) -> None: super(ManagementCluster, self).__init__(cluster_size=cluster_size, **kwargs) - self.provisioning_state = provisioning_state - self.cluster_id = None - self.hosts = None class MetricDimension(Model): @@ -563,17 +743,26 @@ class MetricDimension(Model): :type name: str :param display_name: Localized friendly display name of the dimension :type display_name: str + :param internal_name: Name of the dimension as it appears in MDM + :type internal_name: str + :param to_be_exported_for_shoebox: A boolean flag indicating whether this + dimension should be included for the shoebox export scenario + :type to_be_exported_for_shoebox: bool """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, + 'internal_name': {'key': 'internalName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, } - def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + def __init__(self, *, name: str=None, display_name: str=None, internal_name: str=None, to_be_exported_for_shoebox: bool=None, **kwargs) -> None: super(MetricDimension, self).__init__(**kwargs) self.name = name self.display_name = display_name + self.internal_name = internal_name + self.to_be_exported_for_shoebox = to_be_exported_for_shoebox class MetricSpecification(Model): @@ -802,7 +991,7 @@ class PrivateCloud(TrackedResource): :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 - values include: 'Enabled', 'Disabled' + values include: 'Enabled', 'Disabled'. Default value: "Disabled" . :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] @@ -880,7 +1069,7 @@ class PrivateCloud(TrackedResource): '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="Disabled", identity_sources=None, circuit=None, vcenter_password: str=None, nsxt_password: str=None, **kwargs) -> None: super(PrivateCloud, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.management_cluster = management_cluster @@ -902,12 +1091,12 @@ 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. + :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 - values include: 'Enabled', 'Disabled' + values include: 'Enabled', 'Disabled'. Default value: "Disabled" . :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] @@ -920,7 +1109,7 @@ class PrivateCloudUpdate(Model): 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, } - def __init__(self, *, tags=None, management_cluster=None, internet=None, identity_sources=None, **kwargs) -> None: + def __init__(self, *, tags=None, management_cluster=None, internet="Disabled", identity_sources=None, **kwargs) -> None: super(PrivateCloudUpdate, self).__init__(**kwargs) self.tags = tags self.management_cluster = management_cluster @@ -928,6 +1117,36 @@ def __init__(self, *, tags=None, management_cluster=None, internet=None, identit self.identity_sources = identity_sources +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): """Subscription quotas. @@ -1028,3 +1247,627 @@ 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 WorkloadNetworkDnsService(ProxyResource): + """NSX DNS Service. + + 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 DNS Service. + :type display_name: str + :param dns_service_ip: DNS service IP of the DNS Service. + :type dns_service_ip: str + :param default_dns_zone: Default DNS zone of the DNS Service. + :type default_dns_zone: str + :param fqdn_zones: FQDN zones of the DNS Service. + :type fqdn_zones: list[str] + :param log_level: DNS Service log level. Possible values include: 'DEBUG', + 'INFO', 'WARNING', 'ERROR', 'FATAL' + :type log_level: str or ~azure.mgmt.avs.models.DnsServiceLogLevelEnum + :ivar status: DNS Service status. Possible values include: 'SUCCESS', + 'FAILURE' + :vartype status: str or ~azure.mgmt.avs.models.DnsServiceStatusEnum + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDnsServiceProvisioningState + :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'}, + 'dns_service_ip': {'key': 'properties.dnsServiceIp', 'type': 'str'}, + 'default_dns_zone': {'key': 'properties.defaultDnsZone', 'type': 'str'}, + 'fqdn_zones': {'key': 'properties.fqdnZones', 'type': '[str]'}, + 'log_level': {'key': 'properties.logLevel', '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, dns_service_ip: str=None, default_dns_zone: str=None, fqdn_zones=None, log_level=None, revision: int=None, **kwargs) -> None: + super(WorkloadNetworkDnsService, self).__init__(**kwargs) + self.display_name = display_name + self.dns_service_ip = dns_service_ip + self.default_dns_zone = default_dns_zone + self.fqdn_zones = fqdn_zones + self.log_level = log_level + self.status = None + self.provisioning_state = None + self.revision = revision + + +class WorkloadNetworkDnsZone(ProxyResource): + """NSX DNS Zone. + + 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 DNS Zone. + :type display_name: str + :param domain: Domain names of the DNS Zone. + :type domain: list[str] + :param dns_server_ips: DNS Server IP array of the DNS Zone. + :type dns_server_ips: list[str] + :param source_ip: Source IP of the DNS Zone. + :type source_ip: str + :param dns_services: Number of DNS Services using the DNS zone. + :type dns_services: long + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDnsZoneProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'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'}, + 'domain': {'key': 'properties.domain', 'type': '[str]'}, + 'dns_server_ips': {'key': 'properties.dnsServerIps', 'type': '[str]'}, + 'source_ip': {'key': 'properties.sourceIp', 'type': 'str'}, + 'dns_services': {'key': 'properties.dnsServices', 'type': 'long'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, *, display_name: str=None, domain=None, dns_server_ips=None, source_ip: str=None, dns_services: int=None, revision: int=None, **kwargs) -> None: + super(WorkloadNetworkDnsZone, self).__init__(**kwargs) + self.display_name = display_name + self.domain = domain + self.dns_server_ips = dns_server_ips + self.source_ip = source_ip + self.dns_services = dns_services + self.provisioning_state = None + self.revision = revision + + +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 display_name: Display name of the DHCP entity. + :type display_name: str + :ivar path: NSX Gateway Path. + :vartype path: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'path': {'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'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, **kwargs) -> None: + super(WorkloadNetworkGateway, 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: Subnet which to connect segment to. + :type subnet: ~azure.mgmt.avs.models.WorkloadNetworkSegmentSubnet + :ivar port_vif: Port Vif which segment is associated with. + :vartype port_vif: + list[~azure.mgmt.avs.models.WorkloadNetworkSegmentPortVif] + :ivar status: Segment status. Possible values include: 'SUCCESS, FAILURE' + :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 874c91b84a94..13d063d0374c 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 @@ -77,3 +77,133 @@ 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) +class WorkloadNetworkDnsServicePaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkDnsService ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkDnsService]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkDnsServicePaged, self).__init__(*args, **kwargs) +class WorkloadNetworkDnsZonePaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkDnsZone ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkDnsZone]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkDnsZonePaged, self).__init__(*args, **kwargs) +class AddonPaged(Paged): + """ + A paging container for iterating over a list of :class:`Addon ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Addon]'} + } + + def __init__(self, *args, **kwargs): + + super(AddonPaged, 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 f8c122b9ef0c..c72025bbeea3 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 @@ -15,6 +15,9 @@ 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 +from ._addons_operations import AddonsOperations __all__ = [ 'Operations', @@ -23,4 +26,7 @@ 'ClustersOperations', 'HcxEnterpriseSitesOperations', 'AuthorizationsOperations', + 'GlobalReachConnectionsOperations', + 'WorkloadNetworksOperations', + 'AddonsOperations', ] diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py new file mode 100644 index 000000000000..76d2dc90ec62 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py @@ -0,0 +1,377 @@ +# 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 AddonsOperations(object): + """AddonsOperations 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 addons 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 Addon + :rtype: + ~azure.mgmt.avs.models.AddonPaged[~azure.mgmt.avs.models.Addon] + :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.AddonPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons'} + + def get( + self, resource_group_name, private_cloud_name, addon_name, custom_headers=None, raw=False, **operation_config): + """Get an addon 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 addon_name: Name of the addon for the private cloud + :type addon_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: Addon or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.Addon 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'), + 'addonName': self._serialize.url("addon_name", addon_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('Addon', 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}/addons/{addonName}'} + + + def _create_or_update_initial( + self, resource_group_name, private_cloud_name, addon_name, license_key=None, addon_type=None, custom_headers=None, raw=False, **operation_config): + addon = models.Addon(license_key=license_key, addon_type=addon_type) + + # 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'), + 'addonName': self._serialize.url("addon_name", addon_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(addon, 'Addon') + + # 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('Addon', response) + if response.status_code == 201: + deserialized = self._deserialize('Addon', 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, addon_name, license_key=None, addon_type=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a addon 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 addon_name: Name of the addon for the private cloud + :type addon_name: str + :param license_key: The SRM license + :type license_key: str + :param addon_type: The type of private cloud addon. Possible values + include: 'SRM', 'VR' + :type addon_type: str or ~azure.mgmt.avs.models.AddonType + :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 Addon or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.Addon] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.Addon]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + addon_name=addon_name, + license_key=license_key, + addon_type=addon_type, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Addon', 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}/addons/{addonName}'} + + + def _delete_initial( + self, resource_group_name, private_cloud_name, addon_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'), + 'addonName': self._serialize.url("addon_name", addon_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, addon_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a addon 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 addon_name: Name of the addon for the private cloud + :type addon_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, + addon_name=addon_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}/addons/{addonName}'} 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 ae761e630faa..7d6aab092f9e 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 @@ -182,7 +182,9 @@ def get( def _create_or_update_initial( - self, resource_group_name, private_cloud_name, authorization_name, authorization, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, private_cloud_name, authorization_name, custom_headers=None, raw=False, **operation_config): + authorization = None + # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -209,7 +211,7 @@ def _create_or_update_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(authorization, 'object') + body_content = self._serialize.body(authorization, 'ExpressRouteAuthorization') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -234,7 +236,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, private_cloud_name, authorization_name, authorization, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, private_cloud_name, authorization_name, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update an ExpressRoute Circuit Authorization in a private cloud. @@ -246,8 +248,6 @@ def create_or_update( :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud :type authorization_name: str - :param authorization: An ExpressRoute Circuit Authorization - :type authorization: object :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,7 +266,6 @@ def create_or_update( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, authorization_name=authorization_name, - authorization=authorization, custom_headers=custom_headers, raw=True, **operation_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 b8a0b62774b7..12b01e5de6a0 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,7 +181,9 @@ def get( def _create_or_update_initial( - self, resource_group_name, private_cloud_name, cluster_name, cluster, custom_headers=None, raw=False, **operation_config): + 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) + # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -233,7 +235,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, private_cloud_name, cluster_name, cluster, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, private_cloud_name, cluster_name, sku, cluster_size=None, 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 @@ -243,8 +245,10 @@ 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 cluster: A cluster in the private cloud - :type cluster: ~azure.mgmt.avs.models.Cluster + :param sku: The cluster SKU + :type sku: ~azure.mgmt.avs.models.Sku + :param cluster_size: The cluster size + :type cluster_size: int :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -262,7 +266,8 @@ def create_or_update( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, cluster_name=cluster_name, - cluster=cluster, + sku=sku, + cluster_size=cluster_size, custom_headers=custom_headers, raw=True, **operation_config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py new file mode 100644 index 000000000000..e0de4630e3e8 --- /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 2a6b139c72e3..697dc5e7de45 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 @@ -179,7 +179,7 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}'} def create_or_update( - self, resource_group_name, private_cloud_name, hcx_enterprise_site_name, hcx_enterprise_site, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, private_cloud_name, hcx_enterprise_site_name, custom_headers=None, raw=False, **operation_config): """Create or update an HCX Enterprise Site in a private cloud. :param resource_group_name: The name of the resource group. The name @@ -190,8 +190,6 @@ def create_or_update( :param hcx_enterprise_site_name: Name of the HCX Enterprise Site in the private cloud :type hcx_enterprise_site_name: str - :param hcx_enterprise_site: The HCX Enterprise Site - :type hcx_enterprise_site: object :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -202,6 +200,8 @@ def create_or_update( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + hcx_enterprise_site = None + # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -228,7 +228,7 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(hcx_enterprise_site, 'object') + body_content = self._serialize.body(hcx_enterprise_site, 'HcxEnterpriseSite') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) 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 6d8d140021c9..7d96e4b72311 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 2e02064516c0..fdafc20e1d94 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 128a4596f79b..44728abf5a91 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 @@ -526,6 +526,166 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}'} + + def _rotate_vcenter_password_initial( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.rotate_vcenter_password.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) + + # 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [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 rotate_vcenter_password( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Rotate the vCenter password. + + :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: 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._rotate_vcenter_password_initial( + resource_group_name=resource_group_name, + 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) + rotate_vcenter_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword'} + + + def _rotate_nsxt_password_initial( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.rotate_nsxt_password.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) + + # 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [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 rotate_nsxt_password( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Rotate the NSX-T Manager password. + + :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: 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._rotate_nsxt_password_initial( + resource_group_name=resource_group_name, + 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) + rotate_nsxt_password.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword'} + def list_admin_credentials( self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): """List the admin credentials for the private cloud. 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 000000000000..382e0ee82d94 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py @@ -0,0 +1,2976 @@ +# 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 get_gateway( + self, resource_group_name, private_cloud_name, gateway_id, custom_headers=None, raw=False, **operation_config): + """Get a gateway 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 gateway_id: NSX Gateway identifier. Generally the same as the + Gateway's display name + :type gateway_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: WorkloadNetworkGateway or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkGateway or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_gateway.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'), + 'gatewayId': self._serialize.url("gateway_id", gateway_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('WorkloadNetworkGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}'} + + 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'} + + def get_virtual_machine( + self, resource_group_name, private_cloud_name, virtual_machine_id, custom_headers=None, raw=False, **operation_config): + """Get a virtual machine 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 virtual_machine_id: NSX Virtual Machine identifier. + :type virtual_machine_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WorkloadNetworkVirtualMachine or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_virtual_machine.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'), + 'virtualMachineId': self._serialize.url("virtual_machine_id", virtual_machine_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkVirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_virtual_machine.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}'} + + def list_dns_services( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List of DNS services 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 WorkloadNetworkDnsService + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkDnsServicePaged[~azure.mgmt.avs.models.WorkloadNetworkDnsService] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_dns_services.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.WorkloadNetworkDnsServicePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_dns_services.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices'} + + def get_dns_service( + self, resource_group_name, private_cloud_name, dns_service_id, custom_headers=None, raw=False, **operation_config): + """Get a DNS service 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 dns_service_id: NSX DNS Service identifier. Generally the same + as the DNS Service's display name + :type dns_service_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: WorkloadNetworkDnsService or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDnsService or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_dns_service.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'), + 'dnsServiceId': self._serialize.url("dns_service_id", dns_service_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('WorkloadNetworkDnsService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_dns_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'} + + + def _create_dns_service_initial( + self, resource_group_name, private_cloud_name, dns_service_id, workload_network_dns_service, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_dns_service.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'), + 'dnsServiceId': self._serialize.url("dns_service_id", dns_service_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_dns_service, 'WorkloadNetworkDnsService') + + # 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('WorkloadNetworkDnsService', response) + if response.status_code == 201: + deserialized = self._deserialize('WorkloadNetworkDnsService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_dns_service( + self, resource_group_name, private_cloud_name, dns_service_id, workload_network_dns_service, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a DNS service 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 dns_service_id: NSX DNS Service identifier. Generally the same + as the DNS Service's display name + :type dns_service_id: str + :param workload_network_dns_service: NSX DNS Service + :type workload_network_dns_service: + ~azure.mgmt.avs.models.WorkloadNetworkDnsService + :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 + WorkloadNetworkDnsService or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkDnsService]] + :raises: :class:`CloudError` + """ + raw_result = self._create_dns_service_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + dns_service_id=dns_service_id, + workload_network_dns_service=workload_network_dns_service, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkDnsService', 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_dns_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'} + + + def _update_dns_service_initial( + self, resource_group_name, private_cloud_name, dns_service_id, workload_network_dns_service, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update_dns_service.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'), + 'dnsServiceId': self._serialize.url("dns_service_id", dns_service_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_dns_service, 'WorkloadNetworkDnsService') + + # 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('WorkloadNetworkDnsService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_dns_service( + self, resource_group_name, private_cloud_name, dns_service_id, workload_network_dns_service, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a DNS service 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 dns_service_id: NSX DNS Service identifier. Generally the same + as the DNS Service's display name + :type dns_service_id: str + :param workload_network_dns_service: NSX DNS Service + :type workload_network_dns_service: + ~azure.mgmt.avs.models.WorkloadNetworkDnsService + :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 + WorkloadNetworkDnsService or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsService] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkDnsService]] + :raises: :class:`CloudError` + """ + raw_result = self._update_dns_service_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + dns_service_id=dns_service_id, + workload_network_dns_service=workload_network_dns_service, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkDnsService', 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_dns_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'} + + + def _delete_dns_service_initial( + self, resource_group_name, dns_service_id, private_cloud_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_dns_service.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\._\(\)]+$'), + 'dnsServiceId': self._serialize.url("dns_service_id", dns_service_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_dns_service( + self, resource_group_name, dns_service_id, private_cloud_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a DNS service 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 dns_service_id: NSX DNS Service identifier. Generally the same + as the DNS Service's display name + :type dns_service_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_dns_service_initial( + resource_group_name=resource_group_name, + dns_service_id=dns_service_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_dns_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'} + + def list_dns_zones( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List of DNS zones 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 WorkloadNetworkDnsZone + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkDnsZonePaged[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_dns_zones.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.WorkloadNetworkDnsZonePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_dns_zones.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones'} + + def get_dns_zone( + self, resource_group_name, private_cloud_name, dns_zone_id, custom_headers=None, raw=False, **operation_config): + """Get a DNS zone 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 dns_zone_id: NSX DNS Zone identifier. Generally the same as the + DNS Zone's display name + :type dns_zone_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: WorkloadNetworkDnsZone or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDnsZone or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_dns_zone.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'), + 'dnsZoneId': self._serialize.url("dns_zone_id", dns_zone_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('WorkloadNetworkDnsZone', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_dns_zone.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'} + + + def _create_dns_zone_initial( + self, resource_group_name, private_cloud_name, dns_zone_id, workload_network_dns_zone, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_dns_zone.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'), + 'dnsZoneId': self._serialize.url("dns_zone_id", dns_zone_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_dns_zone, 'WorkloadNetworkDnsZone') + + # 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('WorkloadNetworkDnsZone', response) + if response.status_code == 201: + deserialized = self._deserialize('WorkloadNetworkDnsZone', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_dns_zone( + self, resource_group_name, private_cloud_name, dns_zone_id, workload_network_dns_zone, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a DNS zone 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 dns_zone_id: NSX DNS Zone identifier. Generally the same as the + DNS Zone's display name + :type dns_zone_id: str + :param workload_network_dns_zone: NSX DNS Zone + :type workload_network_dns_zone: + ~azure.mgmt.avs.models.WorkloadNetworkDnsZone + :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 WorkloadNetworkDnsZone + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkDnsZone]] + :raises: :class:`CloudError` + """ + raw_result = self._create_dns_zone_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + dns_zone_id=dns_zone_id, + workload_network_dns_zone=workload_network_dns_zone, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkDnsZone', 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_dns_zone.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'} + + + def _update_dns_zone_initial( + self, resource_group_name, private_cloud_name, dns_zone_id, workload_network_dns_zone, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update_dns_zone.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'), + 'dnsZoneId': self._serialize.url("dns_zone_id", dns_zone_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_dns_zone, 'WorkloadNetworkDnsZone') + + # 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('WorkloadNetworkDnsZone', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_dns_zone( + self, resource_group_name, private_cloud_name, dns_zone_id, workload_network_dns_zone, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a DNS zone 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 dns_zone_id: NSX DNS Zone identifier. Generally the same as the + DNS Zone's display name + :type dns_zone_id: str + :param workload_network_dns_zone: NSX DNS Zone + :type workload_network_dns_zone: + ~azure.mgmt.avs.models.WorkloadNetworkDnsZone + :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 WorkloadNetworkDnsZone + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkDnsZone] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkDnsZone]] + :raises: :class:`CloudError` + """ + raw_result = self._update_dns_zone_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + dns_zone_id=dns_zone_id, + workload_network_dns_zone=workload_network_dns_zone, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkDnsZone', 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_dns_zone.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'} + + + def _delete_dns_zone_initial( + self, resource_group_name, dns_zone_id, private_cloud_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_dns_zone.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\._\(\)]+$'), + 'dnsZoneId': self._serialize.url("dns_zone_id", dns_zone_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_dns_zone( + self, resource_group_name, dns_zone_id, private_cloud_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a DNS zone 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 dns_zone_id: NSX DNS Zone identifier. Generally the same as the + DNS Zone's display name + :type dns_zone_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_dns_zone_initial( + resource_group_name=resource_group_name, + dns_zone_id=dns_zone_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_dns_zone.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'}