0
# Data Models and Types
1
2
Comprehensive data structures representing clusters, configurations, credentials, and enumerations used throughout the Azure Machine Learning Compute Management API. These models define the structure of requests, responses, and configuration objects.
3
4
## Capabilities
5
6
### Core Resource Models
7
8
Primary resource models representing Azure Machine Learning compute resources.
9
10
```python { .api }
11
class OperationalizationCluster(Resource):
12
"""
13
Instance of an Azure ML Operationalization Cluster resource.
14
15
Args:
16
location (str): Specifies the location of the resource
17
cluster_type (ClusterType): The cluster type (ACS or Local)
18
tags (Dict[str, str], optional): Resource tags (max 15, key ≤128 chars, value ≤256 chars)
19
description (str, optional): The description of the cluster
20
storage_account (StorageAccountProperties, optional): Storage Account properties
21
container_registry (ContainerRegistryProperties, optional): Container Registry properties
22
container_service (AcsClusterProperties, optional): Azure Container Service cluster parameters
23
app_insights (AppInsightsProperties, optional): AppInsights configuration
24
global_service_configuration (GlobalServiceConfiguration, optional): Global web services configuration
25
26
Read-only Attributes:
27
id (str): Specifies the resource ID
28
name (str): Specifies the name of the resource
29
type (str): Specifies the type of the resource
30
created_on (datetime): The date and time when the cluster was created
31
modified_on (datetime): The date and time when the cluster was last modified
32
provisioning_state (OperationStatus): The provision state of the cluster
33
provisioning_errors (List[ErrorResponseWrapper]): List of provisioning errors
34
"""
35
def __init__(self, location: str, cluster_type: ClusterType, **kwargs): ...
36
37
# Required properties
38
location: str
39
cluster_type: ClusterType
40
41
# Optional properties
42
tags: Dict[str, str]
43
description: str
44
storage_account: StorageAccountProperties
45
container_registry: ContainerRegistryProperties
46
container_service: AcsClusterProperties
47
app_insights: AppInsightsProperties
48
global_service_configuration: GlobalServiceConfiguration
49
50
# Read-only properties
51
id: str # readonly
52
name: str # readonly
53
type: str # readonly
54
created_on: datetime # readonly
55
modified_on: datetime # readonly
56
provisioning_state: OperationStatus # readonly
57
provisioning_errors: List[ErrorResponseWrapper] # readonly
58
59
class OperationalizationClusterUpdateParameters:
60
"""
61
Parameters for updating an operationalization cluster.
62
63
Args:
64
tags (Dict[str, str], optional): Resource tags to update
65
"""
66
def __init__(self, tags: Dict[str, str] = None): ...
67
68
tags: Dict[str, str]
69
70
class Resource:
71
"""
72
Base Azure resource with common properties.
73
74
Args:
75
location (str): Specifies the location of the resource
76
tags (Dict[str, str], optional): Resource tags
77
78
Read-only Attributes:
79
id (str): Specifies the resource ID
80
name (str): Specifies the name of the resource
81
type (str): Specifies the type of the resource
82
"""
83
def __init__(self, location: str, tags: Dict[str, str] = None): ...
84
85
location: str
86
tags: Dict[str, str]
87
id: str # readonly
88
name: str # readonly
89
type: str # readonly
90
```
91
92
**Usage Examples:**
93
94
```python
95
from azure.mgmt.machinelearningcompute.models import (
96
OperationalizationCluster,
97
ClusterType,
98
StorageAccountProperties
99
)
100
101
# Create a basic local cluster
102
cluster = OperationalizationCluster(
103
location="eastus",
104
cluster_type=ClusterType.local,
105
description="Development cluster",
106
tags={"environment": "dev", "team": "ml-ops"}
107
)
108
109
# Create an ACS cluster with storage
110
acs_cluster = OperationalizationCluster(
111
location="westus2",
112
cluster_type=ClusterType.acs,
113
description="Production ACS cluster",
114
storage_account=StorageAccountProperties(
115
resource_id="/subscriptions/.../storageAccounts/prodml"
116
)
117
)
118
119
# Update parameters for PATCH operations
120
update_params = OperationalizationClusterUpdateParameters(
121
tags={"environment": "production", "cost-center": "ml-team"}
122
)
123
```
124
125
### Configuration Models
126
127
Models for configuring various cluster components and services.
128
129
```python { .api }
130
class StorageAccountProperties:
131
"""
132
Azure Storage account configuration.
133
134
Args:
135
resource_id (str, optional): Full resource ID of the storage account
136
"""
137
def __init__(self, resource_id: str = None): ...
138
139
resource_id: str
140
141
class ContainerRegistryProperties:
142
"""
143
Azure Container Registry configuration.
144
145
Args:
146
resource_id (str, optional): Full resource ID of the container registry
147
"""
148
def __init__(self, resource_id: str = None): ...
149
150
resource_id: str
151
152
class ServicePrincipalProperties:
153
"""
154
Service principal authentication configuration.
155
156
Args:
157
client_id (str): Application (client) ID of the service principal
158
secret (str): Client secret for the service principal
159
"""
160
def __init__(self, client_id: str, secret: str): ...
161
162
client_id: str
163
secret: str
164
165
class KubernetesClusterProperties:
166
"""
167
Kubernetes cluster-specific properties.
168
169
Args:
170
service_principal (ServicePrincipalProperties, optional): Service principal for cluster access
171
"""
172
def __init__(self, service_principal: ServicePrincipalProperties = None): ...
173
174
service_principal: ServicePrincipalProperties
175
176
class AcsClusterProperties:
177
"""
178
Azure Container Service cluster properties.
179
180
Args:
181
orchestrator_type (OrchestratorType): Container orchestrator type
182
master_count (int, optional): Number of masters (default: 1)
183
agent_count (int, optional): Number of agents (default: 2)
184
agent_vm_size (AgentVMSizeTypes, optional): VM size for agents
185
"""
186
def __init__(
187
self,
188
orchestrator_type: OrchestratorType,
189
master_count: int = None,
190
agent_count: int = None,
191
agent_vm_size: AgentVMSizeTypes = None
192
): ...
193
194
orchestrator_type: OrchestratorType
195
master_count: int
196
agent_count: int
197
agent_vm_size: AgentVMSizeTypes
198
199
class AppInsightsProperties:
200
"""
201
Application Insights configuration.
202
203
Args:
204
resource_id (str, optional): Full resource ID of the Application Insights component
205
"""
206
def __init__(self, resource_id: str = None): ...
207
208
resource_id: str
209
```
210
211
**Usage Examples:**
212
213
```python
214
from azure.mgmt.machinelearningcompute.models import (
215
AcsClusterProperties,
216
OrchestratorType,
217
AgentVMSizeTypes,
218
ServicePrincipalProperties,
219
AppInsightsProperties
220
)
221
222
# Configure ACS cluster with Kubernetes
223
acs_config = AcsClusterProperties(
224
orchestrator_type=OrchestratorType.kubernetes,
225
master_count=3,
226
agent_count=5,
227
agent_vm_size=AgentVMSizeTypes.standard_d2_v2
228
)
229
230
# Configure service principal
231
service_principal = ServicePrincipalProperties(
232
client_id="12345678-1234-5678-9012-123456789012",
233
secret="your-client-secret"
234
)
235
236
# Configure Application Insights
237
app_insights = AppInsightsProperties(
238
resource_id="/subscriptions/.../components/ml-insights"
239
)
240
```
241
242
### Service Configuration Models
243
244
Models for configuring cluster services and global settings.
245
246
```python { .api }
247
class ServiceAuthConfiguration:
248
"""
249
Service authentication configuration.
250
251
Args:
252
primary_auth_key_hash (str, optional): Primary authentication key hash
253
secondary_auth_key_hash (str, optional): Secondary authentication key hash
254
"""
255
def __init__(
256
self,
257
primary_auth_key_hash: str = None,
258
secondary_auth_key_hash: str = None
259
): ...
260
261
primary_auth_key_hash: str
262
secondary_auth_key_hash: str
263
264
class SslConfiguration:
265
"""
266
SSL/TLS configuration settings.
267
268
Args:
269
status (Status, optional): SSL status (Enabled or Disabled)
270
cert (str, optional): SSL certificate
271
key (str, optional): SSL private key
272
cname (str, optional): SSL CNAME
273
"""
274
def __init__(
275
self,
276
status: Status = None,
277
cert: str = None,
278
key: str = None,
279
cname: str = None
280
): ...
281
282
status: Status
283
cert: str
284
key: str
285
cname: str
286
287
class AutoScaleConfiguration:
288
"""
289
Auto-scaling configuration.
290
291
Args:
292
status (Status, optional): Auto-scale status (Enabled or Disabled)
293
min_replicas (int, optional): Minimum number of replicas
294
max_replicas (int, optional): Maximum number of replicas
295
target_utilization (int, optional): Target CPU utilization percentage
296
refresh_period_in_seconds (int, optional): Refresh period in seconds
297
"""
298
def __init__(
299
self,
300
status: Status = None,
301
min_replicas: int = None,
302
max_replicas: int = None,
303
target_utilization: int = None,
304
refresh_period_in_seconds: int = None
305
): ...
306
307
status: Status
308
min_replicas: int
309
max_replicas: int
310
target_utilization: int
311
refresh_period_in_seconds: int
312
313
class GlobalServiceConfiguration:
314
"""
315
Global service configuration settings.
316
317
Args:
318
etag (str, optional): ETag for optimistic concurrency
319
ssl (SslConfiguration, optional): SSL configuration
320
service_auth (ServiceAuthConfiguration, optional): Service authentication configuration
321
auto_scale (AutoScaleConfiguration, optional): Auto-scaling configuration
322
"""
323
def __init__(
324
self,
325
etag: str = None,
326
ssl: SslConfiguration = None,
327
service_auth: ServiceAuthConfiguration = None,
328
auto_scale: AutoScaleConfiguration = None
329
): ...
330
331
etag: str
332
ssl: SslConfiguration
333
service_auth: ServiceAuthConfiguration
334
auto_scale: AutoScaleConfiguration
335
336
class SystemService:
337
"""
338
System service definition.
339
340
Args:
341
system_service_type (SystemServiceType): Type of system service
342
public_ip_address (str, optional): Public IP address of the service
343
version (str, optional): Version of the service
344
345
Read-only Attributes:
346
state (str): Current state of the service
347
"""
348
def __init__(
349
self,
350
system_service_type: SystemServiceType,
351
public_ip_address: str = None,
352
version: str = None
353
): ...
354
355
system_service_type: SystemServiceType
356
public_ip_address: str
357
version: str
358
state: str # readonly
359
```
360
361
### Credential Models
362
363
Models for storing and accessing various types of cluster credentials.
364
365
```python { .api }
366
class OperationalizationClusterCredentials:
367
"""
368
Container for all cluster access credentials.
369
370
Attributes:
371
storage_account (StorageAccountCredentials, optional): Storage account credentials
372
container_registry (ContainerRegistryCredentials, optional): Container registry credentials
373
container_service (ContainerServiceCredentials, optional): Container service credentials
374
app_insights (AppInsightsCredentials, optional): Application Insights credentials
375
"""
376
storage_account: StorageAccountCredentials
377
container_registry: ContainerRegistryCredentials
378
container_service: ContainerServiceCredentials
379
app_insights: AppInsightsCredentials
380
381
class StorageAccountCredentials:
382
"""
383
Storage account access credentials.
384
385
Attributes:
386
resource_id (str): Resource ID of the storage account
387
primary_key (str): Primary access key
388
secondary_key (str): Secondary access key
389
"""
390
resource_id: str
391
primary_key: str
392
secondary_key: str
393
394
class ContainerRegistryCredentials:
395
"""
396
Container registry access credentials.
397
398
Attributes:
399
login_server (str): Registry login server URL
400
username (str): Registry username
401
password (str): Registry password
402
password2 (str): Secondary registry password
403
"""
404
login_server: str
405
username: str
406
password: str
407
password2: str
408
409
class ContainerServiceCredentials:
410
"""
411
Container service access credentials.
412
413
Attributes:
414
acs_kube_config (str): Kubernetes configuration file content
415
image_pull_secret_name (str): Name of the image pull secret
416
service_principal_configuration (ServicePrincipalProperties): Service principal configuration
417
"""
418
acs_kube_config: str
419
image_pull_secret_name: str
420
service_principal_configuration: ServicePrincipalProperties
421
422
class AppInsightsCredentials:
423
"""
424
Application Insights access credentials.
425
426
Attributes:
427
app_id (str): Application Insights application ID
428
instrumentation_key (str): Instrumentation key
429
"""
430
app_id: str
431
instrumentation_key: str
432
```
433
434
### Response Models
435
436
Models for API operation responses and system information.
437
438
```python { .api }
439
class CheckSystemServicesUpdatesAvailableResponse:
440
"""
441
Response for system update availability check.
442
443
Attributes:
444
updates_available (UpdatesAvailable): Whether updates are available (Yes or No)
445
"""
446
updates_available: UpdatesAvailable
447
448
class UpdateSystemServicesResponse:
449
"""
450
Response for system services update operation.
451
452
Attributes:
453
update_status (str): Status of the update operation
454
update_started_on (datetime): When the update started
455
update_completed_on (datetime): When the update completed
456
"""
457
update_status: str
458
update_started_on: datetime
459
update_completed_on: datetime
460
```
461
462
### Collection Models
463
464
Models for paginated collections and operation listings.
465
466
```python { .api }
467
class OperationalizationClusterPaged:
468
"""
469
Paginated collection of OperationalizationCluster objects.
470
Supports iteration and automatic pagination.
471
"""
472
def __iter__(self) -> Iterator[OperationalizationCluster]: ...
473
def __next__(self) -> OperationalizationCluster: ...
474
```
475
476
### Error Models
477
478
Models for structured error handling and reporting.
479
480
```python { .api }
481
class ErrorDetail:
482
"""
483
Detailed error information.
484
485
Attributes:
486
code (str): Error code
487
message (str): Error message
488
target (str): Error target
489
"""
490
code: str
491
message: str
492
target: str
493
494
class ErrorResponse:
495
"""
496
Error response container.
497
498
Attributes:
499
error (ErrorDetail): Detailed error information
500
"""
501
error: ErrorDetail
502
503
class ErrorResponseWrapper:
504
"""
505
Wrapped error response.
506
507
Attributes:
508
error (ErrorResponse): Error response information
509
"""
510
error: ErrorResponse
511
512
class ErrorResponseWrapperException(Exception):
513
"""
514
Exception thrown for wrapped error responses.
515
516
Attributes:
517
message (str): Exception message
518
response: HTTP response object
519
inner_exception: Original exception
520
"""
521
message: str
522
response: object
523
inner_exception: Exception
524
```
525
526
## Enumerations
527
528
### Core Enumerations
529
530
```python { .api }
531
class OperationStatus(Enum):
532
"""Cluster provisioning and operation status."""
533
unknown = "Unknown"
534
updating = "Updating"
535
creating = "Creating"
536
deleting = "Deleting"
537
succeeded = "Succeeded"
538
failed = "Failed"
539
canceled = "Canceled"
540
541
class ClusterType(Enum):
542
"""Type of operationalization cluster."""
543
acs = "ACS" # Azure Container Service
544
local = "Local" # Local cluster
545
546
class OrchestratorType(Enum):
547
"""Container orchestrator type."""
548
kubernetes = "Kubernetes"
549
none = "None"
550
551
class SystemServiceType(Enum):
552
"""Type of system service."""
553
none = "None"
554
scoring_front_end = "ScoringFrontEnd"
555
batch_front_end = "BatchFrontEnd"
556
557
class Status(Enum):
558
"""General status enumeration."""
559
enabled = "Enabled"
560
disabled = "Disabled"
561
562
class UpdatesAvailable(Enum):
563
"""System updates availability status."""
564
yes = "Yes"
565
no = "No"
566
```
567
568
### VM Size Enumeration
569
570
```python { .api }
571
class AgentVMSizeTypes(Enum):
572
"""Available Azure VM sizes for cluster agents."""
573
# A-series VMs
574
standard_a0 = "Standard_A0"
575
standard_a1 = "Standard_A1"
576
standard_a2 = "Standard_A2"
577
standard_a3 = "Standard_A3"
578
standard_a4 = "Standard_A4"
579
standard_a5 = "Standard_A5"
580
standard_a6 = "Standard_A6"
581
standard_a7 = "Standard_A7"
582
standard_a8 = "Standard_A8"
583
standard_a9 = "Standard_A9"
584
standard_a10 = "Standard_A10"
585
standard_a11 = "Standard_A11"
586
587
# D-series VMs
588
standard_d1 = "Standard_D1"
589
standard_d2 = "Standard_D2"
590
standard_d3 = "Standard_D3"
591
standard_d4 = "Standard_D4"
592
standard_d11 = "Standard_D11"
593
standard_d12 = "Standard_D12"
594
standard_d13 = "Standard_D13"
595
standard_d14 = "Standard_D14"
596
597
# D-series v2 VMs
598
standard_d1_v2 = "Standard_D1_v2"
599
standard_d2_v2 = "Standard_D2_v2"
600
standard_d3_v2 = "Standard_D3_v2"
601
standard_d4_v2 = "Standard_D4_v2"
602
standard_d5_v2 = "Standard_D5_v2"
603
standard_d11_v2 = "Standard_D11_v2"
604
standard_d12_v2 = "Standard_D12_v2"
605
standard_d13_v2 = "Standard_D13_v2"
606
standard_d14_v2 = "Standard_D14_v2"
607
608
# G-series VMs
609
standard_g1 = "Standard_G1"
610
standard_g2 = "Standard_G2"
611
standard_g3 = "Standard_G3"
612
standard_g4 = "Standard_G4"
613
standard_g5 = "Standard_G5"
614
615
# DS-series VMs
616
standard_ds1 = "Standard_DS1"
617
standard_ds2 = "Standard_DS2"
618
standard_ds3 = "Standard_DS3"
619
standard_ds4 = "Standard_DS4"
620
standard_ds11 = "Standard_DS11"
621
standard_ds12 = "Standard_DS12"
622
standard_ds13 = "Standard_DS13"
623
standard_ds14 = "Standard_DS14"
624
625
# GS-series VMs
626
standard_gs1 = "Standard_GS1"
627
standard_gs2 = "Standard_GS2"
628
standard_gs3 = "Standard_GS3"
629
standard_gs4 = "Standard_GS4"
630
standard_gs5 = "Standard_GS5"
631
```
632
633
**Usage Examples:**
634
635
```python
636
from azure.mgmt.machinelearningcompute.models import (
637
ClusterType,
638
OperationStatus,
639
AgentVMSizeTypes,
640
Status
641
)
642
643
# Use enums in cluster configuration
644
cluster_type = ClusterType.acs
645
vm_size = AgentVMSizeTypes.standard_d2_v2
646
ssl_status = Status.enabled
647
648
print(f"Cluster type: {cluster_type.value}") # "ACS"
649
print(f"VM size: {vm_size.value}") # "Standard_D2_v2"
650
651
# Check cluster status
652
if cluster.provisioning_state == OperationStatus.succeeded:
653
print("Cluster is ready")
654
elif cluster.provisioning_state == OperationStatus.failed:
655
print("Cluster creation failed")
656
```