CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-azure-mgmt-computeschedule

Microsoft Azure ComputeSchedule Management Client Library for Python providing VM scheduling operations.

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

models-types.mddocs/

Models and Types

Comprehensive data structures including request/response models, enumerations, and error handling types for all API operations. These types define the structure of data exchanged with the Azure ComputeSchedule service.

Core Data Models

Schedule Configuration

class Schedule:
    """
    Schedule configuration for timed operations.
    
    Attributes:
    - deadline_type: DeadlineType - Type of deadline (INITIATE_AT, COMPLETE_BY, UNKNOWN)
    - deadline: str - ISO 8601 datetime string for operation execution
    - timezone: str - Timezone identifier (e.g., "UTC", "America/New_York")
    """
    deadline_type: DeadlineType
    deadline: str
    timezone: str

Execution Parameters

class ExecutionParameters:
    """
    Parameters controlling how operations are executed.
    
    Attributes:
    - resources: Resources - Target resources for the operation (required)
    - optimization_preference: OptimizationPreference - Speed vs cost optimization (optional)
    - retry_policy: RetryPolicy - Retry configuration for failed operations (optional)
    """
    resources: Resources
    optimization_preference: Optional[OptimizationPreference]
    retry_policy: Optional[RetryPolicy]

Resource Specifications

class Resources:
    """
    Specification of target Azure resources.
    
    Attributes:
    - ids: List[str] - List of Azure Resource Manager resource IDs
    """
    ids: List[str]

class ResourceProvisionPayload:
    """
    Payload for resource provisioning operations.
    
    Contains configuration parameters for creating new VM resources.
    Specific attributes depend on resource type and configuration requirements.
    """

Retry Configuration

class RetryPolicy:
    """
    Retry policy configuration for failed operations.
    
    Attributes:
    - retry_count: int - Number of retry attempts
    - retry_window_in_minutes: int - Time window for retry attempts
    """
    retry_count: int
    retry_window_in_minutes: int

Request Models

Scheduled Operation Requests

class SubmitDeallocateRequest:
    """
    Request for scheduled deallocate operations.
    
    Attributes:
    - schedule: Schedule - When to execute the operation (required)
    - execution_parameters: ExecutionParameters - How to execute the operation (required)
    """
    schedule: Schedule
    execution_parameters: ExecutionParameters

class SubmitHibernateRequest:
    """
    Request for scheduled hibernate operations.
    
    Attributes:
    - schedule: Schedule - When to execute the operation (required)
    - execution_parameters: ExecutionParameters - How to execute the operation (required)
    """
    schedule: Schedule
    execution_parameters: ExecutionParameters

class SubmitStartRequest:
    """
    Request for scheduled start operations.
    
    Attributes:
    - schedule: Schedule - When to execute the operation (required)
    - execution_parameters: ExecutionParameters - How to execute the operation (required)
    """
    schedule: Schedule
    execution_parameters: ExecutionParameters

Immediate Operation Requests

class ExecuteDeallocateRequest:
    """
    Request for immediate deallocate operations.
    
    Attributes:
    - execution_parameters: ExecutionParameters - How to execute the operation (required)
    """
    execution_parameters: ExecutionParameters

class ExecuteHibernateRequest:
    """
    Request for immediate hibernate operations.
    
    Attributes:
    - execution_parameters: ExecutionParameters - How to execute the operation (required)
    """
    execution_parameters: ExecutionParameters

class ExecuteStartRequest:
    """
    Request for immediate start operations.
    
    Attributes:
    - execution_parameters: ExecutionParameters - How to execute the operation (required)
    """
    execution_parameters: ExecutionParameters

class ExecuteCreateRequest:
    """
    Request for immediate create operations.
    
    Attributes:
    - resource_config_parameters: ResourceProvisionPayload - Resource creation configuration (required)
    """
    resource_config_parameters: ResourceProvisionPayload

class ExecuteDeleteRequest:
    """
    Request for immediate delete operations.
    
    Attributes:
    - execution_parameters: ExecutionParameters - How to execute the operation (required)
    """
    execution_parameters: ExecutionParameters

Management Operation Requests

