Microsoft Azure Data Migration Client Library for Python providing comprehensive database migration management capabilities
A comprehensive Python client library for Azure Data Migration services that enables developers to programmatically manage and orchestrate database migration tasks between various database platforms and Azure services. This library provides complete management API for creating, configuring, and monitoring database migration services, projects, and tasks, with support for both synchronous and asynchronous operations.
pip install azure-mgmt-datamigrationazure-mgmt-core>=1.2.0,<2.0.0, msrest>=0.6.21, azure-common~=1.1from azure.mgmt.datamigration import DataMigrationManagementClientFor asynchronous operations:
from azure.mgmt.datamigration.aio import DataMigrationManagementClientfrom azure.mgmt.datamigration import DataMigrationManagementClient
from azure.identity import DefaultAzureCredential
# Create the client
credential = DefaultAzureCredential()
client = DataMigrationManagementClient(
credential=credential,
subscription_id="your-subscription-id"
)
# List all migration services
services = client.services.list()
for service in services:
print(f"Service: {service.name}, Status: {service.provisioning_state}")
# Get a specific service
service = client.services.get(
resource_group_name="my-resource-group",
service_name="my-migration-service"
)
# List projects in the service
projects = client.projects.list(
resource_group_name="my-resource-group",
service_name="my-migration-service"
)
# Close the client when done
client.close()The Azure Data Migration Management Client follows Azure's ARM (Azure Resource Manager) pattern with these key components:
aio moduleThe client integrates with Azure's authentication system, resource management, and compliance policies through Azure Resource Manager.
Core functionality for managing Azure Data Migration Service instances, including creation, configuration, start/stop operations, and status monitoring.
class ServicesOperations:
def begin_create_or_update(self, group_name: str, service_name: str, parameters: DataMigrationService, **kwargs) -> LROPoller[DataMigrationService]: ...
def get(self, group_name: str, service_name: str, **kwargs) -> DataMigrationService: ...
def begin_delete(self, group_name: str, service_name: str, **kwargs) -> LROPoller[None]: ...
def begin_start(self, group_name: str, service_name: str, **kwargs) -> LROPoller[None]: ...
def begin_stop(self, group_name: str, service_name: str, **kwargs) -> LROPoller[None]: ...
def list(self, **kwargs) -> ItemPaged[DataMigrationService]: ...
def list_by_resource_group(self, group_name: str, **kwargs) -> ItemPaged[DataMigrationService]: ...Project lifecycle management for organizing and configuring migration scenarios, including source and target platform configuration.
class ProjectsOperations:
def create_or_update(self, group_name: str, service_name: str, project_name: str, parameters: Project, **kwargs) -> Project: ...
def get(self, group_name: str, service_name: str, project_name: str, **kwargs) -> Project: ...
def delete(self, group_name: str, service_name: str, project_name: str, **kwargs) -> None: ...
def list(self, group_name: str, service_name: str, **kwargs) -> ItemPaged[Project]: ...Execution and monitoring of specific migration tasks, including data migration, schema migration, and validation tasks for various database platforms.
class TasksOperations:
def create_or_update(self, group_name: str, service_name: str, project_name: str, task_name: str, parameters: ProjectTask, **kwargs) -> ProjectTask: ...
def get(self, group_name: str, service_name: str, project_name: str, task_name: str, **kwargs) -> ProjectTask: ...
def delete(self, group_name: str, service_name: str, project_name: str, task_name: str, **kwargs) -> None: ...
def cancel(self, group_name: str, service_name: str, project_name: str, task_name: str, **kwargs) -> ProjectTask: ...
def command(self, group_name: str, service_name: str, project_name: str, task_name: str, parameters: CommandProperties, **kwargs) -> CommandProperties: ...Service-level task management for operations performed by Data Migration Service instances, including service task lifecycle and status monitoring.
class ServiceTasksOperations:
def list(self, group_name: str, service_name: str, task_type: str = None, **kwargs) -> ItemPaged[TaskList]: ...
def create_or_update(self, group_name: str, service_name: str, task_name: str, parameters: ProjectTask, **kwargs) -> ProjectTask: ...
def get(self, group_name: str, service_name: str, task_name: str, expand: str = None, **kwargs) -> ProjectTask: ...
def delete(self, group_name: str, service_name: str, task_name: str, delete_running_tasks: bool = None, **kwargs) -> None: ...
def update(self, group_name: str, service_name: str, task_name: str, parameters: ProjectTask, **kwargs) -> ProjectTask: ...
def cancel(self, group_name: str, service_name: str, task_name: str, **kwargs) -> ProjectTask: ...Database connection testing and migration validation capabilities for ensuring successful migration setup and execution.
# Connection task properties for various database platforms
class ConnectToSourceSqlServerTaskProperties: ...
class ConnectToSourceMySqlTaskProperties: ...
class ConnectToSourcePostgreSqlSyncTaskProperties: ...
class ConnectToSourceOracleSyncTaskProperties: ...
class ConnectToMongoDbTaskProperties: ...
# Validation task properties
class ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: ...
class ValidateMigrationInputSqlServerSqlMITaskProperties: ...
class ValidateMongoDbTaskProperties: ...Resource SKU information, usage quotas, and service availability management for planning and monitoring migration resources.
class ResourceSkusOperations:
def list_skus(self, **kwargs) -> ItemPaged[ResourceSku]: ...
class UsagesOperations:
def list(self, location: str, **kwargs) -> ItemPaged[Quota]: ...Project file upload, management, and access for migration artifacts like scripts, configurations, and backup files.
class FilesOperations:
def create_or_update(self, group_name: str, service_name: str, project_name: str, file_name: str, parameters: ProjectFile, **kwargs) -> ProjectFile: ...
def get(self, group_name: str, service_name: str, project_name: str, file_name: str, **kwargs) -> ProjectFile: ...
def read(self, group_name: str, service_name: str, project_name: str, file_name: str, **kwargs) -> FileStorageInfo: ...Discovery of available resource provider actions and operations supported by the Azure Data Migration Service.
class Operations:
def list(self, **kwargs) -> ItemPaged[ServiceOperationList]: ...class DataMigrationManagementClient:
"""Main client for Azure Data Migration services."""
def __init__(self, credential: TokenCredential, subscription_id: str, base_url: str = None, **kwargs): ...
def close(self) -> None: ...
def __enter__(self) -> DataMigrationManagementClient: ...
def __exit__(self, *exc_details) -> None: ...
# Operation groups
services: ServicesOperations
projects: ProjectsOperations
tasks: TasksOperations
service_tasks: ServiceTasksOperations
files: FilesOperations
resource_skus: ResourceSkusOperations
usages: UsagesOperations
operations: Operations
class DataMigrationService:
"""Represents a data migration service instance."""
name: str
location: str
kind: str
provisioning_state: str
public_key: str
virtual_subnet_id: str
class Project:
"""Migration project configuration."""
name: str
location: str
source_platform: str
target_platform: str
creation_time: datetime
source_connection_info: ConnectionInfo
target_connection_info: ConnectionInfo
class ProjectTask:
"""Migration task within a project."""
name: str
task_type: str
state: str
properties: ProjectTaskProperties
class ConnectionInfo:
"""Base class for database connection information."""
type: str
user_name: str
password: str
class TaskList:
"""List of service tasks."""
value: List[ProjectTask]
next_link: str
class ServiceOperationList:
"""List of available operations."""
value: List[ServiceOperation]
next_link: str
class ServiceOperation:
"""A REST API operation."""
name: str
display: ServiceOperationDisplay
origin: str
class ServiceOperationDisplay:
"""Operation display information."""
provider: str
resource: str
operation: str
description: strtessl i tessl/pypi-azure-mgmt-datamigration@9.0.0