CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-azure-mgmt-datamigration

Azure Data Migration Client Library for programmatically managing database migration services and operations.

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

service-management.mddocs/

Service Management

Operations for managing Azure Data Migration Service instances, including creation, configuration, lifecycle management, and monitoring. These operations handle the fundamental service resources that host migration projects and tasks.

Capabilities

Create or Update Service

Creates a new Data Migration Service or updates an existing one. This is a long-running operation that provisions Azure resources.

def begin_create_or_update(
    group_name: str,
    service_name: str, 
    parameters: DataMigrationService,
    **kwargs
) -> LROPoller[DataMigrationService]:
    """
    Creates or updates a Data Migration Service instance.
    
    Parameters:
    - group_name: Name of the resource group
    - service_name: Name of the service
    - parameters: Service configuration and properties
    
    Returns:
    LROPoller for the long-running operation
    """

Usage Example:

from azure.mgmt.datamigration.models import DataMigrationService, ServiceSku

service_params = DataMigrationService(
    location="eastus",
    kind="vm",
    sku=ServiceSku(
        name="Standard_1vCore", 
        tier="Standard",
        size="1 vCore"
    ),
    virtual_subnet_id="/subscriptions/.../virtualNetworks/myVNet/subnets/default"
)

# Start the creation (long-running operation)
poller = client.services.begin_create_or_update(
    group_name="myResourceGroup",
    service_name="myMigrationService", 
    parameters=service_params
)

# Wait for completion
service = poller.result()
print(f"Service {service.name} created successfully")

Get Service

Retrieves details of an existing Data Migration Service.

def get(group_name: str, service_name: str, **kwargs) -> DataMigrationService:
    """
    Gets a Data Migration Service resource.
    
    Parameters:
    - group_name: Name of the resource group
    - service_name: Name of the service
    
    Returns:
    DataMigrationService object with current state and properties
    """

Delete Service

Deletes an Data Migration Service instance and all associated resources.

def begin_delete(group_name: str, service_name: str, **kwargs) -> LROPoller[None]:
    """
    Deletes a Data Migration Service instance.
    
    Parameters:
    - group_name: Name of the resource group  
    - service_name: Name of the service
    
    Returns:
    LROPoller for the deletion operation
    """

Update Service

Updates properties of an existing Data Migration Service.

def begin_update(
    group_name: str,
    service_name: str,
    parameters: DataMigrationService,
    **kwargs
) -> LROPoller[DataMigrationService]:
    """
    Updates a Data Migration Service instance.
    
    Parameters:
    - group_name: Name of the resource group
    - service_name: Name of the service  
    - parameters: Updated service properties
    
    Returns:
    LROPoller for the update operation
    """

Start Service

Starts a Data Migration Service that is currently stopped.

def begin_start(group_name: str, service_name: str, **kwargs) -> LROPoller[None]:
    """
    Starts a Data Migration Service.
    
    Parameters:
    - group_name: Name of the resource group
    - service_name: Name of the service
    
    Returns:
    LROPoller for the start operation
    """

Stop Service

Stops a running Data Migration Service to reduce costs.

def begin_stop(group_name: str, service_name: str, **kwargs) -> LROPoller[None]:
    """
    Stops a Data Migration Service.
    
    Parameters:
    - group_name: Name of the resource group
    - service_name: Name of the service
    
    Returns:
    LROPoller for the stop operation
    """

Check Service Status

Gets the current operational status of a Data Migration Service.

def check_status(group_name: str, service_name: str, **kwargs) -> DataMigrationServiceStatusResponse:
    """
    Gets the status of a Data Migration Service.
    
    Parameters:
    - group_name: Name of the resource group
    - service_name: Name of the service
    
    Returns:
    Service status information including operational state
    """

List Services

Lists Data Migration Services in the subscription or resource group.

def list(**kwargs) -> ItemPaged[DataMigrationService]:
    """
    Lists all Data Migration Services in the subscription.
    
    Returns:
    Paged collection of DataMigrationService objects
    """

