From 70aec050e12acc0ae1c300c2ee7e48a3fb09f7cf Mon Sep 17 00:00:00 2001 From: xichen Date: Tue, 14 Jul 2020 10:52:49 +0800 Subject: [PATCH] release for avs 560 (#12357) * release avs for 1.0.0 * update version to 1.0.0-preview.2 * update rc version Co-authored-by: xichen --- sdk/compute/azure-mgmt-avs/CHANGELOG.md | 24 + .../azure/mgmt/avs/_avs_client.py | 14 +- .../azure/mgmt/avs/_configuration.py | 2 +- .../azure/mgmt/avs/models/__init__.py | 46 +- .../mgmt/avs/models/_avs_client_enums.py | 24 + .../azure/mgmt/avs/models/_models.py | 512 ++++++++++------- .../azure/mgmt/avs/models/_models_py3.py | 526 +++++++++++------- .../azure/mgmt/avs/models/_paged_models.py | 26 + .../azure/mgmt/avs/operations/__init__.py | 4 + .../operations/_authorizations_operations.py | 376 +++++++++++++ .../avs/operations/_clusters_operations.py | 119 ++-- .../_hcx_enterprise_sites_operations.py | 311 +++++++++++ .../avs/operations/_locations_operations.py | 27 +- .../azure/mgmt/avs/operations/_operations.py | 14 +- .../operations/_private_clouds_operations.py | 131 +++-- .../azure-mgmt-avs/azure/mgmt/avs/version.py | 2 +- 16 files changed, 1614 insertions(+), 544 deletions(-) create mode 100644 sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py create mode 100644 sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py diff --git a/sdk/compute/azure-mgmt-avs/CHANGELOG.md b/sdk/compute/azure-mgmt-avs/CHANGELOG.md index 14d5e406e3c8..ea3b79fff39d 100644 --- a/sdk/compute/azure-mgmt-avs/CHANGELOG.md +++ b/sdk/compute/azure-mgmt-avs/CHANGELOG.md @@ -1,5 +1,29 @@ # Release History +## 1.0.0rc1 (2020-07-03) + +**Features** + + - Model Endpoints has a new parameter hcx_cloud_manager + - Model Cluster has a new parameter hosts + - Model Cluster has a new parameter cluster_id + - Model Cluster has a new parameter cluster_size + - Model Cluster has a new parameter provisioning_state + - Added operation group HcxEnterpriseSitesOperations + - Added operation group AuthorizationsOperations + +**Breaking changes** + + - Operation ClustersOperations.update has a new signature + - Operation ClustersOperations.create_or_update has a new signature + - Operation PrivateCloudsOperations.update has a new signature + - Operation ClustersOperations.create_or_update has a new signature + - Model Circuit no longer has parameter authorizations + - Model Cluster no longer has parameter properties + - Model Cluster has a new required parameter sku + - Model PrivateCloud has a new signature + - Model ExpressRouteAuthorization has a new signature + ## 0.1.0 (2020-06-12) * Initial Release 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 8646bf5bcf48..e2c496724837 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py @@ -17,6 +17,8 @@ from .operations import LocationsOperations from .operations import PrivateCloudsOperations from .operations import ClustersOperations +from .operations import HcxEnterpriseSitesOperations +from .operations import AuthorizationsOperations from . import models @@ -34,11 +36,15 @@ class AVSClient(SDKClient): :vartype private_clouds: azure.mgmt.avs.operations.PrivateCloudsOperations :ivar clusters: Clusters operations :vartype clusters: azure.mgmt.avs.operations.ClustersOperations + :ivar hcx_enterprise_sites: HcxEnterpriseSites operations + :vartype hcx_enterprise_sites: azure.mgmt.avs.operations.HcxEnterpriseSitesOperations + :ivar authorizations: Authorizations operations + :vartype authorizations: azure.mgmt.avs.operations.AuthorizationsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` - :param subscription_id: Unique identifier for the Azure subscription + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -50,7 +56,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 = '2019-08-09-preview' + self.api_version = '2020-03-20' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -62,3 +68,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.clusters = ClustersOperations( self._client, self.config, self._serialize, self._deserialize) + self.hcx_enterprise_sites = HcxEnterpriseSitesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.authorizations = AuthorizationsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py index 3e97aaba096c..9d5df83720de 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py @@ -21,7 +21,7 @@ class AVSClientConfiguration(AzureConfiguration): :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` - :param subscription_id: Unique identifier for the Azure subscription + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ 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 a3c8f5cc25ab..c9859074da49 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 @@ -11,19 +11,21 @@ try: from ._models_py3 import AdminCredentials - from ._models_py3 import ApiError, ApiErrorException - from ._models_py3 import ApiErrorBase from ._models_py3 import Circuit from ._models_py3 import Cluster - from ._models_py3 import ClusterProperties - from ._models_py3 import DefaultClusterProperties + from ._models_py3 import ClusterUpdate + from ._models_py3 import ClusterUpdateProperties from ._models_py3 import Endpoints + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorResponse from ._models_py3 import ExpressRouteAuthorization + from ._models_py3 import HcxEnterpriseSite from ._models_py3 import IdentitySource + from ._models_py3 import ManagementCluster from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import PrivateCloud - from ._models_py3 import PrivateCloudProperties + from ._models_py3 import PrivateCloudUpdate from ._models_py3 import Quota from ._models_py3 import Resource from ._models_py3 import Sku @@ -31,50 +33,59 @@ from ._models_py3 import Trial except (SyntaxError, ImportError): from ._models import AdminCredentials - from ._models import ApiError, ApiErrorException - from ._models import ApiErrorBase from ._models import Circuit from ._models import Cluster - from ._models import ClusterProperties - from ._models import DefaultClusterProperties + from ._models import ClusterUpdate + from ._models import ClusterUpdateProperties from ._models import Endpoints + from ._models import ErrorAdditionalInfo + from ._models import ErrorResponse from ._models import ExpressRouteAuthorization + from ._models import HcxEnterpriseSite from ._models import IdentitySource + from ._models import ManagementCluster from ._models import Operation from ._models import OperationDisplay from ._models import PrivateCloud - from ._models import PrivateCloudProperties + from ._models import PrivateCloudUpdate from ._models import Quota from ._models import Resource from ._models import Sku from ._models import TrackedResource from ._models import Trial from ._paged_models import ClusterPaged +from ._paged_models import ExpressRouteAuthorizationPaged +from ._paged_models import HcxEnterpriseSitePaged from ._paged_models import OperationPaged from ._paged_models import PrivateCloudPaged from ._avs_client_enums import ( + TrialStatus, QuotaEnabled, + ExpressRouteAuthorizationProvisioningState, SslEnum, PrivateCloudProvisioningState, InternetEnum, ClusterProvisioningState, + HcxEnterpriseSiteStatus, ) __all__ = [ 'AdminCredentials', - 'ApiError', 'ApiErrorException', - 'ApiErrorBase', 'Circuit', 'Cluster', - 'ClusterProperties', - 'DefaultClusterProperties', + 'ClusterUpdate', + 'ClusterUpdateProperties', 'Endpoints', + 'ErrorAdditionalInfo', + 'ErrorResponse', 'ExpressRouteAuthorization', + 'HcxEnterpriseSite', 'IdentitySource', + 'ManagementCluster', 'Operation', 'OperationDisplay', 'PrivateCloud', - 'PrivateCloudProperties', + 'PrivateCloudUpdate', 'Quota', 'Resource', 'Sku', @@ -83,9 +94,14 @@ 'OperationPaged', 'PrivateCloudPaged', 'ClusterPaged', + 'HcxEnterpriseSitePaged', + 'ExpressRouteAuthorizationPaged', + 'TrialStatus', 'QuotaEnabled', + 'ExpressRouteAuthorizationProvisioningState', 'SslEnum', 'PrivateCloudProvisioningState', 'InternetEnum', 'ClusterProvisioningState', + 'HcxEnterpriseSiteStatus', ] 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 bf53315dd149..dfda35df4748 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 @@ -12,12 +12,26 @@ from enum import Enum +class TrialStatus(str, Enum): + + trial_available = "TrialAvailable" + trial_used = "TrialUsed" + trial_disabled = "TrialDisabled" + + class QuotaEnabled(str, Enum): enabled = "Enabled" disabled = "Disabled" +class ExpressRouteAuthorizationProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + updating = "Updating" + + class SslEnum(str, Enum): enabled = "Enabled" @@ -31,6 +45,7 @@ class PrivateCloudProvisioningState(str, Enum): cancelled = "Cancelled" pending = "Pending" building = "Building" + deleting = "Deleting" updating = "Updating" @@ -45,4 +60,13 @@ class ClusterProvisioningState(str, Enum): succeeded = "Succeeded" failed = "Failed" cancelled = "Cancelled" + deleting = "Deleting" updating = "Updating" + + +class HcxEnterpriseSiteStatus(str, Enum): + + available = "Available" + consumed = "Consumed" + deactivated = "Deactivated" + deleted = "Deleted" 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 cf6dddf052e1..f268da2f0a80 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 @@ -51,54 +51,6 @@ def __init__(self, **kwargs): self.vcenter_password = None -class ApiError(Model): - """API error response. - - :param error: An error returned by the API - :type error: ~azure.mgmt.avs.models.ApiErrorBase - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ApiErrorBase'}, - } - - def __init__(self, **kwargs): - super(ApiError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ApiErrorException(HttpOperationError): - """Server responsed with exception of type: 'ApiError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ApiErrorException, self).__init__(deserialize, response, 'ApiError', *args) - - -class ApiErrorBase(Model): - """Api error. - - :param code: Error code - :type code: str - :param message: Error message - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ApiErrorBase, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - - class Circuit(Model): """An ExpressRoute Circuit. @@ -109,15 +61,11 @@ class Circuit(Model): :vartype primary_subnet: str :ivar secondary_subnet: CIDR of secondary subnet :vartype secondary_subnet: str - :ivar express_route_id: Identifier of the ExpressRoute (Microsoft Colo - only) + :ivar express_route_id: Identifier of the ExpressRoute Circuit (Microsoft + Colo only) :vartype express_route_id: str - :param authorizations: Authorizations for the ExpressRoute (Microsoft Colo - only) - :type authorizations: - list[~azure.mgmt.avs.models.ExpressRouteAuthorization] - :ivar express_route_private_peering_id: ExpressRoute private peering - identifier + :ivar express_route_private_peering_id: ExpressRoute Circuit private + peering identifier :vartype express_route_private_peering_id: str """ @@ -132,7 +80,6 @@ class Circuit(Model): 'primary_subnet': {'key': 'primarySubnet', 'type': 'str'}, 'secondary_subnet': {'key': 'secondarySubnet', 'type': 'str'}, 'express_route_id': {'key': 'expressRouteID', 'type': 'str'}, - 'authorizations': {'key': 'authorizations', 'type': '[ExpressRouteAuthorization]'}, 'express_route_private_peering_id': {'key': 'expressRoutePrivatePeeringID', 'type': 'str'}, } @@ -141,17 +88,36 @@ def __init__(self, **kwargs): self.primary_subnet = None self.secondary_subnet = None self.express_route_id = None - self.authorizations = kwargs.get('authorizations', None) self.express_route_private_peering_id = None class CloudError(Model): - """CloudError. + """API error response. + + :param error: An error returned by the API + :type error: ~azure.mgmt.avs.models.ErrorResponse """ _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, } + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + class Resource(Model): """The core properties of ARM resources. @@ -192,100 +158,88 @@ class Cluster(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param properties: The properties of a cluster resource - :type properties: ~azure.mgmt.avs.models.ClusterProperties + :param sku: Required. The cluster SKU + :type sku: ~azure.mgmt.avs.models.Sku + :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 = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'sku': {'required': True}, + 'cluster_id': {'readonly': True}, + 'hosts': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ClusterProperties'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + '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.properties = kwargs.get('properties', None) - + self.sku = kwargs.get('sku', None) + self.cluster_size = kwargs.get('cluster_size', None) + self.cluster_id = None + self.hosts = None + self.provisioning_state = None -class DefaultClusterProperties(Model): - """The properties of a default cluster. - Variables are only populated by the server, and will be ignored when - sending a request. +class ClusterUpdate(Model): + """An update of a cluster resource. - :ivar cluster_id: The identity - :vartype cluster_id: int :param cluster_size: The cluster size :type cluster_size: int - :ivar hosts: The hosts - :vartype hosts: list[str] """ - _validation = { - 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, - } - _attribute_map = { - 'cluster_id': {'key': 'clusterId', 'type': 'int'}, - 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, - 'hosts': {'key': 'hosts', 'type': '[str]'}, + 'cluster_size': {'key': 'properties.clusterSize', 'type': 'int'}, } def __init__(self, **kwargs): - super(DefaultClusterProperties, self).__init__(**kwargs) - self.cluster_id = None + super(ClusterUpdate, self).__init__(**kwargs) self.cluster_size = kwargs.get('cluster_size', None) - self.hosts = None -class ClusterProperties(DefaultClusterProperties): - """The properties of a cluster. +class ClusterUpdateProperties(Model): + """The properties of a cluster that may be updated. - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar cluster_id: The identity - :vartype cluster_id: int :param cluster_size: The cluster size :type cluster_size: int - :ivar hosts: The hosts - :vartype hosts: list[str] - :ivar provisioning_state: The state of the cluster provisioning. Possible - values include: 'Succeeded', 'Failed', 'Cancelled', 'Updating' - :vartype provisioning_state: str or - ~azure.mgmt.avs.models.ClusterProvisioningState """ - _validation = { - 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - _attribute_map = { - 'cluster_id': {'key': 'clusterId', 'type': 'int'}, 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, - 'hosts': {'key': 'hosts', 'type': '[str]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } def __init__(self, **kwargs): - super(ClusterProperties, self).__init__(**kwargs) - self.provisioning_state = None + super(ClusterUpdateProperties, self).__init__(**kwargs) + self.cluster_size = kwargs.get('cluster_size', None) class Endpoints(Model): @@ -298,54 +252,189 @@ class Endpoints(Model): :vartype nsxt_manager: str :ivar vcsa: Endpoint for Virtual Center Server Appliance :vartype vcsa: str + :ivar hcx_cloud_manager: Endpoint for the HCX Cloud Manager + :vartype hcx_cloud_manager: str """ _validation = { 'nsxt_manager': {'readonly': True}, 'vcsa': {'readonly': True}, + 'hcx_cloud_manager': {'readonly': True}, } _attribute_map = { 'nsxt_manager': {'key': 'nsxtManager', 'type': 'str'}, 'vcsa': {'key': 'vcsa', 'type': 'str'}, + 'hcx_cloud_manager': {'key': 'hcxCloudManager', 'type': 'str'}, } def __init__(self, **kwargs): super(Endpoints, self).__init__(**kwargs) self.nsxt_manager = None self.vcsa = None + self.hcx_cloud_manager = None -class ExpressRouteAuthorization(Model): - """Authorization for an ExpressRoute. +class ErrorAdditionalInfo(Model): + """The resource management error additional info. Variables are only populated by the server, and will be ignored when sending a request. - :param name: The name of the ExpressRoute - :type name: str - :ivar id: The ID of the ExpressRoute + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """The resource management error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.avs.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.avs.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ExpressRouteAuthorization(Resource): + """ExpressRoute Circuit Authorization. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. :vartype id: str - :ivar key: The key of the ExpressRoute - :vartype key: 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.ExpressRouteAuthorizationProvisioningState + :ivar express_route_authorization_id: The ID of the ExpressRoute Circuit + Authorization + :vartype express_route_authorization_id: str + :ivar express_route_authorization_key: The key of the ExpressRoute Circuit + Authorization + :vartype express_route_authorization_key: str """ _validation = { 'id': {'readonly': True}, - 'key': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'express_route_authorization_id': {'readonly': True}, + 'express_route_authorization_key': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'express_route_authorization_id': {'key': 'properties.expressRouteAuthorizationId', 'type': 'str'}, + 'express_route_authorization_key': {'key': 'properties.expressRouteAuthorizationKey', 'type': 'str'}, } def __init__(self, **kwargs): super(ExpressRouteAuthorization, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.id = None - self.key = None + self.provisioning_state = None + self.express_route_authorization_id = None + self.express_route_authorization_key = None + + +class HcxEnterpriseSite(Resource): + """An HCX Enterprise Site resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar activation_key: The activation key + :vartype activation_key: str + :ivar status: The status of the HCX Enterprise Site. Possible values + include: 'Available', 'Consumed', 'Deactivated', 'Deleted' + :vartype status: str or ~azure.mgmt.avs.models.HcxEnterpriseSiteStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'activation_key': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'activation_key': {'key': 'properties.activationKey', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HcxEnterpriseSite, self).__init__(**kwargs) + self.activation_key = None + self.status = None class IdentitySource(Model): @@ -403,6 +492,37 @@ def __init__(self, **kwargs): self.password = kwargs.get('password', None) +class ManagementCluster(ClusterUpdateProperties): + """The properties of a default cluster. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param cluster_size: The cluster size + :type cluster_size: int + :ivar cluster_id: The identity + :vartype cluster_id: int + :ivar hosts: The hosts + :vartype hosts: list[str] + """ + + _validation = { + 'cluster_id': {'readonly': True}, + 'hosts': {'readonly': True}, + } + + _attribute_map = { + 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, + 'cluster_id': {'key': 'clusterId', 'type': 'int'}, + 'hosts': {'key': 'hosts', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ManagementCluster, self).__init__(**kwargs) + self.cluster_id = None + self.hosts = None + + class Operation(Model): """A REST API operation. @@ -515,6 +635,8 @@ class PrivateCloud(TrackedResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. @@ -525,61 +647,28 @@ class PrivateCloud(TrackedResource): :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param sku: The private cloud SKU + :param sku: Required. The private cloud SKU :type sku: ~azure.mgmt.avs.models.Sku - :param properties: The properties of a private cloud resource - :type properties: ~azure.mgmt.avs.models.PrivateCloudProperties - """ - - _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'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'properties': {'key': 'properties', 'type': 'PrivateCloudProperties'}, - } - - def __init__(self, **kwargs): - super(PrivateCloud, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.properties = kwargs.get('properties', None) - - -class PrivateCloudProperties(Model): - """The properties of a private cloud resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - + :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' + :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] :ivar provisioning_state: The provisioning state. Possible values include: - 'Succeeded', 'Failed', 'Cancelled', 'Pending', 'Building', 'Updating' + 'Succeeded', 'Failed', 'Cancelled', 'Pending', 'Building', 'Deleting', + 'Updating' :vartype provisioning_state: str or ~azure.mgmt.avs.models.PrivateCloudProvisioningState :param circuit: An ExpressRoute Circuit :type circuit: ~azure.mgmt.avs.models.Circuit - :param cluster: The default cluster used for management - :type cluster: ~azure.mgmt.avs.models.DefaultClusterProperties - :ivar clusters: The clusters - :vartype clusters: list[str] :ivar endpoints: The endpoints :vartype endpoints: ~azure.mgmt.avs.models.Endpoints - :param internet: Connectivity to internet is enabled or disabled. Possible - values include: 'Enabled', '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 network_block: The block of addresses should be unique across VNet - in your subscription as well as on-premise. Make sure the CIDR format is - conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is - between 0 and 22 + :param network_block: Required. The block of addresses should be unique + across VNet in your subscription as well as on-premise. Make sure the CIDR + format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, + and X is between 0 and 22 :type network_block: str :ivar management_network: Network used to access vCenter Server and NSX-T Manager @@ -604,9 +693,13 @@ class PrivateCloudProperties(Model): """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'required': True}, 'provisioning_state': {'readonly': True}, - 'clusters': {'readonly': True}, 'endpoints': {'readonly': True}, + 'network_block': {'required': True}, 'management_network': {'readonly': True}, 'provisioning_network': {'readonly': True}, 'vmotion_network': {'readonly': True}, @@ -615,32 +708,37 @@ class PrivateCloudProperties(Model): } _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'circuit': {'key': 'circuit', 'type': 'Circuit'}, - 'cluster': {'key': 'cluster', 'type': 'DefaultClusterProperties'}, - 'clusters': {'key': 'clusters', 'type': '[str]'}, - 'endpoints': {'key': 'endpoints', 'type': 'Endpoints'}, - 'internet': {'key': 'internet', 'type': 'str'}, - 'identity_sources': {'key': 'identitySources', 'type': '[IdentitySource]'}, - 'network_block': {'key': 'networkBlock', 'type': 'str'}, - 'management_network': {'key': 'managementNetwork', 'type': 'str'}, - 'provisioning_network': {'key': 'provisioningNetwork', 'type': 'str'}, - 'vmotion_network': {'key': 'vmotionNetwork', 'type': 'str'}, - 'vcenter_password': {'key': 'vcenterPassword', 'type': 'str'}, - 'nsxt_password': {'key': 'nsxtPassword', 'type': 'str'}, - 'vcenter_certificate_thumbprint': {'key': 'vcenterCertificateThumbprint', 'type': 'str'}, - 'nsxt_certificate_thumbprint': {'key': 'nsxtCertificateThumbprint', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, + 'internet': {'key': 'properties.internet', 'type': 'str'}, + 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'circuit': {'key': 'properties.circuit', 'type': 'Circuit'}, + 'endpoints': {'key': 'properties.endpoints', 'type': 'Endpoints'}, + 'network_block': {'key': 'properties.networkBlock', 'type': 'str'}, + '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, **kwargs): - super(PrivateCloudProperties, self).__init__(**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.identity_sources = kwargs.get('identity_sources', None) self.provisioning_state = None self.circuit = kwargs.get('circuit', None) - self.cluster = kwargs.get('cluster', None) - self.clusters = None self.endpoints = None - self.internet = kwargs.get('internet', None) - self.identity_sources = kwargs.get('identity_sources', None) self.network_block = kwargs.get('network_block', None) self.management_network = None self.provisioning_network = None @@ -651,6 +749,35 @@ def __init__(self, **kwargs): self.nsxt_certificate_thumbprint = None +class PrivateCloudUpdate(Model): + """An update to a private cloud resource. + + :param tags: Resource tags. + :type tags: dict[str, str] + :param management_cluster: The default cluster used for management + :type management_cluster: ~azure.mgmt.avs.models.ManagementCluster + :param internet: Connectivity to internet is enabled or disabled. Possible + values include: 'Enabled', '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] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, + 'internet': {'key': 'properties.internet', 'type': 'str'}, + 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + } + + def __init__(self, **kwargs): + super(PrivateCloudUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.management_cluster = kwargs.get('management_cluster', None) + self.internet = kwargs.get('internet', None) + self.identity_sources = kwargs.get('identity_sources', None) + + class Quota(Model): """Subscription quotas. @@ -659,13 +786,14 @@ class Quota(Model): :ivar hosts_remaining: Remaining hosts quota by sku type :vartype hosts_remaining: dict[str, int] - :param quota_enabled: Host quota is active for current subscription. + :ivar quota_enabled: Host quota is active for current subscription. Possible values include: 'Enabled', 'Disabled' - :type quota_enabled: str or ~azure.mgmt.avs.models.QuotaEnabled + :vartype quota_enabled: str or ~azure.mgmt.avs.models.QuotaEnabled """ _validation = { 'hosts_remaining': {'readonly': True}, + 'quota_enabled': {'readonly': True}, } _attribute_map = { @@ -676,7 +804,7 @@ class Quota(Model): def __init__(self, **kwargs): super(Quota, self).__init__(**kwargs) self.hosts_remaining = None - self.quota_enabled = kwargs.get('quota_enabled', None) + self.quota_enabled = None class Sku(Model): @@ -709,7 +837,7 @@ class Trial(Model): :ivar status: Trial status. Possible values include: 'TrialAvailable', 'TrialUsed', 'TrialDisabled' - :vartype status: str or ~azure.mgmt.avs.models.enum + :vartype status: str or ~azure.mgmt.avs.models.TrialStatus :ivar available_hosts: Number of trial hosts available :vartype available_hosts: int """ 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 64318ee9b579..dd91b09cdb61 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 @@ -51,54 +51,6 @@ def __init__(self, **kwargs) -> None: self.vcenter_password = None -class ApiError(Model): - """API error response. - - :param error: An error returned by the API - :type error: ~azure.mgmt.avs.models.ApiErrorBase - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ApiErrorBase'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(ApiError, self).__init__(**kwargs) - self.error = error - - -class ApiErrorException(HttpOperationError): - """Server responsed with exception of type: 'ApiError'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ApiErrorException, self).__init__(deserialize, response, 'ApiError', *args) - - -class ApiErrorBase(Model): - """Api error. - - :param code: Error code - :type code: str - :param message: Error message - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: - super(ApiErrorBase, self).__init__(**kwargs) - self.code = code - self.message = message - - class Circuit(Model): """An ExpressRoute Circuit. @@ -109,15 +61,11 @@ class Circuit(Model): :vartype primary_subnet: str :ivar secondary_subnet: CIDR of secondary subnet :vartype secondary_subnet: str - :ivar express_route_id: Identifier of the ExpressRoute (Microsoft Colo - only) + :ivar express_route_id: Identifier of the ExpressRoute Circuit (Microsoft + Colo only) :vartype express_route_id: str - :param authorizations: Authorizations for the ExpressRoute (Microsoft Colo - only) - :type authorizations: - list[~azure.mgmt.avs.models.ExpressRouteAuthorization] - :ivar express_route_private_peering_id: ExpressRoute private peering - identifier + :ivar express_route_private_peering_id: ExpressRoute Circuit private + peering identifier :vartype express_route_private_peering_id: str """ @@ -132,26 +80,44 @@ class Circuit(Model): 'primary_subnet': {'key': 'primarySubnet', 'type': 'str'}, 'secondary_subnet': {'key': 'secondarySubnet', 'type': 'str'}, 'express_route_id': {'key': 'expressRouteID', 'type': 'str'}, - 'authorizations': {'key': 'authorizations', 'type': '[ExpressRouteAuthorization]'}, 'express_route_private_peering_id': {'key': 'expressRoutePrivatePeeringID', 'type': 'str'}, } - def __init__(self, *, authorizations=None, **kwargs) -> None: + def __init__(self, **kwargs) -> None: super(Circuit, self).__init__(**kwargs) self.primary_subnet = None self.secondary_subnet = None self.express_route_id = None - self.authorizations = authorizations self.express_route_private_peering_id = None class CloudError(Model): - """CloudError. + """API error response. + + :param error: An error returned by the API + :type error: ~azure.mgmt.avs.models.ErrorResponse """ _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, } + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + class Resource(Model): """The core properties of ARM resources. @@ -192,100 +158,88 @@ class Cluster(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param properties: The properties of a cluster resource - :type properties: ~azure.mgmt.avs.models.ClusterProperties + :param sku: Required. The cluster SKU + :type sku: ~azure.mgmt.avs.models.Sku + :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 = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'sku': {'required': True}, + 'cluster_id': {'readonly': True}, + 'hosts': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ClusterProperties'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + '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, *, properties=None, **kwargs) -> None: + def __init__(self, *, sku, cluster_size: int=None, **kwargs) -> None: super(Cluster, self).__init__(**kwargs) - self.properties = properties - + self.sku = sku + self.cluster_size = cluster_size + self.cluster_id = None + self.hosts = None + self.provisioning_state = None -class DefaultClusterProperties(Model): - """The properties of a default cluster. - Variables are only populated by the server, and will be ignored when - sending a request. +class ClusterUpdate(Model): + """An update of a cluster resource. - :ivar cluster_id: The identity - :vartype cluster_id: int :param cluster_size: The cluster size :type cluster_size: int - :ivar hosts: The hosts - :vartype hosts: list[str] """ - _validation = { - 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, - } - _attribute_map = { - 'cluster_id': {'key': 'clusterId', 'type': 'int'}, - 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, - 'hosts': {'key': 'hosts', 'type': '[str]'}, + 'cluster_size': {'key': 'properties.clusterSize', 'type': 'int'}, } def __init__(self, *, cluster_size: int=None, **kwargs) -> None: - super(DefaultClusterProperties, self).__init__(**kwargs) - self.cluster_id = None + super(ClusterUpdate, self).__init__(**kwargs) self.cluster_size = cluster_size - self.hosts = None -class ClusterProperties(DefaultClusterProperties): - """The properties of a cluster. +class ClusterUpdateProperties(Model): + """The properties of a cluster that may be updated. - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar cluster_id: The identity - :vartype cluster_id: int :param cluster_size: The cluster size :type cluster_size: int - :ivar hosts: The hosts - :vartype hosts: list[str] - :ivar provisioning_state: The state of the cluster provisioning. Possible - values include: 'Succeeded', 'Failed', 'Cancelled', 'Updating' - :vartype provisioning_state: str or - ~azure.mgmt.avs.models.ClusterProvisioningState """ - _validation = { - 'cluster_id': {'readonly': True}, - 'hosts': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - _attribute_map = { - 'cluster_id': {'key': 'clusterId', 'type': 'int'}, 'cluster_size': {'key': 'clusterSize', 'type': 'int'}, - 'hosts': {'key': 'hosts', 'type': '[str]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, } def __init__(self, *, cluster_size: int=None, **kwargs) -> None: - super(ClusterProperties, self).__init__(cluster_size=cluster_size, **kwargs) - self.provisioning_state = None + super(ClusterUpdateProperties, self).__init__(**kwargs) + self.cluster_size = cluster_size class Endpoints(Model): @@ -298,54 +252,189 @@ class Endpoints(Model): :vartype nsxt_manager: str :ivar vcsa: Endpoint for Virtual Center Server Appliance :vartype vcsa: str + :ivar hcx_cloud_manager: Endpoint for the HCX Cloud Manager + :vartype hcx_cloud_manager: str """ _validation = { 'nsxt_manager': {'readonly': True}, 'vcsa': {'readonly': True}, + 'hcx_cloud_manager': {'readonly': True}, } _attribute_map = { 'nsxt_manager': {'key': 'nsxtManager', 'type': 'str'}, 'vcsa': {'key': 'vcsa', 'type': 'str'}, + 'hcx_cloud_manager': {'key': 'hcxCloudManager', 'type': 'str'}, } def __init__(self, **kwargs) -> None: super(Endpoints, self).__init__(**kwargs) self.nsxt_manager = None self.vcsa = None + self.hcx_cloud_manager = None -class ExpressRouteAuthorization(Model): - """Authorization for an ExpressRoute. +class ErrorAdditionalInfo(Model): + """The resource management error additional info. Variables are only populated by the server, and will be ignored when sending a request. - :param name: The name of the ExpressRoute - :type name: str - :ivar id: The ID of the ExpressRoute + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """The resource management error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.avs.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.avs.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ExpressRouteAuthorization(Resource): + """ExpressRoute Circuit Authorization. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. :vartype id: str - :ivar key: The key of the ExpressRoute - :vartype key: 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.ExpressRouteAuthorizationProvisioningState + :ivar express_route_authorization_id: The ID of the ExpressRoute Circuit + Authorization + :vartype express_route_authorization_id: str + :ivar express_route_authorization_key: The key of the ExpressRoute Circuit + Authorization + :vartype express_route_authorization_key: str """ _validation = { 'id': {'readonly': True}, - 'key': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'express_route_authorization_id': {'readonly': True}, + 'express_route_authorization_key': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'express_route_authorization_id': {'key': 'properties.expressRouteAuthorizationId', 'type': 'str'}, + 'express_route_authorization_key': {'key': 'properties.expressRouteAuthorizationKey', 'type': 'str'}, } - def __init__(self, *, name: str=None, **kwargs) -> None: + def __init__(self, **kwargs) -> None: super(ExpressRouteAuthorization, self).__init__(**kwargs) - self.name = name - self.id = None - self.key = None + self.provisioning_state = None + self.express_route_authorization_id = None + self.express_route_authorization_key = None + + +class HcxEnterpriseSite(Resource): + """An HCX Enterprise Site resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar activation_key: The activation key + :vartype activation_key: str + :ivar status: The status of the HCX Enterprise Site. Possible values + include: 'Available', 'Consumed', 'Deactivated', 'Deleted' + :vartype status: str or ~azure.mgmt.avs.models.HcxEnterpriseSiteStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'activation_key': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'activation_key': {'key': 'properties.activationKey', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(HcxEnterpriseSite, self).__init__(**kwargs) + self.activation_key = None + self.status = None class IdentitySource(Model): @@ -403,6 +492,37 @@ 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. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param cluster_size: The cluster size + :type cluster_size: int + :ivar cluster_id: The identity + :vartype cluster_id: int + :ivar hosts: The hosts + :vartype hosts: list[str] + """ + + _validation = { + 'cluster_id': {'readonly': True}, + 'hosts': {'readonly': True}, + } + + _attribute_map = { + '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(ManagementCluster, self).__init__(cluster_size=cluster_size, **kwargs) + self.cluster_id = None + self.hosts = None + + class Operation(Model): """A REST API operation. @@ -515,6 +635,8 @@ class PrivateCloud(TrackedResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. @@ -525,61 +647,28 @@ class PrivateCloud(TrackedResource): :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param sku: The private cloud SKU + :param sku: Required. The private cloud SKU :type sku: ~azure.mgmt.avs.models.Sku - :param properties: The properties of a private cloud resource - :type properties: ~azure.mgmt.avs.models.PrivateCloudProperties - """ - - _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'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'properties': {'key': 'properties', 'type': 'PrivateCloudProperties'}, - } - - def __init__(self, *, location: str=None, tags=None, sku=None, properties=None, **kwargs) -> None: - super(PrivateCloud, self).__init__(location=location, tags=tags, **kwargs) - self.sku = sku - self.properties = properties - - -class PrivateCloudProperties(Model): - """The properties of a private cloud resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - + :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' + :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] :ivar provisioning_state: The provisioning state. Possible values include: - 'Succeeded', 'Failed', 'Cancelled', 'Pending', 'Building', 'Updating' + 'Succeeded', 'Failed', 'Cancelled', 'Pending', 'Building', 'Deleting', + 'Updating' :vartype provisioning_state: str or ~azure.mgmt.avs.models.PrivateCloudProvisioningState :param circuit: An ExpressRoute Circuit :type circuit: ~azure.mgmt.avs.models.Circuit - :param cluster: The default cluster used for management - :type cluster: ~azure.mgmt.avs.models.DefaultClusterProperties - :ivar clusters: The clusters - :vartype clusters: list[str] :ivar endpoints: The endpoints :vartype endpoints: ~azure.mgmt.avs.models.Endpoints - :param internet: Connectivity to internet is enabled or disabled. Possible - values include: 'Enabled', '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 network_block: The block of addresses should be unique across VNet - in your subscription as well as on-premise. Make sure the CIDR format is - conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is - between 0 and 22 + :param network_block: Required. The block of addresses should be unique + across VNet in your subscription as well as on-premise. Make sure the CIDR + format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, + and X is between 0 and 22 :type network_block: str :ivar management_network: Network used to access vCenter Server and NSX-T Manager @@ -604,9 +693,13 @@ class PrivateCloudProperties(Model): """ _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'required': True}, 'provisioning_state': {'readonly': True}, - 'clusters': {'readonly': True}, 'endpoints': {'readonly': True}, + 'network_block': {'required': True}, 'management_network': {'readonly': True}, 'provisioning_network': {'readonly': True}, 'vmotion_network': {'readonly': True}, @@ -615,32 +708,37 @@ class PrivateCloudProperties(Model): } _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'circuit': {'key': 'circuit', 'type': 'Circuit'}, - 'cluster': {'key': 'cluster', 'type': 'DefaultClusterProperties'}, - 'clusters': {'key': 'clusters', 'type': '[str]'}, - 'endpoints': {'key': 'endpoints', 'type': 'Endpoints'}, - 'internet': {'key': 'internet', 'type': 'str'}, - 'identity_sources': {'key': 'identitySources', 'type': '[IdentitySource]'}, - 'network_block': {'key': 'networkBlock', 'type': 'str'}, - 'management_network': {'key': 'managementNetwork', 'type': 'str'}, - 'provisioning_network': {'key': 'provisioningNetwork', 'type': 'str'}, - 'vmotion_network': {'key': 'vmotionNetwork', 'type': 'str'}, - 'vcenter_password': {'key': 'vcenterPassword', 'type': 'str'}, - 'nsxt_password': {'key': 'nsxtPassword', 'type': 'str'}, - 'vcenter_certificate_thumbprint': {'key': 'vcenterCertificateThumbprint', 'type': 'str'}, - 'nsxt_certificate_thumbprint': {'key': 'nsxtCertificateThumbprint', 'type': 'str'}, - } - - def __init__(self, *, circuit=None, cluster=None, internet=None, identity_sources=None, network_block: str=None, vcenter_password: str=None, nsxt_password: str=None, **kwargs) -> None: - super(PrivateCloudProperties, self).__init__(**kwargs) + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, + 'internet': {'key': 'properties.internet', 'type': 'str'}, + 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'circuit': {'key': 'properties.circuit', 'type': 'Circuit'}, + 'endpoints': {'key': 'properties.endpoints', 'type': 'Endpoints'}, + 'network_block': {'key': 'properties.networkBlock', 'type': 'str'}, + '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: + 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.provisioning_state = None self.circuit = circuit - self.cluster = cluster - self.clusters = None self.endpoints = None - self.internet = internet - self.identity_sources = identity_sources self.network_block = network_block self.management_network = None self.provisioning_network = None @@ -651,6 +749,35 @@ def __init__(self, *, circuit=None, cluster=None, internet=None, identity_source self.nsxt_certificate_thumbprint = None +class PrivateCloudUpdate(Model): + """An update to a private cloud resource. + + :param tags: Resource tags. + :type tags: dict[str, str] + :param management_cluster: The default cluster used for management + :type management_cluster: ~azure.mgmt.avs.models.ManagementCluster + :param internet: Connectivity to internet is enabled or disabled. Possible + values include: 'Enabled', '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] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'management_cluster': {'key': 'properties.managementCluster', 'type': 'ManagementCluster'}, + 'internet': {'key': 'properties.internet', 'type': 'str'}, + 'identity_sources': {'key': 'properties.identitySources', 'type': '[IdentitySource]'}, + } + + def __init__(self, *, tags=None, management_cluster=None, internet=None, identity_sources=None, **kwargs) -> None: + super(PrivateCloudUpdate, self).__init__(**kwargs) + self.tags = tags + self.management_cluster = management_cluster + self.internet = internet + self.identity_sources = identity_sources + + class Quota(Model): """Subscription quotas. @@ -659,13 +786,14 @@ class Quota(Model): :ivar hosts_remaining: Remaining hosts quota by sku type :vartype hosts_remaining: dict[str, int] - :param quota_enabled: Host quota is active for current subscription. + :ivar quota_enabled: Host quota is active for current subscription. Possible values include: 'Enabled', 'Disabled' - :type quota_enabled: str or ~azure.mgmt.avs.models.QuotaEnabled + :vartype quota_enabled: str or ~azure.mgmt.avs.models.QuotaEnabled """ _validation = { 'hosts_remaining': {'readonly': True}, + 'quota_enabled': {'readonly': True}, } _attribute_map = { @@ -673,10 +801,10 @@ class Quota(Model): 'quota_enabled': {'key': 'quotaEnabled', 'type': 'str'}, } - def __init__(self, *, quota_enabled=None, **kwargs) -> None: + def __init__(self, **kwargs) -> None: super(Quota, self).__init__(**kwargs) self.hosts_remaining = None - self.quota_enabled = quota_enabled + self.quota_enabled = None class Sku(Model): @@ -709,7 +837,7 @@ class Trial(Model): :ivar status: Trial status. Possible values include: 'TrialAvailable', 'TrialUsed', 'TrialDisabled' - :vartype status: str or ~azure.mgmt.avs.models.enum + :vartype status: str or ~azure.mgmt.avs.models.TrialStatus :ivar available_hosts: Number of trial hosts available :vartype available_hosts: int """ 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 93b7f7f420ce..874c91b84a94 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_paged_models.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_paged_models.py @@ -51,3 +51,29 @@ class ClusterPaged(Paged): def __init__(self, *args, **kwargs): super(ClusterPaged, self).__init__(*args, **kwargs) +class HcxEnterpriseSitePaged(Paged): + """ + A paging container for iterating over a list of :class:`HcxEnterpriseSite ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[HcxEnterpriseSite]'} + } + + def __init__(self, *args, **kwargs): + + super(HcxEnterpriseSitePaged, self).__init__(*args, **kwargs) +class ExpressRouteAuthorizationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ExpressRouteAuthorization ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ExpressRouteAuthorization]'} + } + + def __init__(self, *args, **kwargs): + + super(ExpressRouteAuthorizationPaged, 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 632207515508..f8c122b9ef0c 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py @@ -13,10 +13,14 @@ from ._locations_operations import LocationsOperations from ._private_clouds_operations import PrivateCloudsOperations from ._clusters_operations import ClustersOperations +from ._hcx_enterprise_sites_operations import HcxEnterpriseSitesOperations +from ._authorizations_operations import AuthorizationsOperations __all__ = [ 'Operations', 'LocationsOperations', 'PrivateCloudsOperations', 'ClustersOperations', + 'HcxEnterpriseSitesOperations', + 'AuthorizationsOperations', ] 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 new file mode 100644 index 000000000000..ae761e630faa --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_authorizations_operations.py @@ -0,0 +1,376 @@ +# 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 AuthorizationsOperations(object): + """AuthorizationsOperations 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-03-20". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-20" + + self.config = config + + def list( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List ExpressRoute Circuit Authorizations 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 ExpressRouteAuthorization + :rtype: + ~azure.mgmt.avs.models.ExpressRouteAuthorizationPaged[~azure.mgmt.avs.models.ExpressRouteAuthorization] + :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.ExpressRouteAuthorizationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations'} + + def get( + self, resource_group_name, private_cloud_name, authorization_name, custom_headers=None, raw=False, **operation_config): + """Get an ExpressRoute Circuit Authorization 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 authorization_name: Name of the ExpressRoute Circuit + Authorization in the private cloud + :type authorization_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: ExpressRouteAuthorization or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.ExpressRouteAuthorization 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'), + 'authorizationName': self._serialize.url("authorization_name", authorization_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('ExpressRouteAuthorization', 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}/authorizations/{authorizationName}'} + + + def _create_or_update_initial( + self, resource_group_name, private_cloud_name, authorization_name, authorization, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'authorizationName': self._serialize.url("authorization_name", authorization_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(authorization, 'object') + + # 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('ExpressRouteAuthorization', response) + if response.status_code == 201: + deserialized = self._deserialize('ExpressRouteAuthorization', 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, authorization_name, authorization, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update an ExpressRoute Circuit Authorization 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 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ExpressRouteAuthorization or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.ExpressRouteAuthorization] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.ExpressRouteAuthorization]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + 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 + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ExpressRouteAuthorization', 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}/authorizations/{authorizationName}'} + + + def _delete_initial( + self, resource_group_name, private_cloud_name, authorization_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'), + 'authorizationName': self._serialize.url("authorization_name", authorization_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, authorization_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete an ExpressRoute Circuit Authorization 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 authorization_name: Name of the ExpressRoute Circuit + Authorization in the private cloud + :type authorization_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, + authorization_name=authorization_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}/authorizations/{authorizationName}'} 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 972c3b4f97bb..3d9a15ab9ec8 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 @@ -11,6 +11,7 @@ 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 @@ -26,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: Version of Azure VMware Solution API to be used with the client request. Constant value: "2019-08-09-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-20". """ models = models @@ -36,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-09-preview" + self.api_version = "2020-03-20" self.config = config @@ -44,8 +45,8 @@ def list( self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): """List clusters in a private cloud. - :param resource_group_name: Name of the resource group within the - Azure subscription + :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 @@ -57,23 +58,22 @@ def list( :return: An iterator like instance of Cluster :rtype: ~azure.mgmt.avs.models.ClusterPaged[~azure.mgmt.avs.models.Cluster] - :raises: - :class:`ApiErrorException` + :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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -99,7 +99,9 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response @@ -116,8 +118,8 @@ def get( self, resource_group_name, private_cloud_name, cluster_name, custom_headers=None, raw=False, **operation_config): """Get a cluster by name in a private cloud. - :param resource_group_name: Name of the resource group within the - Azure subscription + :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 @@ -131,14 +133,13 @@ def get( :return: Cluster or ClientRawResponse if raw=true :rtype: ~azure.mgmt.avs.models.Cluster or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ApiErrorException` + :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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } @@ -146,7 +147,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -163,7 +164,9 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: @@ -178,14 +181,14 @@ def get( def _create_or_update_initial( - self, resource_group_name, private_cloud_name, cluster_name, properties=None, custom_headers=None, raw=False, **operation_config): - cluster = models.Cluster(properties=properties) + self, resource_group_name, private_cloud_name, cluster_name, sku, cluster_size=None, custom_headers=None, raw=False, **operation_config): + cluster = models.Cluster(sku=sku, cluster_size=cluster_size) # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } @@ -193,7 +196,7 @@ def _create_or_update_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -214,7 +217,9 @@ def _create_or_update_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -230,18 +235,20 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, private_cloud_name, cluster_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, private_cloud_name, cluster_name, sku, cluster_size=None, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a cluster in a private cloud. - :param resource_group_name: Name of the resource group within the - Azure subscription + :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 cluster_name: Name of the cluster in the private cloud :type cluster_name: str - :param properties: The properties of a cluster resource - :type properties: ~azure.mgmt.avs.models.ClusterProperties + :param sku: The cluster SKU + :type sku: ~azure.mgmt.avs.models.Sku + :param cluster_size: The cluster size + :type cluster_size: int :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -253,14 +260,14 @@ def create_or_update( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.Cluster] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.Cluster]] - :raises: - :class:`ApiErrorException` + :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, cluster_name=cluster_name, - properties=properties, + sku=sku, + cluster_size=cluster_size, custom_headers=custom_headers, raw=True, **operation_config @@ -286,14 +293,14 @@ def get_long_running_output(response): def _update_initial( - self, resource_group_name, private_cloud_name, cluster_name, properties=None, custom_headers=None, raw=False, **operation_config): - cluster = models.Cluster(properties=properties) + self, resource_group_name, private_cloud_name, cluster_name, cluster_size=None, custom_headers=None, raw=False, **operation_config): + cluster_update = models.ClusterUpdate(cluster_size=cluster_size) # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } @@ -301,7 +308,7 @@ def _update_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -315,14 +322,16 @@ def _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(cluster, 'Cluster') + body_content = self._serialize.body(cluster_update, 'ClusterUpdate') # 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, 201]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -338,18 +347,18 @@ def _update_initial( return deserialized def update( - self, resource_group_name, private_cloud_name, cluster_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, private_cloud_name, cluster_name, cluster_size=None, custom_headers=None, raw=False, polling=True, **operation_config): """Update a cluster in a private cloud. - :param resource_group_name: Name of the resource group within the - Azure subscription + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param private_cloud_name: Name of the private cloud :type private_cloud_name: str :param cluster_name: Name of the cluster in the private cloud :type cluster_name: str - :param properties: The properties of a cluster resource - :type properties: ~azure.mgmt.avs.models.ClusterProperties + :param cluster_size: The cluster size + :type cluster_size: int :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -361,14 +370,13 @@ def update( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.Cluster] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.Cluster]] - :raises: - :class:`ApiErrorException` + :raises: :class:`CloudError` """ raw_result = self._update_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, cluster_name=cluster_name, - properties=properties, + cluster_size=cluster_size, custom_headers=custom_headers, raw=True, **operation_config @@ -398,8 +406,8 @@ def _delete_initial( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } @@ -407,7 +415,7 @@ def _delete_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -423,7 +431,9 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: client_raw_response = ClientRawResponse(None, response) @@ -433,8 +443,8 @@ def delete( self, resource_group_name, private_cloud_name, cluster_name, custom_headers=None, raw=False, polling=True, **operation_config): """Delete a cluster in a private cloud. - :param resource_group_name: Name of the resource group within the - Azure subscription + :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 @@ -449,8 +459,7 @@ def delete( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ApiErrorException` + :raises: :class:`CloudError` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, 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 new file mode 100644 index 000000000000..2a6b139c72e3 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_hcx_enterprise_sites_operations.py @@ -0,0 +1,311 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class HcxEnterpriseSitesOperations(object): + """HcxEnterpriseSitesOperations 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-03-20". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-20" + + self.config = config + + def list( + self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): + """List HCX Enterprise Sites 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 HcxEnterpriseSite + :rtype: + ~azure.mgmt.avs.models.HcxEnterpriseSitePaged[~azure.mgmt.avs.models.HcxEnterpriseSite] + :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.HcxEnterpriseSitePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites'} + + def get( + self, resource_group_name, private_cloud_name, hcx_enterprise_site_name, custom_headers=None, raw=False, **operation_config): + """Get an HCX Enterprise Site 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 hcx_enterprise_site_name: Name of the HCX Enterprise Site in + the private cloud + :type hcx_enterprise_site_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: HcxEnterpriseSite or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.HcxEnterpriseSite 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'), + 'hcxEnterpriseSiteName': self._serialize.url("hcx_enterprise_site_name", hcx_enterprise_site_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('HcxEnterpriseSite', 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}/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): + """Create or update an HCX Enterprise Site 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 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: HcxEnterpriseSite or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.HcxEnterpriseSite or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'hcxEnterpriseSiteName': self._serialize.url("hcx_enterprise_site_name", hcx_enterprise_site_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(hcx_enterprise_site, 'object') + + # 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('HcxEnterpriseSite', response) + if response.status_code == 201: + deserialized = self._deserialize('HcxEnterpriseSite', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}'} + + def delete( + self, resource_group_name, private_cloud_name, hcx_enterprise_site_name, custom_headers=None, raw=False, **operation_config): + """Delete an HCX Enterprise Site 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 hcx_enterprise_site_name: Name of the HCX Enterprise Site in + the private cloud + :type hcx_enterprise_site_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'hcxEnterpriseSiteName': self._serialize.url("hcx_enterprise_site_name", hcx_enterprise_site_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, 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 + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}'} 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 644da51d118b..6d8d140021c9 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 @@ -11,6 +11,7 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError from .. import models @@ -24,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: Version of Azure VMware Solution API to be used with the client request. Constant value: "2019-08-09-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-20". """ models = models @@ -34,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-09-preview" + self.api_version = "2020-03-20" self.config = config @@ -52,20 +53,19 @@ def check_trial_availability( :return: Trial or ClientRawResponse if raw=true :rtype: ~azure.mgmt.avs.models.Trial or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ApiErrorException` + :raises: :class:`CloudError` """ # Construct URL url = self.check_trial_availability.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'location': self._serialize.url("location", location, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -82,7 +82,9 @@ def check_trial_availability( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: @@ -109,20 +111,19 @@ def check_quota_availability( :return: Quota or ClientRawResponse if raw=true :rtype: ~azure.mgmt.avs.models.Quota or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ApiErrorException` + :raises: :class:`CloudError` """ # Construct URL url = self.check_quota_availability.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'location': self._serialize.url("location", location, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -139,7 +140,9 @@ def check_quota_availability( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: 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 c620297e1ee1..2e02064516c0 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 @@ -11,6 +11,7 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError from .. import models @@ -24,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: Version of Azure VMware Solution API to be used with the client request. Constant value: "2019-08-09-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-20". """ models = models @@ -34,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-09-preview" + self.api_version = "2020-03-20" self.config = config @@ -50,8 +51,7 @@ def list( :return: An iterator like instance of Operation :rtype: ~azure.mgmt.avs.models.OperationPaged[~azure.mgmt.avs.models.Operation] - :raises: - :class:`ApiErrorException` + :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: @@ -60,7 +60,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -86,7 +86,9 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response 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 e7c3b0936b48..128a4596f79b 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 @@ -11,6 +11,7 @@ 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 @@ -26,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: Version of Azure VMware Solution API to be used with the client request. Constant value: "2019-08-09-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-20". """ models = models @@ -36,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-09-preview" + self.api_version = "2020-03-20" self.config = config @@ -44,8 +45,8 @@ def list( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """List private clouds in a resource group. - :param resource_group_name: Name of the resource group within the - Azure subscription + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -55,22 +56,21 @@ def list( :return: An iterator like instance of PrivateCloud :rtype: ~azure.mgmt.avs.models.PrivateCloudPaged[~azure.mgmt.avs.models.PrivateCloud] - :raises: - :class:`ApiErrorException` + :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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + '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\._\(\)]+$') } 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -96,7 +96,9 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response @@ -121,21 +123,20 @@ def list_in_subscription( :return: An iterator like instance of PrivateCloud :rtype: ~azure.mgmt.avs.models.PrivateCloudPaged[~azure.mgmt.avs.models.PrivateCloud] - :raises: - :class:`ApiErrorException` + :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_in_subscription.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } 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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -161,7 +162,9 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response @@ -178,8 +181,8 @@ def get( self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): """Get a private cloud. - :param resource_group_name: Name of the resource group within the - Azure subscription + :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 @@ -191,21 +194,20 @@ def get( :return: PrivateCloud or ClientRawResponse if raw=true :rtype: ~azure.mgmt.avs.models.PrivateCloud or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ApiErrorException` + :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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -222,7 +224,9 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: @@ -241,15 +245,15 @@ def _create_or_update_initial( # 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'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -270,7 +274,9 @@ def _create_or_update_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -289,8 +295,8 @@ def create_or_update( self, resource_group_name, private_cloud_name, private_cloud, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a private cloud. - :param resource_group_name: Name of the resource group within the - Azure subscription + :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 @@ -307,8 +313,7 @@ def create_or_update( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.PrivateCloud] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.PrivateCloud]] - :raises: - :class:`ApiErrorException` + :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -339,19 +344,19 @@ def get_long_running_output(response): def _update_initial( - self, resource_group_name, private_cloud_name, private_cloud, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, private_cloud_name, private_cloud_update, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -365,14 +370,16 @@ def _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(private_cloud, 'PrivateCloud') + body_content = self._serialize.body(private_cloud_update, 'PrivateCloudUpdate') # 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, 201]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -388,16 +395,17 @@ def _update_initial( return deserialized def update( - self, resource_group_name, private_cloud_name, private_cloud, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, private_cloud_name, private_cloud_update, custom_headers=None, raw=False, polling=True, **operation_config): """Update a private cloud. - :param resource_group_name: Name of the resource group within the - Azure subscription + :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 private_cloud: The private cloud - :type private_cloud: ~azure.mgmt.avs.models.PrivateCloud + :param private_cloud_update: The private cloud properties to be + updated + :type private_cloud_update: ~azure.mgmt.avs.models.PrivateCloudUpdate :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 @@ -409,13 +417,12 @@ def update( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.avs.models.PrivateCloud] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.avs.models.PrivateCloud]] - :raises: - :class:`ApiErrorException` + :raises: :class:`CloudError` """ raw_result = self._update_initial( resource_group_name=resource_group_name, private_cloud_name=private_cloud_name, - private_cloud=private_cloud, + private_cloud_update=private_cloud_update, custom_headers=custom_headers, raw=True, **operation_config @@ -445,15 +452,15 @@ def _delete_initial( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -469,7 +476,9 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: client_raw_response = ClientRawResponse(None, response) @@ -479,8 +488,8 @@ def delete( self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, polling=True, **operation_config): """Delete a private cloud. - :param resource_group_name: Name of the resource group within the - Azure subscription + :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 @@ -493,8 +502,7 @@ def delete( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ApiErrorException` + :raises: :class:`CloudError` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -522,8 +530,8 @@ def list_admin_credentials( self, resource_group_name, private_cloud_name, custom_headers=None, raw=False, **operation_config): """List the admin credentials for the private cloud. - :param resource_group_name: Name of the resource group within the - Azure subscription + :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 @@ -535,21 +543,20 @@ def list_admin_credentials( :return: AdminCredentials or ClientRawResponse if raw=true :rtype: ~azure.mgmt.avs.models.AdminCredentials or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ApiErrorException` + :raises: :class:`CloudError` """ # Construct URL url = self.list_admin_credentials.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} @@ -566,7 +573,9 @@ def list_admin_credentials( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ApiErrorException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/version.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/version.py index e0ec669828cb..dd95c38f3058 100644 --- a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/version.py +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "1.0.0rc1"