diff --git a/sdk/compute/azure-mgmt-avs/CHANGELOG.md b/sdk/compute/azure-mgmt-avs/CHANGELOG.md new file mode 100644 index 000000000000..14d5e406e3c8 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (2020-06-12) + +* Initial Release diff --git a/sdk/compute/azure-mgmt-avs/MANIFEST.in b/sdk/compute/azure-mgmt-avs/MANIFEST.in new file mode 100644 index 000000000000..a3cb07df8765 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/compute/azure-mgmt-avs/README.md b/sdk/compute/azure-mgmt-avs/README.md new file mode 100644 index 000000000000..c9b2ac35de7b --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/README.md @@ -0,0 +1,21 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure VMware Solution Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) + + +# Usage + +For code examples, see [VMware Solution Management](https://docs.microsoft.com/python/api/overview/azure/) +on docs.microsoft.com. + + +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-avs%2FREADME.png) diff --git a/sdk/compute/azure-mgmt-avs/azure/__init__.py b/sdk/compute/azure-mgmt-avs/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/__init__.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/__init__.py new file mode 100644 index 000000000000..658daba783e3 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/__init__.py @@ -0,0 +1,19 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._configuration import AVSClientConfiguration +from ._avs_client import AVSClient +__all__ = ['AVSClient', 'AVSClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + 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 new file mode 100644 index 000000000000..8646bf5bcf48 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_avs_client.py @@ -0,0 +1,64 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import AVSClientConfiguration +from .operations import Operations +from .operations import LocationsOperations +from .operations import PrivateCloudsOperations +from .operations import ClustersOperations +from . import models + + +class AVSClient(SDKClient): + """Azure VMware Solution API + + :ivar config: Configuration for client. + :vartype config: AVSClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.avs.operations.Operations + :ivar locations: Locations operations + :vartype locations: azure.mgmt.avs.operations.LocationsOperations + :ivar private_clouds: PrivateClouds operations + :vartype private_clouds: azure.mgmt.avs.operations.PrivateCloudsOperations + :ivar clusters: Clusters operations + :vartype clusters: azure.mgmt.avs.operations.ClustersOperations + + :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 + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = AVSClientConfiguration(credentials, subscription_id, base_url) + 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._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.locations = LocationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_clouds = PrivateCloudsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.clusters = ClustersOperations( + 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 new file mode 100644 index 000000000000..3e97aaba096c --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/_configuration.py @@ -0,0 +1,48 @@ +# 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. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class AVSClientConfiguration(AzureConfiguration): + """Configuration for AVSClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :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 + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(AVSClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-avs/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id 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 new file mode 100644 index 000000000000..a3c8f5cc25ab --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/__init__.py @@ -0,0 +1,91 @@ +# 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. +# -------------------------------------------------------------------------- + +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 Endpoints + from ._models_py3 import ExpressRouteAuthorization + from ._models_py3 import IdentitySource + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import PrivateCloud + from ._models_py3 import PrivateCloudProperties + from ._models_py3 import Quota + from ._models_py3 import Resource + from ._models_py3 import Sku + from ._models_py3 import TrackedResource + 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 Endpoints + from ._models import ExpressRouteAuthorization + from ._models import IdentitySource + from ._models import Operation + from ._models import OperationDisplay + from ._models import PrivateCloud + from ._models import PrivateCloudProperties + 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 OperationPaged +from ._paged_models import PrivateCloudPaged +from ._avs_client_enums import ( + QuotaEnabled, + SslEnum, + PrivateCloudProvisioningState, + InternetEnum, + ClusterProvisioningState, +) + +__all__ = [ + 'AdminCredentials', + 'ApiError', 'ApiErrorException', + 'ApiErrorBase', + 'Circuit', + 'Cluster', + 'ClusterProperties', + 'DefaultClusterProperties', + 'Endpoints', + 'ExpressRouteAuthorization', + 'IdentitySource', + 'Operation', + 'OperationDisplay', + 'PrivateCloud', + 'PrivateCloudProperties', + 'Quota', + 'Resource', + 'Sku', + 'TrackedResource', + 'Trial', + 'OperationPaged', + 'PrivateCloudPaged', + 'ClusterPaged', + 'QuotaEnabled', + 'SslEnum', + 'PrivateCloudProvisioningState', + 'InternetEnum', + 'ClusterProvisioningState', +] 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 new file mode 100644 index 000000000000..bf53315dd149 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_avs_client_enums.py @@ -0,0 +1,48 @@ +# 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. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class QuotaEnabled(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class SslEnum(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class PrivateCloudProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + cancelled = "Cancelled" + pending = "Pending" + building = "Building" + updating = "Updating" + + +class InternetEnum(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class ClusterProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + cancelled = "Cancelled" + updating = "Updating" diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py new file mode 100644 index 000000000000..cf6dddf052e1 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models.py @@ -0,0 +1,730 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AdminCredentials(Model): + """Administrative credentials for accessing vCenter and NSX-T. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar nsxt_username: NSX-T Manager username + :vartype nsxt_username: str + :ivar nsxt_password: NSX-T Manager password + :vartype nsxt_password: str + :ivar vcenter_username: vCenter admin username + :vartype vcenter_username: str + :ivar vcenter_password: vCenter admin password + :vartype vcenter_password: str + """ + + _validation = { + 'nsxt_username': {'readonly': True}, + 'nsxt_password': {'readonly': True}, + 'vcenter_username': {'readonly': True}, + 'vcenter_password': {'readonly': True}, + } + + _attribute_map = { + 'nsxt_username': {'key': 'nsxtUsername', 'type': 'str'}, + 'nsxt_password': {'key': 'nsxtPassword', 'type': 'str'}, + 'vcenter_username': {'key': 'vcenterUsername', 'type': 'str'}, + 'vcenter_password': {'key': 'vcenterPassword', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AdminCredentials, self).__init__(**kwargs) + self.nsxt_username = None + self.nsxt_password = None + self.vcenter_username = 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, **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. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar primary_subnet: CIDR of primary subnet + :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) + :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 + :vartype express_route_private_peering_id: str + """ + + _validation = { + 'primary_subnet': {'readonly': True}, + 'secondary_subnet': {'readonly': True}, + 'express_route_id': {'readonly': True}, + 'express_route_private_peering_id': {'readonly': True}, + } + + _attribute_map = { + '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, **kwargs): + super(Circuit, self).__init__(**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. + """ + + _attribute_map = { + } + + +class Resource(Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Cluster(Resource): + """A cluster resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param properties: The properties of a cluster resource + :type properties: ~azure.mgmt.avs.models.ClusterProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ClusterProperties'}, + } + + def __init__(self, **kwargs): + super(Cluster, self).__init__(**kwargs) + self.properties = kwargs.get('properties', 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. + + :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]'}, + } + + def __init__(self, **kwargs): + super(DefaultClusterProperties, self).__init__(**kwargs) + self.cluster_id = None + self.cluster_size = kwargs.get('cluster_size', None) + self.hosts = None + + +class ClusterProperties(DefaultClusterProperties): + """The properties of a cluster. + + 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 + + +class Endpoints(Model): + """Endpoint addresses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar nsxt_manager: Endpoint for the NSX-T Data Center manager + :vartype nsxt_manager: str + :ivar vcsa: Endpoint for Virtual Center Server Appliance + :vartype vcsa: str + """ + + _validation = { + 'nsxt_manager': {'readonly': True}, + 'vcsa': {'readonly': True}, + } + + _attribute_map = { + 'nsxt_manager': {'key': 'nsxtManager', 'type': 'str'}, + 'vcsa': {'key': 'vcsa', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.nsxt_manager = None + self.vcsa = None + + +class ExpressRouteAuthorization(Model): + """Authorization for an ExpressRoute. + + 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 + :vartype id: str + :ivar key: The key of the ExpressRoute + :vartype key: str + """ + + _validation = { + 'id': {'readonly': True}, + 'key': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExpressRouteAuthorization, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.id = None + self.key = None + + +class IdentitySource(Model): + """vCenter Single Sign On Identity Source. + + :param name: The name of the identity source + :type name: str + :param alias: The domain's NetBIOS name + :type alias: str + :param domain: The domain's dns name + :type domain: str + :param base_user_dn: The base distinguished name for users + :type base_user_dn: str + :param base_group_dn: The base distinguished name for groups + :type base_group_dn: str + :param primary_server: Primary server URL + :type primary_server: str + :param secondary_server: Secondary server URL + :type secondary_server: str + :param ssl: Protect LDAP communication using SSL certificate (LDAPS). + Possible values include: 'Enabled', 'Disabled' + :type ssl: str or ~azure.mgmt.avs.models.SslEnum + :param username: The ID of an Active Directory user with a minimum of + read-only access to Base DN for users and group + :type username: str + :param password: The password of the Active Directory user with a minimum + of read-only access to Base DN for users and groups. + :type password: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'alias': {'key': 'alias', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'base_user_dn': {'key': 'baseUserDN', 'type': 'str'}, + 'base_group_dn': {'key': 'baseGroupDN', 'type': 'str'}, + 'primary_server': {'key': 'primaryServer', 'type': 'str'}, + 'secondary_server': {'key': 'secondaryServer', 'type': 'str'}, + 'ssl': {'key': 'ssl', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IdentitySource, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.alias = kwargs.get('alias', None) + self.domain = kwargs.get('domain', None) + self.base_user_dn = kwargs.get('base_user_dn', None) + self.base_group_dn = kwargs.get('base_group_dn', None) + self.primary_server = kwargs.get('primary_server', None) + self.secondary_server = kwargs.get('secondary_server', None) + self.ssl = kwargs.get('ssl', None) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + + +class Operation(Model): + """A REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the operation being performed on this object + :vartype name: str + :ivar display: Contains the localized display information for this + operation + :vartype display: ~azure.mgmt.avs.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + + +class OperationDisplay(Model): + """Contains the localized display information for this operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Localized friendly form of the resource provider name + :vartype provider: str + :ivar resource: Localized friendly form of the resource type related to + this operation + :vartype resource: str + :ivar operation: Localized friendly name for the operation + :vartype operation: str + :ivar description: Localized friendly description for the operation + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class PrivateCloud(TrackedResource): + """A private cloud resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: 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. + + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Cancelled', 'Pending', 'Building', '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 + :type network_block: str + :ivar management_network: Network used to access vCenter Server and NSX-T + Manager + :vartype management_network: str + :ivar provisioning_network: Used for virtual machine cold migration, + cloning, and snapshot migration + :vartype provisioning_network: str + :ivar vmotion_network: Used for live migration of virtual machines + :vartype vmotion_network: str + :param vcenter_password: Optionally, set the vCenter admin password when + the private cloud is created + :type vcenter_password: str + :param nsxt_password: Optionally, set the NSX-T Manager password when the + private cloud is created + :type nsxt_password: str + :ivar vcenter_certificate_thumbprint: Thumbprint of the vCenter Server SSL + certificate + :vartype vcenter_certificate_thumbprint: str + :ivar nsxt_certificate_thumbprint: Thumbprint of the NSX-T Manager SSL + certificate + :vartype nsxt_certificate_thumbprint: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'clusters': {'readonly': True}, + 'endpoints': {'readonly': True}, + 'management_network': {'readonly': True}, + 'provisioning_network': {'readonly': True}, + 'vmotion_network': {'readonly': True}, + 'vcenter_certificate_thumbprint': {'readonly': True}, + 'nsxt_certificate_thumbprint': {'readonly': True}, + } + + _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, **kwargs): + super(PrivateCloudProperties, self).__init__(**kwargs) + 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 + self.vmotion_network = None + self.vcenter_password = kwargs.get('vcenter_password', None) + self.nsxt_password = kwargs.get('nsxt_password', None) + self.vcenter_certificate_thumbprint = None + self.nsxt_certificate_thumbprint = None + + +class Quota(Model): + """Subscription quotas. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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. + Possible values include: 'Enabled', 'Disabled' + :type quota_enabled: str or ~azure.mgmt.avs.models.QuotaEnabled + """ + + _validation = { + 'hosts_remaining': {'readonly': True}, + } + + _attribute_map = { + 'hosts_remaining': {'key': 'hostsRemaining', 'type': '{int}'}, + 'quota_enabled': {'key': 'quotaEnabled', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Quota, self).__init__(**kwargs) + self.hosts_remaining = None + self.quota_enabled = kwargs.get('quota_enabled', None) + + +class Sku(Model): + """The resource model definition representing SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class Trial(Model): + """Subscription trial availability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: Trial status. Possible values include: 'TrialAvailable', + 'TrialUsed', 'TrialDisabled' + :vartype status: str or ~azure.mgmt.avs.models.enum + :ivar available_hosts: Number of trial hosts available + :vartype available_hosts: int + """ + + _validation = { + 'status': {'readonly': True}, + 'available_hosts': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'available_hosts': {'key': 'availableHosts', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Trial, self).__init__(**kwargs) + self.status = None + self.available_hosts = None 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 new file mode 100644 index 000000000000..64318ee9b579 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_models_py3.py @@ -0,0 +1,730 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class AdminCredentials(Model): + """Administrative credentials for accessing vCenter and NSX-T. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar nsxt_username: NSX-T Manager username + :vartype nsxt_username: str + :ivar nsxt_password: NSX-T Manager password + :vartype nsxt_password: str + :ivar vcenter_username: vCenter admin username + :vartype vcenter_username: str + :ivar vcenter_password: vCenter admin password + :vartype vcenter_password: str + """ + + _validation = { + 'nsxt_username': {'readonly': True}, + 'nsxt_password': {'readonly': True}, + 'vcenter_username': {'readonly': True}, + 'vcenter_password': {'readonly': True}, + } + + _attribute_map = { + 'nsxt_username': {'key': 'nsxtUsername', 'type': 'str'}, + 'nsxt_password': {'key': 'nsxtPassword', 'type': 'str'}, + 'vcenter_username': {'key': 'vcenterUsername', 'type': 'str'}, + 'vcenter_password': {'key': 'vcenterPassword', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AdminCredentials, self).__init__(**kwargs) + self.nsxt_username = None + self.nsxt_password = None + self.vcenter_username = 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. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar primary_subnet: CIDR of primary subnet + :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) + :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 + :vartype express_route_private_peering_id: str + """ + + _validation = { + 'primary_subnet': {'readonly': True}, + 'secondary_subnet': {'readonly': True}, + 'express_route_id': {'readonly': True}, + 'express_route_private_peering_id': {'readonly': True}, + } + + _attribute_map = { + '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: + 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. + """ + + _attribute_map = { + } + + +class Resource(Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Cluster(Resource): + """A cluster resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param properties: The properties of a cluster resource + :type properties: ~azure.mgmt.avs.models.ClusterProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ClusterProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(Cluster, self).__init__(**kwargs) + self.properties = properties + + +class DefaultClusterProperties(Model): + """The properties of a default cluster. + + 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] + """ + + _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]'}, + } + + def __init__(self, *, cluster_size: int=None, **kwargs) -> None: + super(DefaultClusterProperties, self).__init__(**kwargs) + self.cluster_id = None + self.cluster_size = cluster_size + self.hosts = None + + +class ClusterProperties(DefaultClusterProperties): + """The properties of a cluster. + + 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 + + +class Endpoints(Model): + """Endpoint addresses. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar nsxt_manager: Endpoint for the NSX-T Data Center manager + :vartype nsxt_manager: str + :ivar vcsa: Endpoint for Virtual Center Server Appliance + :vartype vcsa: str + """ + + _validation = { + 'nsxt_manager': {'readonly': True}, + 'vcsa': {'readonly': True}, + } + + _attribute_map = { + 'nsxt_manager': {'key': 'nsxtManager', 'type': 'str'}, + 'vcsa': {'key': 'vcsa', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.nsxt_manager = None + self.vcsa = None + + +class ExpressRouteAuthorization(Model): + """Authorization for an ExpressRoute. + + 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 + :vartype id: str + :ivar key: The key of the ExpressRoute + :vartype key: str + """ + + _validation = { + 'id': {'readonly': True}, + 'key': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(ExpressRouteAuthorization, self).__init__(**kwargs) + self.name = name + self.id = None + self.key = None + + +class IdentitySource(Model): + """vCenter Single Sign On Identity Source. + + :param name: The name of the identity source + :type name: str + :param alias: The domain's NetBIOS name + :type alias: str + :param domain: The domain's dns name + :type domain: str + :param base_user_dn: The base distinguished name for users + :type base_user_dn: str + :param base_group_dn: The base distinguished name for groups + :type base_group_dn: str + :param primary_server: Primary server URL + :type primary_server: str + :param secondary_server: Secondary server URL + :type secondary_server: str + :param ssl: Protect LDAP communication using SSL certificate (LDAPS). + Possible values include: 'Enabled', 'Disabled' + :type ssl: str or ~azure.mgmt.avs.models.SslEnum + :param username: The ID of an Active Directory user with a minimum of + read-only access to Base DN for users and group + :type username: str + :param password: The password of the Active Directory user with a minimum + of read-only access to Base DN for users and groups. + :type password: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'alias': {'key': 'alias', 'type': 'str'}, + 'domain': {'key': 'domain', 'type': 'str'}, + 'base_user_dn': {'key': 'baseUserDN', 'type': 'str'}, + 'base_group_dn': {'key': 'baseGroupDN', 'type': 'str'}, + 'primary_server': {'key': 'primaryServer', 'type': 'str'}, + 'secondary_server': {'key': 'secondaryServer', 'type': 'str'}, + 'ssl': {'key': 'ssl', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, alias: str=None, domain: str=None, base_user_dn: str=None, base_group_dn: str=None, primary_server: str=None, secondary_server: str=None, ssl=None, username: str=None, password: str=None, **kwargs) -> None: + super(IdentitySource, self).__init__(**kwargs) + self.name = name + self.alias = alias + self.domain = domain + self.base_user_dn = base_user_dn + self.base_group_dn = base_group_dn + self.primary_server = primary_server + self.secondary_server = secondary_server + self.ssl = ssl + self.username = username + self.password = password + + +class Operation(Model): + """A REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the operation being performed on this object + :vartype name: str + :ivar display: Contains the localized display information for this + operation + :vartype display: ~azure.mgmt.avs.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + + +class OperationDisplay(Model): + """Contains the localized display information for this operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Localized friendly form of the resource provider name + :vartype provider: str + :ivar resource: Localized friendly form of the resource type related to + this operation + :vartype resource: str + :ivar operation: Localized friendly name for the operation + :vartype operation: str + :ivar description: Localized friendly description for the operation + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags + + +class PrivateCloud(TrackedResource): + """A private cloud resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: 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. + + :ivar provisioning_state: The provisioning state. Possible values include: + 'Succeeded', 'Failed', 'Cancelled', 'Pending', 'Building', '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 + :type network_block: str + :ivar management_network: Network used to access vCenter Server and NSX-T + Manager + :vartype management_network: str + :ivar provisioning_network: Used for virtual machine cold migration, + cloning, and snapshot migration + :vartype provisioning_network: str + :ivar vmotion_network: Used for live migration of virtual machines + :vartype vmotion_network: str + :param vcenter_password: Optionally, set the vCenter admin password when + the private cloud is created + :type vcenter_password: str + :param nsxt_password: Optionally, set the NSX-T Manager password when the + private cloud is created + :type nsxt_password: str + :ivar vcenter_certificate_thumbprint: Thumbprint of the vCenter Server SSL + certificate + :vartype vcenter_certificate_thumbprint: str + :ivar nsxt_certificate_thumbprint: Thumbprint of the NSX-T Manager SSL + certificate + :vartype nsxt_certificate_thumbprint: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'clusters': {'readonly': True}, + 'endpoints': {'readonly': True}, + 'management_network': {'readonly': True}, + 'provisioning_network': {'readonly': True}, + 'vmotion_network': {'readonly': True}, + 'vcenter_certificate_thumbprint': {'readonly': True}, + 'nsxt_certificate_thumbprint': {'readonly': True}, + } + + _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) + 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 + self.vmotion_network = None + self.vcenter_password = vcenter_password + self.nsxt_password = nsxt_password + self.vcenter_certificate_thumbprint = None + self.nsxt_certificate_thumbprint = None + + +class Quota(Model): + """Subscription quotas. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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. + Possible values include: 'Enabled', 'Disabled' + :type quota_enabled: str or ~azure.mgmt.avs.models.QuotaEnabled + """ + + _validation = { + 'hosts_remaining': {'readonly': True}, + } + + _attribute_map = { + 'hosts_remaining': {'key': 'hostsRemaining', 'type': '{int}'}, + 'quota_enabled': {'key': 'quotaEnabled', 'type': 'str'}, + } + + def __init__(self, *, quota_enabled=None, **kwargs) -> None: + super(Quota, self).__init__(**kwargs) + self.hosts_remaining = None + self.quota_enabled = quota_enabled + + +class Sku(Model): + """The resource model definition representing SKU. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the SKU. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + + +class Trial(Model): + """Subscription trial availability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: Trial status. Possible values include: 'TrialAvailable', + 'TrialUsed', 'TrialDisabled' + :vartype status: str or ~azure.mgmt.avs.models.enum + :ivar available_hosts: Number of trial hosts available + :vartype available_hosts: int + """ + + _validation = { + 'status': {'readonly': True}, + 'available_hosts': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'available_hosts': {'key': 'availableHosts', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(Trial, self).__init__(**kwargs) + self.status = None + self.available_hosts = None 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 new file mode 100644 index 000000000000..93b7f7f420ce --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/models/_paged_models.py @@ -0,0 +1,53 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class PrivateCloudPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateCloud ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateCloud]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateCloudPaged, self).__init__(*args, **kwargs) +class ClusterPaged(Paged): + """ + A paging container for iterating over a list of :class:`Cluster ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Cluster]'} + } + + def __init__(self, *args, **kwargs): + + super(ClusterPaged, 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 new file mode 100644 index 000000000000..632207515508 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/__init__.py @@ -0,0 +1,22 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._locations_operations import LocationsOperations +from ._private_clouds_operations import PrivateCloudsOperations +from ._clusters_operations import ClustersOperations + +__all__ = [ + 'Operations', + 'LocationsOperations', + 'PrivateCloudsOperations', + 'ClustersOperations', +] 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 new file mode 100644 index 000000000000..972c3b4f97bb --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_clusters_operations.py @@ -0,0 +1,476 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ClustersOperations(object): + """ClustersOperations 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: Version of Azure VMware Solution API to be used with the client request. Constant value: "2019-08-09-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-09-preview" + + self.config = config + + 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 + :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 Cluster + :rtype: + ~azure.mgmt.avs.models.ClusterPaged[~azure.mgmt.avs.models.Cluster] + :raises: + :class:`ApiErrorException` + """ + 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'), + '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') + + 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]: + raise models.ApiErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ClusterPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters'} + + 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 + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud + :type cluster_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Cluster or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.Cluster or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # 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'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Cluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'} + + + 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) + + # 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'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(cluster, 'Cluster') + + # 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]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Cluster', response) + if response.status_code == 201: + deserialized = self._deserialize('Cluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, private_cloud_name, cluster_name, properties=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 + :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 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 Cluster or + ClientRawResponse if raw==True + :rtype: + ~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` + """ + 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, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Cluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'} + + + 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) + + # 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'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(cluster, 'Cluster') + + # 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) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Cluster', response) + if response.status_code == 201: + deserialized = self._deserialize('Cluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, private_cloud_name, cluster_name, properties=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 + :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 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 Cluster or + ClientRawResponse if raw==True + :rtype: + ~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` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Cluster', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'} + + + def _delete_initial( + self, resource_group_name, private_cloud_name, cluster_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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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]: + raise models.ApiErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + 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 + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param cluster_name: Name of the cluster in the private cloud + :type cluster_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: 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:`ApiErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + cluster_name=cluster_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'} 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 new file mode 100644 index 000000000000..644da51d118b --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_locations_operations.py @@ -0,0 +1,153 @@ +# 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 .. import models + + +class LocationsOperations(object): + """LocationsOperations 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: Version of Azure VMware Solution API to be used with the client request. Constant value: "2019-08-09-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-09-preview" + + self.config = config + + def check_trial_availability( + self, location, custom_headers=None, raw=False, **operation_config): + """Return trial status for subscription by region. + + :param location: Azure region + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Trial or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.Trial or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # 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'), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Trial', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_trial_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability'} + + def check_quota_availability( + self, location, custom_headers=None, raw=False, **operation_config): + """Return quota for subscription by region. + + :param location: Azure region + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Quota or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.Quota or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # 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'), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Quota', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_quota_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability'} 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 new file mode 100644 index 000000000000..c620297e1ee1 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_operations.py @@ -0,0 +1,100 @@ +# 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 .. import models + + +class Operations(object): + """Operations 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: Version of Azure VMware Solution API to be used with the client request. Constant value: "2019-08-09-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-09-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available operations. + + :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 Operation + :rtype: + ~azure.mgmt.avs.models.OperationPaged[~azure.mgmt.avs.models.Operation] + :raises: + :class:`ApiErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + 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]: + raise models.ApiErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.AVS/operations'} 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 new file mode 100644 index 000000000000..e7c3b0936b48 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/operations/_private_clouds_operations.py @@ -0,0 +1,580 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PrivateCloudsOperations(object): + """PrivateCloudsOperations 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: Version of Azure VMware Solution API to be used with the client request. Constant value: "2019-08-09-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-09-preview" + + self.config = config + + 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 + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PrivateCloud + :rtype: + ~azure.mgmt.avs.models.PrivateCloudPaged[~azure.mgmt.avs.models.PrivateCloud] + :raises: + :class:`ApiErrorException` + """ + 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') + } + 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') + + 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]: + raise models.ApiErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateCloudPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds'} + + def list_in_subscription( + self, custom_headers=None, raw=False, **operation_config): + """List private clouds in a subscription. + + :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 PrivateCloud + :rtype: + ~azure.mgmt.avs.models.PrivateCloudPaged[~azure.mgmt.avs.models.PrivateCloud] + :raises: + :class:`ApiErrorException` + """ + 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') + } + 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') + + 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]: + raise models.ApiErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateCloudPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_in_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds'} + + 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 + :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: PrivateCloud or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.PrivateCloud or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # 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'), + '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') + + # 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]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateCloud', 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}'} + + + def _create_or_update_initial( + self, resource_group_name, private_cloud_name, private_cloud, 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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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(private_cloud, 'PrivateCloud') + + # 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]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateCloud', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateCloud', 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, 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 + :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 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 PrivateCloud or + ClientRawResponse if raw==True + :rtype: + ~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` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + private_cloud=private_cloud, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateCloud', 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}'} + + + def _update_initial( + self, resource_group_name, private_cloud_name, private_cloud, 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'), + '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') + + # 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(private_cloud, 'PrivateCloud') + + # 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) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PrivateCloud', response) + if response.status_code == 201: + deserialized = self._deserialize('PrivateCloud', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, private_cloud_name, private_cloud, 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 + :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 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 PrivateCloud or + ClientRawResponse if raw==True + :rtype: + ~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` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + private_cloud=private_cloud, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PrivateCloud', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}'} + + + def _delete_initial( + self, resource_group_name, private_cloud_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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'privateCloudName': self._serialize.url("private_cloud_name", private_cloud_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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]: + raise models.ApiErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + 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 + :type resource_group_name: str + :param private_cloud_name: Name of the private cloud + :type private_cloud_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ApiErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + private_cloud_name=private_cloud_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}'} + + 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 + :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: AdminCredentials or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.avs.models.AdminCredentials or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ApiErrorException` + """ + # 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'), + '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') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ApiErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AdminCredentials', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_admin_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials'} diff --git a/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/version.py b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/azure/mgmt/avs/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" + diff --git a/sdk/compute/azure-mgmt-avs/dev_requirements.txt b/sdk/compute/azure-mgmt-avs/dev_requirements.txt new file mode 100644 index 000000000000..6ccb7f031ddd --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/dev_requirements.txt @@ -0,0 +1 @@ +-e ../../../tools/azure-sdk-tools diff --git a/sdk/compute/azure-mgmt-avs/sdk_packaging.toml b/sdk/compute/azure-mgmt-avs/sdk_packaging.toml new file mode 100644 index 000000000000..74dd3199c709 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/sdk_packaging.toml @@ -0,0 +1,5 @@ +[packaging] +package_name = "azure-mgmt-avs" +package_pprint_name = "VMware Solution Management" +package_doc_id = "" +is_stable = false diff --git a/sdk/compute/azure-mgmt-avs/setup.cfg b/sdk/compute/azure-mgmt-avs/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/compute/azure-mgmt-avs/setup.py b/sdk/compute/azure-mgmt-avs/setup.py new file mode 100644 index 000000000000..54bd45fcfcc4 --- /dev/null +++ b/sdk/compute/azure-mgmt-avs/setup.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-avs" +PACKAGE_PPRINT_NAME = "VMware Solution Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + long_description_content_type='text/markdown', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)