class GetOperationStatusRequest:
    """
    Request to get operation status using operation IDs.
    
    Attributes:
    - operation_ids: List[str] - List of operation IDs to query (required)
    """
    operation_ids: List[str]

class CancelOperationsRequest:
    """
    Request to cancel running operations using operation IDs.
    
    Attributes:
    - operation_ids: List[str] - List of operation IDs to cancel (required)
    """
    operation_ids: List[str]

class GetOperationErrorsRequest:
    """
    Request to get error details for operations.
    
    Attributes:
    - operation_ids: List[str] - List of operation IDs to query errors (required)
    """
    operation_ids: List[str]

Response Models

Operation Response Models

class DeallocateResourceOperationResponse:
    """
    Response for deallocate operations.
    
    Attributes:
    - operation_id: str - Unique identifier for the operation
    - type: str - Operation type
    - location: str - Azure region where operation executes
    - status: str - Current operation status
    """
    operation_id: str
    type: str
    location: str
    status: str

class HibernateResourceOperationResponse:
    """
    Response for hibernate operations.
    
    Attributes:
    - operation_id: str - Unique identifier for the operation
    - type: str - Operation type
    - location: str - Azure region where operation executes
    - status: str - Current operation status
    """
    operation_id: str
    type: str
    location: str
    status: str

class StartResourceOperationResponse:
    """
    Response for start operations.
    
    Attributes:
    - operation_id: str - Unique identifier for the operation
    - type: str - Operation type
    - location: str - Azure region where operation executes
    - status: str - Current operation status
    """
    operation_id: str
    type: str
    location: str
    status: str

class CreateResourceOperationResponse:
    """
    Response for create operations.
    
    Attributes:
    - operation_id: str - Unique identifier for the operation
    - type: str - Operation type
    - location: str - Azure region where operation executes
    - status: str - Current operation status
    """
    operation_id: str
    type: str
    location: str
    status: str

class DeleteResourceOperationResponse:
    """
    Response for delete operations.
    
    Attributes:
    - operation_id: str - Unique identifier for the operation
    - type: str - Operation type
    - location: str - Azure region where operation executes
    - status: str - Current operation status
    """
    operation_id: str
    type: str
    location: str
    status: str

Management Response Models

class GetOperationStatusResponse:
    """
    Response containing operation status information.
    
    Attributes:
    - results: List[ResourceOperationDetails] - Status details for each requested operation
    """
    results: List[ResourceOperationDetails]

class CancelOperationsResponse:
    """
    Response for operation cancellation requests.
    
    Attributes:
    - results: List[ResourceOperation] - Cancellation results for each operation
    """
    results: List[ResourceOperation]

class GetOperationErrorsResponse:
    """
    Response containing detailed error information.
    
    Attributes:
    - results: List[OperationErrorsResult] - Error details for each requested operation
    """
    results: List[OperationErrorsResult]

Detailed Data Models

class ResourceOperationDetails:
    """
    Detailed information about a resource operation.
    
    Attributes:
    - operation_id: str - Unique operation identifier
    - state: OperationState - Current operation state
    - completion_time: str - ISO 8601 completion timestamp (if completed)
    - progress_percentage: int - Execution progress percentage
    - error_message: str - Error message (if failed)
    """
    operation_id: str
    state: OperationState
    completion_time: Optional[str]
    progress_percentage: Optional[int]
    error_message: Optional[str]

class ResourceOperation:
    """
    Basic resource operation information.
    
    Attributes:
    - operation_id: str - Unique operation identifier
    - cancelled: bool - Whether operation was successfully cancelled
    - reason: str - Reason if cancellation failed
    """
    operation_id: str
    cancelled: bool
    reason: Optional[str]

class OperationErrorsResult:
    """
    Error information for a specific operation.
    
    Attributes:
    - operation_id: str - Operation identifier
    - errors: List[ResourceOperationError] - List of errors that occurred
    """
    operation_id: str
    errors: List[ResourceOperationError]

class ResourceOperationError:
    """
    Detailed error information for operation failures.
    
    Attributes:
    - error_code: str - Standardized error code
    - error_message: str - Human-readable error description
    - target_resource: str - Resource ID that caused the error
    - additional_info: str - Additional error context
    """
    error_code: str
    error_message: str
    target_resource: Optional[str]
    additional_info: Optional[str]

