Microsoft Azure Machine Learning Compute Management Client Library for Python
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
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.
Primary resource models representing Azure Machine Learning compute resources.
class OperationalizationCluster(Resource):
"""
Instance of an Azure ML Operationalization Cluster resource.
Args:
location (str): Specifies the location of the resource
cluster_type (ClusterType): The cluster type (ACS or Local)
tags (Dict[str, str], optional): Resource tags (max 15, key ≤128 chars, value ≤256 chars)
description (str, optional): The description of the cluster
storage_account (StorageAccountProperties, optional): Storage Account properties
container_registry (ContainerRegistryProperties, optional): Container Registry properties
container_service (AcsClusterProperties, optional): Azure Container Service cluster parameters
app_insights (AppInsightsProperties, optional): AppInsights configuration
global_service_configuration (GlobalServiceConfiguration, optional): Global web services configuration
Read-only Attributes:
id (str): Specifies the resource ID
name (str): Specifies the name of the resource
type (str): Specifies the type of the resource
created_on (datetime): The date and time when the cluster was created
modified_on (datetime): The date and time when the cluster was last modified
provisioning_state (OperationStatus): The provision state of the cluster
provisioning_errors (List[ErrorResponseWrapper]): List of provisioning errors
"""
def __init__(self, location: str, cluster_type: ClusterType, **kwargs): ...
# Required properties
location: str
cluster_type: ClusterType
# Optional properties
tags: Dict[str, str]
description: str
storage_account: StorageAccountProperties
container_registry: ContainerRegistryProperties
container_service: AcsClusterProperties
app_insights: AppInsightsProperties
global_service_configuration: GlobalServiceConfiguration
# Read-only properties
id: str # readonly
name: str # readonly
type: str # readonly
created_on: datetime # readonly
modified_on: datetime # readonly
provisioning_state: OperationStatus # readonly
provisioning_errors: List[ErrorResponseWrapper] # readonly
class OperationalizationClusterUpdateParameters:
"""
Parameters for updating an operationalization cluster.
Args:
tags (Dict[str, str], optional): Resource tags to update
"""
def __init__(self, tags: Dict[str, str] = None): ...
tags: Dict[str, str]
class Resource:
"""
Base Azure resource with common properties.
Args:
location (str): Specifies the location of the resource
tags (Dict[str, str], optional): Resource tags
Read-only Attributes:
id (str): Specifies the resource ID
name (str): Specifies the name of the resource
type (str): Specifies the type of the resource
"""
def __init__(self, location: str, tags: Dict[str, str] = None): ...
location: str
tags: Dict[str, str]
id: str # readonly
name: str # readonly
type: str # readonlyUsage Examples:
from azure.mgmt.machinelearningcompute.models import (
OperationalizationCluster,
ClusterType,
StorageAccountProperties
)
# Create a basic local cluster
cluster = OperationalizationCluster(
location="eastus",
cluster_type=ClusterType.local,
description="Development cluster",
tags={"environment": "dev", "team": "ml-ops"}
)
# Create an ACS cluster with storage
acs_cluster = OperationalizationCluster(
location="westus2",
cluster_type=ClusterType.acs,
description="Production ACS cluster",
storage_account=StorageAccountProperties(
resource_id="/subscriptions/.../storageAccounts/prodml"
)
)
# Update parameters for PATCH operations
update_params = OperationalizationClusterUpdateParameters(
tags={"environment": "production", "cost-center": "ml-team"}
)Models for configuring various cluster components and services.
class StorageAccountProperties:
"""
Azure Storage account configuration.
Args:
resource_id (str, optional): Full resource ID of the storage account
"""
def __init__(self, resource_id: str = None): ...
resource_id: str
class ContainerRegistryProperties:
"""
Azure Container Registry configuration.
Args:
resource_id (str, optional): Full resource ID of the container registry
"""
def __init__(self, resource_id: str = None): ...
resource_id: str
class ServicePrincipalProperties:
"""
Service principal authentication configuration.
Args:
client_id (str): Application (client) ID of the service principal
secret (str): Client secret for the service principal
"""
def __init__(self, client_id: str, secret: str): ...
client_id: str
secret: str
class KubernetesClusterProperties:
"""
Kubernetes cluster-specific properties.
Args:
service_principal (ServicePrincipalProperties, optional): Service principal for cluster access
"""
def __init__(self, service_principal: ServicePrincipalProperties = None): ...
service_principal: ServicePrincipalProperties
class AcsClusterProperties:
"""
Azure Container Service cluster properties.
Args:
orchestrator_type (OrchestratorType): Container orchestrator type
master_count (int, optional): Number of masters (default: 1)
agent_count (int, optional): Number of agents (default: 2)
agent_vm_size (AgentVMSizeTypes, optional): VM size for agents
"""
def __init__(
self,
orchestrator_type: OrchestratorType,
master_count: int = None,
agent_count: int = None,
agent_vm_size: AgentVMSizeTypes = None
): ...
orchestrator_type: OrchestratorType
master_count: int
agent_count: int
agent_vm_size: AgentVMSizeTypes
class AppInsightsProperties:
"""
Application Insights configuration.
Args:
resource_id (str, optional): Full resource ID of the Application Insights component
"""
def __init__(self, resource_id: str = None): ...
resource_id: strUsage Examples:
from azure.mgmt.machinelearningcompute.models import (
AcsClusterProperties,
OrchestratorType,
AgentVMSizeTypes,
ServicePrincipalProperties,
AppInsightsProperties
)
# Configure ACS cluster with Kubernetes
acs_config = AcsClusterProperties(
orchestrator_type=OrchestratorType.kubernetes,
master_count=3,
agent_count=5,
agent_vm_size=AgentVMSizeTypes.standard_d2_v2
)
# Configure service principal
service_principal = ServicePrincipalProperties(
client_id="12345678-1234-5678-9012-123456789012",
secret="your-client-secret"
)
# Configure Application Insights
app_insights = AppInsightsProperties(
resource_id="/subscriptions/.../components/ml-insights"
)Models for configuring cluster services and global settings.
class ServiceAuthConfiguration:
"""
Service authentication configuration.
Args:
primary_auth_key_hash (str, optional): Primary authentication key hash
secondary_auth_key_hash (str, optional): Secondary authentication key hash
"""
def __init__(
self,
primary_auth_key_hash: str = None,
secondary_auth_key_hash: str = None
): ...
primary_auth_key_hash: str
secondary_auth_key_hash: str
class SslConfiguration:
"""
SSL/TLS configuration settings.
Args:
status (Status, optional): SSL status (Enabled or Disabled)
cert (str, optional): SSL certificate
key (str, optional): SSL private key
cname (str, optional): SSL CNAME
"""
def __init__(
self,
status: Status = None,
cert: str = None,
key: str = None,
cname: str = None
): ...
status: Status
cert: str
key: str
cname: str
class AutoScaleConfiguration:
"""
Auto-scaling configuration.
Args:
status (Status, optional): Auto-scale status (Enabled or Disabled)
min_replicas (int, optional): Minimum number of replicas
max_replicas (int, optional): Maximum number of replicas
target_utilization (int, optional): Target CPU utilization percentage
refresh_period_in_seconds (int, optional): Refresh period in seconds
"""
def __init__(
self,
status: Status = None,
min_replicas: int = None,
max_replicas: int = None,
target_utilization: int = None,
refresh_period_in_seconds: int = None
): ...
status: Status
min_replicas: int
max_replicas: int
target_utilization: int
refresh_period_in_seconds: int
class GlobalServiceConfiguration:
"""
Global service configuration settings.
Args:
etag (str, optional): ETag for optimistic concurrency
ssl (SslConfiguration, optional): SSL configuration
service_auth (ServiceAuthConfiguration, optional): Service authentication configuration
auto_scale (AutoScaleConfiguration, optional): Auto-scaling configuration
"""
def __init__(
self,
etag: str = None,
ssl: SslConfiguration = None,
service_auth: ServiceAuthConfiguration = None,
auto_scale: AutoScaleConfiguration = None
): ...
etag: str
ssl: SslConfiguration
service_auth: ServiceAuthConfiguration
auto_scale: AutoScaleConfiguration
class SystemService:
"""
System service definition.
Args:
system_service_type (SystemServiceType): Type of system service
public_ip_address (str, optional): Public IP address of the service
version (str, optional): Version of the service
Read-only Attributes:
state (str): Current state of the service
"""
def __init__(
self,
system_service_type: SystemServiceType,
public_ip_address: str = None,
version: str = None
): ...
system_service_type: SystemServiceType
public_ip_address: str
version: str
state: str # readonlyModels for storing and accessing various types of cluster credentials.
class OperationalizationClusterCredentials:
"""
Container for all cluster access credentials.
Attributes:
storage_account (StorageAccountCredentials, optional): Storage account credentials
container_registry (ContainerRegistryCredentials, optional): Container registry credentials
container_service (ContainerServiceCredentials, optional): Container service credentials
app_insights (AppInsightsCredentials, optional): Application Insights credentials
"""
storage_account: StorageAccountCredentials
container_registry: ContainerRegistryCredentials
container_service: ContainerServiceCredentials
app_insights: AppInsightsCredentials
class StorageAccountCredentials:
"""
Storage account access credentials.
Attributes:
resource_id (str): Resource ID of the storage account
primary_key (str): Primary access key
secondary_key (str): Secondary access key
"""
resource_id: str
primary_key: str
secondary_key: str
class ContainerRegistryCredentials:
"""
Container registry access credentials.
Attributes:
login_server (str): Registry login server URL
username (str): Registry username
password (str): Registry password
password2 (str): Secondary registry password
"""
login_server: str
username: str
password: str
password2: str
class ContainerServiceCredentials:
"""
Container service access credentials.
Attributes:
acs_kube_config (str): Kubernetes configuration file content
image_pull_secret_name (str): Name of the image pull secret
service_principal_configuration (ServicePrincipalProperties): Service principal configuration
"""
acs_kube_config: str
image_pull_secret_name: str
service_principal_configuration: ServicePrincipalProperties
class AppInsightsCredentials:
"""
Application Insights access credentials.
Attributes:
app_id (str): Application Insights application ID
instrumentation_key (str): Instrumentation key
"""
app_id: str
instrumentation_key: strModels for API operation responses and system information.
class CheckSystemServicesUpdatesAvailableResponse:
"""
Response for system update availability check.
Attributes:
updates_available (UpdatesAvailable): Whether updates are available (Yes or No)
"""
updates_available: UpdatesAvailable
class UpdateSystemServicesResponse:
"""
Response for system services update operation.
Attributes:
update_status (str): Status of the update operation
update_started_on (datetime): When the update started
update_completed_on (datetime): When the update completed
"""
update_status: str
update_started_on: datetime
update_completed_on: datetimeModels for paginated collections and operation listings.
class OperationalizationClusterPaged:
"""
Paginated collection of OperationalizationCluster objects.
Supports iteration and automatic pagination.
"""
def __iter__(self) -> Iterator[OperationalizationCluster]: ...
def __next__(self) -> OperationalizationCluster: ...Models for structured error handling and reporting.
class ErrorDetail:
"""
Detailed error information.
Attributes:
code (str): Error code
message (str): Error message
target (str): Error target
"""
code: str
message: str
target: str
class ErrorResponse:
"""
Error response container.
Attributes:
error (ErrorDetail): Detailed error information
"""
error: ErrorDetail
class ErrorResponseWrapper:
"""
Wrapped error response.
Attributes:
error (ErrorResponse): Error response information
"""
error: ErrorResponse
class ErrorResponseWrapperException(Exception):
"""
Exception thrown for wrapped error responses.
Attributes:
message (str): Exception message
response: HTTP response object
inner_exception: Original exception
"""
message: str
response: object
inner_exception: Exceptionclass OperationStatus(Enum):
"""Cluster provisioning and operation status."""
unknown = "Unknown"
updating = "Updating"
creating = "Creating"
deleting = "Deleting"
succeeded = "Succeeded"
failed = "Failed"
canceled = "Canceled"
class ClusterType(Enum):
"""Type of operationalization cluster."""
acs = "ACS" # Azure Container Service
local = "Local" # Local cluster
class OrchestratorType(Enum):
"""Container orchestrator type."""
kubernetes = "Kubernetes"
none = "None"
class SystemServiceType(Enum):
"""Type of system service."""
none = "None"
scoring_front_end = "ScoringFrontEnd"
batch_front_end = "BatchFrontEnd"
class Status(Enum):
"""General status enumeration."""
enabled = "Enabled"
disabled = "Disabled"
class UpdatesAvailable(Enum):
"""System updates availability status."""
yes = "Yes"
no = "No"class AgentVMSizeTypes(Enum):
"""Available Azure VM sizes for cluster agents."""
# A-series VMs
standard_a0 = "Standard_A0"
standard_a1 = "Standard_A1"
standard_a2 = "Standard_A2"
standard_a3 = "Standard_A3"
standard_a4 = "Standard_A4"
standard_a5 = "Standard_A5"
standard_a6 = "Standard_A6"
standard_a7 = "Standard_A7"
standard_a8 = "Standard_A8"
standard_a9 = "Standard_A9"
standard_a10 = "Standard_A10"
standard_a11 = "Standard_A11"
# D-series VMs
standard_d1 = "Standard_D1"
standard_d2 = "Standard_D2"
standard_d3 = "Standard_D3"
standard_d4 = "Standard_D4"
standard_d11 = "Standard_D11"
standard_d12 = "Standard_D12"
standard_d13 = "Standard_D13"
standard_d14 = "Standard_D14"
# D-series v2 VMs
standard_d1_v2 = "Standard_D1_v2"
standard_d2_v2 = "Standard_D2_v2"
standard_d3_v2 = "Standard_D3_v2"
standard_d4_v2 = "Standard_D4_v2"
standard_d5_v2 = "Standard_D5_v2"
standard_d11_v2 = "Standard_D11_v2"
standard_d12_v2 = "Standard_D12_v2"
standard_d13_v2 = "Standard_D13_v2"
standard_d14_v2 = "Standard_D14_v2"
# G-series VMs
standard_g1 = "Standard_G1"
standard_g2 = "Standard_G2"
standard_g3 = "Standard_G3"
standard_g4 = "Standard_G4"
standard_g5 = "Standard_G5"
# DS-series VMs
standard_ds1 = "Standard_DS1"
standard_ds2 = "Standard_DS2"
standard_ds3 = "Standard_DS3"
standard_ds4 = "Standard_DS4"
standard_ds11 = "Standard_DS11"
standard_ds12 = "Standard_DS12"
standard_ds13 = "Standard_DS13"
standard_ds14 = "Standard_DS14"
# GS-series VMs
standard_gs1 = "Standard_GS1"
standard_gs2 = "Standard_GS2"
standard_gs3 = "Standard_GS3"
standard_gs4 = "Standard_GS4"
standard_gs5 = "Standard_GS5"Usage Examples:
from azure.mgmt.machinelearningcompute.models import (
ClusterType,
OperationStatus,
AgentVMSizeTypes,
Status
)
# Use enums in cluster configuration
cluster_type = ClusterType.acs
vm_size = AgentVMSizeTypes.standard_d2_v2
ssl_status = Status.enabled
print(f"Cluster type: {cluster_type.value}") # "ACS"
print(f"VM size: {vm_size.value}") # "Standard_D2_v2"
# Check cluster status
if cluster.provisioning_state == OperationStatus.succeeded:
print("Cluster is ready")
elif cluster.provisioning_state == OperationStatus.failed:
print("Cluster creation failed")Install with Tessl CLI
npx tessl i tessl/pypi-azure-mgmt-machinelearningcompute