diff --git a/sdk/compute/azure-mgmt-avs/MANIFEST.in b/sdk/compute/azure-mgmt-avs/MANIFEST.in index a3cb07df87658..3a9b6517412bc 100644 --- a/sdk/compute/azure-mgmt-avs/MANIFEST.in +++ b/sdk/compute/azure-mgmt-avs/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/compute/azure-mgmt-avs/_meta.json b/sdk/compute/azure-mgmt-avs/_meta.json new file mode 100644 index 0000000000000..883fa21e92b65 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "1d53085a5bf835189b3ec91126edb093e1c24fee", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/vmware/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/vmware/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py index e2c4967248372..e8a8d3b541ba6 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 @@ -17,8 +17,16 @@ from .operations import LocationsOperations from .operations import PrivateCloudsOperations from .operations import ClustersOperations +from .operations import DatastoresOperations from .operations import HcxEnterpriseSitesOperations from .operations import AuthorizationsOperations +from .operations import GlobalReachConnectionsOperations +from .operations import WorkloadNetworksOperations +from .operations import CloudLinksOperations +from .operations import AddonsOperations +from .operations import ScriptPackagesOperations +from .operations import ScriptCmdletsOperations +from .operations import ScriptExecutionsOperations from . import models @@ -36,10 +44,26 @@ class AVSClient(SDKClient): :vartype private_clouds: azure.mgmt.avs.operations.PrivateCloudsOperations :ivar clusters: Clusters operations :vartype clusters: azure.mgmt.avs.operations.ClustersOperations + :ivar datastores: Datastores operations + :vartype datastores: azure.mgmt.avs.operations.DatastoresOperations :ivar hcx_enterprise_sites: HcxEnterpriseSites operations :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 cloud_links: CloudLinks operations + :vartype cloud_links: azure.mgmt.avs.operations.CloudLinksOperations + :ivar addons: Addons operations + :vartype addons: azure.mgmt.avs.operations.AddonsOperations + :ivar script_packages: ScriptPackages operations + :vartype script_packages: azure.mgmt.avs.operations.ScriptPackagesOperations + :ivar script_cmdlets: ScriptCmdlets operations + :vartype script_cmdlets: azure.mgmt.avs.operations.ScriptCmdletsOperations + :ivar script_executions: ScriptExecutions operations + :vartype script_executions: azure.mgmt.avs.operations.ScriptExecutionsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -56,7 +80,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 = '2021-06-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -68,7 +92,23 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.clusters = ClustersOperations( self._client, self.config, self._serialize, self._deserialize) + self.datastores = DatastoresOperations( + self._client, self.config, self._serialize, self._deserialize) self.hcx_enterprise_sites = HcxEnterpriseSitesOperations( 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.cloud_links = CloudLinksOperations( + self._client, self.config, self._serialize, self._deserialize) + self.addons = AddonsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.script_packages = ScriptPackagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.script_cmdlets = ScriptCmdletsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.script_executions = ScriptExecutionsOperations( + 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 b17c4c0b6fef5..2753da60813cc 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,113 +10,294 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import Addon + from ._models_py3 import AddonHcxProperties + from ._models_py3 import AddonProperties + from ._models_py3 import AddonSrmProperties + from ._models_py3 import AddonVrProperties from ._models_py3 import AdminCredentials from ._models_py3 import Circuit + from ._models_py3 import CloudLink from ._models_py3 import Cluster from ._models_py3 import ClusterUpdate - from ._models_py3 import ClusterUpdateProperties + from ._models_py3 import CommonClusterProperties + from ._models_py3 import Datastore + from ._models_py3 import DiskPoolVolume 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 from ._models_py3 import ManagementCluster from ._models_py3 import MetricDimension from ._models_py3 import MetricSpecification + from ._models_py3 import NetAppVolume from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationProperties from ._models_py3 import PrivateCloud from ._models_py3 import PrivateCloudUpdate + from ._models_py3 import ProxyResource + from ._models_py3 import PSCredentialExecutionParameter from ._models_py3 import Quota from ._models_py3 import Resource + from ._models_py3 import ScriptCmdlet + from ._models_py3 import ScriptExecution + from ._models_py3 import ScriptExecutionParameter + from ._models_py3 import ScriptPackage + from ._models_py3 import ScriptParameter + from ._models_py3 import ScriptSecureStringExecutionParameter + from ._models_py3 import ScriptStringExecutionParameter 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 WorkloadNetworkPublicIP + 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 AddonHcxProperties + from ._models import AddonProperties + from ._models import AddonSrmProperties + from ._models import AddonVrProperties from ._models import AdminCredentials from ._models import Circuit + from ._models import CloudLink from ._models import Cluster from ._models import ClusterUpdate - from ._models import ClusterUpdateProperties + from ._models import CommonClusterProperties + from ._models import Datastore + from ._models import DiskPoolVolume 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 from ._models import ManagementCluster from ._models import MetricDimension from ._models import MetricSpecification + from ._models import NetAppVolume from ._models import Operation from ._models import OperationDisplay from ._models import OperationProperties from ._models import PrivateCloud from ._models import PrivateCloudUpdate + from ._models import ProxyResource + from ._models import PSCredentialExecutionParameter from ._models import Quota from ._models import Resource + from ._models import ScriptCmdlet + from ._models import ScriptExecution + from ._models import ScriptExecutionParameter + from ._models import ScriptPackage + from ._models import ScriptParameter + from ._models import ScriptSecureStringExecutionParameter + from ._models import ScriptStringExecutionParameter 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 WorkloadNetworkPublicIP + 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 CloudLinkPaged from ._paged_models import ClusterPaged +from ._paged_models import DatastorePaged 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 ScriptCmdletPaged +from ._paged_models import ScriptExecutionPaged +from ._paged_models import ScriptPackagePaged +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 WorkloadNetworkPublicIPPaged +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, + AddonProvisioningState, + DatastoreProvisioningState, + MountOptionEnum, HcxEnterpriseSiteStatus, + GlobalReachConnectionProvisioningState, + GlobalReachConnectionStatus, + CloudLinkStatus, + SegmentStatusEnum, + WorkloadNetworkSegmentProvisioningState, + WorkloadNetworkDhcpProvisioningState, + PortMirroringDirectionEnum, + PortMirroringStatusEnum, + WorkloadNetworkPortMirroringProvisioningState, + VMGroupStatusEnum, + WorkloadNetworkVMGroupProvisioningState, + VMTypeEnum, + DnsServiceLogLevelEnum, + DnsServiceStatusEnum, + WorkloadNetworkDnsServiceProvisioningState, + WorkloadNetworkDnsZoneProvisioningState, + WorkloadNetworkPublicIPProvisioningState, + ScriptParameterTypes, + VisibilityParameterEnum, + OptionalParamEnum, + ScriptExecutionProvisioningState, + ScriptOutputStreamType, ) __all__ = [ + 'Addon', + 'AddonHcxProperties', + 'AddonProperties', + 'AddonSrmProperties', + 'AddonVrProperties', 'AdminCredentials', 'Circuit', + 'CloudLink', 'Cluster', 'ClusterUpdate', - 'ClusterUpdateProperties', + 'CommonClusterProperties', + 'Datastore', + 'DiskPoolVolume', 'Endpoints', 'ErrorAdditionalInfo', 'ErrorResponse', 'ExpressRouteAuthorization', + 'GlobalReachConnection', 'HcxEnterpriseSite', 'IdentitySource', 'LogSpecification', 'ManagementCluster', 'MetricDimension', 'MetricSpecification', + 'NetAppVolume', 'Operation', 'OperationDisplay', 'OperationProperties', 'PrivateCloud', 'PrivateCloudUpdate', + 'ProxyResource', + 'PSCredentialExecutionParameter', 'Quota', 'Resource', + 'ScriptCmdlet', + 'ScriptExecution', + 'ScriptExecutionParameter', + 'ScriptPackage', + 'ScriptParameter', + 'ScriptSecureStringExecutionParameter', + 'ScriptStringExecutionParameter', 'ServiceSpecification', 'Sku', 'TrackedResource', 'Trial', + 'WorkloadNetworkDhcp', + 'WorkloadNetworkDhcpEntity', + 'WorkloadNetworkDhcpRelay', + 'WorkloadNetworkDhcpServer', + 'WorkloadNetworkDnsService', + 'WorkloadNetworkDnsZone', + 'WorkloadNetworkGateway', + 'WorkloadNetworkPortMirroring', + 'WorkloadNetworkPublicIP', + 'WorkloadNetworkSegment', + 'WorkloadNetworkSegmentPortVif', + 'WorkloadNetworkSegmentSubnet', + 'WorkloadNetworkVirtualMachine', + 'WorkloadNetworkVMGroup', 'OperationPaged', 'PrivateCloudPaged', 'ClusterPaged', + 'DatastorePaged', 'HcxEnterpriseSitePaged', 'ExpressRouteAuthorizationPaged', + 'GlobalReachConnectionPaged', + 'WorkloadNetworkSegmentPaged', + 'WorkloadNetworkDhcpPaged', + 'WorkloadNetworkGatewayPaged', + 'WorkloadNetworkPortMirroringPaged', + 'WorkloadNetworkVMGroupPaged', + 'WorkloadNetworkVirtualMachinePaged', + 'WorkloadNetworkDnsServicePaged', + 'WorkloadNetworkDnsZonePaged', + 'WorkloadNetworkPublicIPPaged', + 'CloudLinkPaged', + 'AddonPaged', + 'ScriptPackagePaged', + 'ScriptCmdletPaged', + 'ScriptExecutionPaged', 'TrialStatus', 'QuotaEnabled', 'ExpressRouteAuthorizationProvisioningState', 'SslEnum', 'PrivateCloudProvisioningState', - 'ClusterProvisioningState', 'InternetEnum', + 'ClusterProvisioningState', + 'AddonProvisioningState', + 'DatastoreProvisioningState', + 'MountOptionEnum', 'HcxEnterpriseSiteStatus', + 'GlobalReachConnectionProvisioningState', + 'GlobalReachConnectionStatus', + 'CloudLinkStatus', + 'SegmentStatusEnum', + 'WorkloadNetworkSegmentProvisioningState', + 'WorkloadNetworkDhcpProvisioningState', + 'PortMirroringDirectionEnum', + 'PortMirroringStatusEnum', + 'WorkloadNetworkPortMirroringProvisioningState', + 'VMGroupStatusEnum', + 'WorkloadNetworkVMGroupProvisioningState', + 'VMTypeEnum', + 'DnsServiceLogLevelEnum', + 'DnsServiceStatusEnum', + 'WorkloadNetworkDnsServiceProvisioningState', + 'WorkloadNetworkDnsZoneProvisioningState', + 'WorkloadNetworkPublicIPProvisioningState', + 'ScriptParameterTypes', + 'VisibilityParameterEnum', + 'OptionalParamEnum', + 'ScriptExecutionProvisioningState', + 'ScriptOutputStreamType', ] 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 153fc821f5f8a..aa990cdd6a3c9 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,31 @@ class ClusterProvisioningState(str, Enum): updating = "Updating" -class InternetEnum(str, Enum): +class AddonProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + cancelled = "Cancelled" + building = "Building" + deleting = "Deleting" + updating = "Updating" - enabled = "Enabled" - disabled = "Disabled" + +class DatastoreProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + cancelled = "Cancelled" + pending = "Pending" + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + + +class MountOptionEnum(str, Enum): + + mount = "MOUNT" + attach = "ATTACH" class HcxEnterpriseSiteStatus(str, Enum): @@ -70,3 +97,170 @@ 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 CloudLinkStatus(str, Enum): + + active = "Active" + building = "Building" + deleting = "Deleting" + failed = "Failed" + 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" + + +class WorkloadNetworkPublicIPProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + building = "Building" + deleting = "Deleting" + updating = "Updating" + + +class ScriptParameterTypes(str, Enum): + + string = "String" + secure_string = "SecureString" + credential = "Credential" + int_enum = "Int" + bool_enum = "Bool" + float_enum = "Float" + + +class VisibilityParameterEnum(str, Enum): + + visible = "Visible" + hidden = "Hidden" + + +class OptionalParamEnum(str, Enum): + + optional = "Optional" + required = "Required" + + +class ScriptExecutionProvisioningState(str, Enum): + + pending = "Pending" + running = "Running" + succeeded = "Succeeded" + failed = "Failed" + cancelling = "Cancelling" + cancelled = "Cancelled" + deleting = "Deleting" + + +class ScriptOutputStreamType(str, Enum): + + information = "Information" + warning = "Warning" + output = "Output" + error = "Error" 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 6c6c812af272c..f8741fa7d7e23 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,225 @@ 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 properties: The properties of an addon resource + :type properties: ~azure.mgmt.avs.models.AddonProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'AddonProperties'}, + } + + def __init__(self, **kwargs): + super(Addon, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class AddonProperties(Model): + """The properties of an addon. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AddonSrmProperties, AddonVrProperties, AddonHcxProperties + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The state of the addon provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Building', + 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.AddonProvisioningState + :param addon_type: Required. Constant filled by server. + :type addon_type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'addon_type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'addon_type': {'key': 'addonType', 'type': 'str'}, + } + + _subtype_map = { + 'addon_type': {'SRM': 'AddonSrmProperties', 'VR': 'AddonVrProperties', 'HCX': 'AddonHcxProperties'} + } + + def __init__(self, **kwargs): + super(AddonProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.addon_type = None + + +class AddonHcxProperties(AddonProperties): + """The properties of an HCX addon. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The state of the addon provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Building', + 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.AddonProvisioningState + :param addon_type: Required. Constant filled by server. + :type addon_type: str + :param offer: Required. The HCX offer, example VMware MaaS Cloud Provider + (Enterprise) + :type offer: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'addon_type': {'required': True}, + 'offer': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'addon_type': {'key': 'addonType', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AddonHcxProperties, self).__init__(**kwargs) + self.offer = kwargs.get('offer', None) + self.addon_type = 'HCX' + + +class AddonSrmProperties(AddonProperties): + """The properties of a Site Recovery Manager (SRM) addon. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The state of the addon provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Building', + 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.AddonProvisioningState + :param addon_type: Required. Constant filled by server. + :type addon_type: str + :param license_key: Required. The Site Recovery Manager (SRM) license + :type license_key: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'addon_type': {'required': True}, + 'license_key': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'addon_type': {'key': 'addonType', 'type': 'str'}, + 'license_key': {'key': 'licenseKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AddonSrmProperties, self).__init__(**kwargs) + self.license_key = kwargs.get('license_key', None) + self.addon_type = 'SRM' + + +class AddonVrProperties(AddonProperties): + """The properties of a vSphere Replication (VR) addon. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The state of the addon provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Building', + 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.AddonProvisioningState + :param addon_type: Required. Constant filled by server. + :type addon_type: str + :param vrs_count: Required. The vSphere Replication Server (VRS) count + :type vrs_count: int + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'addon_type': {'required': True}, + 'vrs_count': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'addon_type': {'key': 'addonType', 'type': 'str'}, + 'vrs_count': {'key': 'vrsCount', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AddonVrProperties, self).__init__(**kwargs) + self.vrs_count = kwargs.get('vrs_count', None) + self.addon_type = 'VR' + + class AdminCredentials(Model): """Administrative credentials for accessing vCenter and NSX-T. @@ -119,8 +338,8 @@ def __init__(self, deserialize, response, *args): super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) -class Resource(Model): - """The core properties of ARM resources. +class CloudLink(Resource): + """A cloud link resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -131,25 +350,33 @@ class Resource(Model): :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar status: The state of the cloud link. Possible values include: + 'Active', 'Building', 'Deleting', 'Failed', 'Disconnected' + :vartype status: str or ~azure.mgmt.avs.models.CloudLinkStatus + :param linked_cloud: Identifier of the other private cloud participating + in the link. + :type linked_cloud: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'linked_cloud': {'key': 'properties.linkedCloud', 'type': 'str'}, } def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None + super(CloudLink, self).__init__(**kwargs) + self.status = None + self.linked_cloud = kwargs.get('linked_cloud', None) class Cluster(Resource): @@ -168,12 +395,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 values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' :type 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 @@ -194,8 +421,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 +430,8 @@ class Cluster(Resource): def __init__(self, **kwargs): super(Cluster, self).__init__(**kwargs) self.sku = kwargs.get('sku', None) - self.cluster_size = kwargs.get('cluster_size', None) self.provisioning_state = kwargs.get('provisioning_state', None) + self.cluster_size = kwargs.get('cluster_size', None) self.cluster_id = None self.hosts = None @@ -225,20 +452,129 @@ 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. + :param provisioning_state: The state of the cluster provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + :type 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 = { + '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 = kwargs.get('provisioning_state', None) self.cluster_size = kwargs.get('cluster_size', None) + self.cluster_id = None + self.hosts = None + + +class Datastore(Resource): + """A datastore 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 datastore provisioning. + Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Pending', + 'Creating', 'Updating', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.DatastoreProvisioningState + :param net_app_volume: An Azure NetApp Files volume + :type net_app_volume: ~azure.mgmt.avs.models.NetAppVolume + :param disk_pool_volume: An iSCSI volume + :type disk_pool_volume: ~azure.mgmt.avs.models.DiskPoolVolume + """ + + _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'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'net_app_volume': {'key': 'properties.netAppVolume', 'type': 'NetAppVolume'}, + 'disk_pool_volume': {'key': 'properties.diskPoolVolume', 'type': 'DiskPoolVolume'}, + } + + def __init__(self, **kwargs): + super(Datastore, self).__init__(**kwargs) + self.provisioning_state = None + self.net_app_volume = kwargs.get('net_app_volume', None) + self.disk_pool_volume = kwargs.get('disk_pool_volume', None) + + +class DiskPoolVolume(Model): + """An iSCSI volume from Microsoft.StoragePool provider. + + 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 target_id: Required. Azure resource ID of the iSCSI target + :type target_id: str + :param lun_name: Required. Name of the LUN to be used for datastore + :type lun_name: str + :param mount_option: Mode that describes whether the LUN has to be mounted + as a datastore or attached as a LUN. Possible values include: 'MOUNT', + 'ATTACH'. Default value: "MOUNT" . + :type mount_option: str or ~azure.mgmt.avs.models.MountOptionEnum + :ivar path: Device path + :vartype path: str + """ + + _validation = { + 'target_id': {'required': True}, + 'lun_name': {'required': True}, + 'path': {'readonly': True}, + } + + _attribute_map = { + 'target_id': {'key': 'targetId', 'type': 'str'}, + 'lun_name': {'key': 'lunName', 'type': 'str'}, + 'mount_option': {'key': 'mountOption', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DiskPoolVolume, self).__init__(**kwargs) + self.target_id = kwargs.get('target_id', None) + self.lun_name = kwargs.get('lun_name', None) + self.mount_option = kwargs.get('mount_option', "MOUNT") + self.path = None class Endpoints(Model): @@ -399,8 +735,8 @@ def __init__(self, **kwargs): self.express_route_authorization_key = None -class HcxEnterpriseSite(Resource): - """An HCX Enterprise Site resource. +class GlobalReachConnection(Resource): + """A global reach connection resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -411,37 +747,99 @@ class HcxEnterpriseSite(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar activation_key: The activation key - :vartype activation_key: str - :ivar status: The status of the HCX Enterprise Site. Possible values - include: 'Available', 'Consumed', 'Deactivated', 'Deleted' - :vartype status: str or ~azure.mgmt.avs.models.HcxEnterpriseSiteStatus + :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}, - 'activation_key': {'readonly': True}, - 'status': {'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'}, - 'activation_key': {'key': 'properties.activationKey', 'type': 'str'}, - 'status': {'key': 'properties.status', '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(HcxEnterpriseSite, self).__init__(**kwargs) - self.activation_key = None - self.status = None - + 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 IdentitySource(Model): - """vCenter Single Sign On Identity Source. + +class HcxEnterpriseSite(Resource): + """An HCX Enterprise Site 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 activation_key: The activation key + :vartype activation_key: str + :ivar status: The status of the HCX Enterprise Site. Possible values + include: 'Available', 'Consumed', 'Deactivated', 'Deleted' + :vartype status: str or ~azure.mgmt.avs.models.HcxEnterpriseSiteStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'activation_key': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'activation_key': {'key': 'properties.activationKey', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HcxEnterpriseSite, self).__init__(**kwargs) + self.activation_key = None + self.status = None + + +class IdentitySource(Model): + """vCenter Single Sign On Identity Source. :param name: The name of the identity source :type name: str @@ -519,18 +917,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 values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' :type 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 @@ -543,17 +941,14 @@ class ManagementCluster(ClusterUpdateProperties): } _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 +958,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): @@ -644,6 +1048,28 @@ def __init__(self, **kwargs): self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None) +class NetAppVolume(Model): + """An Azure NetApp Files volume from Microsoft.NetApp provider. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Azure resource ID of the NetApp volume + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetAppVolume, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + class Operation(Model): """A REST API operation. @@ -802,7 +1228,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] @@ -820,6 +1246,9 @@ class PrivateCloud(TrackedResource): format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22 :type network_block: str + :ivar external_cloud_links: Array of cloud link IDs from other clouds that + connect to this one + :vartype external_cloud_links: list[str] :ivar management_network: Network used to access vCenter Server and NSX-T Manager :vartype management_network: str @@ -850,6 +1279,7 @@ class PrivateCloud(TrackedResource): 'provisioning_state': {'readonly': True}, 'endpoints': {'readonly': True}, 'network_block': {'required': True}, + 'external_cloud_links': {'readonly': True}, 'management_network': {'readonly': True}, 'provisioning_network': {'readonly': True}, 'vmotion_network': {'readonly': True}, @@ -871,6 +1301,7 @@ class PrivateCloud(TrackedResource): 'circuit': {'key': 'properties.circuit', 'type': 'Circuit'}, 'endpoints': {'key': 'properties.endpoints', 'type': 'Endpoints'}, 'network_block': {'key': 'properties.networkBlock', 'type': 'str'}, + 'external_cloud_links': {'key': 'properties.externalCloudLinks', 'type': '[str]'}, 'management_network': {'key': 'properties.managementNetwork', 'type': 'str'}, 'provisioning_network': {'key': 'properties.provisioningNetwork', 'type': 'str'}, 'vmotion_network': {'key': 'properties.vmotionNetwork', 'type': 'str'}, @@ -884,12 +1315,13 @@ 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) self.endpoints = None self.network_block = kwargs.get('network_block', None) + self.external_cloud_links = None self.management_network = None self.provisioning_network = None self.vmotion_network = None @@ -902,12 +1334,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 +1356,109 @@ 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 ScriptExecutionParameter(Model): + """The arguments passed in to the execution. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScriptSecureStringExecutionParameter, + ScriptStringExecutionParameter, PSCredentialExecutionParameter + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The parameter name + :type name: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'SecureValue': 'ScriptSecureStringExecutionParameter', 'Value': 'ScriptStringExecutionParameter', 'Credential': 'PSCredentialExecutionParameter'} + } + + def __init__(self, **kwargs): + super(ScriptExecutionParameter, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = None + + +class PSCredentialExecutionParameter(ScriptExecutionParameter): + """a powershell credential object. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The parameter name + :type name: str + :param type: Required. Constant filled by server. + :type type: str + :param username: username for login + :type username: str + :param password: password for login + :type password: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PSCredentialExecutionParameter, self).__init__(**kwargs) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + self.type = 'Credential' + + class Quota(Model): """Subscription quotas. @@ -957,74 +1488,1035 @@ def __init__(self, **kwargs): self.quota_enabled = None -class ServiceSpecification(Model): - """Service specification payload. +class ScriptCmdlet(ProxyResource): + """A cmdlet available for script execution. - :param log_specifications: Specifications of the Log for Azure Monitoring - :type log_specifications: list[~azure.mgmt.avs.models.LogSpecification] - :param metric_specifications: Specifications of the Metrics for Azure - Monitoring - :type metric_specifications: - list[~azure.mgmt.avs.models.MetricSpecification] + 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 description: Description of the scripts functionality + :vartype description: str + :ivar timeout: Recommended time limit for execution + :vartype timeout: str + :ivar parameters: Parameters the script will accept + :vartype parameters: list[~azure.mgmt.avs.models.ScriptParameter] """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'timeout': {'readonly': True}, + 'parameters': {'readonly': True}, + } + _attribute_map = { - 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'timeout': {'key': 'properties.timeout', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '[ScriptParameter]'}, } def __init__(self, **kwargs): - super(ServiceSpecification, self).__init__(**kwargs) - self.log_specifications = kwargs.get('log_specifications', None) - self.metric_specifications = kwargs.get('metric_specifications', None) + super(ScriptCmdlet, self).__init__(**kwargs) + self.description = None + self.timeout = None + self.parameters = None -class Sku(Model): - """The resource model definition representing SKU. +class ScriptExecution(ProxyResource): + """An instance of a script executed by a user - custom or AVS. + + Variables are only populated by the server, and will be ignored when + sending a request. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the SKU. - :type name: str + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param script_cmdlet_id: A reference to the script cmdlet resource if user + is running a AVS script + :type script_cmdlet_id: str + :param parameters: Parameters the script will accept + :type parameters: list[~azure.mgmt.avs.models.ScriptExecutionParameter] + :param hidden_parameters: Parameters that will be hidden/not visible to + ARM, such as passwords and credentials + :type hidden_parameters: + list[~azure.mgmt.avs.models.ScriptExecutionParameter] + :param failure_reason: Error message if the script was able to run, but if + the script itself had errors or powershell threw an exception + :type failure_reason: str + :param timeout: Required. Time limit for execution + :type timeout: str + :param retention: Time to live for the resource. If not provided, will be + available for 60 days + :type retention: str + :ivar submitted_at: Time the script execution was submitted + :vartype submitted_at: datetime + :ivar started_at: Time the script execution was started + :vartype started_at: datetime + :ivar finished_at: Time the script execution was finished + :vartype finished_at: datetime + :ivar provisioning_state: The state of the script execution resource. + Possible values include: 'Pending', 'Running', 'Succeeded', 'Failed', + 'Cancelling', 'Cancelled', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.ScriptExecutionProvisioningState + :param output: Standard output stream from the powershell execution + :type output: list[str] + :param named_outputs: User-defined dictionary. + :type named_outputs: dict[str, object] + :ivar information: Standard information out stream from the powershell + execution + :vartype information: list[str] + :ivar warnings: Standard warning out stream from the powershell execution + :vartype warnings: list[str] + :ivar errors: Standard error output stream from the powershell execution + :vartype errors: list[str] """ _validation = { - 'name': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'timeout': {'required': True}, + 'submitted_at': {'readonly': True}, + 'started_at': {'readonly': True}, + 'finished_at': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'information': {'readonly': True}, + 'warnings': {'readonly': True}, + 'errors': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'script_cmdlet_id': {'key': 'properties.scriptCmdletId', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '[ScriptExecutionParameter]'}, + 'hidden_parameters': {'key': 'properties.hiddenParameters', 'type': '[ScriptExecutionParameter]'}, + 'failure_reason': {'key': 'properties.failureReason', 'type': 'str'}, + 'timeout': {'key': 'properties.timeout', 'type': 'str'}, + 'retention': {'key': 'properties.retention', 'type': 'str'}, + 'submitted_at': {'key': 'properties.submittedAt', 'type': 'iso-8601'}, + 'started_at': {'key': 'properties.startedAt', 'type': 'iso-8601'}, + 'finished_at': {'key': 'properties.finishedAt', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'output': {'key': 'properties.output', 'type': '[str]'}, + 'named_outputs': {'key': 'properties.namedOutputs', 'type': '{object}'}, + 'information': {'key': 'properties.information', 'type': '[str]'}, + 'warnings': {'key': 'properties.warnings', 'type': '[str]'}, + 'errors': {'key': 'properties.errors', 'type': '[str]'}, } def __init__(self, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) + super(ScriptExecution, self).__init__(**kwargs) + self.script_cmdlet_id = kwargs.get('script_cmdlet_id', None) + self.parameters = kwargs.get('parameters', None) + self.hidden_parameters = kwargs.get('hidden_parameters', None) + self.failure_reason = kwargs.get('failure_reason', None) + self.timeout = kwargs.get('timeout', None) + self.retention = kwargs.get('retention', None) + self.submitted_at = None + self.started_at = None + self.finished_at = None + self.provisioning_state = None + self.output = kwargs.get('output', None) + self.named_outputs = kwargs.get('named_outputs', None) + self.information = None + self.warnings = None + self.errors = None -class Trial(Model): - """Subscription trial availability. +class ScriptPackage(ProxyResource): + """Script Package resources available for execution. Variables are only populated by the server, and will be ignored when sending a request. - :ivar status: Trial status. Possible values include: 'TrialAvailable', - 'TrialUsed', 'TrialDisabled' - :vartype status: str or ~azure.mgmt.avs.models.TrialStatus - :ivar available_hosts: Number of trial hosts available - :vartype available_hosts: int + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar description: User friendly description of the package + :vartype description: str + :ivar version: Module version + :vartype version: str """ _validation = { - 'status': {'readonly': True}, - 'available_hosts': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'version': {'readonly': True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'available_hosts': {'key': 'availableHosts', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, } def __init__(self, **kwargs): - super(Trial, self).__init__(**kwargs) - self.status = None - self.available_hosts = None + super(ScriptPackage, self).__init__(**kwargs) + self.description = None + self.version = None + + +class ScriptParameter(Model): + """An parameter that the script will accept. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of parameter the script is expecting. psCredential is + a PSCredentialObject. Possible values include: 'String', 'SecureString', + 'Credential', 'Int', 'Bool', 'Float' + :vartype type: str or ~azure.mgmt.avs.models.ScriptParameterTypes + :param name: The parameter name that the script will expect a parameter + value for + :type name: str + :ivar description: User friendly description of the parameter + :vartype description: str + :ivar visibility: Should this parameter be visible to arm and passed in + the parameters argument when executing. Possible values include: + 'Visible', 'Hidden' + :vartype visibility: str or ~azure.mgmt.avs.models.VisibilityParameterEnum + :ivar optional: Is this parameter required or optional. Possible values + include: 'Optional', 'Required' + :vartype optional: str or ~azure.mgmt.avs.models.OptionalParamEnum + """ + + _validation = { + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'visibility': {'readonly': True}, + 'optional': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'visibility': {'key': 'visibility', 'type': 'str'}, + 'optional': {'key': 'optional', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScriptParameter, self).__init__(**kwargs) + self.type = None + self.name = kwargs.get('name', None) + self.description = None + self.visibility = None + self.optional = None + + +class ScriptSecureStringExecutionParameter(ScriptExecutionParameter): + """a plain text value execution parameter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The parameter name + :type name: str + :param type: Required. Constant filled by server. + :type type: str + :param secure_value: A secure value for the passed parameter, not to be + stored in logs + :type secure_value: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'secure_value': {'key': 'secureValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScriptSecureStringExecutionParameter, self).__init__(**kwargs) + self.secure_value = kwargs.get('secure_value', None) + self.type = 'SecureValue' + + +class ScriptStringExecutionParameter(ScriptExecutionParameter): + """a plain text value execution parameter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The parameter name + :type name: str + :param type: Required. Constant filled by server. + :type type: str + :param value: The value for the passed parameter + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScriptStringExecutionParameter, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.type = 'Value' + + +class ServiceSpecification(Model): + """Service specification payload. + + :param log_specifications: Specifications of the Log for Azure Monitoring + :type log_specifications: list[~azure.mgmt.avs.models.LogSpecification] + :param metric_specifications: Specifications of the Metrics for Azure + Monitoring + :type metric_specifications: + list[~azure.mgmt.avs.models.MetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = kwargs.get('log_specifications', None) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Sku(Model): + """The resource model definition representing SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class Trial(Model): + """Subscription trial availability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: Trial status. Possible values include: 'TrialAvailable', + 'TrialUsed', 'TrialDisabled' + :vartype status: str or ~azure.mgmt.avs.models.TrialStatus + :ivar available_hosts: Number of trial hosts available + :vartype available_hosts: int + """ + + _validation = { + 'status': {'readonly': True}, + 'available_hosts': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'available_hosts': {'key': 'availableHosts', 'type': 'int'}, + } + + 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 properties: DHCP properties. + :type properties: ~azure.mgmt.avs.models.WorkloadNetworkDhcpEntity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'WorkloadNetworkDhcpEntity'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkDhcp, self).__init__(**kwargs) + self.properties = kwargs.get('properties', 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 WorkloadNetworkPublicIP(ProxyResource): + """NSX Public IP Block. + + 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 Public IP Block. + :type display_name: str + :param number_of_public_ips: Number of Public IPs requested. + :type number_of_public_ips: long + :ivar public_ip_block: CIDR Block of the Public IP Block. + :vartype public_ip_block: str + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkPublicIPProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'public_ip_block': {'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'}, + 'number_of_public_ips': {'key': 'properties.numberOfPublicIPs', 'type': 'long'}, + 'public_ip_block': {'key': 'properties.publicIPBlock', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkPublicIP, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.number_of_public_ips = kwargs.get('number_of_public_ips', None) + self.public_ip_block = None + self.provisioning_state = 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 4fbfc42e0f42b..b2cfde024edc1 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,225 @@ 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 properties: The properties of an addon resource + :type properties: ~azure.mgmt.avs.models.AddonProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'AddonProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(Addon, self).__init__(**kwargs) + self.properties = properties + + +class AddonProperties(Model): + """The properties of an addon. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AddonSrmProperties, AddonVrProperties, AddonHcxProperties + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The state of the addon provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Building', + 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.AddonProvisioningState + :param addon_type: Required. Constant filled by server. + :type addon_type: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'addon_type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'addon_type': {'key': 'addonType', 'type': 'str'}, + } + + _subtype_map = { + 'addon_type': {'SRM': 'AddonSrmProperties', 'VR': 'AddonVrProperties', 'HCX': 'AddonHcxProperties'} + } + + def __init__(self, **kwargs) -> None: + super(AddonProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.addon_type = None + + +class AddonHcxProperties(AddonProperties): + """The properties of an HCX addon. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The state of the addon provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Building', + 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.AddonProvisioningState + :param addon_type: Required. Constant filled by server. + :type addon_type: str + :param offer: Required. The HCX offer, example VMware MaaS Cloud Provider + (Enterprise) + :type offer: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'addon_type': {'required': True}, + 'offer': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'addon_type': {'key': 'addonType', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + } + + def __init__(self, *, offer: str, **kwargs) -> None: + super(AddonHcxProperties, self).__init__(**kwargs) + self.offer = offer + self.addon_type = 'HCX' + + +class AddonSrmProperties(AddonProperties): + """The properties of a Site Recovery Manager (SRM) addon. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The state of the addon provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Building', + 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.AddonProvisioningState + :param addon_type: Required. Constant filled by server. + :type addon_type: str + :param license_key: Required. The Site Recovery Manager (SRM) license + :type license_key: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'addon_type': {'required': True}, + 'license_key': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'addon_type': {'key': 'addonType', 'type': 'str'}, + 'license_key': {'key': 'licenseKey', 'type': 'str'}, + } + + def __init__(self, *, license_key: str, **kwargs) -> None: + super(AddonSrmProperties, self).__init__(**kwargs) + self.license_key = license_key + self.addon_type = 'SRM' + + +class AddonVrProperties(AddonProperties): + """The properties of a vSphere Replication (VR) addon. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The state of the addon provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Building', + 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.AddonProvisioningState + :param addon_type: Required. Constant filled by server. + :type addon_type: str + :param vrs_count: Required. The vSphere Replication Server (VRS) count + :type vrs_count: int + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'addon_type': {'required': True}, + 'vrs_count': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'addon_type': {'key': 'addonType', 'type': 'str'}, + 'vrs_count': {'key': 'vrsCount', 'type': 'int'}, + } + + def __init__(self, *, vrs_count: int, **kwargs) -> None: + super(AddonVrProperties, self).__init__(**kwargs) + self.vrs_count = vrs_count + self.addon_type = 'VR' + + class AdminCredentials(Model): """Administrative credentials for accessing vCenter and NSX-T. @@ -119,8 +338,8 @@ def __init__(self, deserialize, response, *args): super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) -class Resource(Model): - """The core properties of ARM resources. +class CloudLink(Resource): + """A cloud link resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -131,25 +350,33 @@ class Resource(Model): :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar status: The state of the cloud link. Possible values include: + 'Active', 'Building', 'Deleting', 'Failed', 'Disconnected' + :vartype status: str or ~azure.mgmt.avs.models.CloudLinkStatus + :param linked_cloud: Identifier of the other private cloud participating + in the link. + :type linked_cloud: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'linked_cloud': {'key': 'properties.linkedCloud', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None + def __init__(self, *, linked_cloud: str=None, **kwargs) -> None: + super(CloudLink, self).__init__(**kwargs) + self.status = None + self.linked_cloud = linked_cloud class Cluster(Resource): @@ -168,12 +395,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 values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' :type 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 @@ -194,17 +421,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, provisioning_state=None, cluster_size: int=None, **kwargs) -> None: super(Cluster, self).__init__(**kwargs) self.sku = sku - self.cluster_size = cluster_size self.provisioning_state = provisioning_state + self.cluster_size = cluster_size self.cluster_id = None self.hosts = None @@ -225,20 +452,129 @@ 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. + :param provisioning_state: The state of the cluster provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + :type 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 = { + '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) + def __init__(self, *, provisioning_state=None, cluster_size: int=None, **kwargs) -> None: + super(CommonClusterProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state self.cluster_size = cluster_size + self.cluster_id = None + self.hosts = None + + +class Datastore(Resource): + """A datastore 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 datastore provisioning. + Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Pending', + 'Creating', 'Updating', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.DatastoreProvisioningState + :param net_app_volume: An Azure NetApp Files volume + :type net_app_volume: ~azure.mgmt.avs.models.NetAppVolume + :param disk_pool_volume: An iSCSI volume + :type disk_pool_volume: ~azure.mgmt.avs.models.DiskPoolVolume + """ + + _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'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'net_app_volume': {'key': 'properties.netAppVolume', 'type': 'NetAppVolume'}, + 'disk_pool_volume': {'key': 'properties.diskPoolVolume', 'type': 'DiskPoolVolume'}, + } + + def __init__(self, *, net_app_volume=None, disk_pool_volume=None, **kwargs) -> None: + super(Datastore, self).__init__(**kwargs) + self.provisioning_state = None + self.net_app_volume = net_app_volume + self.disk_pool_volume = disk_pool_volume + + +class DiskPoolVolume(Model): + """An iSCSI volume from Microsoft.StoragePool provider. + + 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 target_id: Required. Azure resource ID of the iSCSI target + :type target_id: str + :param lun_name: Required. Name of the LUN to be used for datastore + :type lun_name: str + :param mount_option: Mode that describes whether the LUN has to be mounted + as a datastore or attached as a LUN. Possible values include: 'MOUNT', + 'ATTACH'. Default value: "MOUNT" . + :type mount_option: str or ~azure.mgmt.avs.models.MountOptionEnum + :ivar path: Device path + :vartype path: str + """ + + _validation = { + 'target_id': {'required': True}, + 'lun_name': {'required': True}, + 'path': {'readonly': True}, + } + + _attribute_map = { + 'target_id': {'key': 'targetId', 'type': 'str'}, + 'lun_name': {'key': 'lunName', 'type': 'str'}, + 'mount_option': {'key': 'mountOption', 'type': 'str'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__(self, *, target_id: str, lun_name: str, mount_option="MOUNT", **kwargs) -> None: + super(DiskPoolVolume, self).__init__(**kwargs) + self.target_id = target_id + self.lun_name = lun_name + self.mount_option = mount_option + self.path = None class Endpoints(Model): @@ -399,8 +735,8 @@ def __init__(self, **kwargs) -> None: self.express_route_authorization_key = None -class HcxEnterpriseSite(Resource): - """An HCX Enterprise Site resource. +class GlobalReachConnection(Resource): + """A global reach connection resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -411,40 +747,102 @@ class HcxEnterpriseSite(Resource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar activation_key: The activation key - :vartype activation_key: str - :ivar status: The status of the HCX Enterprise Site. Possible values - include: 'Available', 'Consumed', 'Deactivated', 'Deleted' - :vartype status: str or ~azure.mgmt.avs.models.HcxEnterpriseSiteStatus + :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}, - 'activation_key': {'readonly': True}, - 'status': {'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'}, - 'activation_key': {'key': 'properties.activationKey', 'type': 'str'}, - 'status': {'key': 'properties.status', '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) -> None: - super(HcxEnterpriseSite, self).__init__(**kwargs) - self.activation_key = None - self.status = None + 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 IdentitySource(Model): - """vCenter Single Sign On Identity Source. +class HcxEnterpriseSite(Resource): + """An HCX Enterprise Site resource. - :param name: The name of the identity source - :type name: str + 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 activation_key: The activation key + :vartype activation_key: str + :ivar status: The status of the HCX Enterprise Site. Possible values + include: 'Available', 'Consumed', 'Deactivated', 'Deleted' + :vartype status: str or ~azure.mgmt.avs.models.HcxEnterpriseSiteStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'activation_key': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'activation_key': {'key': 'properties.activationKey', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(HcxEnterpriseSite, self).__init__(**kwargs) + self.activation_key = None + self.status = None + + +class IdentitySource(Model): + """vCenter Single Sign On Identity Source. + + :param name: The name of the identity source + :type name: str :param alias: The domain's NetBIOS name :type alias: str :param domain: The domain's dns name @@ -519,18 +917,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 values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' :type 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 @@ -543,17 +941,14 @@ class ManagementCluster(ClusterUpdateProperties): } _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: - super(ManagementCluster, self).__init__(cluster_size=cluster_size, **kwargs) - self.provisioning_state = provisioning_state - self.cluster_id = None - self.hosts = None + def __init__(self, *, provisioning_state=None, cluster_size: int=None, **kwargs) -> None: + super(ManagementCluster, self).__init__(provisioning_state=provisioning_state, cluster_size=cluster_size, **kwargs) class MetricDimension(Model): @@ -563,17 +958,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): @@ -644,6 +1048,28 @@ def __init__(self, *, name: str=None, display_name: str=None, display_descriptio self.source_mdm_namespace = source_mdm_namespace +class NetAppVolume(Model): + """An Azure NetApp Files volume from Microsoft.NetApp provider. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Azure resource ID of the NetApp volume + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(NetAppVolume, self).__init__(**kwargs) + self.id = id + + class Operation(Model): """A REST API operation. @@ -802,7 +1228,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] @@ -820,6 +1246,9 @@ class PrivateCloud(TrackedResource): format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22 :type network_block: str + :ivar external_cloud_links: Array of cloud link IDs from other clouds that + connect to this one + :vartype external_cloud_links: list[str] :ivar management_network: Network used to access vCenter Server and NSX-T Manager :vartype management_network: str @@ -850,6 +1279,7 @@ class PrivateCloud(TrackedResource): 'provisioning_state': {'readonly': True}, 'endpoints': {'readonly': True}, 'network_block': {'required': True}, + 'external_cloud_links': {'readonly': True}, 'management_network': {'readonly': True}, 'provisioning_network': {'readonly': True}, 'vmotion_network': {'readonly': True}, @@ -871,6 +1301,7 @@ class PrivateCloud(TrackedResource): 'circuit': {'key': 'properties.circuit', 'type': 'Circuit'}, 'endpoints': {'key': 'properties.endpoints', 'type': 'Endpoints'}, 'network_block': {'key': 'properties.networkBlock', 'type': 'str'}, + 'external_cloud_links': {'key': 'properties.externalCloudLinks', 'type': '[str]'}, 'management_network': {'key': 'properties.managementNetwork', 'type': 'str'}, 'provisioning_network': {'key': 'properties.provisioningNetwork', 'type': 'str'}, 'vmotion_network': {'key': 'properties.vmotionNetwork', 'type': 'str'}, @@ -880,7 +1311,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 @@ -890,6 +1321,7 @@ def __init__(self, *, sku, network_block: str, location: str=None, tags=None, ma self.circuit = circuit self.endpoints = None self.network_block = network_block + self.external_cloud_links = None self.management_network = None self.provisioning_network = None self.vmotion_network = None @@ -902,12 +1334,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 +1352,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 +1360,105 @@ 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 ScriptExecutionParameter(Model): + """The arguments passed in to the execution. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScriptSecureStringExecutionParameter, + ScriptStringExecutionParameter, PSCredentialExecutionParameter + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The parameter name + :type name: str + :param type: Required. Constant filled by server. + :type type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'SecureValue': 'ScriptSecureStringExecutionParameter', 'Value': 'ScriptStringExecutionParameter', 'Credential': 'PSCredentialExecutionParameter'} + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(ScriptExecutionParameter, self).__init__(**kwargs) + self.name = name + self.type = None + + +class PSCredentialExecutionParameter(ScriptExecutionParameter): + """a powershell credential object. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The parameter name + :type name: str + :param type: Required. Constant filled by server. + :type type: str + :param username: username for login + :type username: str + :param password: password for login + :type password: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, name: str, username: str=None, password: str=None, **kwargs) -> None: + super(PSCredentialExecutionParameter, self).__init__(name=name, **kwargs) + self.username = username + self.password = password + self.type = 'Credential' + + class Quota(Model): """Subscription quotas. @@ -957,74 +1488,1035 @@ def __init__(self, **kwargs) -> None: self.quota_enabled = None -class ServiceSpecification(Model): - """Service specification payload. +class ScriptCmdlet(ProxyResource): + """A cmdlet available for script execution. - :param log_specifications: Specifications of the Log for Azure Monitoring - :type log_specifications: list[~azure.mgmt.avs.models.LogSpecification] - :param metric_specifications: Specifications of the Metrics for Azure - Monitoring - :type metric_specifications: - list[~azure.mgmt.avs.models.MetricSpecification] + 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 description: Description of the scripts functionality + :vartype description: str + :ivar timeout: Recommended time limit for execution + :vartype timeout: str + :ivar parameters: Parameters the script will accept + :vartype parameters: list[~azure.mgmt.avs.models.ScriptParameter] """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'timeout': {'readonly': True}, + 'parameters': {'readonly': True}, + } + _attribute_map = { - 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'timeout': {'key': 'properties.timeout', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '[ScriptParameter]'}, } - def __init__(self, *, log_specifications=None, metric_specifications=None, **kwargs) -> None: - super(ServiceSpecification, self).__init__(**kwargs) - self.log_specifications = log_specifications - self.metric_specifications = metric_specifications + def __init__(self, **kwargs) -> None: + super(ScriptCmdlet, self).__init__(**kwargs) + self.description = None + self.timeout = None + self.parameters = None -class Sku(Model): - """The resource model definition representing SKU. +class ScriptExecution(ProxyResource): + """An instance of a script executed by a user - custom or AVS. + + Variables are only populated by the server, and will be ignored when + sending a request. All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the SKU. - :type name: str + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param script_cmdlet_id: A reference to the script cmdlet resource if user + is running a AVS script + :type script_cmdlet_id: str + :param parameters: Parameters the script will accept + :type parameters: list[~azure.mgmt.avs.models.ScriptExecutionParameter] + :param hidden_parameters: Parameters that will be hidden/not visible to + ARM, such as passwords and credentials + :type hidden_parameters: + list[~azure.mgmt.avs.models.ScriptExecutionParameter] + :param failure_reason: Error message if the script was able to run, but if + the script itself had errors or powershell threw an exception + :type failure_reason: str + :param timeout: Required. Time limit for execution + :type timeout: str + :param retention: Time to live for the resource. If not provided, will be + available for 60 days + :type retention: str + :ivar submitted_at: Time the script execution was submitted + :vartype submitted_at: datetime + :ivar started_at: Time the script execution was started + :vartype started_at: datetime + :ivar finished_at: Time the script execution was finished + :vartype finished_at: datetime + :ivar provisioning_state: The state of the script execution resource. + Possible values include: 'Pending', 'Running', 'Succeeded', 'Failed', + 'Cancelling', 'Cancelled', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.ScriptExecutionProvisioningState + :param output: Standard output stream from the powershell execution + :type output: list[str] + :param named_outputs: User-defined dictionary. + :type named_outputs: dict[str, object] + :ivar information: Standard information out stream from the powershell + execution + :vartype information: list[str] + :ivar warnings: Standard warning out stream from the powershell execution + :vartype warnings: list[str] + :ivar errors: Standard error output stream from the powershell execution + :vartype errors: list[str] """ _validation = { - 'name': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'timeout': {'required': True}, + 'submitted_at': {'readonly': True}, + 'started_at': {'readonly': True}, + 'finished_at': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'information': {'readonly': True}, + 'warnings': {'readonly': True}, + 'errors': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'script_cmdlet_id': {'key': 'properties.scriptCmdletId', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '[ScriptExecutionParameter]'}, + 'hidden_parameters': {'key': 'properties.hiddenParameters', 'type': '[ScriptExecutionParameter]'}, + 'failure_reason': {'key': 'properties.failureReason', 'type': 'str'}, + 'timeout': {'key': 'properties.timeout', 'type': 'str'}, + 'retention': {'key': 'properties.retention', 'type': 'str'}, + 'submitted_at': {'key': 'properties.submittedAt', 'type': 'iso-8601'}, + 'started_at': {'key': 'properties.startedAt', 'type': 'iso-8601'}, + 'finished_at': {'key': 'properties.finishedAt', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'output': {'key': 'properties.output', 'type': '[str]'}, + 'named_outputs': {'key': 'properties.namedOutputs', 'type': '{object}'}, + 'information': {'key': 'properties.information', 'type': '[str]'}, + 'warnings': {'key': 'properties.warnings', 'type': '[str]'}, + 'errors': {'key': 'properties.errors', 'type': '[str]'}, } - def __init__(self, *, name: str, **kwargs) -> None: - super(Sku, self).__init__(**kwargs) - self.name = name + def __init__(self, *, timeout: str, script_cmdlet_id: str=None, parameters=None, hidden_parameters=None, failure_reason: str=None, retention: str=None, output=None, named_outputs=None, **kwargs) -> None: + super(ScriptExecution, self).__init__(**kwargs) + self.script_cmdlet_id = script_cmdlet_id + self.parameters = parameters + self.hidden_parameters = hidden_parameters + self.failure_reason = failure_reason + self.timeout = timeout + self.retention = retention + self.submitted_at = None + self.started_at = None + self.finished_at = None + self.provisioning_state = None + self.output = output + self.named_outputs = named_outputs + self.information = None + self.warnings = None + self.errors = None -class Trial(Model): - """Subscription trial availability. +class ScriptPackage(ProxyResource): + """Script Package resources available for execution. Variables are only populated by the server, and will be ignored when sending a request. - :ivar status: Trial status. Possible values include: 'TrialAvailable', - 'TrialUsed', 'TrialDisabled' - :vartype status: str or ~azure.mgmt.avs.models.TrialStatus - :ivar available_hosts: Number of trial hosts available - :vartype available_hosts: int + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar description: User friendly description of the package + :vartype description: str + :ivar version: Module version + :vartype version: str """ _validation = { - 'status': {'readonly': True}, - 'available_hosts': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'version': {'readonly': True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'available_hosts': {'key': 'availableHosts', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, } def __init__(self, **kwargs) -> None: - super(Trial, self).__init__(**kwargs) - self.status = None - self.available_hosts = None + super(ScriptPackage, self).__init__(**kwargs) + self.description = None + self.version = None + + +class ScriptParameter(Model): + """An parameter that the script will accept. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of parameter the script is expecting. psCredential is + a PSCredentialObject. Possible values include: 'String', 'SecureString', + 'Credential', 'Int', 'Bool', 'Float' + :vartype type: str or ~azure.mgmt.avs.models.ScriptParameterTypes + :param name: The parameter name that the script will expect a parameter + value for + :type name: str + :ivar description: User friendly description of the parameter + :vartype description: str + :ivar visibility: Should this parameter be visible to arm and passed in + the parameters argument when executing. Possible values include: + 'Visible', 'Hidden' + :vartype visibility: str or ~azure.mgmt.avs.models.VisibilityParameterEnum + :ivar optional: Is this parameter required or optional. Possible values + include: 'Optional', 'Required' + :vartype optional: str or ~azure.mgmt.avs.models.OptionalParamEnum + """ + + _validation = { + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'visibility': {'readonly': True}, + 'optional': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'visibility': {'key': 'visibility', 'type': 'str'}, + 'optional': {'key': 'optional', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(ScriptParameter, self).__init__(**kwargs) + self.type = None + self.name = name + self.description = None + self.visibility = None + self.optional = None + + +class ScriptSecureStringExecutionParameter(ScriptExecutionParameter): + """a plain text value execution parameter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The parameter name + :type name: str + :param type: Required. Constant filled by server. + :type type: str + :param secure_value: A secure value for the passed parameter, not to be + stored in logs + :type secure_value: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'secure_value': {'key': 'secureValue', 'type': 'str'}, + } + + def __init__(self, *, name: str, secure_value: str=None, **kwargs) -> None: + super(ScriptSecureStringExecutionParameter, self).__init__(name=name, **kwargs) + self.secure_value = secure_value + self.type = 'SecureValue' + + +class ScriptStringExecutionParameter(ScriptExecutionParameter): + """a plain text value execution parameter. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The parameter name + :type name: str + :param type: Required. Constant filled by server. + :type type: str + :param value: The value for the passed parameter + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str, value: str=None, **kwargs) -> None: + super(ScriptStringExecutionParameter, self).__init__(name=name, **kwargs) + self.value = value + self.type = 'Value' + + +class ServiceSpecification(Model): + """Service specification payload. + + :param log_specifications: Specifications of the Log for Azure Monitoring + :type log_specifications: list[~azure.mgmt.avs.models.LogSpecification] + :param metric_specifications: Specifications of the Metrics for Azure + Monitoring + :type metric_specifications: + list[~azure.mgmt.avs.models.MetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, log_specifications=None, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = log_specifications + self.metric_specifications = metric_specifications + + +class Sku(Model): + """The resource model definition representing SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + + +class Trial(Model): + """Subscription trial availability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: Trial status. Possible values include: 'TrialAvailable', + 'TrialUsed', 'TrialDisabled' + :vartype status: str or ~azure.mgmt.avs.models.TrialStatus + :ivar available_hosts: Number of trial hosts available + :vartype available_hosts: int + """ + + _validation = { + 'status': {'readonly': True}, + 'available_hosts': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'available_hosts': {'key': 'availableHosts', 'type': 'int'}, + } + + 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 properties: DHCP properties. + :type properties: ~azure.mgmt.avs.models.WorkloadNetworkDhcpEntity + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'WorkloadNetworkDhcpEntity'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(WorkloadNetworkDhcp, self).__init__(**kwargs) + self.properties = properties + + +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 WorkloadNetworkPublicIP(ProxyResource): + """NSX Public IP Block. + + 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 Public IP Block. + :type display_name: str + :param number_of_public_ips: Number of Public IPs requested. + :type number_of_public_ips: long + :ivar public_ip_block: CIDR Block of the Public IP Block. + :vartype public_ip_block: str + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkPublicIPProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'public_ip_block': {'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'}, + 'number_of_public_ips': {'key': 'properties.numberOfPublicIPs', 'type': 'long'}, + 'public_ip_block': {'key': 'properties.publicIPBlock', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, number_of_public_ips: int=None, **kwargs) -> None: + super(WorkloadNetworkPublicIP, self).__init__(**kwargs) + self.display_name = display_name + self.number_of_public_ips = number_of_public_ips + self.public_ip_block = None + self.provisioning_state = 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, *, display_name: str=None, connected_gateway: str=None, subnet=None, revision: int=None, **kwargs) -> None: + super(WorkloadNetworkSegment, self).__init__(**kwargs) + self.display_name = display_name + self.connected_gateway = connected_gateway + self.subnet = subnet + self.port_vif = None + self.status = None + self.provisioning_state = None + self.revision = revision + + +class WorkloadNetworkSegmentPortVif(Model): + """Ports and any VIF attached to segment. + + :param port_name: Name of port or VIF attached to segment. + :type port_name: str + """ + + _attribute_map = { + 'port_name': {'key': 'portName', 'type': 'str'}, + } + + def __init__(self, *, port_name: str=None, **kwargs) -> None: + super(WorkloadNetworkSegmentPortVif, self).__init__(**kwargs) + self.port_name = port_name + + +class WorkloadNetworkSegmentSubnet(Model): + """Subnet configuration for segment. + + :param dhcp_ranges: DHCP Range assigned for subnet. + :type dhcp_ranges: list[str] + :param gateway_address: Gateway address. + :type gateway_address: str + """ + + _attribute_map = { + 'dhcp_ranges': {'key': 'dhcpRanges', 'type': '[str]'}, + 'gateway_address': {'key': 'gatewayAddress', 'type': 'str'}, + } + + def __init__(self, *, dhcp_ranges=None, gateway_address: str=None, **kwargs) -> None: + super(WorkloadNetworkSegmentSubnet, self).__init__(**kwargs) + self.dhcp_ranges = dhcp_ranges + self.gateway_address = gateway_address + + +class WorkloadNetworkVirtualMachine(ProxyResource): + """NSX Virtual Machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: Display name of the VM. + :type display_name: str + :ivar vm_type: Virtual machine type. Possible values include: 'REGULAR, + EDGE, SERVICE' + :vartype vm_type: str or ~azure.mgmt.avs.models.VMTypeEnum + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'vm_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'vm_type': {'key': 'properties.vmType', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, **kwargs) -> None: + super(WorkloadNetworkVirtualMachine, self).__init__(**kwargs) + self.display_name = display_name + self.vm_type = None + + +class WorkloadNetworkVMGroup(ProxyResource): + """NSX VM Group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: Display name of the VM group. + :type display_name: str + :param members: Virtual machine members of this group. + :type members: list[str] + :ivar status: VM Group status. Possible values include: 'SUCCESS, FAILURE' + :vartype status: str or ~azure.mgmt.avs.models.VMGroupStatusEnum + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkVMGroupProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'members': {'key': 'properties.members', 'type': '[str]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, *, display_name: str=None, members=None, revision: int=None, **kwargs) -> None: + super(WorkloadNetworkVMGroup, self).__init__(**kwargs) + self.display_name = display_name + self.members = members + self.status = None + self.provisioning_state = None + self.revision = revision diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_paged_models.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_paged_models.py index 874c91b84a94e..9cc32b284af16 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 @@ -51,6 +51,19 @@ class ClusterPaged(Paged): def __init__(self, *args, **kwargs): super(ClusterPaged, self).__init__(*args, **kwargs) +class DatastorePaged(Paged): + """ + A paging container for iterating over a list of :class:`Datastore ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Datastore]'} + } + + def __init__(self, *args, **kwargs): + + super(DatastorePaged, self).__init__(*args, **kwargs) class HcxEnterpriseSitePaged(Paged): """ A paging container for iterating over a list of :class:`HcxEnterpriseSite ` object @@ -77,3 +90,198 @@ 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 WorkloadNetworkPublicIPPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkPublicIP ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkPublicIP]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkPublicIPPaged, self).__init__(*args, **kwargs) +class CloudLinkPaged(Paged): + """ + A paging container for iterating over a list of :class:`CloudLink ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CloudLink]'} + } + + def __init__(self, *args, **kwargs): + + super(CloudLinkPaged, 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) +class ScriptPackagePaged(Paged): + """ + A paging container for iterating over a list of :class:`ScriptPackage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ScriptPackage]'} + } + + def __init__(self, *args, **kwargs): + + super(ScriptPackagePaged, self).__init__(*args, **kwargs) +class ScriptCmdletPaged(Paged): + """ + A paging container for iterating over a list of :class:`ScriptCmdlet ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ScriptCmdlet]'} + } + + def __init__(self, *args, **kwargs): + + super(ScriptCmdletPaged, self).__init__(*args, **kwargs) +class ScriptExecutionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ScriptExecution ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ScriptExecution]'} + } + + def __init__(self, *args, **kwargs): + + super(ScriptExecutionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py index f8c122b9ef0c5..99bc4cafde2a3 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 @@ -13,14 +13,30 @@ from ._locations_operations import LocationsOperations from ._private_clouds_operations import PrivateCloudsOperations from ._clusters_operations import ClustersOperations +from ._datastores_operations import DatastoresOperations 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 ._cloud_links_operations import CloudLinksOperations +from ._addons_operations import AddonsOperations +from ._script_packages_operations import ScriptPackagesOperations +from ._script_cmdlets_operations import ScriptCmdletsOperations +from ._script_executions_operations import ScriptExecutionsOperations __all__ = [ 'Operations', 'LocationsOperations', 'PrivateCloudsOperations', 'ClustersOperations', + 'DatastoresOperations', 'HcxEnterpriseSitesOperations', 'AuthorizationsOperations', + 'GlobalReachConnectionsOperations', + 'WorkloadNetworksOperations', + 'CloudLinksOperations', + 'AddonsOperations', + 'ScriptPackagesOperations', + 'ScriptCmdletsOperations', + 'ScriptExecutionsOperations', ] diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py new file mode 100644 index 0000000000000..deacbe38fb1a2 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_addons_operations.py @@ -0,0 +1,373 @@ +# 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: "2021-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-06-01" + + 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, properties=None, custom_headers=None, raw=False, **operation_config): + addon = models.Addon(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, 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, properties=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 properties: The properties of an addon resource + :type properties: ~azure.mgmt.avs.models.AddonProperties + :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, + properties=properties, + 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 ae761e630faaf..2c5b5882ae0cf 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: "2021-06-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-20" + self.api_version = "2021-06-01" 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/_cloud_links_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py new file mode 100644 index 0000000000000..dd9be1106b863 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_cloud_links_operations.py @@ -0,0 +1,374 @@ +# 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 CloudLinksOperations(object): + """CloudLinksOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-06-01" + + self.config = config + + def list( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List cloud link 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 CloudLink + :rtype: + ~azure.mgmt.avs.models.CloudLinkPaged[~azure.mgmt.avs.models.CloudLink] + :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.CloudLinkPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks'} + + def get( + self, resource_group_name, private_cloud_name, cloud_link_name, custom_headers=None, raw=False, **operation_config): + """Get an cloud link 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 cloud_link_name: Name of the cloud link resource + :type cloud_link_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: CloudLink or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.CloudLink 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'), + 'cloudLinkName': self._serialize.url("cloud_link_name", cloud_link_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('CloudLink', 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}/cloudLinks/{cloudLinkName}'} + + + def _create_or_update_initial( + self, resource_group_name, private_cloud_name, cloud_link_name, linked_cloud=None, custom_headers=None, raw=False, **operation_config): + cloud_link = models.CloudLink(linked_cloud=linked_cloud) + + # 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'), + 'cloudLinkName': self._serialize.url("cloud_link_name", cloud_link_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(cloud_link, 'CloudLink') + + # 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('CloudLink', response) + if response.status_code == 201: + deserialized = self._deserialize('CloudLink', 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, cloud_link_name, linked_cloud=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a cloud link 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 cloud_link_name: Name of the cloud link resource + :type cloud_link_name: str + :param linked_cloud: Identifier of the other private cloud + participating in the link. + :type linked_cloud: 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 CloudLink or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.CloudLink] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.CloudLink]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cloud_link_name=cloud_link_name, + linked_cloud=linked_cloud, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('CloudLink', 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}/cloudLinks/{cloudLinkName}'} + + + def _delete_initial( + self, resource_group_name, private_cloud_name, cloud_link_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'), + 'cloudLinkName': self._serialize.url("cloud_link_name", cloud_link_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, cloud_link_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a cloud link 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 cloud_link_name: Name of the cloud link resource + :type cloud_link_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, + cloud_link_name=cloud_link_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}/cloudLinks/{cloudLinkName}'} 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 b8a0b62774b74..883a7e091d884 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: "2021-06-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-20" + self.api_version = "2021-06-01" self.config = config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py new file mode 100644 index 0000000000000..c31639e991e5e --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_datastores_operations.py @@ -0,0 +1,393 @@ +# 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 DatastoresOperations(object): + """DatastoresOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-06-01" + + self.config = config + + def list( + self, resource_group_name, private_cloud_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """List datastores in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud + :type cluster_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Datastore + :rtype: + ~azure.mgmt.avs.models.DatastorePaged[~azure.mgmt.avs.models.Datastore] + :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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DatastorePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores'} + + def get( + self, resource_group_name, private_cloud_name, cluster_name, datastore_name, custom_headers=None, raw=False, **operation_config): + """Get a datastore in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud + :type cluster_name: str + :param datastore_name: Name of the datastore in the private cloud + cluster + :type datastore_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: Datastore or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.Datastore 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'datastoreName': self._serialize.url("datastore_name", datastore_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('Datastore', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}'} + + + def _create_or_update_initial( + self, resource_group_name, private_cloud_name, cluster_name, datastore_name, net_app_volume=None, disk_pool_volume=None, custom_headers=None, raw=False, **operation_config): + datastore = models.Datastore(net_app_volume=net_app_volume, disk_pool_volume=disk_pool_volume) + + # 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'datastoreName': self._serialize.url("datastore_name", datastore_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(datastore, 'Datastore') + + # 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('Datastore', response) + if response.status_code == 201: + deserialized = self._deserialize('Datastore', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, private_cloud_name, cluster_name, datastore_name, net_app_volume=None, disk_pool_volume=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a datastore in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud + :type cluster_name: str + :param datastore_name: Name of the datastore in the private cloud + cluster + :type datastore_name: str + :param net_app_volume: An Azure NetApp Files volume + :type net_app_volume: ~azure.mgmt.avs.models.NetAppVolume + :param disk_pool_volume: An iSCSI volume + :type disk_pool_volume: ~azure.mgmt.avs.models.DiskPoolVolume + :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 Datastore or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.Datastore] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.Datastore]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + datastore_name=datastore_name, + net_app_volume=net_app_volume, + disk_pool_volume=disk_pool_volume, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Datastore', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}'} + + + def _delete_initial( + self, resource_group_name, private_cloud_name, cluster_name, datastore_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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'datastoreName': self._serialize.url("datastore_name", datastore_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, private_cloud_name, cluster_name, datastore_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a datastore in a private cloud cluster. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud + :type cluster_name: str + :param datastore_name: Name of the datastore in the private cloud + cluster + :type datastore_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + datastore_name=datastore_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}'} diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py new file mode 100644 index 0000000000000..f031b50bd3df5 --- /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: "2021-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-06-01" + + self.config = config + + def list( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List global reach connections in a private cloud. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of GlobalReachConnection + :rtype: + ~azure.mgmt.avs.models.GlobalReachConnectionPaged[~azure.mgmt.avs.models.GlobalReachConnection] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.GlobalReachConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections'} + + def get( + self, resource_group_name, private_cloud_name, global_reach_connection_name, custom_headers=None, raw=False, **operation_config): + """Get a global reach connection by name in a private cloud. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param global_reach_connection_name: Name of the global reach + connection in the private cloud + :type global_reach_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GlobalReachConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.GlobalReachConnection or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'globalReachConnectionName': self._serialize.url("global_reach_connection_name", global_reach_connection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GlobalReachConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}'} + + + def _create_or_update_initial( + self, resource_group_name, private_cloud_name, global_reach_connection_name, authorization_key=None, peer_express_route_circuit=None, custom_headers=None, raw=False, **operation_config): + global_reach_connection = models.GlobalReachConnection(authorization_key=authorization_key, peer_express_route_circuit=peer_express_route_circuit) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'globalReachConnectionName': self._serialize.url("global_reach_connection_name", global_reach_connection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(global_reach_connection, 'GlobalReachConnection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GlobalReachConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('GlobalReachConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, private_cloud_name, global_reach_connection_name, authorization_key=None, peer_express_route_circuit=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a global reach connection in a private cloud. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: The name of the private cloud. + :type private_cloud_name: str + :param global_reach_connection_name: Name of the global reach + connection in the private cloud + :type global_reach_connection_name: str + :param authorization_key: Authorization key from the peer express + route used for the global reach connection + :type authorization_key: str + :param peer_express_route_circuit: Identifier of the ExpressRoute + Circuit to peer with in the global reach connection + :type peer_express_route_circuit: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GlobalReachConnection + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.GlobalReachConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.GlobalReachConnection]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + global_reach_connection_name=global_reach_connection_name, + authorization_key=authorization_key, + peer_express_route_circuit=peer_express_route_circuit, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GlobalReachConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}'} + + + def _delete_initial( + self, resource_group_name, private_cloud_name, global_reach_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'globalReachConnectionName': self._serialize.url("global_reach_connection_name", global_reach_connection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, private_cloud_name, global_reach_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a global reach connection in a private cloud. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param global_reach_connection_name: Name of the global reach + connection in the private cloud + :type global_reach_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + global_reach_connection_name=global_reach_connection_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}'} diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py index 2a6b139c72e35..b1d7194c2a523 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: "2021-06-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-20" + self.api_version = "2021-06-01" 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 6d8d140021c9b..35d832dcabc91 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: "2021-06-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-20" + self.api_version = "2021-06-01" self.config = config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py index 2e02064516c05..263b7ae65ee82 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: "2021-06-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-20" + self.api_version = "2021-06-01" self.config = config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py index 128a4596f79ba..fccd5541bfd95 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: "2021-06-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-20" + self.api_version = "2021-06-01" 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/_script_cmdlets_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py new file mode 100644 index 0000000000000..1cc749cda277a --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_cmdlets_operations.py @@ -0,0 +1,189 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ScriptCmdletsOperations(object): + """ScriptCmdletsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-06-01" + + self.config = config + + def list( + self, resource_group_name, private_cloud_name, script_package_name, custom_headers=None, raw=False, **operation_config): + """Return script cmdlet resources available for a private cloud to create + a script execution resource on their Private Cloud. + + :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 script_package_name: Name of the script package in the private + cloud + :type script_package_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 ScriptCmdlet + :rtype: + ~azure.mgmt.avs.models.ScriptCmdletPaged[~azure.mgmt.avs.models.ScriptCmdlet] + :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'), + 'scriptPackageName': self._serialize.url("script_package_name", script_package_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.ScriptCmdletPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets'} + + def get( + self, resource_group_name, private_cloud_name, script_package_name, script_cmdlet_name, custom_headers=None, raw=False, **operation_config): + """Return information about a script cmdlet resource in a specific package + on 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 script_package_name: Name of the script package in the private + cloud + :type script_package_name: str + :param script_cmdlet_name: Name of the script cmdlet resource in the + script package in the private cloud + :type script_cmdlet_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: ScriptCmdlet or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.ScriptCmdlet 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'), + 'scriptPackageName': self._serialize.url("script_package_name", script_package_name, 'str'), + 'scriptCmdletName': self._serialize.url("script_cmdlet_name", script_cmdlet_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('ScriptCmdlet', 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}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}'} diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py new file mode 100644 index 0000000000000..01d42abda8723 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_executions_operations.py @@ -0,0 +1,452 @@ +# 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 ScriptExecutionsOperations(object): + """ScriptExecutionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-06-01" + + self.config = config + + def list( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """Get an script execution resource by name in a private cloud. + + :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 ScriptExecution + :rtype: + ~azure.mgmt.avs.models.ScriptExecutionPaged[~azure.mgmt.avs.models.ScriptExecution] + :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.ScriptExecutionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions'} + + def get( + self, resource_group_name, private_cloud_name, script_execution_name, custom_headers=None, raw=False, **operation_config): + """Get an script execution resource by name in a private cloud. + + :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 script_execution_name: Name of the user-invoked script + execution resource + :type script_execution_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: ScriptExecution or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.ScriptExecution 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'), + 'scriptExecutionName': self._serialize.url("script_execution_name", script_execution_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('ScriptExecution', 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}/scriptExecutions/{scriptExecutionName}'} + + + def _create_or_update_initial( + self, resource_group_name, private_cloud_name, script_execution_name, script_execution, custom_headers=None, raw=False, **operation_config): + # 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'), + 'scriptExecutionName': self._serialize.url("script_execution_name", script_execution_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(script_execution, 'ScriptExecution') + + # 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('ScriptExecution', response) + if response.status_code == 201: + deserialized = self._deserialize('ScriptExecution', 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, script_execution_name, script_execution, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a script execution resource in a private cloud. + + :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 script_execution_name: Name of the user-invoked script + execution resource + :type script_execution_name: str + :param script_execution: A script running in the private cloud + :type script_execution: ~azure.mgmt.avs.models.ScriptExecution + :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 ScriptExecution or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.ScriptExecution] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.ScriptExecution]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + script_execution_name=script_execution_name, + script_execution=script_execution, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ScriptExecution', 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}/scriptExecutions/{scriptExecutionName}'} + + + def _delete_initial( + self, resource_group_name, private_cloud_name, script_execution_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'), + 'scriptExecutionName': self._serialize.url("script_execution_name", script_execution_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, script_execution_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Cancel a ScriptExecution 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 script_execution_name: Name of the user-invoked script + execution resource + :type script_execution_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, + script_execution_name=script_execution_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}/scriptExecutions/{scriptExecutionName}'} + + def get_execution_logs( + self, resource_group_name, private_cloud_name, script_execution_name, script_output_stream_type=None, custom_headers=None, raw=False, **operation_config): + """Return the logs for a script execution resource. + + :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 script_execution_name: Name of the user-invoked script + execution resource + :type script_execution_name: str + :param script_output_stream_type: Name of the desired output stream to + return. If not provided, will return all. An empty array will return + nothing + :type script_output_stream_type: list[str or + ~azure.mgmt.avs.models.ScriptOutputStreamType] + :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: ScriptExecution or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.ScriptExecution or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_execution_logs.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'), + 'scriptExecutionName': self._serialize.url("script_execution_name", script_execution_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 + if script_output_stream_type is not None: + body_content = self._serialize.body(script_output_stream_type, '[str]') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [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('ScriptExecution', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_execution_logs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}/getExecutionLogs'} diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py new file mode 100644 index 0000000000000..e2e7b69295142 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_script_packages_operations.py @@ -0,0 +1,180 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ScriptPackagesOperations(object): + """ScriptPackagesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-06-01" + + self.config = config + + def list( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """Return script packages available for a private cloud to run on their + Private Cloud. + + :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 ScriptPackage + :rtype: + ~azure.mgmt.avs.models.ScriptPackagePaged[~azure.mgmt.avs.models.ScriptPackage] + :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.ScriptPackagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages'} + + def get( + self, resource_group_name, private_cloud_name, script_package_name, custom_headers=None, raw=False, **operation_config): + """Return script package available to run on an Private Cloud. + + :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 script_package_name: Name of the script package in the private + cloud + :type script_package_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: ScriptPackage or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.ScriptPackage 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'), + 'scriptPackageName': self._serialize.url("script_package_name", script_package_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('ScriptPackage', 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}/scriptPackages/{scriptPackageName}'} diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py new file mode 100644 index 0000000000000..0cdab0e1f6746 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py @@ -0,0 +1,3307 @@ +# 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: "2021-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-06-01" + + 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, properties=None, custom_headers=None, raw=False, **operation_config): + workload_network_dhcp = models.WorkloadNetworkDhcp(properties=properties) + + # 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, properties=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 properties: DHCP properties. + :type properties: ~azure.mgmt.avs.models.WorkloadNetworkDhcpEntity + :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, + properties=properties, + 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, properties=None, custom_headers=None, raw=False, **operation_config): + workload_network_dhcp = models.WorkloadNetworkDhcp(properties=properties) + + # 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, properties=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 properties: DHCP properties. + :type properties: ~azure.mgmt.avs.models.WorkloadNetworkDhcpEntity + :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, + properties=properties, + 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: 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}'} + + def list_public_ips( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List of Public IP Blocks 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 WorkloadNetworkPublicIP + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkPublicIPPaged[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_public_ips.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.WorkloadNetworkPublicIPPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_public_ips.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs'} + + def get_public_ip( + self, resource_group_name, private_cloud_name, public_ip_id, custom_headers=None, raw=False, **operation_config): + """Get a Public IP Block 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 public_ip_id: NSX Public IP Block identifier. Generally the + same as the Public IP Block's display name + :type public_ip_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: WorkloadNetworkPublicIP or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPublicIP or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_public_ip.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'), + 'publicIPId': self._serialize.url("public_ip_id", public_ip_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('WorkloadNetworkPublicIP', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_public_ip.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}'} + + + def _create_public_ip_initial( + self, resource_group_name, private_cloud_name, public_ip_id, display_name=None, number_of_public_ips=None, custom_headers=None, raw=False, **operation_config): + workload_network_public_ip = models.WorkloadNetworkPublicIP(display_name=display_name, number_of_public_ips=number_of_public_ips) + + # Construct URL + url = self.create_public_ip.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'), + 'publicIPId': self._serialize.url("public_ip_id", public_ip_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_public_ip, 'WorkloadNetworkPublicIP') + + # 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('WorkloadNetworkPublicIP', response) + if response.status_code == 201: + deserialized = self._deserialize('WorkloadNetworkPublicIP', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_public_ip( + self, resource_group_name, private_cloud_name, public_ip_id, display_name=None, number_of_public_ips=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a Public IP Block 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 public_ip_id: NSX Public IP Block identifier. Generally the + same as the Public IP Block's display name + :type public_ip_id: str + :param display_name: Display name of the Public IP Block. + :type display_name: str + :param number_of_public_ips: Number of Public IPs requested. + :type number_of_public_ips: 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 WorkloadNetworkPublicIP + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkPublicIP] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkPublicIP]] + :raises: :class:`CloudError` + """ + raw_result = self._create_public_ip_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + public_ip_id=public_ip_id, + display_name=display_name, + number_of_public_ips=number_of_public_ips, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkPublicIP', 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_public_ip.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}'} + + + def _delete_public_ip_initial( + self, resource_group_name, public_ip_id, private_cloud_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_public_ip.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\._\(\)]+$'), + 'publicIPId': self._serialize.url("public_ip_id", public_ip_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_public_ip( + self, resource_group_name, public_ip_id, private_cloud_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a Public IP Block 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 public_ip_id: NSX Public IP Block identifier. Generally the + same as the Public IP Block's display name + :type public_ip_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_public_ip_initial( + resource_group_name=resource_group_name, + public_ip_id=public_ip_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_public_ip.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}'}