|
| 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 | + |
| 20 | +from ._configuration import ComputeManagementClientConfiguration |
| 21 | +from .operations import Operations |
| 22 | +from .operations import AvailabilitySetsOperations |
| 23 | +from .operations import ProximityPlacementGroupsOperations |
| 24 | +from .operations import DedicatedHostGroupsOperations |
| 25 | +from .operations import DedicatedHostsOperations |
| 26 | +from .operations import SshPublicKeysOperations |
| 27 | +from .operations import VirtualMachineExtensionImagesOperations |
| 28 | +from .operations import VirtualMachineExtensionsOperations |
| 29 | +from .operations import VirtualMachineImagesOperations |
| 30 | +from .operations import VirtualMachineImagesEdgeZoneOperations |
| 31 | +from .operations import UsageOperations |
| 32 | +from .operations import VirtualMachinesOperations |
| 33 | +from .operations import VirtualMachineScaleSetsOperations |
| 34 | +from .operations import VirtualMachineSizesOperations |
| 35 | +from .operations import ImagesOperations |
| 36 | +from .operations import VirtualMachineScaleSetExtensionsOperations |
| 37 | +from .operations import VirtualMachineScaleSetRollingUpgradesOperations |
| 38 | +from .operations import VirtualMachineScaleSetVMExtensionsOperations |
| 39 | +from .operations import VirtualMachineScaleSetVMsOperations |
| 40 | +from .operations import LogAnalyticsOperations |
| 41 | +from .operations import VirtualMachineRunCommandsOperations |
| 42 | +from .operations import VirtualMachineScaleSetVMRunCommandsOperations |
| 43 | +from . import models |
| 44 | + |
| 45 | + |
| 46 | +class ComputeManagementClient(object): |
| 47 | + """Compute Client. |
| 48 | +
|
| 49 | + :ivar operations: Operations operations |
| 50 | + :vartype operations: azure.mgmt.compute.v2020_12_01.operations.Operations |
| 51 | + :ivar availability_sets: AvailabilitySetsOperations operations |
| 52 | + :vartype availability_sets: azure.mgmt.compute.v2020_12_01.operations.AvailabilitySetsOperations |
| 53 | + :ivar proximity_placement_groups: ProximityPlacementGroupsOperations operations |
| 54 | + :vartype proximity_placement_groups: azure.mgmt.compute.v2020_12_01.operations.ProximityPlacementGroupsOperations |
| 55 | + :ivar dedicated_host_groups: DedicatedHostGroupsOperations operations |
| 56 | + :vartype dedicated_host_groups: azure.mgmt.compute.v2020_12_01.operations.DedicatedHostGroupsOperations |
| 57 | + :ivar dedicated_hosts: DedicatedHostsOperations operations |
| 58 | + :vartype dedicated_hosts: azure.mgmt.compute.v2020_12_01.operations.DedicatedHostsOperations |
| 59 | + :ivar ssh_public_keys: SshPublicKeysOperations operations |
| 60 | + :vartype ssh_public_keys: azure.mgmt.compute.v2020_12_01.operations.SshPublicKeysOperations |
| 61 | + :ivar virtual_machine_extension_images: VirtualMachineExtensionImagesOperations operations |
| 62 | + :vartype virtual_machine_extension_images: azure.mgmt.compute.v2020_12_01.operations.VirtualMachineExtensionImagesOperations |
| 63 | + :ivar virtual_machine_extensions: VirtualMachineExtensionsOperations operations |
| 64 | + :vartype virtual_machine_extensions: azure.mgmt.compute.v2020_12_01.operations.VirtualMachineExtensionsOperations |
| 65 | + :ivar virtual_machine_images: VirtualMachineImagesOperations operations |
| 66 | + :vartype virtual_machine_images: azure.mgmt.compute.v2020_12_01.operations.VirtualMachineImagesOperations |
| 67 | + :ivar virtual_machine_images_edge_zone: VirtualMachineImagesEdgeZoneOperations operations |
| 68 | + :vartype virtual_machine_images_edge_zone: azure.mgmt.compute.v2020_12_01.operations.VirtualMachineImagesEdgeZoneOperations |
| 69 | + :ivar usage: UsageOperations operations |
| 70 | + :vartype usage: azure.mgmt.compute.v2020_12_01.operations.UsageOperations |
| 71 | + :ivar virtual_machines: VirtualMachinesOperations operations |
| 72 | + :vartype virtual_machines: azure.mgmt.compute.v2020_12_01.operations.VirtualMachinesOperations |
| 73 | + :ivar virtual_machine_scale_sets: VirtualMachineScaleSetsOperations operations |
| 74 | + :vartype virtual_machine_scale_sets: azure.mgmt.compute.v2020_12_01.operations.VirtualMachineScaleSetsOperations |
| 75 | + :ivar virtual_machine_sizes: VirtualMachineSizesOperations operations |
| 76 | + :vartype virtual_machine_sizes: azure.mgmt.compute.v2020_12_01.operations.VirtualMachineSizesOperations |
| 77 | + :ivar images: ImagesOperations operations |
| 78 | + :vartype images: azure.mgmt.compute.v2020_12_01.operations.ImagesOperations |
| 79 | + :ivar virtual_machine_scale_set_extensions: VirtualMachineScaleSetExtensionsOperations operations |
| 80 | + :vartype virtual_machine_scale_set_extensions: azure.mgmt.compute.v2020_12_01.operations.VirtualMachineScaleSetExtensionsOperations |
| 81 | + :ivar virtual_machine_scale_set_rolling_upgrades: VirtualMachineScaleSetRollingUpgradesOperations operations |
| 82 | + :vartype virtual_machine_scale_set_rolling_upgrades: azure.mgmt.compute.v2020_12_01.operations.VirtualMachineScaleSetRollingUpgradesOperations |
| 83 | + :ivar virtual_machine_scale_set_vm_extensions: VirtualMachineScaleSetVMExtensionsOperations operations |
| 84 | + :vartype virtual_machine_scale_set_vm_extensions: azure.mgmt.compute.v2020_12_01.operations.VirtualMachineScaleSetVMExtensionsOperations |
| 85 | + :ivar virtual_machine_scale_set_vms: VirtualMachineScaleSetVMsOperations operations |
| 86 | + :vartype virtual_machine_scale_set_vms: azure.mgmt.compute.v2020_12_01.operations.VirtualMachineScaleSetVMsOperations |
| 87 | + :ivar log_analytics: LogAnalyticsOperations operations |
| 88 | + :vartype log_analytics: azure.mgmt.compute.v2020_12_01.operations.LogAnalyticsOperations |
| 89 | + :ivar virtual_machine_run_commands: VirtualMachineRunCommandsOperations operations |
| 90 | + :vartype virtual_machine_run_commands: azure.mgmt.compute.v2020_12_01.operations.VirtualMachineRunCommandsOperations |
| 91 | + :ivar virtual_machine_scale_set_vm_run_commands: VirtualMachineScaleSetVMRunCommandsOperations operations |
| 92 | + :vartype virtual_machine_scale_set_vm_run_commands: azure.mgmt.compute.v2020_12_01.operations.VirtualMachineScaleSetVMRunCommandsOperations |
| 93 | + :param credential: Credential needed for the client to connect to Azure. |
| 94 | + :type credential: ~azure.core.credentials.TokenCredential |
| 95 | + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
| 96 | + :type subscription_id: str |
| 97 | + :param str base_url: Service URL |
| 98 | + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. |
| 99 | + """ |
| 100 | + |
| 101 | + def __init__( |
| 102 | + self, |
| 103 | + credential, # type: "TokenCredential" |
| 104 | + subscription_id, # type: str |
| 105 | + base_url=None, # type: Optional[str] |
| 106 | + **kwargs # type: Any |
| 107 | + ): |
| 108 | + # type: (...) -> None |
| 109 | + if not base_url: |
| 110 | + base_url = 'https://management.azure.com' |
| 111 | + self._config = ComputeManagementClientConfiguration(credential, subscription_id, **kwargs) |
| 112 | + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) |
| 113 | + |
| 114 | + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} |
| 115 | + self._serialize = Serializer(client_models) |
| 116 | + self._deserialize = Deserializer(client_models) |
| 117 | + |
| 118 | + self.operations = Operations( |
| 119 | + self._client, self._config, self._serialize, self._deserialize) |
| 120 | + self.availability_sets = AvailabilitySetsOperations( |
| 121 | + self._client, self._config, self._serialize, self._deserialize) |
| 122 | + self.proximity_placement_groups = ProximityPlacementGroupsOperations( |
| 123 | + self._client, self._config, self._serialize, self._deserialize) |
| 124 | + self.dedicated_host_groups = DedicatedHostGroupsOperations( |
| 125 | + self._client, self._config, self._serialize, self._deserialize) |
| 126 | + self.dedicated_hosts = DedicatedHostsOperations( |
| 127 | + self._client, self._config, self._serialize, self._deserialize) |
| 128 | + self.ssh_public_keys = SshPublicKeysOperations( |
| 129 | + self._client, self._config, self._serialize, self._deserialize) |
| 130 | + self.virtual_machine_extension_images = VirtualMachineExtensionImagesOperations( |
| 131 | + self._client, self._config, self._serialize, self._deserialize) |
| 132 | + self.virtual_machine_extensions = VirtualMachineExtensionsOperations( |
| 133 | + self._client, self._config, self._serialize, self._deserialize) |
| 134 | + self.virtual_machine_images = VirtualMachineImagesOperations( |
| 135 | + self._client, self._config, self._serialize, self._deserialize) |
| 136 | + self.virtual_machine_images_edge_zone = VirtualMachineImagesEdgeZoneOperations( |
| 137 | + self._client, self._config, self._serialize, self._deserialize) |
| 138 | + self.usage = UsageOperations( |
| 139 | + self._client, self._config, self._serialize, self._deserialize) |
| 140 | + self.virtual_machines = VirtualMachinesOperations( |
| 141 | + self._client, self._config, self._serialize, self._deserialize) |
| 142 | + self.virtual_machine_scale_sets = VirtualMachineScaleSetsOperations( |
| 143 | + self._client, self._config, self._serialize, self._deserialize) |
| 144 | + self.virtual_machine_sizes = VirtualMachineSizesOperations( |
| 145 | + self._client, self._config, self._serialize, self._deserialize) |
| 146 | + self.images = ImagesOperations( |
| 147 | + self._client, self._config, self._serialize, self._deserialize) |
| 148 | + self.virtual_machine_scale_set_extensions = VirtualMachineScaleSetExtensionsOperations( |
| 149 | + self._client, self._config, self._serialize, self._deserialize) |
| 150 | + self.virtual_machine_scale_set_rolling_upgrades = VirtualMachineScaleSetRollingUpgradesOperations( |
| 151 | + self._client, self._config, self._serialize, self._deserialize) |
| 152 | + self.virtual_machine_scale_set_vm_extensions = VirtualMachineScaleSetVMExtensionsOperations( |
| 153 | + self._client, self._config, self._serialize, self._deserialize) |
| 154 | + self.virtual_machine_scale_set_vms = VirtualMachineScaleSetVMsOperations( |
| 155 | + self._client, self._config, self._serialize, self._deserialize) |
| 156 | + self.log_analytics = LogAnalyticsOperations( |
| 157 | + self._client, self._config, self._serialize, self._deserialize) |
| 158 | + self.virtual_machine_run_commands = VirtualMachineRunCommandsOperations( |
| 159 | + self._client, self._config, self._serialize, self._deserialize) |
| 160 | + self.virtual_machine_scale_set_vm_run_commands = VirtualMachineScaleSetVMRunCommandsOperations( |
| 161 | + self._client, self._config, self._serialize, self._deserialize) |
| 162 | + |
| 163 | + def close(self): |
| 164 | + # type: () -> None |
| 165 | + self._client.close() |
| 166 | + |
| 167 | + def __enter__(self): |
| 168 | + # type: () -> ComputeManagementClient |
| 169 | + self._client.__enter__() |
| 170 | + return self |
| 171 | + |
| 172 | + def __exit__(self, *exc_details): |
| 173 | + # type: (Any) -> None |
| 174 | + self._client.__exit__(*exc_details) |
0 commit comments