Microsoft Azure Compute Management Client Library for programmatic management of Azure compute resources including virtual machines, scale sets, disks, and related infrastructure.
npx @tessl/cli install tessl/pypi-azure-mgmt-compute@36.0.00
# Azure Compute Management Client
1
2
Microsoft Azure Compute Management Client Library for Python provides programmatic management of Azure compute resources including virtual machines, virtual machine scale sets, disks, images, galleries, availability sets, and other compute infrastructure components. This comprehensive SDK enables developers to create, configure, monitor, and manage compute resources in Azure through REST API calls with both synchronous and asynchronous operations.
3
4
## Package Information
5
6
- **Package Name**: azure-mgmt-compute
7
- **Language**: Python
8
- **Version**: 36.0.0
9
- **Python Support**: >=3.9
10
- **Installation**: `pip install azure-mgmt-compute`
11
- **Dependencies**:
12
- `azure-common>=1.1`
13
- `azure-mgmt-core>=1.6.0`
14
- `isodate>=0.6.1`
15
- `typing-extensions>=4.6.0`
16
17
## Core Imports
18
19
```python
20
from azure.mgmt.compute import ComputeManagementClient
21
```
22
23
Common imports for authentication:
24
25
```python
26
from azure.identity import DefaultAzureCredential
27
from azure.mgmt.compute import ComputeManagementClient
28
```
29
30
For accessing models and data types:
31
32
```python
33
from azure.mgmt.compute import models
34
from azure.mgmt.compute.models import (
35
VirtualMachine,
36
VirtualMachineScaleSet,
37
Disk,
38
VirtualMachineExtension,
39
VirtualMachineSizeTypes,
40
OperatingSystemTypes
41
)
42
```
43
44
For async operations:
45
46
```python
47
from azure.mgmt.compute.aio import ComputeManagementClient as AsyncComputeManagementClient
48
from azure.identity.aio import DefaultAzureCredential as AsyncDefaultAzureCredential
49
```
50
51
## Basic Usage
52
53
```python
54
from azure.identity import DefaultAzureCredential
55
from azure.mgmt.compute import ComputeManagementClient
56
57
# Initialize the client
58
credential = DefaultAzureCredential()
59
subscription_id = "your-subscription-id"
60
compute_client = ComputeManagementClient(credential, subscription_id)
61
62
# List virtual machines in a resource group
63
vms = compute_client.virtual_machines.list("my-resource-group")
64
for vm in vms:
65
print(f"VM: {vm.name}, Status: {vm.provisioning_state}")
66
67
# Get VM details
68
vm = compute_client.virtual_machines.get("my-resource-group", "my-vm")
69
print(f"VM Location: {vm.location}")
70
print(f"VM Size: {vm.hardware_profile.vm_size}")
71
72
# Create a simple VM (simplified example)
73
vm_parameters = {
74
'location': 'East US',
75
'hardware_profile': {'vm_size': 'Standard_B1s'},
76
'storage_profile': {
77
'image_reference': {
78
'publisher': 'Canonical',
79
'offer': 'UbuntuServer',
80
'sku': '18.04-LTS',
81
'version': 'latest'
82
}
83
},
84
'os_profile': {
85
'computer_name': 'myvm',
86
'admin_username': 'azuser',
87
'admin_password': 'Password123!'
88
},
89
'network_profile': {
90
'network_interfaces': [{
91
'id': '/subscriptions/.../networkInterfaces/mynic'
92
}]
93
}
94
}
95
96
# This is a long-running operation
97
operation = compute_client.virtual_machines.begin_create_or_update(
98
"my-resource-group",
99
"my-vm",
100
vm_parameters
101
)
102
vm = operation.result() # Wait for completion
103
```
104
105
## Architecture
106
107
The Azure Compute Management Client is organized around resource-specific operation classes, each providing CRUD operations and specialized management functions:
108
109
- **ComputeManagementClient**: Main client class that orchestrates all compute operations
110
- **Operation Classes**: Resource-specific managers (VirtualMachinesOperations, DisksOperations, etc.)
111
- **Model Classes**: Data structures representing Azure compute resources and their properties
112
- **Long-Running Operations (LRO)**: Async operations for resource creation, updates, and deletions
113
- **Instance Views**: Real-time status and diagnostic information for compute resources
114
115
This design provides comprehensive coverage of Azure's compute services while maintaining a consistent programming model across all resource types.
116
117
## Capabilities
118
119
### Virtual Machine Management
120
121
Complete lifecycle management of Azure Virtual Machines including creation, configuration, monitoring, scaling, and deletion. Supports both Windows and Linux VMs with extensive customization options.
122
123
```python { .api }
124
class VirtualMachinesOperations:
125
def list(resource_group_name: str, *, filter: Optional[str] = None, expand: Optional[ExpandTypeForListVMs] = None) -> Iterable[VirtualMachine]: ...
126
def list_all(*, status_only: Optional[str] = None, filter: Optional[str] = None, expand: Optional[ExpandTypeForListVMs] = None) -> Iterable[VirtualMachine]: ...
127
def get(resource_group_name: str, vm_name: str, *, expand: Optional[InstanceViewTypes] = None) -> VirtualMachine: ...
128
def begin_create_or_update(resource_group_name: str, vm_name: str, parameters: VirtualMachine, *, if_match: Optional[str] = None, if_none_match: Optional[str] = None) -> LROPoller[VirtualMachine]: ...
129
def begin_update(resource_group_name: str, vm_name: str, parameters: VirtualMachineUpdate) -> LROPoller[VirtualMachine]: ...
130
def begin_delete(resource_group_name: str, vm_name: str, *, force_deletion: Optional[bool] = None) -> LROPoller[None]: ...
131
def begin_start(resource_group_name: str, vm_name: str) -> LROPoller[None]: ...
132
def begin_restart(resource_group_name: str, vm_name: str) -> LROPoller[None]: ...
133
def begin_power_off(resource_group_name: str, vm_name: str, *, skip_shutdown: Optional[bool] = None) -> LROPoller[None]: ...
134
def begin_deallocate(resource_group_name: str, vm_name: str, *, hibernate: Optional[bool] = None) -> LROPoller[None]: ...
135
def begin_redeploy(resource_group_name: str, vm_name: str) -> LROPoller[None]: ...
136
def begin_reimage(resource_group_name: str, vm_name: str, *, parameters: Optional[VirtualMachineReimageParameters] = None) -> LROPoller[None]: ...
137
def instance_view(resource_group_name: str, vm_name: str) -> VirtualMachineInstanceView: ...
138
def begin_run_command(resource_group_name: str, vm_name: str, parameters: RunCommandInput) -> LROPoller[RunCommandResult]: ...
139
def begin_assess_patches(resource_group_name: str, vm_name: str) -> LROPoller[VirtualMachineAssessPatchesResult]: ...
140
def begin_install_patches(resource_group_name: str, vm_name: str, install_patches_input: VirtualMachineInstallPatchesParameters) -> LROPoller[VirtualMachineInstallPatchesResult]: ...
141
```
142
143
[Virtual Machine Management](./virtual-machines.md)
144
145
### Virtual Machine Scale Set Management
146
147
Comprehensive management of Virtual Machine Scale Sets for auto-scaling applications, including orchestration modes, scaling policies, and rolling upgrades.
148
149
```python { .api }
150
class VirtualMachineScaleSetsOperations:
151
def list(resource_group_name: str) -> Iterable[VirtualMachineScaleSet]: ...
152
def list_all() -> Iterable[VirtualMachineScaleSet]: ...
153
def get(resource_group_name: str, vm_scale_set_name: str, *, expand: Optional[ExpandTypesForGetVMScaleSets] = None) -> VirtualMachineScaleSet: ...
154
def begin_create_or_update(resource_group_name: str, vm_scale_set_name: str, parameters: VirtualMachineScaleSet, *, if_match: Optional[str] = None, if_none_match: Optional[str] = None) -> LROPoller[VirtualMachineScaleSet]: ...
155
def begin_update(resource_group_name: str, vm_scale_set_name: str, parameters: VirtualMachineScaleSetUpdate) -> LROPoller[VirtualMachineScaleSet]: ...
156
def begin_delete(resource_group_name: str, vm_scale_set_name: str, *, force_deletion: Optional[bool] = None) -> LROPoller[None]: ...
157
def begin_deallocate(resource_group_name: str, vm_scale_set_name: str, *, vm_instance_i_ds: Optional[VirtualMachineScaleSetVMInstanceIDs] = None) -> LROPoller[None]: ...
158
def begin_delete_instances(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: VirtualMachineScaleSetVMInstanceRequiredIDs, *, force_deletion: Optional[bool] = None) -> LROPoller[None]: ...
159
def begin_power_off(resource_group_name: str, vm_scale_set_name: str, *, skip_shutdown: Optional[bool] = None, vm_instance_i_ds: Optional[VirtualMachineScaleSetVMInstanceIDs] = None) -> LROPoller[None]: ...
160
def begin_restart(resource_group_name: str, vm_scale_set_name: str, *, vm_instance_i_ds: Optional[VirtualMachineScaleSetVMInstanceIDs] = None) -> LROPoller[None]: ...
161
def begin_start(resource_group_name: str, vm_scale_set_name: str, *, vm_instance_i_ds: Optional[VirtualMachineScaleSetVMInstanceIDs] = None) -> LROPoller[None]: ...
162
def begin_update_instances(resource_group_name: str, vm_scale_set_name: str, vm_instance_i_ds: VirtualMachineScaleSetVMInstanceRequiredIDs) -> LROPoller[None]: ...
163
def begin_reimage(resource_group_name: str, vm_scale_set_name: str, *, vm_scale_set_reimage_input: Optional[VirtualMachineScaleSetReimageParameters] = None) -> LROPoller[None]: ...
164
def begin_reimage_all(resource_group_name: str, vm_scale_set_name: str, *, vm_instance_i_ds: Optional[VirtualMachineScaleSetVMInstanceIDs] = None) -> LROPoller[None]: ...
165
def begin_perform_maintenance(resource_group_name: str, vm_scale_set_name: str, *, vm_instance_i_ds: Optional[VirtualMachineScaleSetVMInstanceIDs] = None) -> LROPoller[None]: ...
166
def get_instance_view(resource_group_name: str, vm_scale_set_name: str) -> VirtualMachineScaleSetInstanceView: ...
167
def list_skus(resource_group_name: str, vm_scale_set_name: str) -> Iterable[VirtualMachineScaleSetSku]: ...
168
def get_os_upgrade_history(resource_group_name: str, vm_scale_set_name: str) -> Iterable[UpgradeOperationHistoryStatus]: ...
169
def begin_set_orchestration_service_state(resource_group_name: str, vm_scale_set_name: str, parameters: OrchestrationServiceStateInput) -> LROPoller[None]: ...
170
```
171
172
[Virtual Machine Scale Sets](./scale-sets.md)
173
174
### Disk and Storage Management
175
176
Management of managed disks, snapshots, disk encryption, and disk access controls for persistent storage solutions.
177
178
```python { .api }
179
class DisksOperations:
180
def list() -> Iterable[Disk]: ...
181
def list_by_resource_group(resource_group_name: str) -> Iterable[Disk]: ...
182
def get(resource_group_name: str, disk_name: str) -> Disk: ...
183
def begin_create_or_update(resource_group_name: str, disk_name: str, disk: Disk) -> LROPoller[Disk]: ...
184
def begin_update(resource_group_name: str, disk_name: str, disk: DiskUpdate) -> LROPoller[Disk]: ...
185
def begin_delete(resource_group_name: str, disk_name: str) -> LROPoller[None]: ...
186
def begin_grant_access(resource_group_name: str, disk_name: str, grant_access_data: GrantAccessData) -> LROPoller[AccessUri]: ...
187
def begin_revoke_access(resource_group_name: str, disk_name: str) -> LROPoller[None]: ...
188
189
class SnapshotsOperations:
190
def list() -> Iterable[Snapshot]: ...
191
def list_by_resource_group(resource_group_name: str) -> Iterable[Snapshot]: ...
192
def get(resource_group_name: str, snapshot_name: str) -> Snapshot: ...
193
def begin_create_or_update(resource_group_name: str, snapshot_name: str, snapshot: Snapshot) -> LROPoller[Snapshot]: ...
194
def begin_update(resource_group_name: str, snapshot_name: str, snapshot: SnapshotUpdate) -> LROPoller[Snapshot]: ...
195
def begin_delete(resource_group_name: str, snapshot_name: str) -> LROPoller[None]: ...
196
def begin_grant_access(resource_group_name: str, snapshot_name: str, grant_access_data: GrantAccessData) -> LROPoller[AccessUri]: ...
197
def begin_revoke_access(resource_group_name: str, snapshot_name: str) -> LROPoller[None]: ...
198
```
199
200
[Disk and Storage Management](./disks-storage.md)
201
202
### Image and Gallery Management
203
204
Management of custom VM images, shared image galleries, and image versions for standardized deployments across organizations.
205
206
```python { .api }
207
class ImagesOperations:
208
def list() -> Iterable[Image]: ...
209
def get(resource_group_name: str, image_name: str) -> Image: ...
210
def begin_create_or_update(resource_group_name: str, image_name: str, parameters: Image) -> LROPoller[Image]: ...
211
212
class GalleriesOperations:
213
def list() -> Iterable[Gallery]: ...
214
def get(resource_group_name: str, gallery_name: str) -> Gallery: ...
215
def begin_create_or_update(resource_group_name: str, gallery_name: str, gallery: Gallery) -> LROPoller[Gallery]: ...
216
```
217
218
[Image and Gallery Management](./images-galleries.md)
219
220
### Infrastructure Management
221
222
Management of supporting infrastructure including availability sets, proximity placement groups, dedicated hosts, and capacity reservations.
223
224
```python { .api }
225
class AvailabilitySetsOperations:
226
def list(resource_group_name: str) -> Iterable[AvailabilitySet]: ...
227
def get(resource_group_name: str, availability_set_name: str) -> AvailabilitySet: ...
228
def create_or_update(resource_group_name: str, availability_set_name: str, parameters: AvailabilitySet) -> AvailabilitySet: ...
229
230
class DedicatedHostsOperations:
231
def list_by_host_group(resource_group_name: str, host_group_name: str) -> Iterable[DedicatedHost]: ...
232
def get(resource_group_name: str, host_group_name: str, host_name: str) -> DedicatedHost: ...
233
```
234
235
[Infrastructure Management](./infrastructure.md)
236
237
### Cloud Services Management
238
239
Management of Azure Cloud Services including roles, update domains, and operating system configurations.
240
241
```python { .api }
242
class CloudServicesOperations:
243
def list(resource_group_name: str) -> Iterable[CloudService]: ...
244
def get(resource_group_name: str, cloud_service_name: str) -> CloudService: ...
245
def begin_create_or_update(resource_group_name: str, cloud_service_name: str, parameters: CloudService) -> LROPoller[CloudService]: ...
246
```
247
248
[Cloud Services Management](./cloud-services.md)
249
250
### VM Extensions Management
251
252
Management of virtual machine extensions for software deployment, configuration, and monitoring.
253
254
```python { .api }
255
class VirtualMachineExtensionsOperations:
256
def begin_create_or_update(resource_group_name: str, vm_name: str, vm_extension_name: str, extension_parameters: VirtualMachineExtension) -> LROPoller[VirtualMachineExtension]: ...
257
def begin_delete(resource_group_name: str, vm_name: str, vm_extension_name: str) -> LROPoller[None]: ...
258
def get(resource_group_name: str, vm_name: str, vm_extension_name: str, *, expand: Optional[str] = None) -> VirtualMachineExtension: ...
259
def list(resource_group_name: str, vm_name: str, *, expand: Optional[str] = None) -> Iterable[VirtualMachineExtension]: ...
260
261
class VirtualMachineRunCommandsOperations:
262
def begin_create_or_update(resource_group_name: str, vm_name: str, run_command_name: str, run_command: VirtualMachineRunCommand) -> LROPoller[VirtualMachineRunCommand]: ...
263
def begin_delete(resource_group_name: str, vm_name: str, run_command_name: str) -> LROPoller[None]: ...
264
def get(resource_group_name: str, vm_name: str, run_command_name: str, *, expand: Optional[str] = None) -> VirtualMachineRunCommand: ...
265
def list(resource_group_name: str, vm_name: str, *, expand: Optional[str] = None) -> Iterable[VirtualMachineRunCommand]: ...
266
```
267
268
### VM Images and Marketplace
269
270
Management of VM images from marketplace and custom sources.
271
272
```python { .api }
273
class VirtualMachineImagesOperations:
274
def get(location: str, publisher_name: str, offer: str, skus: str, version: str) -> VirtualMachineImage: ...
275
def list(location: str, publisher_name: str, offer: str, skus: str, *, filter: Optional[str] = None, top: Optional[int] = None, orderby: Optional[str] = None) -> Iterable[VirtualMachineImageResource]: ...
276
def list_offers(location: str, publisher_name: str) -> Iterable[VirtualMachineImageResource]: ...
277
def list_publishers(location: str) -> Iterable[VirtualMachineImageResource]: ...
278
def list_skus(location: str, publisher_name: str, offer: str) -> Iterable[VirtualMachineImageResource]: ...
279
280
class VirtualMachineImagesEdgeZoneOperations:
281
def list_publishers(location: str, edge_zone: str) -> Iterable[VirtualMachineImageResource]: ...
282
def list_offers(location: str, edge_zone: str, publisher_name: str) -> Iterable[VirtualMachineImageResource]: ...
283
def list_skus(location: str, edge_zone: str, publisher_name: str, offer: str) -> Iterable[VirtualMachineImageResource]: ...
284
def list(location: str, edge_zone: str, publisher_name: str, offer: str, skus: str, *, filter: Optional[str] = None, top: Optional[int] = None, orderby: Optional[str] = None) -> Iterable[VirtualMachineImageResource]: ...
285
def get(location: str, edge_zone: str, publisher_name: str, offer: str, skus: str, version: str) -> VirtualMachineImage: ...
286
287
class VirtualMachineExtensionImagesOperations:
288
def get(location: str, publisher_name: str, type: str, version: str) -> VirtualMachineExtensionImage: ...
289
def list_types(location: str, publisher_name: str) -> Iterable[VirtualMachineExtensionImage]: ...
290
def list_versions(location: str, publisher_name: str, type: str, *, filter: Optional[str] = None, top: Optional[int] = None, orderby: Optional[str] = None) -> Iterable[VirtualMachineExtensionImage]: ...
291
```
292
293
### Resource Management and Analytics
294
295
Resource size information, usage metrics, and log analytics capabilities.
296
297
```python { .api }
298
class VirtualMachineSizesOperations:
299
def list(location: str) -> Iterable[VirtualMachineSize]: ...
300
301
class ResourceSkusOperations:
302
def list(*, filter: Optional[str] = None, include_extended_locations: Optional[str] = None) -> Iterable[ResourceSku]: ...
303
304
class UsageOperations:
305
def list(location: str) -> Iterable[Usage]: ...
306
307
class LogAnalyticsOperations:
308
def begin_export_request_rate_by_interval(location: str, parameters: RequestRateByIntervalInput) -> LROPoller[LogAnalyticsOperationResult]: ...
309
def begin_export_throttled_requests(location: str, parameters: ThrottledRequestsInput) -> LROPoller[LogAnalyticsOperationResult]: ...
310
```
311
312
### Restore Points and Backup
313
314
Management of restore points and restore point collections for VM backup and recovery.
315
316
```python { .api }
317
class RestorePointCollectionsOperations:
318
def create_or_update(resource_group_name: str, restore_point_collection_name: str, parameters: RestorePointCollection) -> RestorePointCollection: ...
319
def delete(resource_group_name: str, restore_point_collection_name: str) -> None: ...
320
def get(resource_group_name: str, restore_point_collection_name: str, *, expand: Optional[RestorePointCollectionExpandOptions] = None) -> RestorePointCollection: ...
321
def list(resource_group_name: str) -> Iterable[RestorePointCollection]: ...
322
def list_all() -> Iterable[RestorePointCollection]: ...
323
324
class RestorePointsOperations:
325
def begin_create(resource_group_name: str, restore_point_collection_name: str, restore_point_name: str, parameters: RestorePoint) -> LROPoller[RestorePoint]: ...
326
def begin_delete(resource_group_name: str, restore_point_collection_name: str, restore_point_name: str) -> LROPoller[None]: ...
327
def get(resource_group_name: str, restore_point_collection_name: str, restore_point_name: str, *, expand: Optional[RestorePointExpandOptions] = None) -> RestorePoint: ...
328
```
329
330
### Shared and Community Galleries
331
332
Management of shared galleries, community galleries, and their image versions for broader distribution.
333
334
```python { .api }
335
class SharedGalleriesOperations:
336
def get(location: str, gallery_unique_name: str) -> SharedGallery: ...
337
def list(location: str, *, shared_to: Optional[SharedToValues] = None) -> Iterable[SharedGallery]: ...
338
339
class SharedGalleryImagesOperations:
340
def get(location: str, gallery_unique_name: str, gallery_image_name: str) -> SharedGalleryImage: ...
341
def list(location: str, gallery_unique_name: str, *, shared_to: Optional[SharedToValues] = None) -> Iterable[SharedGalleryImage]: ...
342
343
class SharedGalleryImageVersionsOperations:
344
def get(location: str, gallery_unique_name: str, gallery_image_name: str, gallery_image_version_name: str) -> SharedGalleryImageVersion: ...
345
def list(location: str, gallery_unique_name: str, gallery_image_name: str, *, shared_to: Optional[SharedToValues] = None) -> Iterable[SharedGalleryImageVersion]: ...
346
347
class CommunityGalleriesOperations:
348
def get(location: str, public_gallery_name: str) -> CommunityGallery: ...
349
350
class CommunityGalleryImagesOperations:
351
def get(location: str, public_gallery_name: str, gallery_image_name: str) -> CommunityGalleryImage: ...
352
def list(location: str, public_gallery_name: str) -> Iterable[CommunityGalleryImage]: ...
353
354
class CommunityGalleryImageVersionsOperations:
355
def get(location: str, public_gallery_name: str, gallery_image_name: str, gallery_image_version_name: str) -> CommunityGalleryImageVersion: ...
356
def list(location: str, public_gallery_name: str, gallery_image_name: str) -> Iterable[CommunityGalleryImageVersion]: ...
357
358
class GallerySharingProfileOperations:
359
def begin_update(resource_group_name: str, gallery_name: str, sharing_update: SharingUpdate) -> LROPoller[SharingUpdate]: ...
360
```
361
362
### Disk Restore Points
363
364
Management of disk-level restore points for granular backup and recovery.
365
366
```python { .api }
367
class DiskRestorePointOperations:
368
def get(resource_group_name: str, restore_point_collection_name: str, vm_restore_point_name: str, disk_restore_point_name: str) -> DiskRestorePoint: ...
369
def list_by_restore_point(resource_group_name: str, restore_point_collection_name: str, vm_restore_point_name: str) -> Iterable[DiskRestorePoint]: ...
370
def begin_grant_access(resource_group_name: str, restore_point_collection_name: str, vm_restore_point_name: str, disk_restore_point_name: str, grant_access_data: GrantAccessData) -> LROPoller[AccessUri]: ...
371
def begin_revoke_access(resource_group_name: str, restore_point_collection_name: str, vm_restore_point_name: str, disk_restore_point_name: str) -> LROPoller[None]: ...
372
```
373
374
### General Operations
375
376
General operations for listing available compute operations and getting operation status.
377
378
```python { .api }
379
class Operations:
380
def list() -> Iterable[ComputeOperationValue]: ...
381
```
382
383
## Core Types
384
385
```python { .api }
386
class ComputeManagementClient:
387
"""
388
Main client for Azure Compute Management operations.
389
390
Args:
391
credential: Azure credential for authentication
392
subscription_id: Azure subscription ID
393
base_url: Service URL (optional)
394
polling_interval: LRO polling interval in seconds (optional)
395
"""
396
def __init__(
397
self,
398
credential: TokenCredential,
399
subscription_id: str,
400
base_url: Optional[str] = None,
401
**kwargs: Any
402
) -> None: ...
403
404
def close(self) -> None: ...
405
def __enter__(self) -> Self: ...
406
def __exit__(self, *exc_details: Any) -> None: ...
407
408
class VirtualMachine:
409
"""Describes a Virtual Machine."""
410
location: str
411
tags: Optional[Dict[str, str]]
412
hardware_profile: Optional[HardwareProfile]
413
storage_profile: Optional[StorageProfile]
414
os_profile: Optional[OSProfile]
415
network_profile: Optional[NetworkProfile]
416
provisioning_state: Optional[str]
417
instance_view: Optional[VirtualMachineInstanceView]
418
419
class VirtualMachineScaleSet:
420
"""Describes a Virtual Machine Scale Set."""
421
location: str
422
tags: Optional[Dict[str, str]]
423
sku: Optional[Sku]
424
upgrade_policy: Optional[UpgradePolicy]
425
virtual_machine_profile: Optional[VirtualMachineScaleSetVMProfile]
426
provisioning_state: Optional[str]
427
orchestration_mode: Optional[OrchestrationMode]
428
429
class Disk:
430
"""Disk resource."""
431
location: str
432
tags: Optional[Dict[str, str]]
433
sku: Optional[DiskSku]
434
creation_data: CreationData
435
disk_size_gb: Optional[int]
436
disk_state: Optional[DiskState]
437
provisioning_state: Optional[str]
438
439
# Key Enum Types
440
class VirtualMachineSizeTypes(str, Enum):
441
"""Available VM sizes."""
442
BASIC_A0 = "Basic_A0"
443
BASIC_A1 = "Basic_A1"
444
BASIC_A2 = "Basic_A2"
445
BASIC_A3 = "Basic_A3"
446
BASIC_A4 = "Basic_A4"
447
STANDARD_A0 = "Standard_A0"
448
STANDARD_A1 = "Standard_A1"
449
STANDARD_A1_V2 = "Standard_A1_v2"
450
STANDARD_A2 = "Standard_A2"
451
STANDARD_A2_V2 = "Standard_A2_v2"
452
STANDARD_A2M_V2 = "Standard_A2m_v2"
453
STANDARD_A4 = "Standard_A4"
454
STANDARD_A4_V2 = "Standard_A4_v2"
455
STANDARD_A4M_V2 = "Standard_A4m_v2"
456
STANDARD_A8 = "Standard_A8"
457
STANDARD_A8_V2 = "Standard_A8_v2"
458
STANDARD_A8M_V2 = "Standard_A8m_v2"
459
STANDARD_B1MS = "Standard_B1ms"
460
STANDARD_B1S = "Standard_B1s"
461
STANDARD_B2MS = "Standard_B2ms"
462
STANDARD_B2S = "Standard_B2s"
463
STANDARD_B4MS = "Standard_B4ms"
464
STANDARD_B8MS = "Standard_B8ms"
465
STANDARD_D1 = "Standard_D1"
466
STANDARD_D11 = "Standard_D11"
467
STANDARD_D11_V2 = "Standard_D11_v2"
468
STANDARD_D12 = "Standard_D12"
469
STANDARD_D12_V2 = "Standard_D12_v2"
470
STANDARD_D13 = "Standard_D13"
471
STANDARD_D13_V2 = "Standard_D13_v2"
472
STANDARD_D14 = "Standard_D14"
473
STANDARD_D14_V2 = "Standard_D14_v2"
474
STANDARD_D15_V2 = "Standard_D15_v2"
475
STANDARD_D1_V2 = "Standard_D1_v2"
476
STANDARD_D2 = "Standard_D2"
477
STANDARD_D2_V2 = "Standard_D2_v2"
478
STANDARD_D2_V3 = "Standard_D2_v3"
479
STANDARD_D2S_V3 = "Standard_D2s_v3"
480
STANDARD_D3 = "Standard_D3"
481
STANDARD_D3_V2 = "Standard_D3_v2"
482
STANDARD_D4 = "Standard_D4"
483
STANDARD_D4_V2 = "Standard_D4_v2"
484
STANDARD_D4_V3 = "Standard_D4_v3"
485
STANDARD_D4S_V3 = "Standard_D4s_v3"
486
STANDARD_D5_V2 = "Standard_D5_v2"
487
STANDARD_D8_V3 = "Standard_D8_v3"
488
STANDARD_D8S_V3 = "Standard_D8s_v3"
489
STANDARD_D16_V3 = "Standard_D16_v3"
490
STANDARD_D16S_V3 = "Standard_D16s_v3"
491
STANDARD_D32_V3 = "Standard_D32_v3"
492
STANDARD_D32S_V3 = "Standard_D32s_v3"
493
STANDARD_D64_V3 = "Standard_D64_v3"
494
STANDARD_D64S_V3 = "Standard_D64s_v3"
495
496
class OperatingSystemTypes(str, Enum):
497
"""Operating system types."""
498
WINDOWS = "Windows"
499
LINUX = "Linux"
500
501
class DiskCreateOption(str, Enum):
502
"""Disk creation options."""
503
FROM_IMAGE = "FromImage"
504
EMPTY = "Empty"
505
ATTACH = "Attach"
506
COPY = "Copy"
507
RESTORE = "Restore"
508
IMPORT = "Import"
509
UPLOAD = "Upload"
510
COPY_START = "CopyStart"
511
IMPORT_SECURE = "ImportSecure"
512
UPLOAD_PREPARED_SECURE = "UploadPreparedSecure"
513
514
class DiskState(str, Enum):
515
"""Disk state."""
516
UNATTACHED = "Unattached"
517
ATTACHED = "Attached"
518
RESERVED = "Reserved"
519
ACTIVE_SAS = "ActiveSAS"
520
READY_TO_UPLOAD = "ReadyToUpload"
521
ACTIVE_UPLOAD = "ActiveUpload"
522
523
class VirtualMachineEvictionPolicyTypes(str, Enum):
524
"""VM eviction policies for Spot VMs."""
525
DEALLOCATE = "Deallocate"
526
DELETE = "Delete"
527
528
class VirtualMachinePriorityTypes(str, Enum):
529
"""VM priority types."""
530
REGULAR = "Regular"
531
LOW = "Low"
532
SPOT = "Spot"
533
534
class InstanceViewTypes(str, Enum):
535
"""Instance view expand types."""
536
INSTANCE_VIEW = "instanceView"
537
538
class ExpandTypeForListVMs(str, Enum):
539
"""Expand types for listing VMs."""
540
INSTANCE_VIEW = "instanceView"
541
542
class ExpandTypesForGetVMScaleSets(str, Enum):
543
"""Expand types for getting scale sets."""
544
USER_DATA = "userData"
545
546
# Access and Authentication Types
547
class AccessLevel(str, Enum):
548
"""Access levels for disk access."""
549
NONE = "None"
550
READ = "Read"
551
WRITE = "Write"
552
553
# LRO and Operation Result Types
554
class LROPoller:
555
"""Long-running operation poller."""
556
def result(self, timeout: Optional[float] = None): ...
557
def done(self) -> bool: ...
558
def status(self) -> str: ...
559
def wait(self, timeout: Optional[float] = None) -> None: ...
560
561
# Core Model Components
562
class SubResource:
563
"""Sub-resource reference."""
564
id: Optional[str]
565
566
class Sku:
567
"""SKU information."""
568
name: Optional[str]
569
tier: Optional[str]
570
capacity: Optional[int]