def list_by_resource_group(group_name: str, **kwargs) -> ItemPaged[DataMigrationService]:
    """
    Lists Data Migration Services in a resource group.
    
    Parameters:
    - group_name: Name of the resource group
    
    Returns:
    Paged collection of DataMigrationService objects
    """

List Available SKUs

Gets available service SKUs for Data Migration Services.

def list_skus(group_name: str, service_name: str, **kwargs) -> ItemPaged[AvailableServiceSku]:
    """
    Lists available SKUs for a Data Migration Service.
    
    Parameters:
    - group_name: Name of the resource group
    - service_name: Name of the service
    
    Returns:
    Available SKU options with capacity and cost information
    """

Check Name Availability

Checks if a service name is available for use.

def check_name_availability(
    location: str,
    parameters: NameAvailabilityRequest,
    **kwargs
) -> NameAvailabilityResponse:
    """
    Checks name availability for a Data Migration Service.
    
    Parameters:
    - location: Azure region
    - parameters: Name availability request with desired name
    
    Returns:
    Name availability response indicating if name is available
    """

def check_children_name_availability(
    group_name: str,
    service_name: str, 
    parameters: NameAvailabilityRequest,
    **kwargs
) -> NameAvailabilityResponse:
    """
    Checks name availability for child resources (projects, tasks).
    
    Parameters:
    - group_name: Name of the resource group
    - service_name: Name of the service
    - parameters: Name availability request
    
    Returns:
    Name availability response for child resource names
    """

Service Configuration Types

DataMigrationService

class DataMigrationService:
    """Azure Data Migration Service resource definition."""
    
    def __init__(self, location: str, **kwargs):
        """
        Initialize Data Migration Service.
        
        Parameters:
        - location: Azure region where service will be created
        - kind: Service kind (typically "vm")
        - sku: Service SKU configuration
        - virtual_subnet_id: Virtual network subnet ID
        - public_key: Public key for service authentication
        """
    
    # Properties
    location: str  # Required: Azure region
    kind: str  # Service kind (e.g., "vm")
    sku: ServiceSku  # Service tier and capacity
    provisioning_state: str  # Current provisioning state  
    public_key: str  # Public key for authentication
    virtual_subnet_id: str  # Virtual network subnet
    etag: str  # Entity tag for concurrency control
    id: str  # Resource ID
    name: str  # Resource name
    type: str  # Resource type
    tags: Dict[str, str]  # Resource tags

ServiceSku

class ServiceSku:
    """Service SKU configuration."""
    
    def __init__(self, **kwargs):
        """Initialize service SKU."""
    
    # Properties  
    name: str  # SKU name (e.g., "Standard_1vCore")
    tier: str  # SKU tier (e.g., "Standard")
    size: str  # SKU size description
    family: str  # SKU family
    capacity: int  # SKU capacity

Service Status Types

class DataMigrationServiceStatusResponse:
    """Service status response."""
    
    # Properties
    agent_version: str  # Version of the service agent
    status: str  # Current operational status
    vm_size: str  # Virtual machine size
    supported_task_types: List[str]  # Supported migration task types

class NameAvailabilityRequest:
    """Name availability check request."""
    
    def __init__(self, name: str, type: str, **kwargs):
        """
        Parameters:
        - name: Desired resource name
        - type: Resource type to check
        """
    
    # Properties
    name: str  # Name to check
    type: str  # Resource type

class NameAvailabilityResponse:
    """Name availability check response."""
    
    # Properties
    name_available: bool  # Whether name is available
    reason: str  # Reason if unavailable
    message: str  # Detailed message

Error Handling

Service operations may raise these common exceptions:

  • ResourceExistsError: Service name already exists
  • ResourceNotFoundError: Service or resource group not found
  • ClientAuthenticationError: Authentication failed
  • HttpResponseError: Other HTTP errors with detailed error information

Always handle long-running operations properly by checking the poller status and handling potential failures during provisioning operations.

Install with Tessl CLI

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

docs

connection-configuration.md

file-management.md

index.md

migration-task-types.md

project-management.md

resource-information.md

service-management.md

service-tasks.md

task-execution.md

tile.json