From 7bfc17a2a20c9536d17c144e75feef6b10f9d57a Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 10 Nov 2020 03:38:40 +0000 Subject: [PATCH] Generated from 30060f5b479356df87a4fe9682e1143c310e288a --- .../azure/mgmt/avs/_avs_client.py | 12 +- .../azure/mgmt/avs/models/__init__.py | 100 +- .../mgmt/avs/models/_avs_client_enums.py | 85 + .../azure/mgmt/avs/models/_models.py | 851 ++++++- .../azure/mgmt/avs/models/_models_py3.py | 853 ++++++- .../azure/mgmt/avs/models/_paged_models.py | 91 + .../azure/mgmt/avs/operations/__init__.py | 4 + .../operations/_authorizations_operations.py | 15 +- .../avs/operations/_clusters_operations.py | 4 +- .../_global_reach_connections_operations.py | 381 +++ .../_hcx_enterprise_sites_operations.py | 12 +- .../avs/operations/_locations_operations.py | 4 +- .../azure/mgmt/avs/operations/_operations.py | 4 +- .../operations/_private_clouds_operations.py | 4 +- .../_workload_networks_operations.py | 2093 +++++++++++++++++ 15 files changed, 4426 insertions(+), 87 deletions(-) create mode 100644 sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py create mode 100644 sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py index e2c496724837..bac6881080c2 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py @@ -19,6 +19,8 @@ from .operations import ClustersOperations from .operations import HcxEnterpriseSitesOperations from .operations import AuthorizationsOperations +from .operations import GlobalReachConnectionsOperations +from .operations import WorkloadNetworksOperations from . import models @@ -40,6 +42,10 @@ class AVSClient(SDKClient): :vartype hcx_enterprise_sites: azure.mgmt.avs.operations.HcxEnterpriseSitesOperations :ivar authorizations: Authorizations operations :vartype authorizations: azure.mgmt.avs.operations.AuthorizationsOperations + :ivar global_reach_connections: GlobalReachConnections operations + :vartype global_reach_connections: azure.mgmt.avs.operations.GlobalReachConnectionsOperations + :ivar workload_networks: WorkloadNetworks operations + :vartype workload_networks: azure.mgmt.avs.operations.WorkloadNetworksOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -56,7 +62,7 @@ def __init__( super(AVSClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2020-03-20' + self.api_version = '2020-07-17-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -72,3 +78,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.authorizations = AuthorizationsOperations( self._client, self.config, self._serialize, self._deserialize) + self.global_reach_connections = GlobalReachConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.workload_networks = WorkloadNetworksOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py index c9859074da49..f4e757c8b9a8 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py @@ -14,50 +14,93 @@ from ._models_py3 import Circuit from ._models_py3 import Cluster from ._models_py3 import ClusterUpdate - from ._models_py3 import ClusterUpdateProperties + from ._models_py3 import CommonClusterProperties from ._models_py3 import Endpoints from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorResponse from ._models_py3 import ExpressRouteAuthorization + from ._models_py3 import GlobalReachConnection from ._models_py3 import HcxEnterpriseSite from ._models_py3 import IdentitySource + from ._models_py3 import LogSpecification from ._models_py3 import ManagementCluster + from ._models_py3 import MetricDimension + from ._models_py3 import MetricSpecification 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 Quota from ._models_py3 import Resource + from ._models_py3 import ServiceSpecification from ._models_py3 import Sku from ._models_py3 import TrackedResource from ._models_py3 import Trial + from ._models_py3 import WorkloadNetworkDhcp + from ._models_py3 import WorkloadNetworkDhcpEntity + from ._models_py3 import WorkloadNetworkDhcpRelay + from ._models_py3 import WorkloadNetworkDhcpServer + from ._models_py3 import WorkloadNetworkGateway + from ._models_py3 import WorkloadNetworkPortMirroring + from ._models_py3 import WorkloadNetworkSegment + from ._models_py3 import WorkloadNetworkSegmentPortVif + from ._models_py3 import WorkloadNetworkSegmentSubnet + from ._models_py3 import WorkloadNetworkVirtualMachine + from ._models_py3 import WorkloadNetworkVMGroup except (SyntaxError, ImportError): from ._models import AdminCredentials from ._models import Circuit from ._models import Cluster from ._models import ClusterUpdate - from ._models import ClusterUpdateProperties + from ._models import CommonClusterProperties from ._models import Endpoints from ._models import ErrorAdditionalInfo from ._models import ErrorResponse from ._models import ExpressRouteAuthorization + from ._models import GlobalReachConnection from ._models import HcxEnterpriseSite from ._models import IdentitySource + from ._models import LogSpecification from ._models import ManagementCluster + from ._models import MetricDimension + from ._models import MetricSpecification 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 Quota from ._models import Resource + from ._models import ServiceSpecification from ._models import Sku from ._models import TrackedResource from ._models import Trial + from ._models import WorkloadNetworkDhcp + from ._models import WorkloadNetworkDhcpEntity + from ._models import WorkloadNetworkDhcpRelay + from ._models import WorkloadNetworkDhcpServer + from ._models import WorkloadNetworkGateway + from ._models import WorkloadNetworkPortMirroring + from ._models import WorkloadNetworkSegment + from ._models import WorkloadNetworkSegmentPortVif + from ._models import WorkloadNetworkSegmentSubnet + from ._models import WorkloadNetworkVirtualMachine + from ._models import WorkloadNetworkVMGroup from ._paged_models import ClusterPaged from ._paged_models import ExpressRouteAuthorizationPaged +from ._paged_models import GlobalReachConnectionPaged from ._paged_models import HcxEnterpriseSitePaged from ._paged_models import OperationPaged from ._paged_models import PrivateCloudPaged +from ._paged_models import WorkloadNetworkDhcpPaged +from ._paged_models import WorkloadNetworkGatewayPaged +from ._paged_models import WorkloadNetworkPortMirroringPaged +from ._paged_models import WorkloadNetworkSegmentPaged +from ._paged_models import WorkloadNetworkVirtualMachinePaged +from ._paged_models import WorkloadNetworkVMGroupPaged from ._avs_client_enums import ( TrialStatus, QuotaEnabled, @@ -65,8 +108,21 @@ SslEnum, PrivateCloudProvisioningState, InternetEnum, + VcsaAdminRotateEnum, + NsxtAdminRotateEnum, ClusterProvisioningState, HcxEnterpriseSiteStatus, + GlobalReachConnectionProvisioningState, + GlobalReachConnectionStatus, + SegmentStatusEnum, + WorkloadNetworkSegmentProvisioningState, + WorkloadNetworkDhcpProvisioningState, + PortMirroringDirectionEnum, + PortMirroringStatusEnum, + WorkloadNetworkPortMirroringProvisioningState, + VMGroupStatusEnum, + WorkloadNetworkVMGroupProvisioningState, + VMTypeEnum, ) __all__ = [ @@ -74,34 +130,72 @@ 'Circuit', 'Cluster', 'ClusterUpdate', - 'ClusterUpdateProperties', + 'CommonClusterProperties', 'Endpoints', 'ErrorAdditionalInfo', 'ErrorResponse', 'ExpressRouteAuthorization', + 'GlobalReachConnection', 'HcxEnterpriseSite', 'IdentitySource', + 'LogSpecification', 'ManagementCluster', + 'MetricDimension', + 'MetricSpecification', 'Operation', 'OperationDisplay', + 'OperationProperties', 'PrivateCloud', 'PrivateCloudUpdate', + 'ProxyResource', 'Quota', 'Resource', + 'ServiceSpecification', 'Sku', 'TrackedResource', 'Trial', + 'WorkloadNetworkDhcp', + 'WorkloadNetworkDhcpEntity', + 'WorkloadNetworkDhcpRelay', + 'WorkloadNetworkDhcpServer', + 'WorkloadNetworkGateway', + 'WorkloadNetworkPortMirroring', + 'WorkloadNetworkSegment', + 'WorkloadNetworkSegmentPortVif', + 'WorkloadNetworkSegmentSubnet', + 'WorkloadNetworkVirtualMachine', + 'WorkloadNetworkVMGroup', 'OperationPaged', 'PrivateCloudPaged', 'ClusterPaged', 'HcxEnterpriseSitePaged', 'ExpressRouteAuthorizationPaged', + 'GlobalReachConnectionPaged', + 'WorkloadNetworkSegmentPaged', + 'WorkloadNetworkDhcpPaged', + 'WorkloadNetworkGatewayPaged', + 'WorkloadNetworkPortMirroringPaged', + 'WorkloadNetworkVMGroupPaged', + 'WorkloadNetworkVirtualMachinePaged', 'TrialStatus', 'QuotaEnabled', 'ExpressRouteAuthorizationProvisioningState', 'SslEnum', 'PrivateCloudProvisioningState', 'InternetEnum', + 'VcsaAdminRotateEnum', + 'NsxtAdminRotateEnum', 'ClusterProvisioningState', 'HcxEnterpriseSiteStatus', + 'GlobalReachConnectionProvisioningState', + 'GlobalReachConnectionStatus', + 'SegmentStatusEnum', + 'WorkloadNetworkSegmentProvisioningState', + 'WorkloadNetworkDhcpProvisioningState', + 'PortMirroringDirectionEnum', + 'PortMirroringStatusEnum', + 'WorkloadNetworkPortMirroringProvisioningState', + 'VMGroupStatusEnum', + 'WorkloadNetworkVMGroupProvisioningState', + 'VMTypeEnum', ] diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py index dfda35df4748..e94b8af75abe 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 @@ -55,6 +55,16 @@ class InternetEnum(str, Enum): disabled = "Disabled" +class VcsaAdminRotateEnum(str, Enum): + + onetime_rotate = "OnetimeRotate" + + +class NsxtAdminRotateEnum(str, Enum): + + onetime_rotate = "OnetimeRotate" + + class ClusterProvisioningState(str, Enum): succeeded = "Succeeded" @@ -70,3 +80,78 @@ class HcxEnterpriseSiteStatus(str, Enum): consumed = "Consumed" deactivated = "Deactivated" deleted = "Deleted" + + +class GlobalReachConnectionProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + updating = "Updating" + + +class GlobalReachConnectionStatus(str, Enum): + + connected = "Connected" + connecting = "Connecting" + disconnected = "Disconnected" + + +class SegmentStatusEnum(str, Enum): + + successfailure = "SUCCESS, FAILURE" + + +class WorkloadNetworkSegmentProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + building = "Building" + deleting = "Deleting" + updating = "Updating" + + +class WorkloadNetworkDhcpProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + building = "Building" + deleting = "Deleting" + updating = "Updating" + + +class PortMirroringDirectionEnum(str, Enum): + + ingressegressbidirectional = "INGRESS, EGRESS, BIDIRECTIONAL" + + +class PortMirroringStatusEnum(str, Enum): + + successfailure = "SUCCESS, FAILURE" + + +class WorkloadNetworkPortMirroringProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + building = "Building" + deleting = "Deleting" + updating = "Updating" + + +class VMGroupStatusEnum(str, Enum): + + successfailure = "SUCCESS, FAILURE" + + +class WorkloadNetworkVMGroupProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + building = "Building" + deleting = "Deleting" + updating = "Updating" + + +class VMTypeEnum(str, Enum): + + regularedgeservice = "REGULAR, EDGE, SERVICE" diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py index f268da2f0a80..90434ab707b0 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py @@ -168,16 +168,16 @@ class Cluster(Resource): :vartype type: str :param sku: Required. The cluster SKU :type sku: ~azure.mgmt.avs.models.Sku + :ivar provisioning_state: The state of the cluster provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.ClusterProvisioningState :param cluster_size: The cluster size :type cluster_size: int :ivar cluster_id: The identity :vartype cluster_id: int :ivar hosts: The hosts :vartype hosts: list[str] - :ivar provisioning_state: The state of the cluster provisioning. Possible - values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' - :vartype provisioning_state: str or - ~azure.mgmt.avs.models.ClusterProvisioningState """ _validation = { @@ -185,9 +185,9 @@ class Cluster(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'sku': {'required': True}, + 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, 'hosts': {'readonly': True}, - 'provisioning_state': {'readonly': True}, } _attribute_map = { @@ -195,19 +195,19 @@ class Cluster(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + '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]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } def __init__(self, **kwargs): super(Cluster, self).__init__(**kwargs) self.sku = kwargs.get('sku', None) + self.provisioning_state = None self.cluster_size = kwargs.get('cluster_size', None) self.cluster_id = None self.hosts = None - self.provisioning_state = None class ClusterUpdate(Model): @@ -226,20 +226,43 @@ def __init__(self, **kwargs): self.cluster_size = kwargs.get('cluster_size', None) -class ClusterUpdateProperties(Model): - """The properties of a cluster that may be updated. +class CommonClusterProperties(Model): + """The common properties of a cluster. + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the cluster provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.ClusterProvisioningState :param cluster_size: The cluster size :type cluster_size: int + :ivar cluster_id: The identity + :vartype cluster_id: int + :ivar hosts: The hosts + :vartype hosts: list[str] """ + _validation = { + 'provisioning_state': {'readonly': True}, + 'cluster_id': {'readonly': True}, + 'hosts': {'readonly': True}, + } + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, + 'cluster_id': {'key': 'clusterId', 'type': 'int'}, + 'hosts': {'key': 'hosts', 'type': '[str]'}, } def __init__(self, **kwargs): - super(ClusterUpdateProperties, self).__init__(**kwargs) + super(CommonClusterProperties, self).__init__(**kwargs) + self.provisioning_state = None self.cluster_size = kwargs.get('cluster_size', None) + self.cluster_id = None + self.hosts = None class Endpoints(Model): @@ -304,7 +327,11 @@ def __init__(self, **kwargs): class ErrorResponse(Model): - """The resource management error response. + """Error Response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). Variables are only populated by the server, and will be ignored when sending a request. @@ -396,6 +423,68 @@ def __init__(self, **kwargs): self.express_route_authorization_key = None +class GlobalReachConnection(Resource): + """A global reach connection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: The state of the ExpressRoute Circuit + Authorization provisioning. Possible values include: 'Succeeded', + 'Failed', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.GlobalReachConnectionProvisioningState + :ivar address_prefix: The network used for global reach carved out from + the original network block provided for the private cloud + :vartype address_prefix: str + :param authorization_key: Authorization key from the peer express route + used for the global reach connection + :type authorization_key: str + :ivar circuit_connection_status: The connection status of the global reach + connection. Possible values include: 'Connected', 'Connecting', + 'Disconnected' + :vartype circuit_connection_status: str or + ~azure.mgmt.avs.models.GlobalReachConnectionStatus + :param peer_express_route_circuit: Identifier of the ExpressRoute Circuit + to peer with in the global reach connection + :type peer_express_route_circuit: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'address_prefix': {'readonly': True}, + 'circuit_connection_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'circuit_connection_status': {'key': 'properties.circuitConnectionStatus', 'type': 'str'}, + 'peer_express_route_circuit': {'key': 'properties.peerExpressRouteCircuit', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GlobalReachConnection, self).__init__(**kwargs) + self.provisioning_state = None + self.address_prefix = None + self.authorization_key = kwargs.get('authorization_key', None) + self.circuit_connection_status = None + self.peer_express_route_circuit = kwargs.get('peer_express_route_circuit', None) + + class HcxEnterpriseSite(Resource): """An HCX Enterprise Site resource. @@ -492,12 +581,40 @@ def __init__(self, **kwargs): self.password = kwargs.get('password', None) -class ManagementCluster(ClusterUpdateProperties): - """The properties of a default cluster. +class LogSpecification(Model): + """Specifications of the Log for Azure Monitoring. + + :param name: Name of the log + :type name: str + :param display_name: Localized friendly display name of the log + :type display_name: str + :param blob_duration: Blob duration of the log + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LogSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.blob_duration = kwargs.get('blob_duration', None) + + +class ManagementCluster(CommonClusterProperties): + """The properties of a management cluster. Variables are only populated by the server, and will be ignored when sending a request. + :ivar provisioning_state: The state of the cluster provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.ClusterProvisioningState :param cluster_size: The cluster size :type cluster_size: int :ivar cluster_id: The identity @@ -507,11 +624,13 @@ class ManagementCluster(ClusterUpdateProperties): """ _validation = { + 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, 'hosts': {'readonly': True}, } _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, 'cluster_id': {'key': 'clusterId', 'type': 'int'}, 'hosts': {'key': 'hosts', 'type': '[str]'}, @@ -519,8 +638,94 @@ class ManagementCluster(ClusterUpdateProperties): def __init__(self, **kwargs): super(ManagementCluster, self).__init__(**kwargs) - self.cluster_id = None - self.hosts = None + + +class MetricDimension(Model): + """Specifications of the Dimension of metrics. + + :param name: Name of the dimension + :type name: str + :param display_name: Localized friendly display name of the dimension + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricDimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class MetricSpecification(Model): + """Specifications of the Metrics for Azure Monitoring. + + :param name: Name of the metric + :type name: str + :param display_name: Localized friendly display name of the metric + :type display_name: str + :param display_description: Localized friendly description of the metric + :type display_description: str + :param unit: Unit that makes sense for the metric + :type unit: str + :param category: Name of the metric category that the metric belongs to. A + metric can only belong to a single category. + :type category: str + :param aggregation_type: Only provide one value for this field. Valid + values: Average, Minimum, Maximum, Total, Count. + :type aggregation_type: str + :param supported_aggregation_types: Supported aggregation types + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: Supported time grain types + :type supported_time_grain_types: list[str] + :param fill_gap_with_zero: Optional. If set to true, then zero will be + returned for time duration where no metric is emitted/published. + :type fill_gap_with_zero: bool + :param dimensions: Dimensions of the metric + :type dimensions: list[~azure.mgmt.avs.models.MetricDimension] + :param enable_regional_mdm_account: Whether or not the service is using + regional MDM accounts. + :type enable_regional_mdm_account: str + :param source_mdm_account: The name of the MDM account. + :type source_mdm_account: str + :param source_mdm_namespace: The name of the MDM namespace. + :type source_mdm_namespace: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'str'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.category = kwargs.get('category', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.dimensions = kwargs.get('dimensions', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.source_mdm_account = kwargs.get('source_mdm_account', None) + self.source_mdm_namespace = kwargs.get('source_mdm_namespace', None) class Operation(Model): @@ -534,6 +739,13 @@ class Operation(Model): :ivar display: Contains the localized display information for this operation :vartype display: ~azure.mgmt.avs.models.OperationDisplay + :param is_data_action: Gets or sets a value indicating whether the + operation is a data action or not + :type is_data_action: bool + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: ~azure.mgmt.avs.models.OperationProperties """ _validation = { @@ -544,12 +756,18 @@ class Operation(Model): _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'OperationProperties'}, } def __init__(self, **kwargs): super(Operation, self).__init__(**kwargs) self.name = None self.display = None + self.is_data_action = kwargs.get('is_data_action', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) class OperationDisplay(Model): @@ -591,6 +809,22 @@ def __init__(self, **kwargs): self.description = None +class OperationProperties(Model): + """Extra Operation properties. + + :param service_specification: Service specifications of the operation + :type service_specification: ~azure.mgmt.avs.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(OperationProperties, self).__init__(**kwargs) + self.service_specification = kwargs.get('service_specification', None) + + class TrackedResource(Resource): """The resource model definition for a ARM tracked top level resource. @@ -652,10 +886,16 @@ 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] + :param vcenter_password: Indicate to rotate the vCenter admin password for + the private cloud. Possible values include: 'OnetimeRotate' + :type vcenter_password: str or ~azure.mgmt.avs.models.VcsaAdminRotateEnum + :param nsxt_password: Indicate to rotate the NSX-T Manager password for + the private cloud. Possible values include: 'OnetimeRotate' + :type nsxt_password: str or ~azure.mgmt.avs.models.NsxtAdminRotateEnum :ivar provisioning_state: The provisioning state. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Pending', 'Building', 'Deleting', 'Updating' @@ -678,12 +918,6 @@ class PrivateCloud(TrackedResource): :vartype provisioning_network: str :ivar vmotion_network: Used for live migration of virtual machines :vartype vmotion_network: str - :param vcenter_password: Optionally, set the vCenter admin password when - the private cloud is created - :type vcenter_password: str - :param nsxt_password: Optionally, set the NSX-T Manager password when the - private cloud is created - :type nsxt_password: str :ivar vcenter_certificate_thumbprint: Thumbprint of the vCenter Server SSL certificate :vartype vcenter_certificate_thumbprint: str @@ -717,6 +951,8 @@ class PrivateCloud(TrackedResource): 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, 'internet': {'key': 'properties.internet', 'type': 'str'}, 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + 'vcenter_password': {'key': 'properties.vcenterPassword', 'type': 'str'}, + 'nsxt_password': {'key': 'properties.nsxtPassword', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'circuit': {'key': 'properties.circuit', 'type': 'Circuit'}, 'endpoints': {'key': 'properties.endpoints', 'type': 'Endpoints'}, @@ -724,8 +960,6 @@ class PrivateCloud(TrackedResource): 'management_network': {'key': 'properties.managementNetwork', 'type': 'str'}, 'provisioning_network': {'key': 'properties.provisioningNetwork', 'type': 'str'}, 'vmotion_network': {'key': 'properties.vmotionNetwork', 'type': 'str'}, - 'vcenter_password': {'key': 'properties.vcenterPassword', 'type': 'str'}, - 'nsxt_password': {'key': 'properties.nsxtPassword', 'type': 'str'}, 'vcenter_certificate_thumbprint': {'key': 'properties.vcenterCertificateThumbprint', 'type': 'str'}, 'nsxt_certificate_thumbprint': {'key': 'properties.nsxtCertificateThumbprint', 'type': 'str'}, } @@ -734,8 +968,10 @@ 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.vcenter_password = kwargs.get('vcenter_password', None) + self.nsxt_password = kwargs.get('nsxt_password', None) self.provisioning_state = None self.circuit = kwargs.get('circuit', None) self.endpoints = None @@ -743,8 +979,6 @@ def __init__(self, **kwargs): self.management_network = None self.provisioning_network = None self.vmotion_network = None - self.vcenter_password = kwargs.get('vcenter_password', None) - self.nsxt_password = kwargs.get('nsxt_password', None) self.vcenter_certificate_thumbprint = None self.nsxt_certificate_thumbprint = None @@ -752,15 +986,21 @@ 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] + :param vcenter_password: Indicate to rotate the vCenter admin password for + the private cloud. Possible values include: 'OnetimeRotate' + :type vcenter_password: str or ~azure.mgmt.avs.models.VcsaAdminRotateEnum + :param nsxt_password: Indicate to rotate the NSX-T Manager password for + the private cloud. Possible values include: 'OnetimeRotate' + :type nsxt_password: str or ~azure.mgmt.avs.models.NsxtAdminRotateEnum """ _attribute_map = { @@ -768,14 +1008,48 @@ class PrivateCloudUpdate(Model): 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, 'internet': {'key': 'properties.internet', 'type': 'str'}, 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + 'vcenter_password': {'key': 'properties.vcenterPassword', 'type': 'str'}, + 'nsxt_password': {'key': 'properties.nsxtPassword', 'type': 'str'}, } def __init__(self, **kwargs): super(PrivateCloudUpdate, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) self.management_cluster = kwargs.get('management_cluster', None) - self.internet = kwargs.get('internet', None) + self.internet = kwargs.get('internet', "Disabled") self.identity_sources = kwargs.get('identity_sources', None) + self.vcenter_password = kwargs.get('vcenter_password', None) + self.nsxt_password = kwargs.get('nsxt_password', None) + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) class Quota(Model): @@ -807,6 +1081,28 @@ def __init__(self, **kwargs): self.quota_enabled = None +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. @@ -856,3 +1152,498 @@ def __init__(self, **kwargs): super(Trial, self).__init__(**kwargs) self.status = None self.available_hosts = None + + +class WorkloadNetworkDhcp(ProxyResource): + """NSX DHCP. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'segments': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'segments': {'key': 'properties.segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkDhcp, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.segments = None + self.provisioning_state = None + self.revision = kwargs.get('revision', None) + + +class WorkloadNetworkDhcpEntity(Model): + """Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to + inherit from. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: WorkloadNetworkDhcpServer, WorkloadNetworkDhcpRelay + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + :param dhcp_type: Required. Constant filled by server. + :type dhcp_type: str + """ + + _validation = { + 'segments': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'dhcp_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'segments': {'key': 'segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'long'}, + 'dhcp_type': {'key': 'dhcpType', 'type': 'str'}, + } + + _subtype_map = { + 'dhcp_type': {'SERVER': 'WorkloadNetworkDhcpServer', 'RELAY': 'WorkloadNetworkDhcpRelay'} + } + + def __init__(self, **kwargs): + super(WorkloadNetworkDhcpEntity, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.segments = None + self.provisioning_state = None + self.revision = kwargs.get('revision', None) + self.dhcp_type = None + + +class WorkloadNetworkDhcpRelay(WorkloadNetworkDhcpEntity): + """NSX DHCP Relay. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + :param dhcp_type: Required. Constant filled by server. + :type dhcp_type: str + :param server_addresses: DHCP Relay Addresses. Max 3. + :type server_addresses: list[str] + """ + + _validation = { + 'segments': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'dhcp_type': {'required': True}, + 'server_addresses': {'max_items': 3, 'min_items': 1}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'segments': {'key': 'segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'long'}, + 'dhcp_type': {'key': 'dhcpType', 'type': 'str'}, + 'server_addresses': {'key': 'serverAddresses', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkDhcpRelay, self).__init__(**kwargs) + self.server_addresses = kwargs.get('server_addresses', None) + self.dhcp_type = 'RELAY' + + +class WorkloadNetworkDhcpServer(WorkloadNetworkDhcpEntity): + """NSX DHCP Server. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + :param dhcp_type: Required. Constant filled by server. + :type dhcp_type: str + :param server_address: DHCP Server Address. + :type server_address: str + :param lease_time: DHCP Server Lease Time. + :type lease_time: long + """ + + _validation = { + 'segments': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'dhcp_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'segments': {'key': 'segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'long'}, + 'dhcp_type': {'key': 'dhcpType', 'type': 'str'}, + 'server_address': {'key': 'serverAddress', 'type': 'str'}, + 'lease_time': {'key': 'leaseTime', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkDhcpServer, self).__init__(**kwargs) + self.server_address = kwargs.get('server_address', None) + self.lease_time = kwargs.get('lease_time', None) + self.dhcp_type = 'SERVER' + + +class WorkloadNetworkGateway(ProxyResource): + """NSX Gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: Display name of the DHCP entity. + :type display_name: str + :ivar path: NSX Gateway Path. + :vartype path: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'path': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkGateway, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.path = None + + +class WorkloadNetworkPortMirroring(ProxyResource): + """NSX Port Mirroring. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: Display name of the port mirroring profile. + :type display_name: str + :param direction: Direction of port mirroring profile. Possible values + include: 'INGRESS, EGRESS, BIDIRECTIONAL' + :type direction: str or ~azure.mgmt.avs.models.PortMirroringDirectionEnum + :param source: Source VM Group. + :type source: str + :param destination: Destination VM Group. + :type destination: str + :ivar status: Port Mirroring Status. Possible values include: 'SUCCESS, + FAILURE' + :vartype status: str or ~azure.mgmt.avs.models.PortMirroringStatusEnum + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroringProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'destination': {'key': 'properties.destination', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkPortMirroring, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.direction = kwargs.get('direction', None) + self.source = kwargs.get('source', None) + self.destination = kwargs.get('destination', None) + self.status = None + self.provisioning_state = None + self.revision = kwargs.get('revision', None) + + +class WorkloadNetworkSegment(ProxyResource): + """NSX Segment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: Display name of the segment. + :type display_name: str + :param connected_gateway: Gateway which to connect segment to. + :type connected_gateway: str + :param subnet: Subnet which to connect segment to. + :type subnet: ~azure.mgmt.avs.models.WorkloadNetworkSegmentSubnet + :ivar port_vif: Port Vif which segment is associated with. + :vartype port_vif: + list[~azure.mgmt.avs.models.WorkloadNetworkSegmentPortVif] + :ivar status: Segment status. Possible values include: 'SUCCESS, FAILURE' + :vartype status: str or ~azure.mgmt.avs.models.SegmentStatusEnum + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkSegmentProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'port_vif': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'connected_gateway': {'key': 'properties.connectedGateway', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'WorkloadNetworkSegmentSubnet'}, + 'port_vif': {'key': 'properties.portVif', 'type': '[WorkloadNetworkSegmentPortVif]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkSegment, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.connected_gateway = kwargs.get('connected_gateway', None) + self.subnet = kwargs.get('subnet', None) + self.port_vif = None + self.status = None + self.provisioning_state = None + self.revision = kwargs.get('revision', None) + + +class WorkloadNetworkSegmentPortVif(Model): + """Ports and any VIF attached to segment. + + :param port_name: Name of port or VIF attached to segment. + :type port_name: str + """ + + _attribute_map = { + 'port_name': {'key': 'portName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkSegmentPortVif, self).__init__(**kwargs) + self.port_name = kwargs.get('port_name', None) + + +class WorkloadNetworkSegmentSubnet(Model): + """Subnet configuration for segment. + + :param dhcp_ranges: DHCP Range assigned for subnet. + :type dhcp_ranges: list[str] + :param gateway_address: Gateway address. + :type gateway_address: str + """ + + _attribute_map = { + 'dhcp_ranges': {'key': 'dhcpRanges', 'type': '[str]'}, + 'gateway_address': {'key': 'gatewayAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkSegmentSubnet, self).__init__(**kwargs) + self.dhcp_ranges = kwargs.get('dhcp_ranges', None) + self.gateway_address = kwargs.get('gateway_address', None) + + +class WorkloadNetworkVirtualMachine(ProxyResource): + """NSX Virtual Machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: Display name of the VM. + :type display_name: str + :ivar vm_type: Virtual machine type. Possible values include: 'REGULAR, + EDGE, SERVICE' + :vartype vm_type: str or ~azure.mgmt.avs.models.VMTypeEnum + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'vm_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'vm_type': {'key': 'properties.vmType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkVirtualMachine, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.vm_type = None + + +class WorkloadNetworkVMGroup(ProxyResource): + """NSX VM Group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: Display name of the VM group. + :type display_name: str + :param members: Virtual machine members of this group. + :type members: list[str] + :ivar status: VM Group status. Possible values include: 'SUCCESS, FAILURE' + :vartype status: str or ~azure.mgmt.avs.models.VMGroupStatusEnum + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkVMGroupProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'members': {'key': 'properties.members', 'type': '[str]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(WorkloadNetworkVMGroup, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.members = kwargs.get('members', None) + self.status = None + self.provisioning_state = None + self.revision = kwargs.get('revision', None) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py index dd91b09cdb61..949aef1bc00e 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py @@ -168,16 +168,16 @@ class Cluster(Resource): :vartype type: str :param sku: Required. The cluster SKU :type sku: ~azure.mgmt.avs.models.Sku + :ivar provisioning_state: The state of the cluster provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.ClusterProvisioningState :param cluster_size: The cluster size :type cluster_size: int :ivar cluster_id: The identity :vartype cluster_id: int :ivar hosts: The hosts :vartype hosts: list[str] - :ivar provisioning_state: The state of the cluster provisioning. Possible - values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' - :vartype provisioning_state: str or - ~azure.mgmt.avs.models.ClusterProvisioningState """ _validation = { @@ -185,9 +185,9 @@ class Cluster(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'sku': {'required': True}, + 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, 'hosts': {'readonly': True}, - 'provisioning_state': {'readonly': True}, } _attribute_map = { @@ -195,19 +195,19 @@ class Cluster(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + '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]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } def __init__(self, *, sku, cluster_size: int=None, **kwargs) -> None: super(Cluster, self).__init__(**kwargs) self.sku = sku + self.provisioning_state = None self.cluster_size = cluster_size self.cluster_id = None self.hosts = None - self.provisioning_state = None class ClusterUpdate(Model): @@ -226,20 +226,43 @@ def __init__(self, *, cluster_size: int=None, **kwargs) -> None: self.cluster_size = cluster_size -class ClusterUpdateProperties(Model): - """The properties of a cluster that may be updated. +class CommonClusterProperties(Model): + """The common properties of a cluster. + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: The state of the cluster provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.ClusterProvisioningState :param cluster_size: The cluster size :type cluster_size: int + :ivar cluster_id: The identity + :vartype cluster_id: int + :ivar hosts: The hosts + :vartype hosts: list[str] """ + _validation = { + 'provisioning_state': {'readonly': True}, + 'cluster_id': {'readonly': True}, + 'hosts': {'readonly': True}, + } + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, + 'cluster_id': {'key': 'clusterId', 'type': 'int'}, + 'hosts': {'key': 'hosts', 'type': '[str]'}, } def __init__(self, *, cluster_size: int=None, **kwargs) -> None: - super(ClusterUpdateProperties, self).__init__(**kwargs) + super(CommonClusterProperties, self).__init__(**kwargs) + self.provisioning_state = None self.cluster_size = cluster_size + self.cluster_id = None + self.hosts = None class Endpoints(Model): @@ -304,7 +327,11 @@ def __init__(self, **kwargs) -> None: class ErrorResponse(Model): - """The resource management error response. + """Error Response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). Variables are only populated by the server, and will be ignored when sending a request. @@ -396,6 +423,68 @@ def __init__(self, **kwargs) -> None: self.express_route_authorization_key = None +class GlobalReachConnection(Resource): + """A global reach connection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: The state of the ExpressRoute Circuit + Authorization provisioning. Possible values include: 'Succeeded', + 'Failed', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.GlobalReachConnectionProvisioningState + :ivar address_prefix: The network used for global reach carved out from + the original network block provided for the private cloud + :vartype address_prefix: str + :param authorization_key: Authorization key from the peer express route + used for the global reach connection + :type authorization_key: str + :ivar circuit_connection_status: The connection status of the global reach + connection. Possible values include: 'Connected', 'Connecting', + 'Disconnected' + :vartype circuit_connection_status: str or + ~azure.mgmt.avs.models.GlobalReachConnectionStatus + :param peer_express_route_circuit: Identifier of the ExpressRoute Circuit + to peer with in the global reach connection + :type peer_express_route_circuit: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'address_prefix': {'readonly': True}, + 'circuit_connection_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, + 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, + 'circuit_connection_status': {'key': 'properties.circuitConnectionStatus', 'type': 'str'}, + 'peer_express_route_circuit': {'key': 'properties.peerExpressRouteCircuit', 'type': 'str'}, + } + + def __init__(self, *, authorization_key: str=None, peer_express_route_circuit: str=None, **kwargs) -> None: + super(GlobalReachConnection, self).__init__(**kwargs) + self.provisioning_state = None + self.address_prefix = None + self.authorization_key = authorization_key + self.circuit_connection_status = None + self.peer_express_route_circuit = peer_express_route_circuit + + class HcxEnterpriseSite(Resource): """An HCX Enterprise Site resource. @@ -492,12 +581,40 @@ def __init__(self, *, name: str=None, alias: str=None, domain: str=None, base_us self.password = password -class ManagementCluster(ClusterUpdateProperties): - """The properties of a default cluster. +class LogSpecification(Model): + """Specifications of the Log for Azure Monitoring. + + :param name: Name of the log + :type name: str + :param display_name: Localized friendly display name of the log + :type display_name: str + :param blob_duration: Blob duration of the log + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, blob_duration: str=None, **kwargs) -> None: + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration + + +class ManagementCluster(CommonClusterProperties): + """The properties of a management cluster. Variables are only populated by the server, and will be ignored when sending a request. + :ivar provisioning_state: The state of the cluster provisioning. Possible + values include: 'Succeeded', 'Failed', 'Cancelled', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.ClusterProvisioningState :param cluster_size: The cluster size :type cluster_size: int :ivar cluster_id: The identity @@ -507,11 +624,13 @@ class ManagementCluster(ClusterUpdateProperties): """ _validation = { + 'provisioning_state': {'readonly': True}, 'cluster_id': {'readonly': True}, 'hosts': {'readonly': True}, } _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, 'cluster_id': {'key': 'clusterId', 'type': 'int'}, 'hosts': {'key': 'hosts', 'type': '[str]'}, @@ -519,8 +638,94 @@ class ManagementCluster(ClusterUpdateProperties): def __init__(self, *, cluster_size: int=None, **kwargs) -> None: super(ManagementCluster, self).__init__(cluster_size=cluster_size, **kwargs) - self.cluster_id = None - self.hosts = None + + +class MetricDimension(Model): + """Specifications of the Dimension of metrics. + + :param name: Name of the dimension + :type name: str + :param display_name: Localized friendly display name of the dimension + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(MetricDimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class MetricSpecification(Model): + """Specifications of the Metrics for Azure Monitoring. + + :param name: Name of the metric + :type name: str + :param display_name: Localized friendly display name of the metric + :type display_name: str + :param display_description: Localized friendly description of the metric + :type display_description: str + :param unit: Unit that makes sense for the metric + :type unit: str + :param category: Name of the metric category that the metric belongs to. A + metric can only belong to a single category. + :type category: str + :param aggregation_type: Only provide one value for this field. Valid + values: Average, Minimum, Maximum, Total, Count. + :type aggregation_type: str + :param supported_aggregation_types: Supported aggregation types + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: Supported time grain types + :type supported_time_grain_types: list[str] + :param fill_gap_with_zero: Optional. If set to true, then zero will be + returned for time duration where no metric is emitted/published. + :type fill_gap_with_zero: bool + :param dimensions: Dimensions of the metric + :type dimensions: list[~azure.mgmt.avs.models.MetricDimension] + :param enable_regional_mdm_account: Whether or not the service is using + regional MDM accounts. + :type enable_regional_mdm_account: str + :param source_mdm_account: The name of the MDM account. + :type source_mdm_account: str + :param source_mdm_namespace: The name of the MDM namespace. + :type source_mdm_namespace: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'str'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, category: str=None, aggregation_type: str=None, supported_aggregation_types=None, supported_time_grain_types=None, fill_gap_with_zero: bool=None, dimensions=None, enable_regional_mdm_account: str=None, source_mdm_account: str=None, source_mdm_namespace: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.category = category + self.aggregation_type = aggregation_type + self.supported_aggregation_types = supported_aggregation_types + self.supported_time_grain_types = supported_time_grain_types + self.fill_gap_with_zero = fill_gap_with_zero + self.dimensions = dimensions + self.enable_regional_mdm_account = enable_regional_mdm_account + self.source_mdm_account = source_mdm_account + self.source_mdm_namespace = source_mdm_namespace class Operation(Model): @@ -534,6 +739,13 @@ class Operation(Model): :ivar display: Contains the localized display information for this operation :vartype display: ~azure.mgmt.avs.models.OperationDisplay + :param is_data_action: Gets or sets a value indicating whether the + operation is a data action or not + :type is_data_action: bool + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: ~azure.mgmt.avs.models.OperationProperties """ _validation = { @@ -544,12 +756,18 @@ class Operation(Model): _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'OperationProperties'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, is_data_action: bool=None, origin: str=None, properties=None, **kwargs) -> None: super(Operation, self).__init__(**kwargs) self.name = None self.display = None + self.is_data_action = is_data_action + self.origin = origin + self.properties = properties class OperationDisplay(Model): @@ -591,6 +809,22 @@ def __init__(self, **kwargs) -> None: self.description = None +class OperationProperties(Model): + """Extra Operation properties. + + :param service_specification: Service specifications of the operation + :type service_specification: ~azure.mgmt.avs.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, service_specification=None, **kwargs) -> None: + super(OperationProperties, self).__init__(**kwargs) + self.service_specification = service_specification + + class TrackedResource(Resource): """The resource model definition for a ARM tracked top level resource. @@ -652,10 +886,16 @@ 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] + :param vcenter_password: Indicate to rotate the vCenter admin password for + the private cloud. Possible values include: 'OnetimeRotate' + :type vcenter_password: str or ~azure.mgmt.avs.models.VcsaAdminRotateEnum + :param nsxt_password: Indicate to rotate the NSX-T Manager password for + the private cloud. Possible values include: 'OnetimeRotate' + :type nsxt_password: str or ~azure.mgmt.avs.models.NsxtAdminRotateEnum :ivar provisioning_state: The provisioning state. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Pending', 'Building', 'Deleting', 'Updating' @@ -678,12 +918,6 @@ class PrivateCloud(TrackedResource): :vartype provisioning_network: str :ivar vmotion_network: Used for live migration of virtual machines :vartype vmotion_network: str - :param vcenter_password: Optionally, set the vCenter admin password when - the private cloud is created - :type vcenter_password: str - :param nsxt_password: Optionally, set the NSX-T Manager password when the - private cloud is created - :type nsxt_password: str :ivar vcenter_certificate_thumbprint: Thumbprint of the vCenter Server SSL certificate :vartype vcenter_certificate_thumbprint: str @@ -717,6 +951,8 @@ class PrivateCloud(TrackedResource): 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, 'internet': {'key': 'properties.internet', 'type': 'str'}, 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + 'vcenter_password': {'key': 'properties.vcenterPassword', 'type': 'str'}, + 'nsxt_password': {'key': 'properties.nsxtPassword', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'circuit': {'key': 'properties.circuit', 'type': 'Circuit'}, 'endpoints': {'key': 'properties.endpoints', 'type': 'Endpoints'}, @@ -724,18 +960,18 @@ class PrivateCloud(TrackedResource): 'management_network': {'key': 'properties.managementNetwork', 'type': 'str'}, 'provisioning_network': {'key': 'properties.provisioningNetwork', 'type': 'str'}, 'vmotion_network': {'key': 'properties.vmotionNetwork', 'type': 'str'}, - 'vcenter_password': {'key': 'properties.vcenterPassword', 'type': 'str'}, - 'nsxt_password': {'key': 'properties.nsxtPassword', 'type': 'str'}, 'vcenter_certificate_thumbprint': {'key': 'properties.vcenterCertificateThumbprint', 'type': 'str'}, 'nsxt_certificate_thumbprint': {'key': 'properties.nsxtCertificateThumbprint', 'type': 'str'}, } - def __init__(self, *, sku, network_block: str, location: str=None, tags=None, management_cluster=None, internet=None, identity_sources=None, circuit=None, vcenter_password: str=None, nsxt_password: str=None, **kwargs) -> None: + def __init__(self, *, sku, network_block: str, location: str=None, tags=None, management_cluster=None, internet="Disabled", identity_sources=None, vcenter_password=None, nsxt_password=None, circuit=None, **kwargs) -> None: super(PrivateCloud, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.management_cluster = management_cluster self.internet = internet self.identity_sources = identity_sources + self.vcenter_password = vcenter_password + self.nsxt_password = nsxt_password self.provisioning_state = None self.circuit = circuit self.endpoints = None @@ -743,8 +979,6 @@ def __init__(self, *, sku, network_block: str, location: str=None, tags=None, ma self.management_network = None self.provisioning_network = None self.vmotion_network = None - self.vcenter_password = vcenter_password - self.nsxt_password = nsxt_password self.vcenter_certificate_thumbprint = None self.nsxt_certificate_thumbprint = None @@ -752,15 +986,21 @@ 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] + :param vcenter_password: Indicate to rotate the vCenter admin password for + the private cloud. Possible values include: 'OnetimeRotate' + :type vcenter_password: str or ~azure.mgmt.avs.models.VcsaAdminRotateEnum + :param nsxt_password: Indicate to rotate the NSX-T Manager password for + the private cloud. Possible values include: 'OnetimeRotate' + :type nsxt_password: str or ~azure.mgmt.avs.models.NsxtAdminRotateEnum """ _attribute_map = { @@ -768,14 +1008,48 @@ class PrivateCloudUpdate(Model): 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, 'internet': {'key': 'properties.internet', 'type': 'str'}, 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + 'vcenter_password': {'key': 'properties.vcenterPassword', 'type': 'str'}, + 'nsxt_password': {'key': 'properties.nsxtPassword', 'type': 'str'}, } - def __init__(self, *, tags=None, management_cluster=None, internet=None, identity_sources=None, **kwargs) -> None: + def __init__(self, *, tags=None, management_cluster=None, internet="Disabled", identity_sources=None, vcenter_password=None, nsxt_password=None, **kwargs) -> None: super(PrivateCloudUpdate, self).__init__(**kwargs) self.tags = tags self.management_cluster = management_cluster self.internet = internet self.identity_sources = identity_sources + self.vcenter_password = vcenter_password + self.nsxt_password = nsxt_password + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) class Quota(Model): @@ -807,6 +1081,28 @@ def __init__(self, **kwargs) -> None: self.quota_enabled = None +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. @@ -856,3 +1152,498 @@ def __init__(self, **kwargs) -> None: super(Trial, self).__init__(**kwargs) self.status = None self.available_hosts = None + + +class WorkloadNetworkDhcp(ProxyResource): + """NSX DHCP. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'segments': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'segments': {'key': 'properties.segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, *, display_name: str=None, revision: int=None, **kwargs) -> None: + super(WorkloadNetworkDhcp, self).__init__(**kwargs) + self.display_name = display_name + self.segments = None + self.provisioning_state = None + self.revision = revision + + +class WorkloadNetworkDhcpEntity(Model): + """Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to + inherit from. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: WorkloadNetworkDhcpServer, WorkloadNetworkDhcpRelay + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + :param dhcp_type: Required. Constant filled by server. + :type dhcp_type: str + """ + + _validation = { + 'segments': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'dhcp_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'segments': {'key': 'segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'long'}, + 'dhcp_type': {'key': 'dhcpType', 'type': 'str'}, + } + + _subtype_map = { + 'dhcp_type': {'SERVER': 'WorkloadNetworkDhcpServer', 'RELAY': 'WorkloadNetworkDhcpRelay'} + } + + def __init__(self, *, display_name: str=None, revision: int=None, **kwargs) -> None: + super(WorkloadNetworkDhcpEntity, self).__init__(**kwargs) + self.display_name = display_name + self.segments = None + self.provisioning_state = None + self.revision = revision + self.dhcp_type = None + + +class WorkloadNetworkDhcpRelay(WorkloadNetworkDhcpEntity): + """NSX DHCP Relay. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + :param dhcp_type: Required. Constant filled by server. + :type dhcp_type: str + :param server_addresses: DHCP Relay Addresses. Max 3. + :type server_addresses: list[str] + """ + + _validation = { + 'segments': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'dhcp_type': {'required': True}, + 'server_addresses': {'max_items': 3, 'min_items': 1}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'segments': {'key': 'segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'long'}, + 'dhcp_type': {'key': 'dhcpType', 'type': 'str'}, + 'server_addresses': {'key': 'serverAddresses', 'type': '[str]'}, + } + + def __init__(self, *, display_name: str=None, revision: int=None, server_addresses=None, **kwargs) -> None: + super(WorkloadNetworkDhcpRelay, self).__init__(display_name=display_name, revision=revision, **kwargs) + self.server_addresses = server_addresses + self.dhcp_type = 'RELAY' + + +class WorkloadNetworkDhcpServer(WorkloadNetworkDhcpEntity): + """NSX DHCP Server. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param display_name: Display name of the DHCP entity. + :type display_name: str + :ivar segments: NSX Segments consuming DHCP. + :vartype segments: list[str] + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkDhcpProvisioningState + :param revision: NSX revision number. + :type revision: long + :param dhcp_type: Required. Constant filled by server. + :type dhcp_type: str + :param server_address: DHCP Server Address. + :type server_address: str + :param lease_time: DHCP Server Lease Time. + :type lease_time: long + """ + + _validation = { + 'segments': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'dhcp_type': {'required': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'segments': {'key': 'segments', 'type': '[str]'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'long'}, + 'dhcp_type': {'key': 'dhcpType', 'type': 'str'}, + 'server_address': {'key': 'serverAddress', 'type': 'str'}, + 'lease_time': {'key': 'leaseTime', 'type': 'long'}, + } + + def __init__(self, *, display_name: str=None, revision: int=None, server_address: str=None, lease_time: int=None, **kwargs) -> None: + super(WorkloadNetworkDhcpServer, self).__init__(display_name=display_name, revision=revision, **kwargs) + self.server_address = server_address + self.lease_time = lease_time + self.dhcp_type = 'SERVER' + + +class WorkloadNetworkGateway(ProxyResource): + """NSX Gateway. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: Display name of the DHCP entity. + :type display_name: str + :ivar path: NSX Gateway Path. + :vartype path: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'path': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, **kwargs) -> None: + super(WorkloadNetworkGateway, self).__init__(**kwargs) + self.display_name = display_name + self.path = None + + +class WorkloadNetworkPortMirroring(ProxyResource): + """NSX Port Mirroring. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: Display name of the port mirroring profile. + :type display_name: str + :param direction: Direction of port mirroring profile. Possible values + include: 'INGRESS, EGRESS, BIDIRECTIONAL' + :type direction: str or ~azure.mgmt.avs.models.PortMirroringDirectionEnum + :param source: Source VM Group. + :type source: str + :param destination: Destination VM Group. + :type destination: str + :ivar status: Port Mirroring Status. Possible values include: 'SUCCESS, + FAILURE' + :vartype status: str or ~azure.mgmt.avs.models.PortMirroringStatusEnum + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroringProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'direction': {'key': 'properties.direction', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'destination': {'key': 'properties.destination', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, *, display_name: str=None, direction=None, source: str=None, destination: str=None, revision: int=None, **kwargs) -> None: + super(WorkloadNetworkPortMirroring, self).__init__(**kwargs) + self.display_name = display_name + self.direction = direction + self.source = source + self.destination = destination + self.status = None + self.provisioning_state = None + self.revision = revision + + +class WorkloadNetworkSegment(ProxyResource): + """NSX Segment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: Display name of the segment. + :type display_name: str + :param connected_gateway: Gateway which to connect segment to. + :type connected_gateway: str + :param subnet: Subnet which to connect segment to. + :type subnet: ~azure.mgmt.avs.models.WorkloadNetworkSegmentSubnet + :ivar port_vif: Port Vif which segment is associated with. + :vartype port_vif: + list[~azure.mgmt.avs.models.WorkloadNetworkSegmentPortVif] + :ivar status: Segment status. Possible values include: 'SUCCESS, FAILURE' + :vartype status: str or ~azure.mgmt.avs.models.SegmentStatusEnum + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkSegmentProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'port_vif': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'connected_gateway': {'key': 'properties.connectedGateway', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'WorkloadNetworkSegmentSubnet'}, + 'port_vif': {'key': 'properties.portVif', 'type': '[WorkloadNetworkSegmentPortVif]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, *, display_name: str=None, connected_gateway: str=None, subnet=None, revision: int=None, **kwargs) -> None: + super(WorkloadNetworkSegment, self).__init__(**kwargs) + self.display_name = display_name + self.connected_gateway = connected_gateway + self.subnet = subnet + self.port_vif = None + self.status = None + self.provisioning_state = None + self.revision = revision + + +class WorkloadNetworkSegmentPortVif(Model): + """Ports and any VIF attached to segment. + + :param port_name: Name of port or VIF attached to segment. + :type port_name: str + """ + + _attribute_map = { + 'port_name': {'key': 'portName', 'type': 'str'}, + } + + def __init__(self, *, port_name: str=None, **kwargs) -> None: + super(WorkloadNetworkSegmentPortVif, self).__init__(**kwargs) + self.port_name = port_name + + +class WorkloadNetworkSegmentSubnet(Model): + """Subnet configuration for segment. + + :param dhcp_ranges: DHCP Range assigned for subnet. + :type dhcp_ranges: list[str] + :param gateway_address: Gateway address. + :type gateway_address: str + """ + + _attribute_map = { + 'dhcp_ranges': {'key': 'dhcpRanges', 'type': '[str]'}, + 'gateway_address': {'key': 'gatewayAddress', 'type': 'str'}, + } + + def __init__(self, *, dhcp_ranges=None, gateway_address: str=None, **kwargs) -> None: + super(WorkloadNetworkSegmentSubnet, self).__init__(**kwargs) + self.dhcp_ranges = dhcp_ranges + self.gateway_address = gateway_address + + +class WorkloadNetworkVirtualMachine(ProxyResource): + """NSX Virtual Machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: Display name of the VM. + :type display_name: str + :ivar vm_type: Virtual machine type. Possible values include: 'REGULAR, + EDGE, SERVICE' + :vartype vm_type: str or ~azure.mgmt.avs.models.VMTypeEnum + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'vm_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'vm_type': {'key': 'properties.vmType', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, **kwargs) -> None: + super(WorkloadNetworkVirtualMachine, self).__init__(**kwargs) + self.display_name = display_name + self.vm_type = None + + +class WorkloadNetworkVMGroup(ProxyResource): + """NSX VM Group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param display_name: Display name of the VM group. + :type display_name: str + :param members: Virtual machine members of this group. + :type members: list[str] + :ivar status: VM Group status. Possible values include: 'SUCCESS, FAILURE' + :vartype status: str or ~azure.mgmt.avs.models.VMGroupStatusEnum + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Building', 'Deleting', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.avs.models.WorkloadNetworkVMGroupProvisioningState + :param revision: NSX revision number. + :type revision: long + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'members': {'key': 'properties.members', 'type': '[str]'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'long'}, + } + + def __init__(self, *, display_name: str=None, members=None, revision: int=None, **kwargs) -> None: + super(WorkloadNetworkVMGroup, self).__init__(**kwargs) + self.display_name = display_name + self.members = members + self.status = None + self.provisioning_state = None + self.revision = revision diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_paged_models.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_paged_models.py index 874c91b84a94..d87d47b390e5 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_paged_models.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_paged_models.py @@ -77,3 +77,94 @@ class ExpressRouteAuthorizationPaged(Paged): def __init__(self, *args, **kwargs): super(ExpressRouteAuthorizationPaged, self).__init__(*args, **kwargs) +class GlobalReachConnectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`GlobalReachConnection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[GlobalReachConnection]'} + } + + def __init__(self, *args, **kwargs): + + super(GlobalReachConnectionPaged, self).__init__(*args, **kwargs) +class WorkloadNetworkSegmentPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkSegment ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkSegment]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkSegmentPaged, self).__init__(*args, **kwargs) +class WorkloadNetworkDhcpPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkDhcp ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkDhcp]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkDhcpPaged, self).__init__(*args, **kwargs) +class WorkloadNetworkGatewayPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkGateway ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkGateway]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkGatewayPaged, self).__init__(*args, **kwargs) +class WorkloadNetworkPortMirroringPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkPortMirroring ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkPortMirroring]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkPortMirroringPaged, self).__init__(*args, **kwargs) +class WorkloadNetworkVMGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkVMGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkVMGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkVMGroupPaged, self).__init__(*args, **kwargs) +class WorkloadNetworkVirtualMachinePaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkloadNetworkVirtualMachine ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkloadNetworkVirtualMachine]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadNetworkVirtualMachinePaged, self).__init__(*args, **kwargs) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py index f8c122b9ef0c..19053f91af96 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py @@ -15,6 +15,8 @@ from ._clusters_operations import ClustersOperations from ._hcx_enterprise_sites_operations import HcxEnterpriseSitesOperations from ._authorizations_operations import AuthorizationsOperations +from ._global_reach_connections_operations import GlobalReachConnectionsOperations +from ._workload_networks_operations import WorkloadNetworksOperations __all__ = [ 'Operations', @@ -23,4 +25,6 @@ 'ClustersOperations', 'HcxEnterpriseSitesOperations', 'AuthorizationsOperations', + 'GlobalReachConnectionsOperations', + 'WorkloadNetworksOperations', ] diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py index ae761e630faa..7d6aab092f9e 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py @@ -27,7 +27,7 @@ class AuthorizationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-03-20". + :ivar api_version: The API version to use for this operation. Constant value: "2020-07-17-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-20" + self.api_version = "2020-07-17-preview" self.config = config @@ -182,7 +182,9 @@ def get( def _create_or_update_initial( - self, resource_group_name, private_cloud_name, authorization_name, authorization, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, private_cloud_name, authorization_name, custom_headers=None, raw=False, **operation_config): + authorization = None + # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -209,7 +211,7 @@ def _create_or_update_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(authorization, 'object') + body_content = self._serialize.body(authorization, 'ExpressRouteAuthorization') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -234,7 +236,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, private_cloud_name, authorization_name, authorization, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, private_cloud_name, authorization_name, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update an ExpressRoute Circuit Authorization in a private cloud. @@ -246,8 +248,6 @@ def create_or_update( :param authorization_name: Name of the ExpressRoute Circuit Authorization in the private cloud :type authorization_name: str - :param authorization: An ExpressRoute Circuit Authorization - :type authorization: object :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -266,7 +266,6 @@ def create_or_update( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, authorization_name=authorization_name, - authorization=authorization, custom_headers=custom_headers, raw=True, **operation_config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py index 3d9a15ab9ec8..12b01e5de6a0 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py @@ -27,7 +27,7 @@ class ClustersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-03-20". + :ivar api_version: The API version to use for this operation. Constant value: "2020-07-17-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-20" + self.api_version = "2020-07-17-preview" self.config = config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py new file mode 100644 index 000000000000..e0de4630e3e8 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_global_reach_connections_operations.py @@ -0,0 +1,381 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class GlobalReachConnectionsOperations(object): + """GlobalReachConnectionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-07-17-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-17-preview" + + self.config = config + + def list( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List global reach connections in a private cloud. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of GlobalReachConnection + :rtype: + ~azure.mgmt.avs.models.GlobalReachConnectionPaged[~azure.mgmt.avs.models.GlobalReachConnection] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.GlobalReachConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections'} + + def get( + self, resource_group_name, private_cloud_name, global_reach_connection_name, custom_headers=None, raw=False, **operation_config): + """Get a global reach connection by name in a private cloud. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param global_reach_connection_name: Name of the global reach + connection in the private cloud + :type global_reach_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GlobalReachConnection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.GlobalReachConnection or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'globalReachConnectionName': self._serialize.url("global_reach_connection_name", global_reach_connection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GlobalReachConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}'} + + + def _create_or_update_initial( + self, resource_group_name, private_cloud_name, global_reach_connection_name, authorization_key=None, peer_express_route_circuit=None, custom_headers=None, raw=False, **operation_config): + global_reach_connection = models.GlobalReachConnection(authorization_key=authorization_key, peer_express_route_circuit=peer_express_route_circuit) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'globalReachConnectionName': self._serialize.url("global_reach_connection_name", global_reach_connection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(global_reach_connection, 'GlobalReachConnection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GlobalReachConnection', response) + if response.status_code == 201: + deserialized = self._deserialize('GlobalReachConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, private_cloud_name, global_reach_connection_name, authorization_key=None, peer_express_route_circuit=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a global reach connection in a private cloud. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: The name of the private cloud. + :type private_cloud_name: str + :param global_reach_connection_name: Name of the global reach + connection in the private cloud + :type global_reach_connection_name: str + :param authorization_key: Authorization key from the peer express + route used for the global reach connection + :type authorization_key: str + :param peer_express_route_circuit: Identifier of the ExpressRoute + Circuit to peer with in the global reach connection + :type peer_express_route_circuit: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GlobalReachConnection + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.GlobalReachConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.GlobalReachConnection]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + global_reach_connection_name=global_reach_connection_name, + authorization_key=authorization_key, + peer_express_route_circuit=peer_express_route_circuit, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GlobalReachConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}'} + + + def _delete_initial( + self, resource_group_name, private_cloud_name, global_reach_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'globalReachConnectionName': self._serialize.url("global_reach_connection_name", global_reach_connection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, private_cloud_name, global_reach_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a global reach connection in a private cloud. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param global_reach_connection_name: Name of the global reach + connection in the private cloud + :type global_reach_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + global_reach_connection_name=global_reach_connection_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}'} diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py index 2a6b139c72e3..697dc5e7de45 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py @@ -25,7 +25,7 @@ class HcxEnterpriseSitesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-03-20". + :ivar api_version: The API version to use for this operation. Constant value: "2020-07-17-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-20" + self.api_version = "2020-07-17-preview" self.config = config @@ -179,7 +179,7 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}'} def create_or_update( - self, resource_group_name, private_cloud_name, hcx_enterprise_site_name, hcx_enterprise_site, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, private_cloud_name, hcx_enterprise_site_name, custom_headers=None, raw=False, **operation_config): """Create or update an HCX Enterprise Site in a private cloud. :param resource_group_name: The name of the resource group. The name @@ -190,8 +190,6 @@ def create_or_update( :param hcx_enterprise_site_name: Name of the HCX Enterprise Site in the private cloud :type hcx_enterprise_site_name: str - :param hcx_enterprise_site: The HCX Enterprise Site - :type hcx_enterprise_site: object :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -202,6 +200,8 @@ def create_or_update( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + hcx_enterprise_site = None + # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -228,7 +228,7 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(hcx_enterprise_site, 'object') + body_content = self._serialize.body(hcx_enterprise_site, 'HcxEnterpriseSite') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py index 6d8d140021c9..7d96e4b72311 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py @@ -25,7 +25,7 @@ class LocationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-03-20". + :ivar api_version: The API version to use for this operation. Constant value: "2020-07-17-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-20" + self.api_version = "2020-07-17-preview" self.config = config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py index 2e02064516c0..fdafc20e1d94 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py @@ -25,7 +25,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-03-20". + :ivar api_version: The API version to use for this operation. Constant value: "2020-07-17-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-20" + self.api_version = "2020-07-17-preview" self.config = config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py index 128a4596f79b..f5fcf3ec3f02 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py @@ -27,7 +27,7 @@ class PrivateCloudsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-03-20". + :ivar api_version: The API version to use for this operation. Constant value: "2020-07-17-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-03-20" + self.api_version = "2020-07-17-preview" self.config = config diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py new file mode 100644 index 000000000000..e91d5746d6af --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_workload_networks_operations.py @@ -0,0 +1,2093 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class WorkloadNetworksOperations(object): + """WorkloadNetworksOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-07-17-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-17-preview" + + self.config = config + + def list_segments( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List of segments in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of WorkloadNetworkSegment + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkSegmentPaged[~azure.mgmt.avs.models.WorkloadNetworkSegment] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_segments.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkloadNetworkSegmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_segments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments'} + + def get_segment( + self, resource_group_name, private_cloud_name, segment_id, custom_headers=None, raw=False, **operation_config): + """Get a segment by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param segment_id: NSX Segment identifier. Generally the same as the + Segment's display name + :type segment_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WorkloadNetworkSegment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkSegment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_segment.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'segmentId': self._serialize.url("segment_id", segment_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkSegment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_segment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'} + + + def _create_segments_initial( + self, resource_group_name, private_cloud_name, segment_id, workload_network_segment, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_segments.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'segmentId': self._serialize.url("segment_id", segment_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(workload_network_segment, 'WorkloadNetworkSegment') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkSegment', response) + if response.status_code == 201: + deserialized = self._deserialize('WorkloadNetworkSegment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_segments( + self, resource_group_name, private_cloud_name, segment_id, workload_network_segment, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a segment by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param segment_id: NSX Segment identifier. Generally the same as the + Segment's display name + :type segment_id: str + :param workload_network_segment: NSX Segment + :type workload_network_segment: + ~azure.mgmt.avs.models.WorkloadNetworkSegment + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WorkloadNetworkSegment + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkSegment]] + :raises: :class:`CloudError` + """ + raw_result = self._create_segments_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + segment_id=segment_id, + workload_network_segment=workload_network_segment, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkSegment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_segments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'} + + + def _update_segments_initial( + self, resource_group_name, private_cloud_name, segment_id, workload_network_segment, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update_segments.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'segmentId': self._serialize.url("segment_id", segment_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(workload_network_segment, 'WorkloadNetworkSegment') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkSegment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_segments( + self, resource_group_name, private_cloud_name, segment_id, workload_network_segment, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a segment by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param segment_id: NSX Segment identifier. Generally the same as the + Segment's display name + :type segment_id: str + :param workload_network_segment: NSX Segment + :type workload_network_segment: + ~azure.mgmt.avs.models.WorkloadNetworkSegment + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WorkloadNetworkSegment + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkSegment] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkSegment]] + :raises: :class:`CloudError` + """ + raw_result = self._update_segments_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + segment_id=segment_id, + workload_network_segment=workload_network_segment, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkSegment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_segments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'} + + + def _delete_segment_initial( + self, resource_group_name, private_cloud_name, segment_id, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_segment.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'segmentId': self._serialize.url("segment_id", segment_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_segment( + self, resource_group_name, private_cloud_name, segment_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a segment by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param segment_id: NSX Segment identifier. Generally the same as the + Segment's display name + :type segment_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_segment_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + segment_id=segment_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_segment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'} + + def list_dhcp( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List dhcp in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of WorkloadNetworkDhcp + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkDhcpPaged[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_dhcp.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkloadNetworkDhcpPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_dhcp.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations'} + + def get_dhcp( + self, resource_group_name, dhcp_id, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """Get dhcp by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP + display name + :type dhcp_id: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WorkloadNetworkDhcp or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkDhcp or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_dhcp.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'dhcpId': self._serialize.url("dhcp_id", dhcp_id, 'str'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkDhcp', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_dhcp.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'} + + + def _create_dhcp_initial( + self, resource_group_name, private_cloud_name, dhcp_id, display_name=None, revision=None, custom_headers=None, raw=False, **operation_config): + workload_network_dhcp = models.WorkloadNetworkDhcp(display_name=display_name, revision=revision) + + # Construct URL + url = self.create_dhcp.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'dhcpId': self._serialize.url("dhcp_id", dhcp_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(workload_network_dhcp, 'WorkloadNetworkDhcp') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkDhcp', response) + if response.status_code == 201: + deserialized = self._deserialize('WorkloadNetworkDhcp', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_dhcp( + self, resource_group_name, private_cloud_name, dhcp_id, display_name=None, revision=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create dhcp by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP + display name + :type dhcp_id: str + :param display_name: Display name of the DHCP entity. + :type display_name: str + :param revision: NSX revision number. + :type revision: long + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WorkloadNetworkDhcp or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkDhcp]] + :raises: :class:`CloudError` + """ + raw_result = self._create_dhcp_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + dhcp_id=dhcp_id, + display_name=display_name, + revision=revision, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkDhcp', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_dhcp.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'} + + + def _update_dhcp_initial( + self, resource_group_name, private_cloud_name, dhcp_id, display_name=None, revision=None, custom_headers=None, raw=False, **operation_config): + workload_network_dhcp = models.WorkloadNetworkDhcp(display_name=display_name, revision=revision) + + # Construct URL + url = self.update_dhcp.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'dhcpId': self._serialize.url("dhcp_id", dhcp_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(workload_network_dhcp, 'WorkloadNetworkDhcp') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkDhcp', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_dhcp( + self, resource_group_name, private_cloud_name, dhcp_id, display_name=None, revision=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update dhcp by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP + display name + :type dhcp_id: str + :param display_name: Display name of the DHCP entity. + :type display_name: str + :param revision: NSX revision number. + :type revision: long + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WorkloadNetworkDhcp or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkDhcp] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkDhcp]] + :raises: :class:`CloudError` + """ + raw_result = self._update_dhcp_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + dhcp_id=dhcp_id, + display_name=display_name, + revision=revision, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkDhcp', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_dhcp.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'} + + + def _delete_dhcp_initial( + self, resource_group_name, private_cloud_name, dhcp_id, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_dhcp.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'dhcpId': self._serialize.url("dhcp_id", dhcp_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_dhcp( + self, resource_group_name, private_cloud_name, dhcp_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete dhcp by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dhcp_id: NSX DHCP identifier. Generally the same as the DHCP + display name + :type dhcp_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_dhcp_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + dhcp_id=dhcp_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_dhcp.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'} + + def list_gateways( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List of gateways in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of WorkloadNetworkGateway + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkGatewayPaged[~azure.mgmt.avs.models.WorkloadNetworkGateway] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_gateways.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkloadNetworkGatewayPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_gateways.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways'} + + def get_gateway( + self, resource_group_name, private_cloud_name, gateway_id, custom_headers=None, raw=False, **operation_config): + """Get a gateway by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param gateway_id: NSX Gateway identifier. Generally the same as the + Gateway's display name + :type gateway_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WorkloadNetworkGateway or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkGateway or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_gateway.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'gatewayId': self._serialize.url("gateway_id", gateway_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_gateway.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}'} + + def list_port_mirroring( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List of port mirroring profiles in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of WorkloadNetworkPortMirroring + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroringPaged[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_port_mirroring.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkloadNetworkPortMirroringPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_port_mirroring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles'} + + def get_port_mirroring( + self, resource_group_name, private_cloud_name, port_mirroring_id, custom_headers=None, raw=False, **operation_config): + """Get a port mirroring profile by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param port_mirroring_id: NSX Port Mirroring identifier. Generally the + same as the Port Mirroring display name + :type port_mirroring_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WorkloadNetworkPortMirroring or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_port_mirroring.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'portMirroringId': self._serialize.url("port_mirroring_id", port_mirroring_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkPortMirroring', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_port_mirroring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'} + + + def _create_port_mirroring_initial( + self, resource_group_name, private_cloud_name, port_mirroring_id, workload_network_port_mirroring, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_port_mirroring.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'portMirroringId': self._serialize.url("port_mirroring_id", port_mirroring_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(workload_network_port_mirroring, 'WorkloadNetworkPortMirroring') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkPortMirroring', response) + if response.status_code == 201: + deserialized = self._deserialize('WorkloadNetworkPortMirroring', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_port_mirroring( + self, resource_group_name, private_cloud_name, port_mirroring_id, workload_network_port_mirroring, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a port mirroring profile by id in a private cloud workload + network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param port_mirroring_id: NSX Port Mirroring identifier. Generally the + same as the Port Mirroring display name + :type port_mirroring_id: str + :param workload_network_port_mirroring: NSX port mirroring + :type workload_network_port_mirroring: + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + WorkloadNetworkPortMirroring or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring]] + :raises: :class:`CloudError` + """ + raw_result = self._create_port_mirroring_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + port_mirroring_id=port_mirroring_id, + workload_network_port_mirroring=workload_network_port_mirroring, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkPortMirroring', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_port_mirroring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'} + + + def _update_port_mirroring_initial( + self, resource_group_name, private_cloud_name, port_mirroring_id, workload_network_port_mirroring, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update_port_mirroring.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'portMirroringId': self._serialize.url("port_mirroring_id", port_mirroring_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(workload_network_port_mirroring, 'WorkloadNetworkPortMirroring') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkPortMirroring', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_port_mirroring( + self, resource_group_name, private_cloud_name, port_mirroring_id, workload_network_port_mirroring, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a port mirroring profile by id in a private cloud + workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param port_mirroring_id: NSX Port Mirroring identifier. Generally the + same as the Port Mirroring display name + :type port_mirroring_id: str + :param workload_network_port_mirroring: NSX port mirroring + :type workload_network_port_mirroring: + ~azure.mgmt.avs.models.WorkloadNetworkPortMirroring + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + WorkloadNetworkPortMirroring or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkPortMirroring]] + :raises: :class:`CloudError` + """ + raw_result = self._update_port_mirroring_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + port_mirroring_id=port_mirroring_id, + workload_network_port_mirroring=workload_network_port_mirroring, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkPortMirroring', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_port_mirroring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'} + + + def _delete_port_mirroring_initial( + self, resource_group_name, port_mirroring_id, private_cloud_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_port_mirroring.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'portMirroringId': self._serialize.url("port_mirroring_id", port_mirroring_id, 'str'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_port_mirroring( + self, resource_group_name, port_mirroring_id, private_cloud_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a port mirroring profile by id in a private cloud workload + network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param port_mirroring_id: NSX Port Mirroring identifier. Generally the + same as the Port Mirroring display name + :type port_mirroring_id: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_port_mirroring_initial( + resource_group_name=resource_group_name, + port_mirroring_id=port_mirroring_id, + private_cloud_name=private_cloud_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_port_mirroring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'} + + def list_vm_groups( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List of vm groups in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of WorkloadNetworkVMGroup + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkVMGroupPaged[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_vm_groups.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkloadNetworkVMGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_vm_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups'} + + def get_vm_group( + self, resource_group_name, private_cloud_name, vm_group_id, custom_headers=None, raw=False, **operation_config): + """Get a vm group by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param vm_group_id: NSX VM Group identifier. Generally the same as the + VM Group's display name + :type vm_group_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WorkloadNetworkVMGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVMGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_vm_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'vmGroupId': self._serialize.url("vm_group_id", vm_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkVMGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_vm_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'} + + + def _create_vm_group_initial( + self, resource_group_name, private_cloud_name, vm_group_id, workload_network_vm_group, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_vm_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'vmGroupId': self._serialize.url("vm_group_id", vm_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(workload_network_vm_group, 'WorkloadNetworkVMGroup') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkVMGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('WorkloadNetworkVMGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_vm_group( + self, resource_group_name, private_cloud_name, vm_group_id, workload_network_vm_group, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a vm group by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param vm_group_id: NSX VM Group identifier. Generally the same as the + VM Group's display name + :type vm_group_id: str + :param workload_network_vm_group: NSX VM Group + :type workload_network_vm_group: + ~azure.mgmt.avs.models.WorkloadNetworkVMGroup + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WorkloadNetworkVMGroup + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkVMGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._create_vm_group_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + vm_group_id=vm_group_id, + workload_network_vm_group=workload_network_vm_group, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkVMGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_vm_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'} + + + def _update_vm_group_initial( + self, resource_group_name, private_cloud_name, vm_group_id, workload_network_vm_group, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update_vm_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'vmGroupId': self._serialize.url("vm_group_id", vm_group_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(workload_network_vm_group, 'WorkloadNetworkVMGroup') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkVMGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_vm_group( + self, resource_group_name, private_cloud_name, vm_group_id, workload_network_vm_group, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a vm group by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param vm_group_id: NSX VM Group identifier. Generally the same as the + VM Group's display name + :type vm_group_id: str + :param workload_network_vm_group: NSX VM Group + :type workload_network_vm_group: + ~azure.mgmt.avs.models.WorkloadNetworkVMGroup + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns WorkloadNetworkVMGroup + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.WorkloadNetworkVMGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.WorkloadNetworkVMGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._update_vm_group_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + vm_group_id=vm_group_id, + workload_network_vm_group=workload_network_vm_group, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadNetworkVMGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_vm_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'} + + + def _delete_vm_group_initial( + self, resource_group_name, vm_group_id, private_cloud_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete_vm_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'vmGroupId': self._serialize.url("vm_group_id", vm_group_id, 'str'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete_vm_group( + self, resource_group_name, vm_group_id, private_cloud_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a vm group by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param vm_group_id: NSX VM Group identifier. Generally the same as the + VM Group's display name + :type vm_group_id: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_vm_group_initial( + resource_group_name=resource_group_name, + vm_group_id=vm_group_id, + private_cloud_name=private_cloud_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete_vm_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'} + + def list_virtual_machines( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List of virtual machines in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of WorkloadNetworkVirtualMachine + :rtype: + ~azure.mgmt.avs.models.WorkloadNetworkVirtualMachinePaged[~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_virtual_machines.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkloadNetworkVirtualMachinePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_virtual_machines.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines'} + + def get_virtual_machine( + self, resource_group_name, private_cloud_name, virtual_machine_id, custom_headers=None, raw=False, **operation_config): + """Get a virtual machine by id in a private cloud workload network. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param virtual_machine_id: NSX Virtual Machine identifier. + :type virtual_machine_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WorkloadNetworkVirtualMachine or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.avs.models.WorkloadNetworkVirtualMachine or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_virtual_machine.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'virtualMachineId': self._serialize.url("virtual_machine_id", virtual_machine_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkloadNetworkVirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_virtual_machine.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}'}