Provider Operations Models

class Operation:
    """
    Available provider operation definition.
    
    Attributes:
    - name: str - Operation name
    - display: OperationDisplay - Display information for the operation
    """
    name: str
    display: OperationDisplay

class OperationDisplay:
    """
    Display information for provider operations.
    
    Attributes:
    - provider: str - Provider name
    - resource: str - Resource type
    - operation: str - Operation name
    - description: str - Operation description
    """
    provider: str
    resource: str
    operation: str
    description: str

class OperationErrorDetails:
    """
    Error details for operation failures.
    
    Attributes:
    - error_code: str - Error code
    - error_message: str - Error message
    - target: str - Error target
    """
    error_code: str
    error_message: str
    target: Optional[str]

Enumerations

Operation States

class OperationState(str, Enum):
    """
    States of operations in Scheduled Actions.
    """
    UNKNOWN = "Unknown"                    # Default value for operation state
    PENDING_SCHEDULING = "PendingScheduling"  # Operations pending scheduling
    SCHEDULED = "Scheduled"                # Operations that have been scheduled
    PENDING_EXECUTION = "PendingExecution"   # Operations waiting to be executed
    EXECUTING = "Executing"                # Operations in process of execution
    SUCCEEDED = "Succeeded"                # Operations that succeeded
    FAILED = "Failed"                      # Operations that have failed
    CANCELLED = "Cancelled"                # Operations that were cancelled
    BLOCKED = "Blocked"                    # Operations that are blocked

Deadline Types

class DeadlineType(str, Enum):
    """
    Types of deadlines supported by ScheduledActions.
    """
    UNKNOWN = "Unknown"        # Default unknown value
    INITIATE_AT = "InitiateAt" # Initiate operation at given deadline
    COMPLETE_BY = "CompleteBy" # Complete operation by given deadline

Optimization Preferences

class OptimizationPreference(str, Enum):
    """
    Optimization preferences for operation execution.
    """
    COST = "Cost"                                   # Optimize for lowest cost
    AVAILABILITY = "Availability"                   # Optimize for resource availability
    COST_AVAILABILITY_BALANCED = "CostAvailabilityBalanced"  # Balance cost and availability

Resource Operation Types

class ResourceOperationType(str, Enum):
    """
    Types of resource operations that can be performed.
    """
    UNKNOWN = "Unknown"       # Default unknown operation type
    START = "Start"           # Start virtual machines
    DEALLOCATE = "Deallocate" # Deallocate virtual machines
    HIBERNATE = "Hibernate"   # Hibernate virtual machines

Action Types

class ActionType(str, Enum):
    """
    Indicates the action type for operations.
    """
    INTERNAL = "Internal"  # Actions for internal-only APIs

Origin Types

class Origin(str, Enum):
    """
    Origin of operations.
    """
    USER = "user"           # User-initiated operations
    SYSTEM = "system"       # System-initiated operations
    USER_SYSTEM = "user,system"  # Combined user and system operations

Error Models

class ErrorResponse:
    """
    Standard error response format.
    
    Attributes:
    - error: ErrorDetail - Detailed error information
    """
    error: ErrorDetail

class ErrorDetail:
    """
    Detailed error information.
    
    Attributes:
    - code: str - Error code
    - message: str - Error message
    - target: str - Error target
    - details: List[ErrorDetail] - Additional error details
    - additional_info: List[ErrorAdditionalInfo] - Additional error information
    """
    code: str
    message: str
    target: Optional[str]
    details: Optional[List[ErrorDetail]]
    additional_info: Optional[List[ErrorAdditionalInfo]]

class ErrorAdditionalInfo:
    """
    Additional error information.
    
    Attributes:
    - type: str - Information type
    - info: Any - Additional information object
    """
    type: str
    info: Any

Install with Tessl CLI

npx tessl i tessl/pypi-azure-mgmt-computeschedule

docs

client-setup.md

immediate-operations.md

index.md

models-types.md

operation-management.md

scheduled-operations.md

tile.json