|
| 1 | +# coding=utf-8 |
| 2 | +# -------------------------------------------------------------------------- |
| 3 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 4 | +# Licensed under the MIT License. See License.txt in the project root for license information. |
| 5 | +# Code generated by Microsoft (R) AutoRest Code Generator. |
| 6 | +# Changes may cause incorrect behavior and will be lost if the code is regenerated. |
| 7 | +# -------------------------------------------------------------------------- |
| 8 | + |
| 9 | +from typing import TYPE_CHECKING |
| 10 | + |
| 11 | +from azure.mgmt.core import ARMPipelineClient |
| 12 | +from msrest import Deserializer, Serializer |
| 13 | + |
| 14 | +if TYPE_CHECKING: |
| 15 | + # pylint: disable=unused-import,ungrouped-imports |
| 16 | + from typing import Any, Optional |
| 17 | + |
| 18 | + from azure.core.credentials import TokenCredential |
| 19 | + from azure.core.pipeline.transport import HttpRequest, HttpResponse |
| 20 | + |
| 21 | +from ._configuration import AzureArcVMwareManagementServiceAPIConfiguration |
| 22 | +from .operations import Operations |
| 23 | +from .operations import ResourcePoolsOperations |
| 24 | +from .operations import ClustersOperations |
| 25 | +from .operations import HostsOperations |
| 26 | +from .operations import DatastoresOperations |
| 27 | +from .operations import VCentersOperations |
| 28 | +from .operations import VirtualMachinesOperations |
| 29 | +from .operations import VirtualMachineTemplatesOperations |
| 30 | +from .operations import VirtualNetworksOperations |
| 31 | +from .operations import InventoryItemsOperations |
| 32 | +from .operations import HybridIdentityMetadataOperations |
| 33 | +from .operations import MachineExtensionsOperations |
| 34 | +from .operations import GuestAgentsOperations |
| 35 | +from . import models |
| 36 | + |
| 37 | + |
| 38 | +class AzureArcVMwareManagementServiceAPI(object): |
| 39 | + """Self service experience for VMware. |
| 40 | +
|
| 41 | + :ivar operations: Operations operations |
| 42 | + :vartype operations: azure.mgmt.connectedvmware.operations.Operations |
| 43 | + :ivar resource_pools: ResourcePoolsOperations operations |
| 44 | + :vartype resource_pools: azure.mgmt.connectedvmware.operations.ResourcePoolsOperations |
| 45 | + :ivar clusters: ClustersOperations operations |
| 46 | + :vartype clusters: azure.mgmt.connectedvmware.operations.ClustersOperations |
| 47 | + :ivar hosts: HostsOperations operations |
| 48 | + :vartype hosts: azure.mgmt.connectedvmware.operations.HostsOperations |
| 49 | + :ivar datastores: DatastoresOperations operations |
| 50 | + :vartype datastores: azure.mgmt.connectedvmware.operations.DatastoresOperations |
| 51 | + :ivar vcenters: VCentersOperations operations |
| 52 | + :vartype vcenters: azure.mgmt.connectedvmware.operations.VCentersOperations |
| 53 | + :ivar virtual_machines: VirtualMachinesOperations operations |
| 54 | + :vartype virtual_machines: azure.mgmt.connectedvmware.operations.VirtualMachinesOperations |
| 55 | + :ivar virtual_machine_templates: VirtualMachineTemplatesOperations operations |
| 56 | + :vartype virtual_machine_templates: azure.mgmt.connectedvmware.operations.VirtualMachineTemplatesOperations |
| 57 | + :ivar virtual_networks: VirtualNetworksOperations operations |
| 58 | + :vartype virtual_networks: azure.mgmt.connectedvmware.operations.VirtualNetworksOperations |
| 59 | + :ivar inventory_items: InventoryItemsOperations operations |
| 60 | + :vartype inventory_items: azure.mgmt.connectedvmware.operations.InventoryItemsOperations |
| 61 | + :ivar hybrid_identity_metadata: HybridIdentityMetadataOperations operations |
| 62 | + :vartype hybrid_identity_metadata: azure.mgmt.connectedvmware.operations.HybridIdentityMetadataOperations |
| 63 | + :ivar machine_extensions: MachineExtensionsOperations operations |
| 64 | + :vartype machine_extensions: azure.mgmt.connectedvmware.operations.MachineExtensionsOperations |
| 65 | + :ivar guest_agents: GuestAgentsOperations operations |
| 66 | + :vartype guest_agents: azure.mgmt.connectedvmware.operations.GuestAgentsOperations |
| 67 | + :param credential: Credential needed for the client to connect to Azure. |
| 68 | + :type credential: ~azure.core.credentials.TokenCredential |
| 69 | + :param subscription_id: The Subscription ID. |
| 70 | + :type subscription_id: str |
| 71 | + :param str base_url: Service URL |
| 72 | + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. |
| 73 | + """ |
| 74 | + |
| 75 | + def __init__( |
| 76 | + self, |
| 77 | + credential, # type: "TokenCredential" |
| 78 | + subscription_id, # type: str |
| 79 | + base_url=None, # type: Optional[str] |
| 80 | + **kwargs # type: Any |
| 81 | + ): |
| 82 | + # type: (...) -> None |
| 83 | + if not base_url: |
| 84 | + base_url = 'https://management.azure.com' |
| 85 | + self._config = AzureArcVMwareManagementServiceAPIConfiguration(credential, subscription_id, **kwargs) |
| 86 | + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) |
| 87 | + |
| 88 | + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} |
| 89 | + self._serialize = Serializer(client_models) |
| 90 | + self._serialize.client_side_validation = False |
| 91 | + self._deserialize = Deserializer(client_models) |
| 92 | + |
| 93 | + self.operations = Operations( |
| 94 | + self._client, self._config, self._serialize, self._deserialize) |
| 95 | + self.resource_pools = ResourcePoolsOperations( |
| 96 | + self._client, self._config, self._serialize, self._deserialize) |
| 97 | + self.clusters = ClustersOperations( |
| 98 | + self._client, self._config, self._serialize, self._deserialize) |
| 99 | + self.hosts = HostsOperations( |
| 100 | + self._client, self._config, self._serialize, self._deserialize) |
| 101 | + self.datastores = DatastoresOperations( |
| 102 | + self._client, self._config, self._serialize, self._deserialize) |
| 103 | + self.vcenters = VCentersOperations( |
| 104 | + self._client, self._config, self._serialize, self._deserialize) |
| 105 | + self.virtual_machines = VirtualMachinesOperations( |
| 106 | + self._client, self._config, self._serialize, self._deserialize) |
| 107 | + self.virtual_machine_templates = VirtualMachineTemplatesOperations( |
| 108 | + self._client, self._config, self._serialize, self._deserialize) |
| 109 | + self.virtual_networks = VirtualNetworksOperations( |
| 110 | + self._client, self._config, self._serialize, self._deserialize) |
| 111 | + self.inventory_items = InventoryItemsOperations( |
| 112 | + self._client, self._config, self._serialize, self._deserialize) |
| 113 | + self.hybrid_identity_metadata = HybridIdentityMetadataOperations( |
| 114 | + self._client, self._config, self._serialize, self._deserialize) |
| 115 | + self.machine_extensions = MachineExtensionsOperations( |
| 116 | + self._client, self._config, self._serialize, self._deserialize) |
| 117 | + self.guest_agents = GuestAgentsOperations( |
| 118 | + self._client, self._config, self._serialize, self._deserialize) |
| 119 | + |
| 120 | + def _send_request(self, http_request, **kwargs): |
| 121 | + # type: (HttpRequest, Any) -> HttpResponse |
| 122 | + """Runs the network request through the client's chained policies. |
| 123 | +
|
| 124 | + :param http_request: The network request you want to make. Required. |
| 125 | + :type http_request: ~azure.core.pipeline.transport.HttpRequest |
| 126 | + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. |
| 127 | + :return: The response of your network call. Does not do error handling on your response. |
| 128 | + :rtype: ~azure.core.pipeline.transport.HttpResponse |
| 129 | + """ |
| 130 | + path_format_arguments = { |
| 131 | + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), |
| 132 | + } |
| 133 | + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) |
| 134 | + stream = kwargs.pop("stream", True) |
| 135 | + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) |
| 136 | + return pipeline_response.http_response |
| 137 | + |
| 138 | + def close(self): |
| 139 | + # type: () -> None |
| 140 | + self._client.close() |
| 141 | + |
| 142 | + def __enter__(self): |
| 143 | + # type: () -> AzureArcVMwareManagementServiceAPI |
| 144 | + self._client.__enter__() |
| 145 | + return self |
| 146 | + |
| 147 | + def __exit__(self, *exc_details): |
| 148 | + # type: (Any) -> None |
| 149 | + self._client.__exit__(*exc_details) |
0 commit comments