Table of Contents
A low-level client representing AWS Server Migration Service (SMS):
client = session.create_client('sms')
These are the available methods:
Check if an operation can be paginated.
The CreateReplicationJob API is used to create a ReplicationJob to replicate a server on AWS. Call this API to first create a ReplicationJob, which will then schedule periodic ReplicationRuns to replicate your server to AWS. Each ReplicationRun will result in the creation of an AWS AMI.
See also: AWS API Documentation
Request Syntax
response = client.create_replication_job(
serverId='string',
seedReplicationTime=datetime(2015, 1, 1),
frequency=123,
licenseType='AWS'|'BYOL',
roleName='string',
description='string'
)
dict
Response Syntax
{
'replicationJobId': 'string'
}
Response Structure
The DeleteReplicationJob API is used to delete a ReplicationJob, resulting in no further ReplicationRuns. This will delete the contents of the S3 bucket used to store SMS artifacts, but will not delete any AMIs created by the SMS service.
See also: AWS API Documentation
Request Syntax
response = client.delete_replication_job(
replicationJobId='string'
)
{}
Response Structure
The DeleteServerCatalog API clears all servers from your server catalog. This means that these servers will no longer be accessible to the Server Migration Service.
See also: AWS API Documentation
Request Syntax
response = client.delete_server_catalog()
{}
Response Structure
The DisassociateConnector API will disassociate a connector from the Server Migration Service, rendering it unavailable to support replication jobs.
See also: AWS API Documentation
Request Syntax
response = client.disassociate_connector(
connectorId='string'
)
{}
Response Structure
Generate a presigned url given a client, its method, and arguments
The presigned url
The GetConnectors API returns a list of connectors that are registered with the Server Migration Service.
See also: AWS API Documentation
Request Syntax
response = client.get_connectors(
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'connectorList': [
{
'connectorId': 'string',
'version': 'string',
'status': 'HEALTHY'|'UNHEALTHY',
'capabilityList': [
'VSPHERE',
],
'vmManagerName': 'string',
'vmManagerType': 'VSPHERE',
'vmManagerId': 'string',
'ipAddress': 'string',
'macAddress': 'string',
'associatedOn': datetime(2015, 1, 1)
},
],
'nextToken': 'string'
}
Response Structure
Create a paginator for an operation.
The GetReplicationJobs API will return all of your ReplicationJobs and their details. This API returns a paginated list, that may be consecutively called with nextToken to retrieve all ReplicationJobs.
See also: AWS API Documentation
Request Syntax
response = client.get_replication_jobs(
replicationJobId='string',
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'replicationJobList': [
{
'replicationJobId': 'string',
'serverId': 'string',
'serverType': 'VIRTUAL_MACHINE',
'vmServer': {
'vmServerAddress': {
'vmManagerId': 'string',
'vmId': 'string'
},
'vmName': 'string',
'vmManagerName': 'string',
'vmManagerType': 'VSPHERE',
'vmPath': 'string'
},
'seedReplicationTime': datetime(2015, 1, 1),
'frequency': 123,
'nextReplicationRunStartTime': datetime(2015, 1, 1),
'licenseType': 'AWS'|'BYOL',
'roleName': 'string',
'latestAmiId': 'string',
'state': 'PENDING'|'ACTIVE'|'FAILED'|'DELETING'|'DELETED',
'statusMessage': 'string',
'description': 'string',
'replicationRunList': [
{
'replicationRunId': 'string',
'state': 'PENDING'|'MISSED'|'ACTIVE'|'FAILED'|'COMPLETED'|'DELETING'|'DELETED',
'type': 'ON_DEMAND'|'AUTOMATIC',
'statusMessage': 'string',
'amiId': 'string',
'scheduledStartTime': datetime(2015, 1, 1),
'completedTime': datetime(2015, 1, 1),
'description': 'string'
},
]
},
],
'nextToken': 'string'
}
Response Structure
The GetReplicationRuns API will return all ReplicationRuns for a given ReplicationJob. This API returns a paginated list, that may be consecutively called with nextToken to retrieve all ReplicationRuns for a ReplicationJob.
See also: AWS API Documentation
Request Syntax
response = client.get_replication_runs(
replicationJobId='string',
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'replicationJob': {
'replicationJobId': 'string',
'serverId': 'string',
'serverType': 'VIRTUAL_MACHINE',
'vmServer': {
'vmServerAddress': {
'vmManagerId': 'string',
'vmId': 'string'
},
'vmName': 'string',
'vmManagerName': 'string',
'vmManagerType': 'VSPHERE',
'vmPath': 'string'
},
'seedReplicationTime': datetime(2015, 1, 1),
'frequency': 123,
'nextReplicationRunStartTime': datetime(2015, 1, 1),
'licenseType': 'AWS'|'BYOL',
'roleName': 'string',
'latestAmiId': 'string',
'state': 'PENDING'|'ACTIVE'|'FAILED'|'DELETING'|'DELETED',
'statusMessage': 'string',
'description': 'string',
'replicationRunList': [
{
'replicationRunId': 'string',
'state': 'PENDING'|'MISSED'|'ACTIVE'|'FAILED'|'COMPLETED'|'DELETING'|'DELETED',
'type': 'ON_DEMAND'|'AUTOMATIC',
'statusMessage': 'string',
'amiId': 'string',
'scheduledStartTime': datetime(2015, 1, 1),
'completedTime': datetime(2015, 1, 1),
'description': 'string'
},
]
},
'replicationRunList': [
{
'replicationRunId': 'string',
'state': 'PENDING'|'MISSED'|'ACTIVE'|'FAILED'|'COMPLETED'|'DELETING'|'DELETED',
'type': 'ON_DEMAND'|'AUTOMATIC',
'statusMessage': 'string',
'amiId': 'string',
'scheduledStartTime': datetime(2015, 1, 1),
'completedTime': datetime(2015, 1, 1),
'description': 'string'
},
],
'nextToken': 'string'
}
Response Structure
The GetServers API returns a list of all servers in your server catalog. For this call to succeed, you must previously have called ImportServerCatalog.
See also: AWS API Documentation
Request Syntax
response = client.get_servers(
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'lastModifiedOn': datetime(2015, 1, 1),
'serverCatalogStatus': 'NOT_IMPORTED'|'IMPORTING'|'AVAILABLE'|'DELETED'|'EXPIRED',
'serverList': [
{
'serverId': 'string',
'serverType': 'VIRTUAL_MACHINE',
'vmServer': {
'vmServerAddress': {
'vmManagerId': 'string',
'vmId': 'string'
},
'vmName': 'string',
'vmManagerName': 'string',
'vmManagerType': 'VSPHERE',
'vmPath': 'string'
},
'replicationJobId': 'string',
'replicationJobTerminated': True|False
},
],
'nextToken': 'string'
}
Response Structure
Returns an object that can wait for some condition.
The ImportServerCatalog API is used to gather the complete list of on-premises servers on your premises. This API call requires connectors to be installed and monitoring all servers you would like imported. This API call returns immediately, but may take some time to retrieve all of the servers.
See also: AWS API Documentation
Request Syntax
response = client.import_server_catalog()
{}
Response Structure
The StartOnDemandReplicationRun API is used to start a ReplicationRun on demand (in addition to those that are scheduled based on your frequency). This ReplicationRun will start immediately. StartOnDemandReplicationRun is subject to limits on how many on demand ReplicationRuns you may call per 24-hour period.
See also: AWS API Documentation
Request Syntax
response = client.start_on_demand_replication_run(
replicationJobId='string',
description='string'
)
dict
Response Syntax
{
'replicationRunId': 'string'
}
Response Structure
The UpdateReplicationJob API is used to change the settings of your existing ReplicationJob created using CreateReplicationJob. Calling this API will affect the next scheduled ReplicationRun.
See also: AWS API Documentation
Request Syntax
response = client.update_replication_job(
replicationJobId='string',
frequency=123,
nextReplicationRunStartTime=datetime(2015, 1, 1),
licenseType='AWS'|'BYOL',
roleName='string',
description='string'
)
dict
Response Syntax
{}
Response Structure
The available paginators are:
paginator = client.get_paginator('get_connectors')
Creates an iterator that will paginate through responses from SMS.Client.get_connectors().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
{
'connectorList': [
{
'connectorId': 'string',
'version': 'string',
'status': 'HEALTHY'|'UNHEALTHY',
'capabilityList': [
'VSPHERE',
],
'vmManagerName': 'string',
'vmManagerType': 'VSPHERE',
'vmManagerId': 'string',
'ipAddress': 'string',
'macAddress': 'string',
'associatedOn': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
A token to resume pagination.
paginator = client.get_paginator('get_replication_jobs')
Creates an iterator that will paginate through responses from SMS.Client.get_replication_jobs().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
replicationJobId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'replicationJobList': [
{
'replicationJobId': 'string',
'serverId': 'string',
'serverType': 'VIRTUAL_MACHINE',
'vmServer': {
'vmServerAddress': {
'vmManagerId': 'string',
'vmId': 'string'
},
'vmName': 'string',
'vmManagerName': 'string',
'vmManagerType': 'VSPHERE',
'vmPath': 'string'
},
'seedReplicationTime': datetime(2015, 1, 1),
'frequency': 123,
'nextReplicationRunStartTime': datetime(2015, 1, 1),
'licenseType': 'AWS'|'BYOL',
'roleName': 'string',
'latestAmiId': 'string',
'state': 'PENDING'|'ACTIVE'|'FAILED'|'DELETING'|'DELETED',
'statusMessage': 'string',
'description': 'string',
'replicationRunList': [
{
'replicationRunId': 'string',
'state': 'PENDING'|'MISSED'|'ACTIVE'|'FAILED'|'COMPLETED'|'DELETING'|'DELETED',
'type': 'ON_DEMAND'|'AUTOMATIC',
'statusMessage': 'string',
'amiId': 'string',
'scheduledStartTime': datetime(2015, 1, 1),
'completedTime': datetime(2015, 1, 1),
'description': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
replicationJobList (list) -- List of Replication Jobs
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('get_replication_runs')
Creates an iterator that will paginate through responses from SMS.Client.get_replication_runs().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
replicationJobId='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'replicationJob': {
'replicationJobId': 'string',
'serverId': 'string',
'serverType': 'VIRTUAL_MACHINE',
'vmServer': {
'vmServerAddress': {
'vmManagerId': 'string',
'vmId': 'string'
},
'vmName': 'string',
'vmManagerName': 'string',
'vmManagerType': 'VSPHERE',
'vmPath': 'string'
},
'seedReplicationTime': datetime(2015, 1, 1),
'frequency': 123,
'nextReplicationRunStartTime': datetime(2015, 1, 1),
'licenseType': 'AWS'|'BYOL',
'roleName': 'string',
'latestAmiId': 'string',
'state': 'PENDING'|'ACTIVE'|'FAILED'|'DELETING'|'DELETED',
'statusMessage': 'string',
'description': 'string',
'replicationRunList': [
{
'replicationRunId': 'string',
'state': 'PENDING'|'MISSED'|'ACTIVE'|'FAILED'|'COMPLETED'|'DELETING'|'DELETED',
'type': 'ON_DEMAND'|'AUTOMATIC',
'statusMessage': 'string',
'amiId': 'string',
'scheduledStartTime': datetime(2015, 1, 1),
'completedTime': datetime(2015, 1, 1),
'description': 'string'
},
]
},
'replicationRunList': [
{
'replicationRunId': 'string',
'state': 'PENDING'|'MISSED'|'ACTIVE'|'FAILED'|'COMPLETED'|'DELETING'|'DELETED',
'type': 'ON_DEMAND'|'AUTOMATIC',
'statusMessage': 'string',
'amiId': 'string',
'scheduledStartTime': datetime(2015, 1, 1),
'completedTime': datetime(2015, 1, 1),
'description': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
replicationJob (dict) -- Object representing a Replication Job
replicationRunList (list) -- List of Replication Runs
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('get_servers')
Creates an iterator that will paginate through responses from SMS.Client.get_servers().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
{
'lastModifiedOn': datetime(2015, 1, 1),
'serverCatalogStatus': 'NOT_IMPORTED'|'IMPORTING'|'AVAILABLE'|'DELETED'|'EXPIRED',
'serverList': [
{
'serverId': 'string',
'serverType': 'VIRTUAL_MACHINE',
'vmServer': {
'vmServerAddress': {
'vmManagerId': 'string',
'vmId': 'string'
},
'vmName': 'string',
'vmManagerName': 'string',
'vmManagerType': 'VSPHERE',
'vmPath': 'string'
},
'replicationJobId': 'string',
'replicationJobTerminated': True|False
},
],
'NextToken': 'string'
}
Response Structure
A token to resume pagination.