diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/HISTORY.rst b/sdk/compute/azure-mgmt-vmwarecloudsimple/HISTORY.rst new file mode 100644 index 000000000000..1ea7ec548bdd --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (2019-10-08) +++++++++++++++++++ + +* Initial Release diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/MANIFEST.in b/sdk/compute/azure-mgmt-vmwarecloudsimple/MANIFEST.in new file mode 100644 index 000000000000..e4884efef41b --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/README.rst b/sdk/compute/azure-mgmt-vmwarecloudsimple/README.rst new file mode 100644 index 000000000000..201bddef967f --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/README.rst @@ -0,0 +1,33 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-vmwarecloudsimple%2FREADME.png diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/__init__.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/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-vmwarecloudsimple/azure/mgmt/__init__.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/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-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/__init__.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/__init__.py new file mode 100644 index 000000000000..9b5285fbe233 --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/__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 VMwareCloudSimpleClientConfiguration +from ._vmware_cloud_simple_client import VMwareCloudSimpleClient +__all__ = ['VMwareCloudSimpleClient', 'VMwareCloudSimpleClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/_configuration.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/_configuration.py new file mode 100644 index 000000000000..714af4bb26e9 --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/_configuration.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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class VMwareCloudSimpleClientConfiguration(AzureConfiguration): + """Configuration for VMwareCloudSimpleClient + 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: The subscription ID. + :type subscription_id: str + :param referer: referer url + :type referer: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, referer, 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 referer is None: + raise ValueError("Parameter 'referer' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(VMwareCloudSimpleClientConfiguration, 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-vmwarecloudsimple/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + self.referer = referer diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/_vmware_cloud_simple_client.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/_vmware_cloud_simple_client.py new file mode 100644 index 000000000000..a3e375652686 --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/_vmware_cloud_simple_client.py @@ -0,0 +1,96 @@ +# 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 VMwareCloudSimpleClientConfiguration +from .operations import Operations +from .operations import DedicatedCloudNodesOperations +from .operations import DedicatedCloudServicesOperations +from .operations import SkusAvailabilityOperations +from .operations import PrivateCloudsOperations +from .operations import ResourcePoolsOperations +from .operations import VirtualMachineTemplatesOperations +from .operations import VirtualNetworksOperations +from .operations import UsagesOperations +from .operations import VirtualMachinesOperations +from . import models + + +class VMwareCloudSimpleClient(SDKClient): + """Description of the new service + + :ivar config: Configuration for client. + :vartype config: VMwareCloudSimpleClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.vmwarecloudsimple.operations.Operations + :ivar dedicated_cloud_nodes: DedicatedCloudNodes operations + :vartype dedicated_cloud_nodes: azure.mgmt.vmwarecloudsimple.operations.DedicatedCloudNodesOperations + :ivar dedicated_cloud_services: DedicatedCloudServices operations + :vartype dedicated_cloud_services: azure.mgmt.vmwarecloudsimple.operations.DedicatedCloudServicesOperations + :ivar skus_availability: SkusAvailability operations + :vartype skus_availability: azure.mgmt.vmwarecloudsimple.operations.SkusAvailabilityOperations + :ivar private_clouds: PrivateClouds operations + :vartype private_clouds: azure.mgmt.vmwarecloudsimple.operations.PrivateCloudsOperations + :ivar resource_pools: ResourcePools operations + :vartype resource_pools: azure.mgmt.vmwarecloudsimple.operations.ResourcePoolsOperations + :ivar virtual_machine_templates: VirtualMachineTemplates operations + :vartype virtual_machine_templates: azure.mgmt.vmwarecloudsimple.operations.VirtualMachineTemplatesOperations + :ivar virtual_networks: VirtualNetworks operations + :vartype virtual_networks: azure.mgmt.vmwarecloudsimple.operations.VirtualNetworksOperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.vmwarecloudsimple.operations.UsagesOperations + :ivar virtual_machines: VirtualMachines operations + :vartype virtual_machines: azure.mgmt.vmwarecloudsimple.operations.VirtualMachinesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription ID. + :type subscription_id: str + :param referer: referer url + :type referer: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, referer, base_url=None): + + self.config = VMwareCloudSimpleClientConfiguration(credentials, subscription_id, referer, base_url) + super(VMwareCloudSimpleClient, 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-04-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.dedicated_cloud_nodes = DedicatedCloudNodesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.dedicated_cloud_services = DedicatedCloudServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.skus_availability = SkusAvailabilityOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_clouds = PrivateCloudsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.resource_pools = ResourcePoolsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.virtual_machine_templates = VirtualMachineTemplatesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.virtual_networks = VirtualNetworksOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.virtual_machines = VirtualMachinesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/__init__.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/__init__.py new file mode 100644 index 000000000000..d1e9407cd7b9 --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/__init__.py @@ -0,0 +1,132 @@ +# 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 AvailableOperation + from ._models_py3 import AvailableOperationDisplay + from ._models_py3 import AvailableOperationDisplayPropertyServiceSpecificationMetricsItem + from ._models_py3 import AvailableOperationDisplayPropertyServiceSpecificationMetricsList + from ._models_py3 import CSRPError, CSRPErrorException + from ._models_py3 import CSRPErrorBody + from ._models_py3 import DedicatedCloudNode + from ._models_py3 import DedicatedCloudService + from ._models_py3 import OperationError + from ._models_py3 import OperationResource + from ._models_py3 import PatchPayload + from ._models_py3 import PrivateCloud + from ._models_py3 import ResourcePool + from ._models_py3 import Sku + from ._models_py3 import SkuAvailability + from ._models_py3 import Usage + from ._models_py3 import UsageName + from ._models_py3 import VirtualDisk + from ._models_py3 import VirtualDiskController + from ._models_py3 import VirtualMachine + from ._models_py3 import VirtualMachineStopMode + from ._models_py3 import VirtualMachineTemplate + from ._models_py3 import VirtualNetwork + from ._models_py3 import VirtualNic +except (SyntaxError, ImportError): + from ._models import AvailableOperation + from ._models import AvailableOperationDisplay + from ._models import AvailableOperationDisplayPropertyServiceSpecificationMetricsItem + from ._models import AvailableOperationDisplayPropertyServiceSpecificationMetricsList + from ._models import CSRPError, CSRPErrorException + from ._models import CSRPErrorBody + from ._models import DedicatedCloudNode + from ._models import DedicatedCloudService + from ._models import OperationError + from ._models import OperationResource + from ._models import PatchPayload + from ._models import PrivateCloud + from ._models import ResourcePool + from ._models import Sku + from ._models import SkuAvailability + from ._models import Usage + from ._models import UsageName + from ._models import VirtualDisk + from ._models import VirtualDiskController + from ._models import VirtualMachine + from ._models import VirtualMachineStopMode + from ._models import VirtualMachineTemplate + from ._models import VirtualNetwork + from ._models import VirtualNic +from ._paged_models import AvailableOperationPaged +from ._paged_models import DedicatedCloudNodePaged +from ._paged_models import DedicatedCloudServicePaged +from ._paged_models import PrivateCloudPaged +from ._paged_models import ResourcePoolPaged +from ._paged_models import SkuAvailabilityPaged +from ._paged_models import UsagePaged +from ._paged_models import VirtualMachinePaged +from ._paged_models import VirtualMachineTemplatePaged +from ._paged_models import VirtualNetworkPaged +from ._vmware_cloud_simple_client_enums import ( + OperationOrigin, + AggregationType, + NodeStatus, + OnboardingStatus, + DiskIndependenceMode, + NICType, + PrivateCloudResourceType, + UsageCount, + GuestOSType, + VirtualMachineStatus, + StopMode, +) + +__all__ = [ + 'AvailableOperation', + 'AvailableOperationDisplay', + 'AvailableOperationDisplayPropertyServiceSpecificationMetricsItem', + 'AvailableOperationDisplayPropertyServiceSpecificationMetricsList', + 'CSRPError', 'CSRPErrorException', + 'CSRPErrorBody', + 'DedicatedCloudNode', + 'DedicatedCloudService', + 'OperationError', + 'OperationResource', + 'PatchPayload', + 'PrivateCloud', + 'ResourcePool', + 'Sku', + 'SkuAvailability', + 'Usage', + 'UsageName', + 'VirtualDisk', + 'VirtualDiskController', + 'VirtualMachine', + 'VirtualMachineStopMode', + 'VirtualMachineTemplate', + 'VirtualNetwork', + 'VirtualNic', + 'AvailableOperationPaged', + 'DedicatedCloudNodePaged', + 'DedicatedCloudServicePaged', + 'SkuAvailabilityPaged', + 'PrivateCloudPaged', + 'ResourcePoolPaged', + 'VirtualMachineTemplatePaged', + 'VirtualNetworkPaged', + 'UsagePaged', + 'VirtualMachinePaged', + 'OperationOrigin', + 'AggregationType', + 'NodeStatus', + 'OnboardingStatus', + 'DiskIndependenceMode', + 'NICType', + 'PrivateCloudResourceType', + 'UsageCount', + 'GuestOSType', + 'VirtualMachineStatus', + 'StopMode', +] diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_models.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_models.py new file mode 100644 index 000000000000..a76f1d648bef --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_models.py @@ -0,0 +1,1276 @@ +# 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 AvailableOperation(Model): + """Resource provider available operation model. + + :param display: The list of operations + :type display: + ~azure.mgmt.vmwarecloudsimple.models.AvailableOperationDisplay + :param is_data_action: Indicating whether the operation is a data action + or not. Default value: False . + :type is_data_action: bool + :param name: + {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} + :type name: str + :param origin: The origin of operation. Possible values include: 'user', + 'system', 'user,system' + :type origin: str or ~azure.mgmt.vmwarecloudsimple.models.OperationOrigin + :param service_specification: The list of specification's service metrics + :type service_specification: + ~azure.mgmt.vmwarecloudsimple.models.AvailableOperationDisplayPropertyServiceSpecificationMetricsList + """ + + _attribute_map = { + 'display': {'key': 'display', 'type': 'AvailableOperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'OperationOrigin'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'AvailableOperationDisplayPropertyServiceSpecificationMetricsList'}, + } + + def __init__(self, **kwargs): + super(AvailableOperation, self).__init__(**kwargs) + self.display = kwargs.get('display', None) + self.is_data_action = kwargs.get('is_data_action', False) + self.name = kwargs.get('name', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class AvailableOperationDisplay(Model): + """Resource provider available operation display model. + + :param description: Description of the operation for display purposes + :type description: str + :param operation: Name of the operation for display purposes + :type operation: str + :param provider: Name of the provider for display purposes + :type provider: str + :param resource: Name of the resource type for display purposes + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AvailableOperationDisplay, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.operation = kwargs.get('operation', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + + +class AvailableOperationDisplayPropertyServiceSpecificationMetricsItem(Model): + """Available operation display property service specification metrics item. + + All required parameters must be populated in order to send to Azure. + + :param aggregation_type: Required. Metric's aggregation type for e.g. + (Average, Total). Possible values include: 'Average', 'Total' + :type aggregation_type: str or + ~azure.mgmt.vmwarecloudsimple.models.AggregationType + :param display_description: Required. Metric's description + :type display_description: str + :param display_name: Required. Human readable metric's name + :type display_name: str + :param name: Required. Metric's name/id + :type name: str + :param unit: Required. Metric's unit + :type unit: str + """ + + _validation = { + 'aggregation_type': {'required': True}, + 'display_description': {'required': True}, + 'display_name': {'required': True}, + 'name': {'required': True}, + 'unit': {'required': True}, + } + + _attribute_map = { + 'aggregation_type': {'key': 'aggregationType', 'type': 'AggregationType'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AvailableOperationDisplayPropertyServiceSpecificationMetricsItem, self).__init__(**kwargs) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.display_description = kwargs.get('display_description', None) + self.display_name = kwargs.get('display_name', None) + self.name = kwargs.get('name', None) + self.unit = kwargs.get('unit', None) + + +class AvailableOperationDisplayPropertyServiceSpecificationMetricsList(Model): + """List of available operation display property service specification metrics. + + :param metric_specifications: Metric specifications of operation + :type metric_specifications: + list[~azure.mgmt.vmwarecloudsimple.models.AvailableOperationDisplayPropertyServiceSpecificationMetricsItem] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[AvailableOperationDisplayPropertyServiceSpecificationMetricsItem]'}, + } + + def __init__(self, **kwargs): + super(AvailableOperationDisplayPropertyServiceSpecificationMetricsList, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CSRPError(Model): + """General error model. + + :param error: Error's body + :type error: ~azure.mgmt.vmwarecloudsimple.models.CSRPErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CSRPErrorBody'}, + } + + def __init__(self, **kwargs): + super(CSRPError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CSRPErrorException(HttpOperationError): + """Server responsed with exception of type: 'CSRPError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CSRPErrorException, self).__init__(deserialize, response, 'CSRPError', *args) + + +class CSRPErrorBody(Model): + """Error properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error's code + :vartype code: str + :ivar details: Error's details + :vartype details: list[~azure.mgmt.vmwarecloudsimple.models.CSRPErrorBody] + :ivar message: Error's message + :vartype message: str + :param target: Error's target + :type target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'details': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CSRPErrorBody]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CSRPErrorBody, self).__init__(**kwargs) + self.code = None + self.details = None + self.message = None + self.target = kwargs.get('target', None) + + +class DedicatedCloudNode(Model): + """Dedicated cloud node model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/dedicatedCloudNodes/{dedicatedCloudNodeName} + :vartype id: str + :param location: Required. Azure region + :type location: str + :ivar name: {dedicatedCloudNodeName} + :vartype name: str + :param availability_zone_id: Required. Availability Zone id, e.g. "az1" + :type availability_zone_id: str + :ivar availability_zone_name: Availability Zone name, e.g. "Availability + Zone 1" + :vartype availability_zone_name: str + :ivar cloud_rack_name: VMWare Cloud Rack Name + :vartype cloud_rack_name: str + :ivar created: date time the resource was created + :vartype created: object + :param nodes_count: Required. count of nodes to create + :type nodes_count: int + :param placement_group_id: Required. Placement Group id, e.g. "n1" + :type placement_group_id: str + :ivar placement_group_name: Placement Name, e.g. "Placement Group 1" + :vartype placement_group_name: str + :ivar private_cloud_id: Private Cloud Id + :vartype private_cloud_id: str + :ivar private_cloud_name: Resource Pool Name + :vartype private_cloud_name: str + :ivar provisioning_state: The provisioning status of the resource + :vartype provisioning_state: str + :param purchase_id: Required. purchase id + :type purchase_id: str + :param id1: Required. SKU's id + :type id1: str + :param name1: Required. SKU's name + :type name1: str + :ivar status: Node status, indicates is private cloud set up on this node + or not. Possible values include: 'unused', 'used' + :vartype status: str or ~azure.mgmt.vmwarecloudsimple.models.NodeStatus + :ivar vmware_cluster_name: VMWare Cluster Name + :vartype vmware_cluster_name: str + :param sku: Dedicated Cloud Nodes SKU + :type sku: ~azure.mgmt.vmwarecloudsimple.models.Sku + :param tags: Dedicated Cloud Nodes tags + :type tags: dict[str, str] + :ivar type: {resourceProviderNamespace}/{resourceType} + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True, 'pattern': r'^[-a-zA-Z0-9]+$'}, + 'availability_zone_id': {'required': True}, + 'availability_zone_name': {'readonly': True}, + 'cloud_rack_name': {'readonly': True}, + 'created': {'readonly': True}, + 'nodes_count': {'required': True}, + 'placement_group_id': {'required': True}, + 'placement_group_name': {'readonly': True}, + 'private_cloud_id': {'readonly': True}, + 'private_cloud_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'purchase_id': {'required': True}, + 'id1': {'required': True}, + 'name1': {'required': True}, + 'status': {'readonly': True}, + 'vmware_cluster_name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'availability_zone_id': {'key': 'properties.availabilityZoneId', 'type': 'str'}, + 'availability_zone_name': {'key': 'properties.availabilityZoneName', 'type': 'str'}, + 'cloud_rack_name': {'key': 'properties.cloudRackName', 'type': 'str'}, + 'created': {'key': 'properties.created', 'type': 'object'}, + 'nodes_count': {'key': 'properties.nodesCount', 'type': 'int'}, + 'placement_group_id': {'key': 'properties.placementGroupId', 'type': 'str'}, + 'placement_group_name': {'key': 'properties.placementGroupName', 'type': 'str'}, + 'private_cloud_id': {'key': 'properties.privateCloudId', 'type': 'str'}, + 'private_cloud_name': {'key': 'properties.privateCloudName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'purchase_id': {'key': 'properties.purchaseId', 'type': 'str'}, + 'id1': {'key': 'properties.skuDescription.id', 'type': 'str'}, + 'name1': {'key': 'properties.skuDescription.name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'NodeStatus'}, + 'vmware_cluster_name': {'key': 'properties.vmwareClusterName', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DedicatedCloudNode, self).__init__(**kwargs) + self.id = None + self.location = kwargs.get('location', None) + self.name = None + self.availability_zone_id = kwargs.get('availability_zone_id', None) + self.availability_zone_name = None + self.cloud_rack_name = None + self.created = None + self.nodes_count = kwargs.get('nodes_count', None) + self.placement_group_id = kwargs.get('placement_group_id', None) + self.placement_group_name = None + self.private_cloud_id = None + self.private_cloud_name = None + self.provisioning_state = None + self.purchase_id = kwargs.get('purchase_id', None) + self.id1 = kwargs.get('id1', None) + self.name1 = kwargs.get('name1', None) + self.status = None + self.vmware_cluster_name = None + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.type = None + + +class DedicatedCloudService(Model): + """Dedicated cloud service model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/dedicatedCloudServices/{dedicatedCloudServiceName} + :vartype id: str + :param location: Required. Azure region + :type location: str + :ivar name: {dedicatedCloudServiceName} + :vartype name: str + :param gateway_subnet: Required. gateway Subnet for the account. It will + collect the subnet address and always treat it as /28 + :type gateway_subnet: str + :ivar is_account_onboarded: indicates whether account onboarded or not in + a given region. Possible values include: 'notOnBoarded', 'onBoarded', + 'onBoardingFailed', 'onBoarding' + :vartype is_account_onboarded: str or + ~azure.mgmt.vmwarecloudsimple.models.OnboardingStatus + :param nodes: total nodes purchased + :type nodes: int + :param service_url: link to a service management web portal + :type service_url: str + :param tags: The list of tags + :type tags: dict[str, str] + :ivar type: {resourceProviderNamespace}/{resourceType} + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True, 'pattern': r'^[-a-zA-Z0-9]+$'}, + 'gateway_subnet': {'required': True}, + 'is_account_onboarded': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'gateway_subnet': {'key': 'properties.gatewaySubnet', 'type': 'str'}, + 'is_account_onboarded': {'key': 'properties.isAccountOnboarded', 'type': 'OnboardingStatus'}, + 'nodes': {'key': 'properties.nodes', 'type': 'int'}, + 'service_url': {'key': 'properties.serviceURL', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DedicatedCloudService, self).__init__(**kwargs) + self.id = None + self.location = kwargs.get('location', None) + self.name = None + self.gateway_subnet = kwargs.get('gateway_subnet', None) + self.is_account_onboarded = None + self.nodes = kwargs.get('nodes', None) + self.service_url = kwargs.get('service_url', None) + self.tags = kwargs.get('tags', None) + self.type = None + + +class OperationError(Model): + """Operation error model. + + :param code: Error's code + :type code: str + :param message: Error's message + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class OperationResource(Model): + """Operation status response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar end_time: End time of the operation + :vartype end_time: datetime + :param error: Error Message if operation failed + :type error: ~azure.mgmt.vmwarecloudsimple.models.OperationError + :ivar id: Operation Id + :vartype id: str + :ivar name: Operation ID + :vartype name: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar status: Operation status + :vartype status: str + """ + + _validation = { + 'end_time': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'start_time': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'OperationError'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationResource, self).__init__(**kwargs) + self.end_time = None + self.error = kwargs.get('error', None) + self.id = None + self.name = None + self.start_time = None + self.status = None + + +class PatchPayload(Model): + """General patch payload modal. + + :param tags: The tags key:value pairs + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(PatchPayload, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class PrivateCloud(Model): + """Private cloud model. + + :param id: Azure Id, e.g. + "/subscriptions/4da99247-a172-4ed6-8ae9-ebed2d12f839/providers/Microsoft.VMwareCloudSimple/privateClouds/cloud123" + :type id: str + :param location: Location where private cloud created, e.g "westus" + :type location: str + :param name: Private cloud name + :type name: str + :param availability_zone_id: Availability Zone id, e.g. "az1" + :type availability_zone_id: str + :param availability_zone_name: Availability Zone name, e.g. "Availability + Zone 1" + :type availability_zone_name: str + :param clusters_number: Number of clusters + :type clusters_number: int + :param created_by: User's emails who created cloud + :type created_by: str + :param created_on: When private cloud was created + :type created_on: datetime + :param dns_servers: Array of DNS servers + :type dns_servers: list[str] + :param expires: Expiration date of PC + :type expires: str + :param nsx_type: Nsx Type, e.g. "Advanced" + :type nsx_type: str + :param placement_group_id: Placement Group id, e.g. "n1" + :type placement_group_id: str + :param placement_group_name: Placement Group name + :type placement_group_name: str + :param private_cloud_id: Id of a private cloud + :type private_cloud_id: str + :param resource_pools: The list of Resource Pools + :type resource_pools: + list[~azure.mgmt.vmwarecloudsimple.models.ResourcePool] + :param state: Private Cloud state, e.g. "operational" + :type state: str + :param total_cpu_cores: Number of cores + :type total_cpu_cores: int + :param total_nodes: Number of nodes + :type total_nodes: int + :param total_ram: Memory size + :type total_ram: int + :param total_storage: Disk space in TB + :type total_storage: float + :param private_cloud_properties_type: Virtualization type e.g. "vSphere" + :type private_cloud_properties_type: str + :param v_sphere_version: e.g. "6.5u2" + :type v_sphere_version: str + :param vcenter_fqdn: FQDN for vcenter access + :type vcenter_fqdn: str + :param vcenter_refid: Vcenter ip address + :type vcenter_refid: str + :param virtual_machine_templates: The list of Virtual Machine Templates + :type virtual_machine_templates: + list[~azure.mgmt.vmwarecloudsimple.models.VirtualMachineTemplate] + :param virtual_networks: The list of Virtual Networks + :type virtual_networks: + list[~azure.mgmt.vmwarecloudsimple.models.VirtualNetwork] + :param vr_ops_enabled: Is Vrops enabled/disabled + :type vr_ops_enabled: bool + :param type: Azure Resource type. Possible values include: + 'Microsoft.VMwareCloudSimple/privateClouds' + :type type: str or + ~azure.mgmt.vmwarecloudsimple.models.PrivateCloudResourceType + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'availability_zone_id': {'key': 'properties.availabilityZoneId', 'type': 'str'}, + 'availability_zone_name': {'key': 'properties.availabilityZoneName', 'type': 'str'}, + 'clusters_number': {'key': 'properties.clustersNumber', 'type': 'int'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'dns_servers': {'key': 'properties.dnsServers', 'type': '[str]'}, + 'expires': {'key': 'properties.expires', 'type': 'str'}, + 'nsx_type': {'key': 'properties.nsxType', 'type': 'str'}, + 'placement_group_id': {'key': 'properties.placementGroupId', 'type': 'str'}, + 'placement_group_name': {'key': 'properties.placementGroupName', 'type': 'str'}, + 'private_cloud_id': {'key': 'properties.privateCloudId', 'type': 'str'}, + 'resource_pools': {'key': 'properties.resourcePools', 'type': '[ResourcePool]'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'total_cpu_cores': {'key': 'properties.totalCpuCores', 'type': 'int'}, + 'total_nodes': {'key': 'properties.totalNodes', 'type': 'int'}, + 'total_ram': {'key': 'properties.totalRam', 'type': 'int'}, + 'total_storage': {'key': 'properties.totalStorage', 'type': 'float'}, + 'private_cloud_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'v_sphere_version': {'key': 'properties.vSphereVersion', 'type': 'str'}, + 'vcenter_fqdn': {'key': 'properties.vcenterFqdn', 'type': 'str'}, + 'vcenter_refid': {'key': 'properties.vcenterRefid', 'type': 'str'}, + 'virtual_machine_templates': {'key': 'properties.virtualMachineTemplates', 'type': '[VirtualMachineTemplate]'}, + 'virtual_networks': {'key': 'properties.virtualNetworks', 'type': '[VirtualNetwork]'}, + 'vr_ops_enabled': {'key': 'properties.vrOpsEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'PrivateCloudResourceType'}, + } + + def __init__(self, **kwargs): + super(PrivateCloud, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.location = kwargs.get('location', None) + self.name = kwargs.get('name', None) + self.availability_zone_id = kwargs.get('availability_zone_id', None) + self.availability_zone_name = kwargs.get('availability_zone_name', None) + self.clusters_number = kwargs.get('clusters_number', None) + self.created_by = kwargs.get('created_by', None) + self.created_on = kwargs.get('created_on', None) + self.dns_servers = kwargs.get('dns_servers', None) + self.expires = kwargs.get('expires', None) + self.nsx_type = kwargs.get('nsx_type', None) + self.placement_group_id = kwargs.get('placement_group_id', None) + self.placement_group_name = kwargs.get('placement_group_name', None) + self.private_cloud_id = kwargs.get('private_cloud_id', None) + self.resource_pools = kwargs.get('resource_pools', None) + self.state = kwargs.get('state', None) + self.total_cpu_cores = kwargs.get('total_cpu_cores', None) + self.total_nodes = kwargs.get('total_nodes', None) + self.total_ram = kwargs.get('total_ram', None) + self.total_storage = kwargs.get('total_storage', None) + self.private_cloud_properties_type = kwargs.get('private_cloud_properties_type', None) + self.v_sphere_version = kwargs.get('v_sphere_version', None) + self.vcenter_fqdn = kwargs.get('vcenter_fqdn', None) + self.vcenter_refid = kwargs.get('vcenter_refid', None) + self.virtual_machine_templates = kwargs.get('virtual_machine_templates', None) + self.virtual_networks = kwargs.get('virtual_networks', None) + self.vr_ops_enabled = kwargs.get('vr_ops_enabled', None) + self.type = kwargs.get('type', None) + + +class ResourcePool(Model): + """Resource pool model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. resource pool id (privateCloudId:vsphereId) + :type id: str + :ivar location: Azure region + :vartype location: str + :ivar name: {ResourcePoolName} + :vartype name: str + :ivar private_cloud_id: The Private Cloud Id + :vartype private_cloud_id: str + :ivar full_name: Hierarchical resource pool name + :vartype full_name: str + :ivar type: {resourceProviderNamespace}/{resourceType} + :vartype type: str + """ + + _validation = { + 'id': {'required': True}, + 'location': {'readonly': True}, + 'name': {'readonly': True}, + 'private_cloud_id': {'readonly': True}, + 'full_name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'private_cloud_id': {'key': 'privateCloudId', 'type': 'str'}, + 'full_name': {'key': 'properties.fullName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourcePool, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.location = None + self.name = None + self.private_cloud_id = None + self.full_name = None + self.type = None + + +class Sku(Model): + """The purchase SKU for CloudSimple paid resources. + + All required parameters must be populated in order to send to Azure. + + :param capacity: The capacity of the SKU + :type capacity: str + :param description: dedicatedCloudNode example: 8 x Ten-Core Intel® Xeon® + Processor E5-2640 v4 2.40GHz 25MB Cache (90W); 12 x 64GB PC4-19200 2400MHz + DDR4 ECC Registered DIMM, ... + :type description: str + :param family: If the service has different generations of hardware, for + the same SKU, then that can be captured here + :type family: str + :param name: Required. The name of the SKU for VMWare CloudSimple Node + :type name: str + :param tier: The tier of the SKU + :type tier: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'capacity': {'key': 'capacity', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.capacity = kwargs.get('capacity', None) + self.description = kwargs.get('description', None) + self.family = kwargs.get('family', None) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class SkuAvailability(Model): + """SKU availability model. + + All required parameters must be populated in order to send to Azure. + + :param dedicated_availability_zone_id: CloudSimple Availability Zone id + :type dedicated_availability_zone_id: str + :param dedicated_availability_zone_name: CloudSimple Availability Zone + Name + :type dedicated_availability_zone_name: str + :param dedicated_placement_group_id: CloudSimple Placement Group Id + :type dedicated_placement_group_id: str + :param dedicated_placement_group_name: CloudSimple Placement Group name + :type dedicated_placement_group_name: str + :param limit: Required. indicates how many resources of a given SKU is + available in a AZ->PG + :type limit: int + :param resource_type: resource type e.g. DedicatedCloudNodes + :type resource_type: str + :param sku_id: sku id + :type sku_id: str + :param sku_name: sku name + :type sku_name: str + """ + + _validation = { + 'limit': {'required': True}, + } + + _attribute_map = { + 'dedicated_availability_zone_id': {'key': 'dedicatedAvailabilityZoneId', 'type': 'str'}, + 'dedicated_availability_zone_name': {'key': 'dedicatedAvailabilityZoneName', 'type': 'str'}, + 'dedicated_placement_group_id': {'key': 'dedicatedPlacementGroupId', 'type': 'str'}, + 'dedicated_placement_group_name': {'key': 'dedicatedPlacementGroupName', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku_id': {'key': 'skuId', 'type': 'str'}, + 'sku_name': {'key': 'skuName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SkuAvailability, self).__init__(**kwargs) + self.dedicated_availability_zone_id = kwargs.get('dedicated_availability_zone_id', None) + self.dedicated_availability_zone_name = kwargs.get('dedicated_availability_zone_name', None) + self.dedicated_placement_group_id = kwargs.get('dedicated_placement_group_id', None) + self.dedicated_placement_group_name = kwargs.get('dedicated_placement_group_name', None) + self.limit = kwargs.get('limit', None) + self.resource_type = kwargs.get('resource_type', None) + self.sku_id = kwargs.get('sku_id', None) + self.sku_name = kwargs.get('sku_name', None) + + +class Usage(Model): + """Usage model. + + All required parameters must be populated in order to send to Azure. + + :param current_value: Required. The current usage value. Default value: 0 + . + :type current_value: int + :param limit: Required. limit of a given sku in a region for a + subscription. The maximum permitted value for the usage quota. If there is + no limit, this value will be -1. Default value: 0 . + :type limit: int + :param name: Usage name value and localized name + :type name: ~azure.mgmt.vmwarecloudsimple.models.UsageName + :param unit: The usages' unit. Possible values include: 'Count', 'Bytes', + 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' + :type unit: str or ~azure.mgmt.vmwarecloudsimple.models.UsageCount + """ + + _validation = { + 'current_value': {'required': True}, + 'limit': {'required': True}, + } + + _attribute_map = { + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + 'unit': {'key': 'unit', 'type': 'UsageCount'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.current_value = kwargs.get('current_value', 0) + self.limit = kwargs.get('limit', 0) + self.name = kwargs.get('name', None) + self.unit = kwargs.get('unit', None) + + +class UsageName(Model): + """User name model. + + :param localized_value: e.g. "Virtual Machines" + :type localized_value: str + :param value: resource type or resource type sku name, e.g. + virtualMachines + :type value: str + """ + + _attribute_map = { + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.localized_value = kwargs.get('localized_value', None) + self.value = kwargs.get('value', None) + + +class VirtualDisk(Model): + """Virtual disk model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param controller_id: Required. Disk's Controller id + :type controller_id: str + :param independence_mode: Required. Disk's independence mode type. + Possible values include: 'persistent', 'independent_persistent', + 'independent_nonpersistent' + :type independence_mode: str or + ~azure.mgmt.vmwarecloudsimple.models.DiskIndependenceMode + :param total_size: Required. Disk's total size + :type total_size: int + :param virtual_disk_id: Disk's id + :type virtual_disk_id: str + :ivar virtual_disk_name: Disk's display name + :vartype virtual_disk_name: str + """ + + _validation = { + 'controller_id': {'required': True}, + 'independence_mode': {'required': True}, + 'total_size': {'required': True}, + 'virtual_disk_name': {'readonly': True}, + } + + _attribute_map = { + 'controller_id': {'key': 'controllerId', 'type': 'str'}, + 'independence_mode': {'key': 'independenceMode', 'type': 'DiskIndependenceMode'}, + 'total_size': {'key': 'totalSize', 'type': 'int'}, + 'virtual_disk_id': {'key': 'virtualDiskId', 'type': 'str'}, + 'virtual_disk_name': {'key': 'virtualDiskName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualDisk, self).__init__(**kwargs) + self.controller_id = kwargs.get('controller_id', None) + self.independence_mode = kwargs.get('independence_mode', None) + self.total_size = kwargs.get('total_size', None) + self.virtual_disk_id = kwargs.get('virtual_disk_id', None) + self.virtual_disk_name = None + + +class VirtualDiskController(Model): + """Virtual disk controller model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Controller's id + :vartype id: str + :ivar name: The display name of Controller + :vartype name: str + :ivar sub_type: dik controller subtype (VMWARE_PARAVIRTUAL, BUS_PARALLEL, + LSI_PARALLEL, LSI_SAS) + :vartype sub_type: str + :ivar type: disk controller type (SCSI) + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'sub_type': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'sub_type': {'key': 'subType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualDiskController, self).__init__(**kwargs) + self.id = None + self.name = None + self.sub_type = None + self.type = None + + +class VirtualMachine(Model): + """Virtual machine model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/virtualMachines/{virtualMachineName} + :vartype id: str + :param location: Required. Azure region + :type location: str + :ivar name: {virtualMachineName} + :vartype name: str + :param amount_of_ram: Required. The amount of memory + :type amount_of_ram: int + :ivar controllers: The list of Virtual Disks' Controllers + :vartype controllers: + list[~azure.mgmt.vmwarecloudsimple.models.VirtualDiskController] + :param disks: The list of Virtual Disks + :type disks: list[~azure.mgmt.vmwarecloudsimple.models.VirtualDisk] + :ivar dnsname: The DNS name of Virtual Machine in VCenter + :vartype dnsname: str + :param expose_to_guest_vm: Expose Guest OS or not + :type expose_to_guest_vm: bool + :ivar folder: The path to virtual machine folder in VCenter + :vartype folder: str + :ivar guest_os: The name of Guest OS + :vartype guest_os: str + :ivar guest_os_type: The Guest OS type. Possible values include: 'linux', + 'windows', 'other' + :vartype guest_os_type: str or + ~azure.mgmt.vmwarecloudsimple.models.GuestOSType + :param nics: The list of Virtual NICs + :type nics: list[~azure.mgmt.vmwarecloudsimple.models.VirtualNic] + :param number_of_cores: Required. The number of CPU cores + :type number_of_cores: int + :param password: Password for login + :type password: str + :param private_cloud_id: Required. Private Cloud Id + :type private_cloud_id: str + :ivar provisioning_state: The provisioning status of the resource + :vartype provisioning_state: str + :ivar public_ip: The public ip of Virtual Machine + :vartype public_ip: str + :param resource_pool: Virtual Machines Resource Pool + :type resource_pool: ~azure.mgmt.vmwarecloudsimple.models.ResourcePool + :ivar status: The status of Virtual machine. Possible values include: + 'running', 'suspended', 'poweredoff', 'updating', 'deallocating', + 'deleting' + :vartype status: str or + ~azure.mgmt.vmwarecloudsimple.models.VirtualMachineStatus + :param template_id: Virtual Machine Template Id + :type template_id: str + :param username: Username for login + :type username: str + :param v_sphere_networks: The list of Virtual VSphere Networks + :type v_sphere_networks: list[str] + :ivar vm_id: The internal id of Virtual Machine in VCenter + :vartype vm_id: str + :ivar vmwaretools: VMware tools version + :vartype vmwaretools: str + :param tags: The list of tags + :type tags: dict[str, str] + :ivar type: {resourceProviderNamespace}/{resourceType} + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True, 'pattern': r'^[-a-zA-Z0-9]+$'}, + 'amount_of_ram': {'required': True}, + 'controllers': {'readonly': True}, + 'dnsname': {'readonly': True}, + 'folder': {'readonly': True}, + 'guest_os': {'readonly': True}, + 'guest_os_type': {'readonly': True}, + 'number_of_cores': {'required': True}, + 'private_cloud_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'public_ip': {'readonly': True}, + 'status': {'readonly': True}, + 'vm_id': {'readonly': True}, + 'vmwaretools': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'amount_of_ram': {'key': 'properties.amountOfRam', 'type': 'int'}, + 'controllers': {'key': 'properties.controllers', 'type': '[VirtualDiskController]'}, + 'disks': {'key': 'properties.disks', 'type': '[VirtualDisk]'}, + 'dnsname': {'key': 'properties.dnsname', 'type': 'str'}, + 'expose_to_guest_vm': {'key': 'properties.exposeToGuestVM', 'type': 'bool'}, + 'folder': {'key': 'properties.folder', 'type': 'str'}, + 'guest_os': {'key': 'properties.guestOS', 'type': 'str'}, + 'guest_os_type': {'key': 'properties.guestOSType', 'type': 'GuestOSType'}, + 'nics': {'key': 'properties.nics', 'type': '[VirtualNic]'}, + 'number_of_cores': {'key': 'properties.numberOfCores', 'type': 'int'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'private_cloud_id': {'key': 'properties.privateCloudId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'public_ip': {'key': 'properties.publicIP', 'type': 'str'}, + 'resource_pool': {'key': 'properties.resourcePool', 'type': 'ResourcePool'}, + 'status': {'key': 'properties.status', 'type': 'VirtualMachineStatus'}, + 'template_id': {'key': 'properties.templateId', 'type': 'str'}, + 'username': {'key': 'properties.username', 'type': 'str'}, + 'v_sphere_networks': {'key': 'properties.vSphereNetworks', 'type': '[str]'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'vmwaretools': {'key': 'properties.vmwaretools', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualMachine, self).__init__(**kwargs) + self.id = None + self.location = kwargs.get('location', None) + self.name = None + self.amount_of_ram = kwargs.get('amount_of_ram', None) + self.controllers = None + self.disks = kwargs.get('disks', None) + self.dnsname = None + self.expose_to_guest_vm = kwargs.get('expose_to_guest_vm', None) + self.folder = None + self.guest_os = None + self.guest_os_type = None + self.nics = kwargs.get('nics', None) + self.number_of_cores = kwargs.get('number_of_cores', None) + self.password = kwargs.get('password', None) + self.private_cloud_id = kwargs.get('private_cloud_id', None) + self.provisioning_state = None + self.public_ip = None + self.resource_pool = kwargs.get('resource_pool', None) + self.status = None + self.template_id = kwargs.get('template_id', None) + self.username = kwargs.get('username', None) + self.v_sphere_networks = kwargs.get('v_sphere_networks', None) + self.vm_id = None + self.vmwaretools = None + self.tags = kwargs.get('tags', None) + self.type = None + + +class VirtualMachineStopMode(Model): + """List of virtual machine stop modes. + + :param mode: mode indicates a type of stop operation - reboot, suspend, + shutdown or power-off. Possible values include: 'reboot', 'suspend', + 'shutdown', 'poweroff' + :type mode: str or ~azure.mgmt.vmwarecloudsimple.models.StopMode + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'StopMode'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineStopMode, self).__init__(**kwargs) + self.mode = kwargs.get('mode', None) + + +class VirtualMachineTemplate(Model): + """Virtual machine template model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: virtual machine template id (privateCloudId:vsphereId) + :vartype id: str + :param location: Azure region + :type location: str + :ivar name: {virtualMachineTemplateName} + :vartype name: str + :param amount_of_ram: The amount of memory + :type amount_of_ram: int + :param controllers: The list of Virtual Disk Controllers + :type controllers: + list[~azure.mgmt.vmwarecloudsimple.models.VirtualDiskController] + :param description: The description of Virtual Machine Template + :type description: str + :param disks: The list of Virtual Disks + :type disks: list[~azure.mgmt.vmwarecloudsimple.models.VirtualDisk] + :param expose_to_guest_vm: Expose Guest OS or not + :type expose_to_guest_vm: bool + :ivar guest_os: The Guest OS + :vartype guest_os: str + :ivar guest_os_type: The Guest OS types + :vartype guest_os_type: str + :param nics: The list of Virtual NICs + :type nics: list[~azure.mgmt.vmwarecloudsimple.models.VirtualNic] + :param number_of_cores: The number of CPU cores + :type number_of_cores: int + :param path: path to folder + :type path: str + :param private_cloud_id: Required. The Private Cloud Id + :type private_cloud_id: str + :param v_sphere_networks: The list of VSphere networks + :type v_sphere_networks: list[str] + :param v_sphere_tags: The tags from VSphere + :type v_sphere_tags: list[str] + :ivar vmwaretools: The VMware tools version + :vartype vmwaretools: str + :ivar type: {resourceProviderNamespace}/{resourceType} + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'guest_os': {'readonly': True}, + 'guest_os_type': {'readonly': True}, + 'private_cloud_id': {'required': True}, + 'vmwaretools': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'amount_of_ram': {'key': 'properties.amountOfRam', 'type': 'int'}, + 'controllers': {'key': 'properties.controllers', 'type': '[VirtualDiskController]'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'disks': {'key': 'properties.disks', 'type': '[VirtualDisk]'}, + 'expose_to_guest_vm': {'key': 'properties.exposeToGuestVM', 'type': 'bool'}, + 'guest_os': {'key': 'properties.guestOS', 'type': 'str'}, + 'guest_os_type': {'key': 'properties.guestOSType', 'type': 'str'}, + 'nics': {'key': 'properties.nics', 'type': '[VirtualNic]'}, + 'number_of_cores': {'key': 'properties.numberOfCores', 'type': 'int'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'private_cloud_id': {'key': 'properties.privateCloudId', 'type': 'str'}, + 'v_sphere_networks': {'key': 'properties.vSphereNetworks', 'type': '[str]'}, + 'v_sphere_tags': {'key': 'properties.vSphereTags', 'type': '[str]'}, + 'vmwaretools': {'key': 'properties.vmwaretools', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineTemplate, self).__init__(**kwargs) + self.id = None + self.location = kwargs.get('location', None) + self.name = None + self.amount_of_ram = kwargs.get('amount_of_ram', None) + self.controllers = kwargs.get('controllers', None) + self.description = kwargs.get('description', None) + self.disks = kwargs.get('disks', None) + self.expose_to_guest_vm = kwargs.get('expose_to_guest_vm', None) + self.guest_os = None + self.guest_os_type = None + self.nics = kwargs.get('nics', None) + self.number_of_cores = kwargs.get('number_of_cores', None) + self.path = kwargs.get('path', None) + self.private_cloud_id = kwargs.get('private_cloud_id', None) + self.v_sphere_networks = kwargs.get('v_sphere_networks', None) + self.v_sphere_tags = kwargs.get('v_sphere_tags', None) + self.vmwaretools = None + self.type = None + + +class VirtualNetwork(Model): + """Virtual network model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar assignable: can be used in vm creation/deletion + :vartype assignable: bool + :param id: Required. virtual network id (privateCloudId:vsphereId) + :type id: str + :ivar location: Azure region + :vartype location: str + :ivar name: {VirtualNetworkName} + :vartype name: str + :ivar private_cloud_id: The Private Cloud id + :vartype private_cloud_id: str + :ivar type: {resourceProviderNamespace}/{resourceType} + :vartype type: str + """ + + _validation = { + 'assignable': {'readonly': True}, + 'id': {'required': True}, + 'location': {'readonly': True}, + 'name': {'readonly': True}, + 'private_cloud_id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'assignable': {'key': 'assignable', 'type': 'bool'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'private_cloud_id': {'key': 'properties.privateCloudId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetwork, self).__init__(**kwargs) + self.assignable = None + self.id = kwargs.get('id', None) + self.location = None + self.name = None + self.private_cloud_id = None + self.type = None + + +class VirtualNic(Model): + """Virtual NIC model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param ip_addresses: NIC ip address + :type ip_addresses: list[str] + :param mac_address: NIC MAC address + :type mac_address: str + :param network: Required. Virtual Network + :type network: ~azure.mgmt.vmwarecloudsimple.models.VirtualNetwork + :param nic_type: Required. NIC type. Possible values include: 'E1000', + 'E1000E', 'PCNET32', 'VMXNET', 'VMXNET2', 'VMXNET3' + :type nic_type: str or ~azure.mgmt.vmwarecloudsimple.models.NICType + :param power_on_boot: Is NIC powered on/off on boot + :type power_on_boot: bool + :param virtual_nic_id: NIC id + :type virtual_nic_id: str + :ivar virtual_nic_name: NIC name + :vartype virtual_nic_name: str + """ + + _validation = { + 'network': {'required': True}, + 'nic_type': {'required': True}, + 'virtual_nic_name': {'readonly': True}, + } + + _attribute_map = { + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'VirtualNetwork'}, + 'nic_type': {'key': 'nicType', 'type': 'NICType'}, + 'power_on_boot': {'key': 'powerOnBoot', 'type': 'bool'}, + 'virtual_nic_id': {'key': 'virtualNicId', 'type': 'str'}, + 'virtual_nic_name': {'key': 'virtualNicName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNic, self).__init__(**kwargs) + self.ip_addresses = kwargs.get('ip_addresses', None) + self.mac_address = kwargs.get('mac_address', None) + self.network = kwargs.get('network', None) + self.nic_type = kwargs.get('nic_type', None) + self.power_on_boot = kwargs.get('power_on_boot', None) + self.virtual_nic_id = kwargs.get('virtual_nic_id', None) + self.virtual_nic_name = None diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_models_py3.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_models_py3.py new file mode 100644 index 000000000000..38389072b99d --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_models_py3.py @@ -0,0 +1,1276 @@ +# 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 AvailableOperation(Model): + """Resource provider available operation model. + + :param display: The list of operations + :type display: + ~azure.mgmt.vmwarecloudsimple.models.AvailableOperationDisplay + :param is_data_action: Indicating whether the operation is a data action + or not. Default value: False . + :type is_data_action: bool + :param name: + {resourceProviderNamespace}/{resourceType}/{read|write|delete|action} + :type name: str + :param origin: The origin of operation. Possible values include: 'user', + 'system', 'user,system' + :type origin: str or ~azure.mgmt.vmwarecloudsimple.models.OperationOrigin + :param service_specification: The list of specification's service metrics + :type service_specification: + ~azure.mgmt.vmwarecloudsimple.models.AvailableOperationDisplayPropertyServiceSpecificationMetricsList + """ + + _attribute_map = { + 'display': {'key': 'display', 'type': 'AvailableOperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'OperationOrigin'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'AvailableOperationDisplayPropertyServiceSpecificationMetricsList'}, + } + + def __init__(self, *, display=None, is_data_action: bool=False, name: str=None, origin=None, service_specification=None, **kwargs) -> None: + super(AvailableOperation, self).__init__(**kwargs) + self.display = display + self.is_data_action = is_data_action + self.name = name + self.origin = origin + self.service_specification = service_specification + + +class AvailableOperationDisplay(Model): + """Resource provider available operation display model. + + :param description: Description of the operation for display purposes + :type description: str + :param operation: Name of the operation for display purposes + :type operation: str + :param provider: Name of the provider for display purposes + :type provider: str + :param resource: Name of the resource type for display purposes + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, operation: str=None, provider: str=None, resource: str=None, **kwargs) -> None: + super(AvailableOperationDisplay, self).__init__(**kwargs) + self.description = description + self.operation = operation + self.provider = provider + self.resource = resource + + +class AvailableOperationDisplayPropertyServiceSpecificationMetricsItem(Model): + """Available operation display property service specification metrics item. + + All required parameters must be populated in order to send to Azure. + + :param aggregation_type: Required. Metric's aggregation type for e.g. + (Average, Total). Possible values include: 'Average', 'Total' + :type aggregation_type: str or + ~azure.mgmt.vmwarecloudsimple.models.AggregationType + :param display_description: Required. Metric's description + :type display_description: str + :param display_name: Required. Human readable metric's name + :type display_name: str + :param name: Required. Metric's name/id + :type name: str + :param unit: Required. Metric's unit + :type unit: str + """ + + _validation = { + 'aggregation_type': {'required': True}, + 'display_description': {'required': True}, + 'display_name': {'required': True}, + 'name': {'required': True}, + 'unit': {'required': True}, + } + + _attribute_map = { + 'aggregation_type': {'key': 'aggregationType', 'type': 'AggregationType'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__(self, *, aggregation_type, display_description: str, display_name: str, name: str, unit: str, **kwargs) -> None: + super(AvailableOperationDisplayPropertyServiceSpecificationMetricsItem, self).__init__(**kwargs) + self.aggregation_type = aggregation_type + self.display_description = display_description + self.display_name = display_name + self.name = name + self.unit = unit + + +class AvailableOperationDisplayPropertyServiceSpecificationMetricsList(Model): + """List of available operation display property service specification metrics. + + :param metric_specifications: Metric specifications of operation + :type metric_specifications: + list[~azure.mgmt.vmwarecloudsimple.models.AvailableOperationDisplayPropertyServiceSpecificationMetricsItem] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[AvailableOperationDisplayPropertyServiceSpecificationMetricsItem]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(AvailableOperationDisplayPropertyServiceSpecificationMetricsList, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CSRPError(Model): + """General error model. + + :param error: Error's body + :type error: ~azure.mgmt.vmwarecloudsimple.models.CSRPErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CSRPErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CSRPError, self).__init__(**kwargs) + self.error = error + + +class CSRPErrorException(HttpOperationError): + """Server responsed with exception of type: 'CSRPError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CSRPErrorException, self).__init__(deserialize, response, 'CSRPError', *args) + + +class CSRPErrorBody(Model): + """Error properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Error's code + :vartype code: str + :ivar details: Error's details + :vartype details: list[~azure.mgmt.vmwarecloudsimple.models.CSRPErrorBody] + :ivar message: Error's message + :vartype message: str + :param target: Error's target + :type target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'details': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CSRPErrorBody]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, target: str=None, **kwargs) -> None: + super(CSRPErrorBody, self).__init__(**kwargs) + self.code = None + self.details = None + self.message = None + self.target = target + + +class DedicatedCloudNode(Model): + """Dedicated cloud node model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/dedicatedCloudNodes/{dedicatedCloudNodeName} + :vartype id: str + :param location: Required. Azure region + :type location: str + :ivar name: {dedicatedCloudNodeName} + :vartype name: str + :param availability_zone_id: Required. Availability Zone id, e.g. "az1" + :type availability_zone_id: str + :ivar availability_zone_name: Availability Zone name, e.g. "Availability + Zone 1" + :vartype availability_zone_name: str + :ivar cloud_rack_name: VMWare Cloud Rack Name + :vartype cloud_rack_name: str + :ivar created: date time the resource was created + :vartype created: object + :param nodes_count: Required. count of nodes to create + :type nodes_count: int + :param placement_group_id: Required. Placement Group id, e.g. "n1" + :type placement_group_id: str + :ivar placement_group_name: Placement Name, e.g. "Placement Group 1" + :vartype placement_group_name: str + :ivar private_cloud_id: Private Cloud Id + :vartype private_cloud_id: str + :ivar private_cloud_name: Resource Pool Name + :vartype private_cloud_name: str + :ivar provisioning_state: The provisioning status of the resource + :vartype provisioning_state: str + :param purchase_id: Required. purchase id + :type purchase_id: str + :param id1: Required. SKU's id + :type id1: str + :param name1: Required. SKU's name + :type name1: str + :ivar status: Node status, indicates is private cloud set up on this node + or not. Possible values include: 'unused', 'used' + :vartype status: str or ~azure.mgmt.vmwarecloudsimple.models.NodeStatus + :ivar vmware_cluster_name: VMWare Cluster Name + :vartype vmware_cluster_name: str + :param sku: Dedicated Cloud Nodes SKU + :type sku: ~azure.mgmt.vmwarecloudsimple.models.Sku + :param tags: Dedicated Cloud Nodes tags + :type tags: dict[str, str] + :ivar type: {resourceProviderNamespace}/{resourceType} + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True, 'pattern': r'^[-a-zA-Z0-9]+$'}, + 'availability_zone_id': {'required': True}, + 'availability_zone_name': {'readonly': True}, + 'cloud_rack_name': {'readonly': True}, + 'created': {'readonly': True}, + 'nodes_count': {'required': True}, + 'placement_group_id': {'required': True}, + 'placement_group_name': {'readonly': True}, + 'private_cloud_id': {'readonly': True}, + 'private_cloud_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'purchase_id': {'required': True}, + 'id1': {'required': True}, + 'name1': {'required': True}, + 'status': {'readonly': True}, + 'vmware_cluster_name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'availability_zone_id': {'key': 'properties.availabilityZoneId', 'type': 'str'}, + 'availability_zone_name': {'key': 'properties.availabilityZoneName', 'type': 'str'}, + 'cloud_rack_name': {'key': 'properties.cloudRackName', 'type': 'str'}, + 'created': {'key': 'properties.created', 'type': 'object'}, + 'nodes_count': {'key': 'properties.nodesCount', 'type': 'int'}, + 'placement_group_id': {'key': 'properties.placementGroupId', 'type': 'str'}, + 'placement_group_name': {'key': 'properties.placementGroupName', 'type': 'str'}, + 'private_cloud_id': {'key': 'properties.privateCloudId', 'type': 'str'}, + 'private_cloud_name': {'key': 'properties.privateCloudName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'purchase_id': {'key': 'properties.purchaseId', 'type': 'str'}, + 'id1': {'key': 'properties.skuDescription.id', 'type': 'str'}, + 'name1': {'key': 'properties.skuDescription.name', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'NodeStatus'}, + 'vmware_cluster_name': {'key': 'properties.vmwareClusterName', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, location: str, availability_zone_id: str, nodes_count: int, placement_group_id: str, purchase_id: str, id1: str, name1: str, sku=None, tags=None, **kwargs) -> None: + super(DedicatedCloudNode, self).__init__(**kwargs) + self.id = None + self.location = location + self.name = None + self.availability_zone_id = availability_zone_id + self.availability_zone_name = None + self.cloud_rack_name = None + self.created = None + self.nodes_count = nodes_count + self.placement_group_id = placement_group_id + self.placement_group_name = None + self.private_cloud_id = None + self.private_cloud_name = None + self.provisioning_state = None + self.purchase_id = purchase_id + self.id1 = id1 + self.name1 = name1 + self.status = None + self.vmware_cluster_name = None + self.sku = sku + self.tags = tags + self.type = None + + +class DedicatedCloudService(Model): + """Dedicated cloud service model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/dedicatedCloudServices/{dedicatedCloudServiceName} + :vartype id: str + :param location: Required. Azure region + :type location: str + :ivar name: {dedicatedCloudServiceName} + :vartype name: str + :param gateway_subnet: Required. gateway Subnet for the account. It will + collect the subnet address and always treat it as /28 + :type gateway_subnet: str + :ivar is_account_onboarded: indicates whether account onboarded or not in + a given region. Possible values include: 'notOnBoarded', 'onBoarded', + 'onBoardingFailed', 'onBoarding' + :vartype is_account_onboarded: str or + ~azure.mgmt.vmwarecloudsimple.models.OnboardingStatus + :param nodes: total nodes purchased + :type nodes: int + :param service_url: link to a service management web portal + :type service_url: str + :param tags: The list of tags + :type tags: dict[str, str] + :ivar type: {resourceProviderNamespace}/{resourceType} + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True, 'pattern': r'^[-a-zA-Z0-9]+$'}, + 'gateway_subnet': {'required': True}, + 'is_account_onboarded': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'gateway_subnet': {'key': 'properties.gatewaySubnet', 'type': 'str'}, + 'is_account_onboarded': {'key': 'properties.isAccountOnboarded', 'type': 'OnboardingStatus'}, + 'nodes': {'key': 'properties.nodes', 'type': 'int'}, + 'service_url': {'key': 'properties.serviceURL', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, location: str, gateway_subnet: str, nodes: int=None, service_url: str=None, tags=None, **kwargs) -> None: + super(DedicatedCloudService, self).__init__(**kwargs) + self.id = None + self.location = location + self.name = None + self.gateway_subnet = gateway_subnet + self.is_account_onboarded = None + self.nodes = nodes + self.service_url = service_url + self.tags = tags + self.type = None + + +class OperationError(Model): + """Operation error model. + + :param code: Error's code + :type code: str + :param message: Error's 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(OperationError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class OperationResource(Model): + """Operation status response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar end_time: End time of the operation + :vartype end_time: datetime + :param error: Error Message if operation failed + :type error: ~azure.mgmt.vmwarecloudsimple.models.OperationError + :ivar id: Operation Id + :vartype id: str + :ivar name: Operation ID + :vartype name: str + :ivar start_time: Start time of the operation + :vartype start_time: datetime + :ivar status: Operation status + :vartype status: str + """ + + _validation = { + 'end_time': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'start_time': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'OperationError'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(OperationResource, self).__init__(**kwargs) + self.end_time = None + self.error = error + self.id = None + self.name = None + self.start_time = None + self.status = None + + +class PatchPayload(Model): + """General patch payload modal. + + :param tags: The tags key:value pairs + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(PatchPayload, self).__init__(**kwargs) + self.tags = tags + + +class PrivateCloud(Model): + """Private cloud model. + + :param id: Azure Id, e.g. + "/subscriptions/4da99247-a172-4ed6-8ae9-ebed2d12f839/providers/Microsoft.VMwareCloudSimple/privateClouds/cloud123" + :type id: str + :param location: Location where private cloud created, e.g "westus" + :type location: str + :param name: Private cloud name + :type name: str + :param availability_zone_id: Availability Zone id, e.g. "az1" + :type availability_zone_id: str + :param availability_zone_name: Availability Zone name, e.g. "Availability + Zone 1" + :type availability_zone_name: str + :param clusters_number: Number of clusters + :type clusters_number: int + :param created_by: User's emails who created cloud + :type created_by: str + :param created_on: When private cloud was created + :type created_on: datetime + :param dns_servers: Array of DNS servers + :type dns_servers: list[str] + :param expires: Expiration date of PC + :type expires: str + :param nsx_type: Nsx Type, e.g. "Advanced" + :type nsx_type: str + :param placement_group_id: Placement Group id, e.g. "n1" + :type placement_group_id: str + :param placement_group_name: Placement Group name + :type placement_group_name: str + :param private_cloud_id: Id of a private cloud + :type private_cloud_id: str + :param resource_pools: The list of Resource Pools + :type resource_pools: + list[~azure.mgmt.vmwarecloudsimple.models.ResourcePool] + :param state: Private Cloud state, e.g. "operational" + :type state: str + :param total_cpu_cores: Number of cores + :type total_cpu_cores: int + :param total_nodes: Number of nodes + :type total_nodes: int + :param total_ram: Memory size + :type total_ram: int + :param total_storage: Disk space in TB + :type total_storage: float + :param private_cloud_properties_type: Virtualization type e.g. "vSphere" + :type private_cloud_properties_type: str + :param v_sphere_version: e.g. "6.5u2" + :type v_sphere_version: str + :param vcenter_fqdn: FQDN for vcenter access + :type vcenter_fqdn: str + :param vcenter_refid: Vcenter ip address + :type vcenter_refid: str + :param virtual_machine_templates: The list of Virtual Machine Templates + :type virtual_machine_templates: + list[~azure.mgmt.vmwarecloudsimple.models.VirtualMachineTemplate] + :param virtual_networks: The list of Virtual Networks + :type virtual_networks: + list[~azure.mgmt.vmwarecloudsimple.models.VirtualNetwork] + :param vr_ops_enabled: Is Vrops enabled/disabled + :type vr_ops_enabled: bool + :param type: Azure Resource type. Possible values include: + 'Microsoft.VMwareCloudSimple/privateClouds' + :type type: str or + ~azure.mgmt.vmwarecloudsimple.models.PrivateCloudResourceType + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'availability_zone_id': {'key': 'properties.availabilityZoneId', 'type': 'str'}, + 'availability_zone_name': {'key': 'properties.availabilityZoneName', 'type': 'str'}, + 'clusters_number': {'key': 'properties.clustersNumber', 'type': 'int'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'str'}, + 'created_on': {'key': 'properties.createdOn', 'type': 'iso-8601'}, + 'dns_servers': {'key': 'properties.dnsServers', 'type': '[str]'}, + 'expires': {'key': 'properties.expires', 'type': 'str'}, + 'nsx_type': {'key': 'properties.nsxType', 'type': 'str'}, + 'placement_group_id': {'key': 'properties.placementGroupId', 'type': 'str'}, + 'placement_group_name': {'key': 'properties.placementGroupName', 'type': 'str'}, + 'private_cloud_id': {'key': 'properties.privateCloudId', 'type': 'str'}, + 'resource_pools': {'key': 'properties.resourcePools', 'type': '[ResourcePool]'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'total_cpu_cores': {'key': 'properties.totalCpuCores', 'type': 'int'}, + 'total_nodes': {'key': 'properties.totalNodes', 'type': 'int'}, + 'total_ram': {'key': 'properties.totalRam', 'type': 'int'}, + 'total_storage': {'key': 'properties.totalStorage', 'type': 'float'}, + 'private_cloud_properties_type': {'key': 'properties.type', 'type': 'str'}, + 'v_sphere_version': {'key': 'properties.vSphereVersion', 'type': 'str'}, + 'vcenter_fqdn': {'key': 'properties.vcenterFqdn', 'type': 'str'}, + 'vcenter_refid': {'key': 'properties.vcenterRefid', 'type': 'str'}, + 'virtual_machine_templates': {'key': 'properties.virtualMachineTemplates', 'type': '[VirtualMachineTemplate]'}, + 'virtual_networks': {'key': 'properties.virtualNetworks', 'type': '[VirtualNetwork]'}, + 'vr_ops_enabled': {'key': 'properties.vrOpsEnabled', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'PrivateCloudResourceType'}, + } + + def __init__(self, *, id: str=None, location: str=None, name: str=None, availability_zone_id: str=None, availability_zone_name: str=None, clusters_number: int=None, created_by: str=None, created_on=None, dns_servers=None, expires: str=None, nsx_type: str=None, placement_group_id: str=None, placement_group_name: str=None, private_cloud_id: str=None, resource_pools=None, state: str=None, total_cpu_cores: int=None, total_nodes: int=None, total_ram: int=None, total_storage: float=None, private_cloud_properties_type: str=None, v_sphere_version: str=None, vcenter_fqdn: str=None, vcenter_refid: str=None, virtual_machine_templates=None, virtual_networks=None, vr_ops_enabled: bool=None, type=None, **kwargs) -> None: + super(PrivateCloud, self).__init__(**kwargs) + self.id = id + self.location = location + self.name = name + self.availability_zone_id = availability_zone_id + self.availability_zone_name = availability_zone_name + self.clusters_number = clusters_number + self.created_by = created_by + self.created_on = created_on + self.dns_servers = dns_servers + self.expires = expires + self.nsx_type = nsx_type + self.placement_group_id = placement_group_id + self.placement_group_name = placement_group_name + self.private_cloud_id = private_cloud_id + self.resource_pools = resource_pools + self.state = state + self.total_cpu_cores = total_cpu_cores + self.total_nodes = total_nodes + self.total_ram = total_ram + self.total_storage = total_storage + self.private_cloud_properties_type = private_cloud_properties_type + self.v_sphere_version = v_sphere_version + self.vcenter_fqdn = vcenter_fqdn + self.vcenter_refid = vcenter_refid + self.virtual_machine_templates = virtual_machine_templates + self.virtual_networks = virtual_networks + self.vr_ops_enabled = vr_ops_enabled + self.type = type + + +class ResourcePool(Model): + """Resource pool model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. resource pool id (privateCloudId:vsphereId) + :type id: str + :ivar location: Azure region + :vartype location: str + :ivar name: {ResourcePoolName} + :vartype name: str + :ivar private_cloud_id: The Private Cloud Id + :vartype private_cloud_id: str + :ivar full_name: Hierarchical resource pool name + :vartype full_name: str + :ivar type: {resourceProviderNamespace}/{resourceType} + :vartype type: str + """ + + _validation = { + 'id': {'required': True}, + 'location': {'readonly': True}, + 'name': {'readonly': True}, + 'private_cloud_id': {'readonly': True}, + 'full_name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'private_cloud_id': {'key': 'privateCloudId', 'type': 'str'}, + 'full_name': {'key': 'properties.fullName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(ResourcePool, self).__init__(**kwargs) + self.id = id + self.location = None + self.name = None + self.private_cloud_id = None + self.full_name = None + self.type = None + + +class Sku(Model): + """The purchase SKU for CloudSimple paid resources. + + All required parameters must be populated in order to send to Azure. + + :param capacity: The capacity of the SKU + :type capacity: str + :param description: dedicatedCloudNode example: 8 x Ten-Core Intel® Xeon® + Processor E5-2640 v4 2.40GHz 25MB Cache (90W); 12 x 64GB PC4-19200 2400MHz + DDR4 ECC Registered DIMM, ... + :type description: str + :param family: If the service has different generations of hardware, for + the same SKU, then that can be captured here + :type family: str + :param name: Required. The name of the SKU for VMWare CloudSimple Node + :type name: str + :param tier: The tier of the SKU + :type tier: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'capacity': {'key': 'capacity', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name: str, capacity: str=None, description: str=None, family: str=None, tier: str=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.capacity = capacity + self.description = description + self.family = family + self.name = name + self.tier = tier + + +class SkuAvailability(Model): + """SKU availability model. + + All required parameters must be populated in order to send to Azure. + + :param dedicated_availability_zone_id: CloudSimple Availability Zone id + :type dedicated_availability_zone_id: str + :param dedicated_availability_zone_name: CloudSimple Availability Zone + Name + :type dedicated_availability_zone_name: str + :param dedicated_placement_group_id: CloudSimple Placement Group Id + :type dedicated_placement_group_id: str + :param dedicated_placement_group_name: CloudSimple Placement Group name + :type dedicated_placement_group_name: str + :param limit: Required. indicates how many resources of a given SKU is + available in a AZ->PG + :type limit: int + :param resource_type: resource type e.g. DedicatedCloudNodes + :type resource_type: str + :param sku_id: sku id + :type sku_id: str + :param sku_name: sku name + :type sku_name: str + """ + + _validation = { + 'limit': {'required': True}, + } + + _attribute_map = { + 'dedicated_availability_zone_id': {'key': 'dedicatedAvailabilityZoneId', 'type': 'str'}, + 'dedicated_availability_zone_name': {'key': 'dedicatedAvailabilityZoneName', 'type': 'str'}, + 'dedicated_placement_group_id': {'key': 'dedicatedPlacementGroupId', 'type': 'str'}, + 'dedicated_placement_group_name': {'key': 'dedicatedPlacementGroupName', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku_id': {'key': 'skuId', 'type': 'str'}, + 'sku_name': {'key': 'skuName', 'type': 'str'}, + } + + def __init__(self, *, limit: int, dedicated_availability_zone_id: str=None, dedicated_availability_zone_name: str=None, dedicated_placement_group_id: str=None, dedicated_placement_group_name: str=None, resource_type: str=None, sku_id: str=None, sku_name: str=None, **kwargs) -> None: + super(SkuAvailability, self).__init__(**kwargs) + self.dedicated_availability_zone_id = dedicated_availability_zone_id + self.dedicated_availability_zone_name = dedicated_availability_zone_name + self.dedicated_placement_group_id = dedicated_placement_group_id + self.dedicated_placement_group_name = dedicated_placement_group_name + self.limit = limit + self.resource_type = resource_type + self.sku_id = sku_id + self.sku_name = sku_name + + +class Usage(Model): + """Usage model. + + All required parameters must be populated in order to send to Azure. + + :param current_value: Required. The current usage value. Default value: 0 + . + :type current_value: int + :param limit: Required. limit of a given sku in a region for a + subscription. The maximum permitted value for the usage quota. If there is + no limit, this value will be -1. Default value: 0 . + :type limit: int + :param name: Usage name value and localized name + :type name: ~azure.mgmt.vmwarecloudsimple.models.UsageName + :param unit: The usages' unit. Possible values include: 'Count', 'Bytes', + 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' + :type unit: str or ~azure.mgmt.vmwarecloudsimple.models.UsageCount + """ + + _validation = { + 'current_value': {'required': True}, + 'limit': {'required': True}, + } + + _attribute_map = { + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + 'unit': {'key': 'unit', 'type': 'UsageCount'}, + } + + def __init__(self, *, current_value: int=0, limit: int=0, name=None, unit=None, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.current_value = current_value + self.limit = limit + self.name = name + self.unit = unit + + +class UsageName(Model): + """User name model. + + :param localized_value: e.g. "Virtual Machines" + :type localized_value: str + :param value: resource type or resource type sku name, e.g. + virtualMachines + :type value: str + """ + + _attribute_map = { + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, localized_value: str=None, value: str=None, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.localized_value = localized_value + self.value = value + + +class VirtualDisk(Model): + """Virtual disk model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param controller_id: Required. Disk's Controller id + :type controller_id: str + :param independence_mode: Required. Disk's independence mode type. + Possible values include: 'persistent', 'independent_persistent', + 'independent_nonpersistent' + :type independence_mode: str or + ~azure.mgmt.vmwarecloudsimple.models.DiskIndependenceMode + :param total_size: Required. Disk's total size + :type total_size: int + :param virtual_disk_id: Disk's id + :type virtual_disk_id: str + :ivar virtual_disk_name: Disk's display name + :vartype virtual_disk_name: str + """ + + _validation = { + 'controller_id': {'required': True}, + 'independence_mode': {'required': True}, + 'total_size': {'required': True}, + 'virtual_disk_name': {'readonly': True}, + } + + _attribute_map = { + 'controller_id': {'key': 'controllerId', 'type': 'str'}, + 'independence_mode': {'key': 'independenceMode', 'type': 'DiskIndependenceMode'}, + 'total_size': {'key': 'totalSize', 'type': 'int'}, + 'virtual_disk_id': {'key': 'virtualDiskId', 'type': 'str'}, + 'virtual_disk_name': {'key': 'virtualDiskName', 'type': 'str'}, + } + + def __init__(self, *, controller_id: str, independence_mode, total_size: int, virtual_disk_id: str=None, **kwargs) -> None: + super(VirtualDisk, self).__init__(**kwargs) + self.controller_id = controller_id + self.independence_mode = independence_mode + self.total_size = total_size + self.virtual_disk_id = virtual_disk_id + self.virtual_disk_name = None + + +class VirtualDiskController(Model): + """Virtual disk controller model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Controller's id + :vartype id: str + :ivar name: The display name of Controller + :vartype name: str + :ivar sub_type: dik controller subtype (VMWARE_PARAVIRTUAL, BUS_PARALLEL, + LSI_PARALLEL, LSI_SAS) + :vartype sub_type: str + :ivar type: disk controller type (SCSI) + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'sub_type': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'sub_type': {'key': 'subType', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(VirtualDiskController, self).__init__(**kwargs) + self.id = None + self.name = None + self.sub_type = None + self.type = None + + +class VirtualMachine(Model): + """Virtual machine model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/virtualMachines/{virtualMachineName} + :vartype id: str + :param location: Required. Azure region + :type location: str + :ivar name: {virtualMachineName} + :vartype name: str + :param amount_of_ram: Required. The amount of memory + :type amount_of_ram: int + :ivar controllers: The list of Virtual Disks' Controllers + :vartype controllers: + list[~azure.mgmt.vmwarecloudsimple.models.VirtualDiskController] + :param disks: The list of Virtual Disks + :type disks: list[~azure.mgmt.vmwarecloudsimple.models.VirtualDisk] + :ivar dnsname: The DNS name of Virtual Machine in VCenter + :vartype dnsname: str + :param expose_to_guest_vm: Expose Guest OS or not + :type expose_to_guest_vm: bool + :ivar folder: The path to virtual machine folder in VCenter + :vartype folder: str + :ivar guest_os: The name of Guest OS + :vartype guest_os: str + :ivar guest_os_type: The Guest OS type. Possible values include: 'linux', + 'windows', 'other' + :vartype guest_os_type: str or + ~azure.mgmt.vmwarecloudsimple.models.GuestOSType + :param nics: The list of Virtual NICs + :type nics: list[~azure.mgmt.vmwarecloudsimple.models.VirtualNic] + :param number_of_cores: Required. The number of CPU cores + :type number_of_cores: int + :param password: Password for login + :type password: str + :param private_cloud_id: Required. Private Cloud Id + :type private_cloud_id: str + :ivar provisioning_state: The provisioning status of the resource + :vartype provisioning_state: str + :ivar public_ip: The public ip of Virtual Machine + :vartype public_ip: str + :param resource_pool: Virtual Machines Resource Pool + :type resource_pool: ~azure.mgmt.vmwarecloudsimple.models.ResourcePool + :ivar status: The status of Virtual machine. Possible values include: + 'running', 'suspended', 'poweredoff', 'updating', 'deallocating', + 'deleting' + :vartype status: str or + ~azure.mgmt.vmwarecloudsimple.models.VirtualMachineStatus + :param template_id: Virtual Machine Template Id + :type template_id: str + :param username: Username for login + :type username: str + :param v_sphere_networks: The list of Virtual VSphere Networks + :type v_sphere_networks: list[str] + :ivar vm_id: The internal id of Virtual Machine in VCenter + :vartype vm_id: str + :ivar vmwaretools: VMware tools version + :vartype vmwaretools: str + :param tags: The list of tags + :type tags: dict[str, str] + :ivar type: {resourceProviderNamespace}/{resourceType} + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'location': {'required': True}, + 'name': {'readonly': True, 'pattern': r'^[-a-zA-Z0-9]+$'}, + 'amount_of_ram': {'required': True}, + 'controllers': {'readonly': True}, + 'dnsname': {'readonly': True}, + 'folder': {'readonly': True}, + 'guest_os': {'readonly': True}, + 'guest_os_type': {'readonly': True}, + 'number_of_cores': {'required': True}, + 'private_cloud_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'public_ip': {'readonly': True}, + 'status': {'readonly': True}, + 'vm_id': {'readonly': True}, + 'vmwaretools': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'amount_of_ram': {'key': 'properties.amountOfRam', 'type': 'int'}, + 'controllers': {'key': 'properties.controllers', 'type': '[VirtualDiskController]'}, + 'disks': {'key': 'properties.disks', 'type': '[VirtualDisk]'}, + 'dnsname': {'key': 'properties.dnsname', 'type': 'str'}, + 'expose_to_guest_vm': {'key': 'properties.exposeToGuestVM', 'type': 'bool'}, + 'folder': {'key': 'properties.folder', 'type': 'str'}, + 'guest_os': {'key': 'properties.guestOS', 'type': 'str'}, + 'guest_os_type': {'key': 'properties.guestOSType', 'type': 'GuestOSType'}, + 'nics': {'key': 'properties.nics', 'type': '[VirtualNic]'}, + 'number_of_cores': {'key': 'properties.numberOfCores', 'type': 'int'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + 'private_cloud_id': {'key': 'properties.privateCloudId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'public_ip': {'key': 'properties.publicIP', 'type': 'str'}, + 'resource_pool': {'key': 'properties.resourcePool', 'type': 'ResourcePool'}, + 'status': {'key': 'properties.status', 'type': 'VirtualMachineStatus'}, + 'template_id': {'key': 'properties.templateId', 'type': 'str'}, + 'username': {'key': 'properties.username', 'type': 'str'}, + 'v_sphere_networks': {'key': 'properties.vSphereNetworks', 'type': '[str]'}, + 'vm_id': {'key': 'properties.vmId', 'type': 'str'}, + 'vmwaretools': {'key': 'properties.vmwaretools', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, location: str, amount_of_ram: int, number_of_cores: int, private_cloud_id: str, disks=None, expose_to_guest_vm: bool=None, nics=None, password: str=None, resource_pool=None, template_id: str=None, username: str=None, v_sphere_networks=None, tags=None, **kwargs) -> None: + super(VirtualMachine, self).__init__(**kwargs) + self.id = None + self.location = location + self.name = None + self.amount_of_ram = amount_of_ram + self.controllers = None + self.disks = disks + self.dnsname = None + self.expose_to_guest_vm = expose_to_guest_vm + self.folder = None + self.guest_os = None + self.guest_os_type = None + self.nics = nics + self.number_of_cores = number_of_cores + self.password = password + self.private_cloud_id = private_cloud_id + self.provisioning_state = None + self.public_ip = None + self.resource_pool = resource_pool + self.status = None + self.template_id = template_id + self.username = username + self.v_sphere_networks = v_sphere_networks + self.vm_id = None + self.vmwaretools = None + self.tags = tags + self.type = None + + +class VirtualMachineStopMode(Model): + """List of virtual machine stop modes. + + :param mode: mode indicates a type of stop operation - reboot, suspend, + shutdown or power-off. Possible values include: 'reboot', 'suspend', + 'shutdown', 'poweroff' + :type mode: str or ~azure.mgmt.vmwarecloudsimple.models.StopMode + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'StopMode'}, + } + + def __init__(self, *, mode=None, **kwargs) -> None: + super(VirtualMachineStopMode, self).__init__(**kwargs) + self.mode = mode + + +class VirtualMachineTemplate(Model): + """Virtual machine template model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: virtual machine template id (privateCloudId:vsphereId) + :vartype id: str + :param location: Azure region + :type location: str + :ivar name: {virtualMachineTemplateName} + :vartype name: str + :param amount_of_ram: The amount of memory + :type amount_of_ram: int + :param controllers: The list of Virtual Disk Controllers + :type controllers: + list[~azure.mgmt.vmwarecloudsimple.models.VirtualDiskController] + :param description: The description of Virtual Machine Template + :type description: str + :param disks: The list of Virtual Disks + :type disks: list[~azure.mgmt.vmwarecloudsimple.models.VirtualDisk] + :param expose_to_guest_vm: Expose Guest OS or not + :type expose_to_guest_vm: bool + :ivar guest_os: The Guest OS + :vartype guest_os: str + :ivar guest_os_type: The Guest OS types + :vartype guest_os_type: str + :param nics: The list of Virtual NICs + :type nics: list[~azure.mgmt.vmwarecloudsimple.models.VirtualNic] + :param number_of_cores: The number of CPU cores + :type number_of_cores: int + :param path: path to folder + :type path: str + :param private_cloud_id: Required. The Private Cloud Id + :type private_cloud_id: str + :param v_sphere_networks: The list of VSphere networks + :type v_sphere_networks: list[str] + :param v_sphere_tags: The tags from VSphere + :type v_sphere_tags: list[str] + :ivar vmwaretools: The VMware tools version + :vartype vmwaretools: str + :ivar type: {resourceProviderNamespace}/{resourceType} + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'guest_os': {'readonly': True}, + 'guest_os_type': {'readonly': True}, + 'private_cloud_id': {'required': True}, + 'vmwaretools': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'amount_of_ram': {'key': 'properties.amountOfRam', 'type': 'int'}, + 'controllers': {'key': 'properties.controllers', 'type': '[VirtualDiskController]'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'disks': {'key': 'properties.disks', 'type': '[VirtualDisk]'}, + 'expose_to_guest_vm': {'key': 'properties.exposeToGuestVM', 'type': 'bool'}, + 'guest_os': {'key': 'properties.guestOS', 'type': 'str'}, + 'guest_os_type': {'key': 'properties.guestOSType', 'type': 'str'}, + 'nics': {'key': 'properties.nics', 'type': '[VirtualNic]'}, + 'number_of_cores': {'key': 'properties.numberOfCores', 'type': 'int'}, + 'path': {'key': 'properties.path', 'type': 'str'}, + 'private_cloud_id': {'key': 'properties.privateCloudId', 'type': 'str'}, + 'v_sphere_networks': {'key': 'properties.vSphereNetworks', 'type': '[str]'}, + 'v_sphere_tags': {'key': 'properties.vSphereTags', 'type': '[str]'}, + 'vmwaretools': {'key': 'properties.vmwaretools', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, private_cloud_id: str, location: str=None, amount_of_ram: int=None, controllers=None, description: str=None, disks=None, expose_to_guest_vm: bool=None, nics=None, number_of_cores: int=None, path: str=None, v_sphere_networks=None, v_sphere_tags=None, **kwargs) -> None: + super(VirtualMachineTemplate, self).__init__(**kwargs) + self.id = None + self.location = location + self.name = None + self.amount_of_ram = amount_of_ram + self.controllers = controllers + self.description = description + self.disks = disks + self.expose_to_guest_vm = expose_to_guest_vm + self.guest_os = None + self.guest_os_type = None + self.nics = nics + self.number_of_cores = number_of_cores + self.path = path + self.private_cloud_id = private_cloud_id + self.v_sphere_networks = v_sphere_networks + self.v_sphere_tags = v_sphere_tags + self.vmwaretools = None + self.type = None + + +class VirtualNetwork(Model): + """Virtual network model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar assignable: can be used in vm creation/deletion + :vartype assignable: bool + :param id: Required. virtual network id (privateCloudId:vsphereId) + :type id: str + :ivar location: Azure region + :vartype location: str + :ivar name: {VirtualNetworkName} + :vartype name: str + :ivar private_cloud_id: The Private Cloud id + :vartype private_cloud_id: str + :ivar type: {resourceProviderNamespace}/{resourceType} + :vartype type: str + """ + + _validation = { + 'assignable': {'readonly': True}, + 'id': {'required': True}, + 'location': {'readonly': True}, + 'name': {'readonly': True}, + 'private_cloud_id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'assignable': {'key': 'assignable', 'type': 'bool'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'private_cloud_id': {'key': 'properties.privateCloudId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(VirtualNetwork, self).__init__(**kwargs) + self.assignable = None + self.id = id + self.location = None + self.name = None + self.private_cloud_id = None + self.type = None + + +class VirtualNic(Model): + """Virtual NIC model. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param ip_addresses: NIC ip address + :type ip_addresses: list[str] + :param mac_address: NIC MAC address + :type mac_address: str + :param network: Required. Virtual Network + :type network: ~azure.mgmt.vmwarecloudsimple.models.VirtualNetwork + :param nic_type: Required. NIC type. Possible values include: 'E1000', + 'E1000E', 'PCNET32', 'VMXNET', 'VMXNET2', 'VMXNET3' + :type nic_type: str or ~azure.mgmt.vmwarecloudsimple.models.NICType + :param power_on_boot: Is NIC powered on/off on boot + :type power_on_boot: bool + :param virtual_nic_id: NIC id + :type virtual_nic_id: str + :ivar virtual_nic_name: NIC name + :vartype virtual_nic_name: str + """ + + _validation = { + 'network': {'required': True}, + 'nic_type': {'required': True}, + 'virtual_nic_name': {'readonly': True}, + } + + _attribute_map = { + 'ip_addresses': {'key': 'ipAddresses', 'type': '[str]'}, + 'mac_address': {'key': 'macAddress', 'type': 'str'}, + 'network': {'key': 'network', 'type': 'VirtualNetwork'}, + 'nic_type': {'key': 'nicType', 'type': 'NICType'}, + 'power_on_boot': {'key': 'powerOnBoot', 'type': 'bool'}, + 'virtual_nic_id': {'key': 'virtualNicId', 'type': 'str'}, + 'virtual_nic_name': {'key': 'virtualNicName', 'type': 'str'}, + } + + def __init__(self, *, network, nic_type, ip_addresses=None, mac_address: str=None, power_on_boot: bool=None, virtual_nic_id: str=None, **kwargs) -> None: + super(VirtualNic, self).__init__(**kwargs) + self.ip_addresses = ip_addresses + self.mac_address = mac_address + self.network = network + self.nic_type = nic_type + self.power_on_boot = power_on_boot + self.virtual_nic_id = virtual_nic_id + self.virtual_nic_name = None diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_paged_models.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_paged_models.py new file mode 100644 index 000000000000..28104bcd671e --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_paged_models.py @@ -0,0 +1,144 @@ +# 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 AvailableOperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`AvailableOperation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AvailableOperation]'} + } + + def __init__(self, *args, **kwargs): + + super(AvailableOperationPaged, self).__init__(*args, **kwargs) +class DedicatedCloudNodePaged(Paged): + """ + A paging container for iterating over a list of :class:`DedicatedCloudNode ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DedicatedCloudNode]'} + } + + def __init__(self, *args, **kwargs): + + super(DedicatedCloudNodePaged, self).__init__(*args, **kwargs) +class DedicatedCloudServicePaged(Paged): + """ + A paging container for iterating over a list of :class:`DedicatedCloudService ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DedicatedCloudService]'} + } + + def __init__(self, *args, **kwargs): + + super(DedicatedCloudServicePaged, self).__init__(*args, **kwargs) +class SkuAvailabilityPaged(Paged): + """ + A paging container for iterating over a list of :class:`SkuAvailability ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SkuAvailability]'} + } + + def __init__(self, *args, **kwargs): + + super(SkuAvailabilityPaged, 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 ResourcePoolPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourcePool ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourcePool]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourcePoolPaged, self).__init__(*args, **kwargs) +class VirtualMachineTemplatePaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualMachineTemplate ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualMachineTemplate]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualMachineTemplatePaged, self).__init__(*args, **kwargs) +class VirtualNetworkPaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualNetwork ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualNetwork]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualNetworkPaged, self).__init__(*args, **kwargs) +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) +class VirtualMachinePaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualMachine ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualMachine]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualMachinePaged, self).__init__(*args, **kwargs) diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_vmware_cloud_simple_client_enums.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_vmware_cloud_simple_client_enums.py new file mode 100644 index 000000000000..c5ff8f19244e --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/models/_vmware_cloud_simple_client_enums.py @@ -0,0 +1,96 @@ +# 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 OperationOrigin(str, Enum): + + user = "user" + system = "system" + usersystem = "user,system" + + +class AggregationType(str, Enum): + + average = "Average" + total = "Total" + + +class NodeStatus(str, Enum): + + unused = "unused" + used = "used" + + +class OnboardingStatus(str, Enum): + + not_on_boarded = "notOnBoarded" + on_boarded = "onBoarded" + on_boarding_failed = "onBoardingFailed" + on_boarding = "onBoarding" + + +class DiskIndependenceMode(str, Enum): + + persistent = "persistent" + independent_persistent = "independent_persistent" + independent_nonpersistent = "independent_nonpersistent" + + +class NICType(str, Enum): + + e1000 = "E1000" + e1000_e = "E1000E" + pcnet32 = "PCNET32" + vmxnet = "VMXNET" + vmxnet2 = "VMXNET2" + vmxnet3 = "VMXNET3" + + +class PrivateCloudResourceType(str, Enum): + + microsoft_vmware_cloud_simpleprivate_clouds = "Microsoft.VMwareCloudSimple/privateClouds" + + +class UsageCount(str, Enum): + + count = "Count" + bytes = "Bytes" + seconds = "Seconds" + percent = "Percent" + count_per_second = "CountPerSecond" + bytes_per_second = "BytesPerSecond" + + +class GuestOSType(str, Enum): + + linux = "linux" + windows = "windows" + other = "other" + + +class VirtualMachineStatus(str, Enum): + + running = "running" + suspended = "suspended" + poweredoff = "poweredoff" + updating = "updating" + deallocating = "deallocating" + deleting = "deleting" + + +class StopMode(str, Enum): + + reboot = "reboot" + suspend = "suspend" + shutdown = "shutdown" + poweroff = "poweroff" diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/__init__.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/__init__.py new file mode 100644 index 000000000000..04cf6300813b --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/__init__.py @@ -0,0 +1,34 @@ +# 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 ._dedicated_cloud_nodes_operations import DedicatedCloudNodesOperations +from ._dedicated_cloud_services_operations import DedicatedCloudServicesOperations +from ._skus_availability_operations import SkusAvailabilityOperations +from ._private_clouds_operations import PrivateCloudsOperations +from ._resource_pools_operations import ResourcePoolsOperations +from ._virtual_machine_templates_operations import VirtualMachineTemplatesOperations +from ._virtual_networks_operations import VirtualNetworksOperations +from ._usages_operations import UsagesOperations +from ._virtual_machines_operations import VirtualMachinesOperations + +__all__ = [ + 'Operations', + 'DedicatedCloudNodesOperations', + 'DedicatedCloudServicesOperations', + 'SkusAvailabilityOperations', + 'PrivateCloudsOperations', + 'ResourcePoolsOperations', + 'VirtualMachineTemplatesOperations', + 'VirtualNetworksOperations', + 'UsagesOperations', + 'VirtualMachinesOperations', +] diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_dedicated_cloud_nodes_operations.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_dedicated_cloud_nodes_operations.py new file mode 100644 index 000000000000..e6d940404bb9 --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_dedicated_cloud_nodes_operations.py @@ -0,0 +1,508 @@ +# 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 DedicatedCloudNodesOperations(object): + """DedicatedCloudNodesOperations 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: Client API version. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list_by_subscription( + self, filter=None, top=None, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Implements list of dedicated cloud nodes within subscription method. + + Returns list of dedicate cloud nodes within subscription. + + :param filter: The filter to apply on the list operation + :type filter: str + :param top: The maximum number of record sets to return + :type top: int + :param skip_token: to be used by nextLink implementation + :type skip_token: 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 DedicatedCloudNode + :rtype: + ~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudNodePaged[~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudNode] + :raises: + :class:`CSRPErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.CSRPErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DedicatedCloudNodePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes'} + + def list_by_resource_group( + self, resource_group_name, filter=None, top=None, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Implements list of dedicated cloud nodes within RG method. + + Returns list of dedicate cloud nodes within resource group. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param filter: The filter to apply on the list operation + :type filter: str + :param top: The maximum number of record sets to return + :type top: int + :param skip_token: to be used by nextLink implementation + :type skip_token: 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 DedicatedCloudNode + :rtype: + ~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudNodePaged[~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudNode] + :raises: + :class:`CSRPErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.CSRPErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DedicatedCloudNodePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes'} + + def get( + self, resource_group_name, dedicated_cloud_node_name, custom_headers=None, raw=False, **operation_config): + """Implements dedicated cloud node GET method. + + Returns dedicated cloud node. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param dedicated_cloud_node_name: dedicated cloud node name + :type dedicated_cloud_node_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: DedicatedCloudNode or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudNode or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CSRPErrorException` + """ + # 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'), + 'dedicatedCloudNodeName': self._serialize.url("dedicated_cloud_node_name", dedicated_cloud_node_name, 'str', pattern=r'^[-a-zA-Z0-9]+$') + } + 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.CSRPErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DedicatedCloudNode', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}'} + + + def _create_or_update_initial( + self, resource_group_name, dedicated_cloud_node_name, dedicated_cloud_node_request, 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'), + 'dedicatedCloudNodeName': self._serialize.url("dedicated_cloud_node_name", dedicated_cloud_node_name, 'str', pattern=r'^[-a-zA-Z0-9]+$') + } + 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) + header_parameters['Referer'] = self._serialize.header("self.config.referer", self.config.referer, 'str') + 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(dedicated_cloud_node_request, 'DedicatedCloudNode') + + # 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]: + raise models.CSRPErrorException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('DedicatedCloudNode', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'int', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, dedicated_cloud_node_name, dedicated_cloud_node_request, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements dedicated cloud node PUT method. + + Returns dedicated cloud node by its name. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param dedicated_cloud_node_name: dedicated cloud node name + :type dedicated_cloud_node_name: str + :param dedicated_cloud_node_request: Create Dedicated Cloud Node + request + :type dedicated_cloud_node_request: + ~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudNode + :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 DedicatedCloudNode or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudNode] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudNode]] + :raises: + :class:`CSRPErrorException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + dedicated_cloud_node_name=dedicated_cloud_node_name, + dedicated_cloud_node_request=dedicated_cloud_node_request, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'int', + } + deserialized = self._deserialize('DedicatedCloudNode', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + 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.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}'} + + def delete( + self, resource_group_name, dedicated_cloud_node_name, custom_headers=None, raw=False, **operation_config): + """Implements dedicated cloud node DELETE method. + + Delete dedicated cloud node. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param dedicated_cloud_node_name: dedicated cloud node name + :type dedicated_cloud_node_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CSRPErrorException` + """ + # 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'), + 'dedicatedCloudNodeName': self._serialize.url("dedicated_cloud_node_name", dedicated_cloud_node_name, 'str', pattern=r'^[-a-zA-Z0-9]+$') + } + 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 [204]: + raise models.CSRPErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Content-Type': 'str', + }) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}'} + + def update( + self, resource_group_name, dedicated_cloud_node_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Implements dedicated cloud node PATCH method. + + Patches dedicated node properties. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param dedicated_cloud_node_name: dedicated cloud node name + :type dedicated_cloud_node_name: str + :param tags: The tags key:value pairs + :type tags: dict[str, 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: DedicatedCloudNode or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudNode or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CSRPErrorException` + """ + dedicated_cloud_node_request = models.PatchPayload(tags=tags) + + # 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'), + 'dedicatedCloudNodeName': self._serialize.url("dedicated_cloud_node_name", dedicated_cloud_node_name, 'str', pattern=r'^[-a-zA-Z0-9]+$') + } + 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(dedicated_cloud_node_request, 'PatchPayload') + + # 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]: + raise models.CSRPErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DedicatedCloudNode', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudNodes/{dedicatedCloudNodeName}'} diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_dedicated_cloud_services_operations.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_dedicated_cloud_services_operations.py new file mode 100644 index 000000000000..de6a56d3617c --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_dedicated_cloud_services_operations.py @@ -0,0 +1,492 @@ +# 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 DedicatedCloudServicesOperations(object): + """DedicatedCloudServicesOperations 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: Client API version. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list_by_subscription( + self, filter=None, top=None, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Implements list of dedicatedCloudService objects within subscription + method. + + Returns list of dedicated cloud services within a subscription. + + :param filter: The filter to apply on the list operation + :type filter: str + :param top: The maximum number of record sets to return + :type top: int + :param skip_token: to be used by nextLink implementation + :type skip_token: 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 DedicatedCloudService + :rtype: + ~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudServicePaged[~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudService] + :raises: + :class:`CSRPErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.CSRPErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DedicatedCloudServicePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices'} + + def list_by_resource_group( + self, resource_group_name, filter=None, top=None, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Implements list of dedicatedCloudService objects within RG method. + + Returns list of dedicated cloud services within a resource group. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param filter: The filter to apply on the list operation + :type filter: str + :param top: The maximum number of record sets to return + :type top: int + :param skip_token: to be used by nextLink implementation + :type skip_token: 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 DedicatedCloudService + :rtype: + ~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudServicePaged[~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudService] + :raises: + :class:`CSRPErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.CSRPErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DedicatedCloudServicePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices'} + + def get( + self, resource_group_name, dedicated_cloud_service_name, custom_headers=None, raw=False, **operation_config): + """Implements dedicatedCloudService GET method. + + Returns Dedicate Cloud Service. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param dedicated_cloud_service_name: dedicated cloud Service name + :type dedicated_cloud_service_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: DedicatedCloudService or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudService or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CSRPErrorException` + """ + # 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'), + 'dedicatedCloudServiceName': self._serialize.url("dedicated_cloud_service_name", dedicated_cloud_service_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.CSRPErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DedicatedCloudService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}'} + + def create_or_update( + self, resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers=None, raw=False, **operation_config): + """Implements dedicated cloud service PUT method. + + Create dedicate cloud service. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param dedicated_cloud_service_name: dedicated cloud Service name + :type dedicated_cloud_service_name: str + :param dedicated_cloud_service_request: Create Dedicated Cloud Service + request + :type dedicated_cloud_service_request: + ~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudService + :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: DedicatedCloudService or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudService or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CSRPErrorException` + """ + # 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'), + 'dedicatedCloudServiceName': self._serialize.url("dedicated_cloud_service_name", dedicated_cloud_service_name, 'str', pattern=r'^[-a-zA-Z0-9]+$') + } + 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(dedicated_cloud_service_request, 'DedicatedCloudService') + + # 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]: + raise models.CSRPErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DedicatedCloudService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}'} + + + def _delete_initial( + self, resource_group_name, dedicated_cloud_service_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'), + 'dedicatedCloudServiceName': self._serialize.url("dedicated_cloud_service_name", dedicated_cloud_service_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 [204]: + raise models.CSRPErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Content-Type': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def delete( + self, resource_group_name, dedicated_cloud_service_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements dedicatedCloudService DELETE method. + + Delete dedicate cloud service. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param dedicated_cloud_service_name: dedicated cloud service name + :type dedicated_cloud_service_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:`CSRPErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + dedicated_cloud_service_name=dedicated_cloud_service_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Content-Type': 'str', + }) + 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.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}'} + + def update( + self, resource_group_name, dedicated_cloud_service_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Implements dedicatedCloudService PATCH method. + + Patch dedicated cloud service's properties. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param dedicated_cloud_service_name: dedicated cloud service name + :type dedicated_cloud_service_name: str + :param tags: The tags key:value pairs + :type tags: dict[str, 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: DedicatedCloudService or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmwarecloudsimple.models.DedicatedCloudService or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CSRPErrorException` + """ + dedicated_cloud_service_request = models.PatchPayload(tags=tags) + + # 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'), + 'dedicatedCloudServiceName': self._serialize.url("dedicated_cloud_service_name", dedicated_cloud_service_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(dedicated_cloud_service_request, 'PatchPayload') + + # 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]: + raise models.CSRPErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DedicatedCloudService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}'} diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_operations.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_operations.py new file mode 100644 index 000000000000..9b9294fab4e6 --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_operations.py @@ -0,0 +1,172 @@ +# 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: Client API version. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Implements list of available operations. + + Return list of 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 AvailableOperation + :rtype: + ~azure.mgmt.vmwarecloudsimple.models.AvailableOperationPaged[~azure.mgmt.vmwarecloudsimple.models.AvailableOperation] + :raises: + :class:`CSRPErrorException` + """ + 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.CSRPErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AvailableOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.VMwareCloudSimple/operations'} + + def get( + self, region_id, operation_id, custom_headers=None, raw=False, **operation_config): + """Implements get of async operation. + + Return an async operation. + + :param region_id: The region Id (westus, eastus) + :type region_id: str + :param operation_id: operation id + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmwarecloudsimple.models.OperationResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CSRPErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'regionId': self._serialize.url("region_id", region_id, 'str'), + 'operationId': self._serialize.url("operation_id", operation_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') + + # 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) + header_parameters['Referer'] = self._serialize.header("self.config.referer", self.config.referer, 'str') + 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, 202, 204]: + raise models.CSRPErrorException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResource', response) + header_dict = { + 'Location': 'str', + 'Retry-After': 'int', + 'Content-Type': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/operationResults/{operationId}'} diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_private_clouds_operations.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_private_clouds_operations.py new file mode 100644 index 000000000000..f80634b07173 --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_private_clouds_operations.py @@ -0,0 +1,171 @@ +# 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 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: Client API version. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, region_id, custom_headers=None, raw=False, **operation_config): + """Implements private cloud list GET method. + + Returns list of private clouds in particular region. + + :param region_id: The region Id (westus, eastus) + :type region_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PrivateCloud + :rtype: + ~azure.mgmt.vmwarecloudsimple.models.PrivateCloudPaged[~azure.mgmt.vmwarecloudsimple.models.PrivateCloud] + :raises: + :class:`CSRPErrorException` + """ + 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'), + 'regionId': self._serialize.url("region_id", region_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.CSRPErrorException(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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds'} + + def get( + self, pc_name, region_id, custom_headers=None, raw=False, **operation_config): + """Implements private cloud GET method. + + Returns private cloud by its name. + + :param pc_name: The private cloud name + :type pc_name: str + :param region_id: The region Id (westus, eastus) + :type region_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PrivateCloud or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmwarecloudsimple.models.PrivateCloud or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CSRPErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'pcName': self._serialize.url("pc_name", pc_name, 'str'), + 'regionId': self._serialize.url("region_id", region_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') + + # 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.CSRPErrorException(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}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}'} diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_resource_pools_operations.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_resource_pools_operations.py new file mode 100644 index 000000000000..ceca6e198b60 --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_resource_pools_operations.py @@ -0,0 +1,177 @@ +# 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 ResourcePoolsOperations(object): + """ResourcePoolsOperations 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: Client API version. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, region_id, pc_name, custom_headers=None, raw=False, **operation_config): + """Implements get of resource pools list. + + Returns list of resource pools in region for private cloud. + + :param region_id: The region Id (westus, eastus) + :type region_id: str + :param pc_name: The private cloud name + :type pc_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 ResourcePool + :rtype: + ~azure.mgmt.vmwarecloudsimple.models.ResourcePoolPaged[~azure.mgmt.vmwarecloudsimple.models.ResourcePool] + :raises: + :class:`CSRPErrorException` + """ + 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'), + 'regionId': self._serialize.url("region_id", region_id, 'str'), + 'pcName': self._serialize.url("pc_name", pc_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.CSRPErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ResourcePoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/resourcePools'} + + def get( + self, region_id, pc_name, resource_pool_name, custom_headers=None, raw=False, **operation_config): + """Implements get of resource pool. + + Returns resource pool templates by its name. + + :param region_id: The region Id (westus, eastus) + :type region_id: str + :param pc_name: The private cloud name + :type pc_name: str + :param resource_pool_name: resource pool id (vsphereId) + :type resource_pool_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: ResourcePool or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmwarecloudsimple.models.ResourcePool or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CSRPErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'regionId': self._serialize.url("region_id", region_id, 'str'), + 'pcName': self._serialize.url("pc_name", pc_name, 'str'), + 'resourcePoolName': self._serialize.url("resource_pool_name", resource_pool_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.CSRPErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ResourcePool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/resourcePools/{resourcePoolName}'} diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_skus_availability_operations.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_skus_availability_operations.py new file mode 100644 index 000000000000..b9a93daa08e8 --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_skus_availability_operations.py @@ -0,0 +1,114 @@ +# 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 SkusAvailabilityOperations(object): + """SkusAvailabilityOperations 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: Client API version. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, region_id, sku_id=None, custom_headers=None, raw=False, **operation_config): + """Implements SkuAvailability List method. + + Returns list of available resources in region. + + :param region_id: The region Id (westus, eastus) + :type region_id: str + :param sku_id: sku id, if no sku is passed availability for all skus + will be returned + :type sku_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SkuAvailability + :rtype: + ~azure.mgmt.vmwarecloudsimple.models.SkuAvailabilityPaged[~azure.mgmt.vmwarecloudsimple.models.SkuAvailability] + :raises: + :class:`CSRPErrorException` + """ + 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'), + 'regionId': self._serialize.url("region_id", region_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if sku_id is not None: + query_parameters['skuId'] = self._serialize.query("sku_id", sku_id, 'str') + 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.CSRPErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SkuAvailabilityPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/availabilities'} diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_usages_operations.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_usages_operations.py new file mode 100644 index 000000000000..2f480f803d43 --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_usages_operations.py @@ -0,0 +1,115 @@ +# 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 UsagesOperations(object): + """UsagesOperations 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: Client API version. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, region_id, filter=None, custom_headers=None, raw=False, **operation_config): + """Implements Usages List method. + + Returns list of usage in region. + + :param region_id: The region Id (westus, eastus) + :type region_id: str + :param filter: The filter to apply on the list operation. only + name.value is allowed here as a filter e.g. $filter=name.value eq + 'xxxx' + :type filter: 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 Usage + :rtype: + ~azure.mgmt.vmwarecloudsimple.models.UsagePaged[~azure.mgmt.vmwarecloudsimple.models.Usage] + :raises: + :class:`CSRPErrorException` + """ + 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'), + 'regionId': self._serialize.url("region_id", region_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + 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.CSRPErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/usages'} diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_virtual_machine_templates_operations.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_virtual_machine_templates_operations.py new file mode 100644 index 000000000000..5a93b4e251af --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_virtual_machine_templates_operations.py @@ -0,0 +1,182 @@ +# 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 VirtualMachineTemplatesOperations(object): + """VirtualMachineTemplatesOperations 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: Client API version. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, pc_name, region_id, resource_pool_name, custom_headers=None, raw=False, **operation_config): + """Implements list of available VM templates. + + Returns list of virtual machine templates in region for private cloud. + + :param pc_name: The private cloud name + :type pc_name: str + :param region_id: The region Id (westus, eastus) + :type region_id: str + :param resource_pool_name: Resource pool used to derive vSphere + cluster which contains VM templates + :type resource_pool_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 VirtualMachineTemplate + :rtype: + ~azure.mgmt.vmwarecloudsimple.models.VirtualMachineTemplatePaged[~azure.mgmt.vmwarecloudsimple.models.VirtualMachineTemplate] + :raises: + :class:`CSRPErrorException` + """ + 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'), + 'pcName': self._serialize.url("pc_name", pc_name, 'str'), + 'regionId': self._serialize.url("region_id", region_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') + query_parameters['resourcePoolName'] = self._serialize.query("resource_pool_name", resource_pool_name, '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.CSRPErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.VirtualMachineTemplatePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualMachineTemplates'} + + def get( + self, region_id, pc_name, virtual_machine_template_name, custom_headers=None, raw=False, **operation_config): + """Implements virtual machine template GET method. + + Returns virtual machine templates by its name. + + :param region_id: The region Id (westus, eastus) + :type region_id: str + :param pc_name: The private cloud name + :type pc_name: str + :param virtual_machine_template_name: virtual machine template id + (vsphereId) + :type virtual_machine_template_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: VirtualMachineTemplate or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmwarecloudsimple.models.VirtualMachineTemplate or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CSRPErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'regionId': self._serialize.url("region_id", region_id, 'str'), + 'pcName': self._serialize.url("pc_name", pc_name, 'str'), + 'virtualMachineTemplateName': self._serialize.url("virtual_machine_template_name", virtual_machine_template_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.CSRPErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachineTemplate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualMachineTemplates/{virtualMachineTemplateName}'} diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_virtual_machines_operations.py new file mode 100644 index 000000000000..d03d240726fd --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_virtual_machines_operations.py @@ -0,0 +1,790 @@ +# 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 VirtualMachinesOperations(object): + """VirtualMachinesOperations 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: Client API version. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list_by_subscription( + self, filter=None, top=None, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Implements list virtual machine within subscription method. + + Returns list virtual machine within subscription. + + :param filter: The filter to apply on the list operation + :type filter: str + :param top: The maximum number of record sets to return + :type top: int + :param skip_token: to be used by nextLink implementation + :type skip_token: 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 VirtualMachine + :rtype: + ~azure.mgmt.vmwarecloudsimple.models.VirtualMachinePaged[~azure.mgmt.vmwarecloudsimple.models.VirtualMachine] + :raises: + :class:`CSRPErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.CSRPErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.VirtualMachinePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/virtualMachines'} + + def list_by_resource_group( + self, resource_group_name, filter=None, top=None, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Implements list virtual machine within RG method. + + Returns list of virtual machine within resource group. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param filter: The filter to apply on the list operation + :type filter: str + :param top: The maximum number of record sets to return + :type top: int + :param skip_token: to be used by nextLink implementation + :type skip_token: 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 VirtualMachine + :rtype: + ~azure.mgmt.vmwarecloudsimple.models.VirtualMachinePaged[~azure.mgmt.vmwarecloudsimple.models.VirtualMachine] + :raises: + :class:`CSRPErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.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') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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.CSRPErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.VirtualMachinePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines'} + + def get( + self, resource_group_name, virtual_machine_name, custom_headers=None, raw=False, **operation_config): + """Implements virtual machine GET method. + + Get virtual machine. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param virtual_machine_name: virtual machine name + :type virtual_machine_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: VirtualMachine or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmwarecloudsimple.models.VirtualMachine or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CSRPErrorException` + """ + # 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'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_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.CSRPErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}'} + + + def _create_or_update_initial( + self, resource_group_name, virtual_machine_name, virtual_machine_request, 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'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str', pattern=r'^[-a-zA-Z0-9]+$') + } + 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) + header_parameters['Referer'] = self._serialize.header("self.config.referer", self.config.referer, 'str') + 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(virtual_machine_request, 'VirtualMachine') + + # 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.CSRPErrorException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachine', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + if response.status_code == 201: + deserialized = self._deserialize('VirtualMachine', response) + header_dict = { + 'Azure-AsyncOperation': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, virtual_machine_name, virtual_machine_request, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements virtual machine PUT method. + + Create Or Update Virtual Machine. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param virtual_machine_name: virtual machine name + :type virtual_machine_name: str + :param virtual_machine_request: Create or Update Virtual Machine + request + :type virtual_machine_request: + ~azure.mgmt.vmwarecloudsimple.models.VirtualMachine + :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 VirtualMachine or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.vmwarecloudsimple.models.VirtualMachine] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.vmwarecloudsimple.models.VirtualMachine]] + :raises: + :class:`CSRPErrorException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + virtual_machine_request=virtual_machine_request, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'Azure-AsyncOperation': 'str', + } + deserialized = self._deserialize('VirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + 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.VMwareCloudSimple/virtualMachines/{virtualMachineName}'} + + + def _delete_initial( + self, resource_group_name, virtual_machine_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'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_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) + header_parameters['Referer'] = self._serialize.header("self.config.referer", self.config.referer, 'str') + 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 [202, 204]: + raise models.CSRPErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'int', + 'Content-Type': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def delete( + self, resource_group_name, virtual_machine_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements virtual machine DELETE method. + + Delete virtual machine. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param virtual_machine_name: virtual machine name + :type virtual_machine_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:`CSRPErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'int', + 'Content-Type': 'str', + }) + 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.VMwareCloudSimple/virtualMachines/{virtualMachineName}'} + + + def _update_initial( + self, resource_group_name, virtual_machine_name, tags=None, custom_headers=None, raw=False, **operation_config): + virtual_machine_request = models.PatchPayload(tags=tags) + + # 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'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_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(virtual_machine_request, 'PatchPayload') + + # 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]: + raise models.CSRPErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, virtual_machine_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements virtual machine PATCH method. + + Patch virtual machine properties. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param virtual_machine_name: virtual machine name + :type virtual_machine_name: str + :param tags: The tags key:value pairs + :type tags: dict[str, 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 VirtualMachine or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.vmwarecloudsimple.models.VirtualMachine] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.vmwarecloudsimple.models.VirtualMachine]] + :raises: + :class:`CSRPErrorException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('VirtualMachine', 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.VMwareCloudSimple/virtualMachines/{virtualMachineName}'} + + + def _start_initial( + self, resource_group_name, virtual_machine_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start.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'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_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) + header_parameters['Referer'] = self._serialize.header("self.config.referer", self.config.referer, 'str') + 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, 202]: + raise models.CSRPErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'int', + 'Content-Type': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def start( + self, resource_group_name, virtual_machine_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements a start method for a virtual machine. + + Power on virtual machine. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param virtual_machine_name: virtual machine name + :type virtual_machine_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:`CSRPErrorException` + """ + raw_result = self._start_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'int', + 'Content-Type': 'str', + }) + 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) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}/start'} + + + def _stop_initial( + self, resource_group_name, virtual_machine_name, mode=None, mode1=None, custom_headers=None, raw=False, **operation_config): + m = None + if mode1 is not None: + m = models.VirtualMachineStopMode(mode=mode1) + + # Construct URL + url = self.stop.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'), + 'virtualMachineName': self._serialize.url("virtual_machine_name", virtual_machine_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if mode is not None: + query_parameters['mode'] = self._serialize.query("mode", mode, 'StopMode') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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) + header_parameters['Referer'] = self._serialize.header("self.config.referer", self.config.referer, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if m is not None: + body_content = self._serialize.body(m, 'VirtualMachineStopMode') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.CSRPErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + header_dict = { + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'int', + 'Content-Type': 'str', + } + client_raw_response.add_headers(header_dict) + return client_raw_response + + def stop( + self, resource_group_name, virtual_machine_name, mode=None, mode1=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Implements shutdown, poweroff, and suspend method for a virtual + machine. + + Power off virtual machine, options: shutdown, poweroff, and suspend. + + :param resource_group_name: The name of the resource group + :type resource_group_name: str + :param virtual_machine_name: virtual machine name + :type virtual_machine_name: str + :param mode: query stop mode parameter (reboot, shutdown, etc...). + Possible values include: 'reboot', 'suspend', 'shutdown', 'poweroff' + :type mode: str or ~azure.mgmt.vmwarecloudsimple.models.StopMode + :param mode1: mode indicates a type of stop operation - reboot, + suspend, shutdown or power-off. Possible values include: 'reboot', + 'suspend', 'shutdown', 'poweroff' + :type mode1: str or ~azure.mgmt.vmwarecloudsimple.models.StopMode + :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:`CSRPErrorException` + """ + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + virtual_machine_name=virtual_machine_name, + mode=mode, + mode1=mode1, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Azure-AsyncOperation': 'str', + 'Location': 'str', + 'Retry-After': 'int', + 'Content-Type': 'str', + }) + 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) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/virtualMachines/{virtualMachineName}/stop'} diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_virtual_networks_operations.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_virtual_networks_operations.py new file mode 100644 index 000000000000..b3b593b23be4 --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/operations/_virtual_networks_operations.py @@ -0,0 +1,182 @@ +# 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 VirtualNetworksOperations(object): + """VirtualNetworksOperations 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: Client API version. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list( + self, region_id, pc_name, resource_pool_name, custom_headers=None, raw=False, **operation_config): + """Implements list available virtual networks within a subscription + method. + + Return list of virtual networks in location for private cloud. + + :param region_id: The region Id (westus, eastus) + :type region_id: str + :param pc_name: The private cloud name + :type pc_name: str + :param resource_pool_name: Resource pool used to derive vSphere + cluster which contains virtual networks + :type resource_pool_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 VirtualNetwork + :rtype: + ~azure.mgmt.vmwarecloudsimple.models.VirtualNetworkPaged[~azure.mgmt.vmwarecloudsimple.models.VirtualNetwork] + :raises: + :class:`CSRPErrorException` + """ + 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'), + 'regionId': self._serialize.url("region_id", region_id, 'str'), + 'pcName': self._serialize.url("pc_name", pc_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['resourcePoolName'] = self._serialize.query("resource_pool_name", resource_pool_name, '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.CSRPErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.VirtualNetworkPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualNetworks'} + + def get( + self, region_id, pc_name, virtual_network_name, custom_headers=None, raw=False, **operation_config): + """Implements virtual network GET method. + + Return virtual network by its name. + + :param region_id: The region Id (westus, eastus) + :type region_id: str + :param pc_name: The private cloud name + :type pc_name: str + :param virtual_network_name: virtual network id (vsphereId) + :type virtual_network_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: VirtualNetwork or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.vmwarecloudsimple.models.VirtualNetwork or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`CSRPErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'regionId': self._serialize.url("region_id", region_id, 'str'), + 'pcName': self._serialize.url("pc_name", pc_name, 'str'), + 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_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.CSRPErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VirtualNetwork', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/virtualNetworks/{virtualNetworkName}'} diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/version.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/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-vmwarecloudsimple/sdk_packaging.toml b/sdk/compute/azure-mgmt-vmwarecloudsimple/sdk_packaging.toml new file mode 100644 index 000000000000..78f8cf58c2f5 --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-vmwarecloudsimple" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/setup.cfg b/sdk/compute/azure-mgmt-vmwarecloudsimple/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/compute/azure-mgmt-vmwarecloudsimple/setup.py b/sdk/compute/azure-mgmt-vmwarecloudsimple/setup.py new file mode 100644 index 000000000000..8cd9291dd9e8 --- /dev/null +++ b/sdk/compute/azure-mgmt-vmwarecloudsimple/setup.py @@ -0,0 +1,87 @@ +#!/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-vmwarecloudsimple" +PACKAGE_PPRINT_NAME = "MyService 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'), '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.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', + 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', + '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'], + } +)