Updated on 2022-08-02 GMT+08:00

Querying a Source Server with a Specified ID

Function

After the Agent reports the source server information to SMS, SMS checks the migration feasibility of the source server. This API is used to query the basic information and check results of source servers.

URI

GET /v3/sources/{source_id}

Table 1 Path parameter

Parameter

Mandatory

Type

Description

source_id

Yes

String

Specifies the ID of the source server displayed on the SMS console.

Minimum length: 0 characters

Maximum length: 255 characters

Request

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Minimum length: 1 character

Maximum length: 16,384 characters

Response

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

id

String

Specifies the source server ID.

Minimum length: 0 characters

Maximum length: 255 characters

ip

String

Specifies the IP address of the source server.

Minimum length: 0 characters

Maximum length: 255 characters

name

String

Specifies the name of the source server displayed on the SMS console.

Minimum length: 0 characters

Maximum length: 255 characters

hostname

String

Specifies the host name of the source server. This parameter is mandatory for registering the source server with SMS and optional for updating the information about the source server.

Minimum length: 0 characters

Maximum length: 255 characters

enterprise_project_id

String

Specifies the enterprise project ID.

Minimum length: 1 character

Maximum length: 255 characters

add_date

Long

Specifies the time when the source is registered.

Minimum value: 0

Maximum value: 9223372036854775807

os_type

String

Specifies the OS type of the source server. This parameter is mandatory for registering the source server with SMS and optional for updating the information about the source server.

Minimum length: 0 characters

Maximum length: 255 characters

os_version

String

Specifies the OS version.

Minimum length: 0 characters

Maximum length: 255 characters

oem_system

Boolean

Specifies whether the OS is an OEM OS (Windows).

state

String

Specifies the source server status.

The value can be:

  • unavailable
  • waiting
  • initialize
  • replicate
  • syncing
  • stopping
  • stopped
  • deleting
  • error
  • cloning
  • testing
  • finished

connected

Boolean

Specifies whether the Agent installed on the source server is properly connected to SMS.

firmware

String

Specifies the boot mode.

The value can be:

  • BIOS
  • UEFI

init_target_server

InitTargetServer object

Specifies the recommended configuration of the target server.

cpu_quantity

Integer

Specifies the number of CPU cores on the source server.

Minimum value: 0

Maximum value: 65535

memory

Long

Specifies the physical memory size (MB) of the source server.

Minimum value: 0

Maximum value: 9223372036854775807

current_task

TaskByServerSource object

Specifies the migration task associated with the source server.

disks

Array of ServerDisk objects

Specifies the disk information of the source server.

volume_groups

Array of VolumeGroups objects

Specifies the volume group information of the source server. If there is no volume group, remain an empty array [].

btrfs_list

Array of BtrfsFileSystem objects

Specifies the Btrfs information on the source server. This parameter is mandatory for Linux. If no Btrfs exists on the source server, an empty array will be returned.

networks

Array of NetWork objects

Specifies the NIC information of the source server.

checks

Array of EnvironmentCheck objects

Specifies the information about the migration feasibility check of the source server.

migration_cycle

String

Specifies the current migration stage of the source server.

Minimum length: 0 characters

Maximum length: 255 characters

The value can be:

  • cutovering
  • cutovered
  • checking
  • setting
  • replicating
  • syncing

state_action_time

Long

Specifies the time (in timestamp) when the status of the source server last changed.

Minimum value: 0

Maximum value: 9223372036854775807

replicatesize

Long

Specifies the amount of data that has been migrated, in bytes.

Minimum value: 0

Maximum value: 9223372036854775807

totalsize

Long

Specifies the total amount of data to be migrated, in bytes.

Minimum value: 0

Maximum value: 9223372036854775807

last_visit_time

Long

Specifies the time (in timestamp) when the Agent connection status last changed.

Minimum value: 0

Maximum value: 9223372036854775807

stage_action_time

Long

Specifies the time when the migration stage of the source server last changed.

Minimum value: 0

Maximum value: 9223372036854775807

agent_version

String

Specifies the version of the Agent installed on the source server.

Minimum length: 0 characters

Maximum length: 255 characters

Table 4 InitTargetServer field description

Parameter

Type

Description

disks

Array of DiskIntargetServer objects

Specifies the disk information of the target server.

Table 5 DiskIntargetServer field description

Parameter

Type

Description

name

String

Specifies the disk name.

Minimum length: 0 characters

Maximum length: 255 characters

size

Long

Specifies the disk size, in bytes.

Minimum value: 0

Maximum value: 9223372036854775807

device_use

String

Specifies the disk function.

Minimum length: 0 characters

Maximum length: 255 characters

The value can be:

  • BOOT
  • OS
  • NORMAL
Table 6 TaskByServerSource

Parameter

Type

Description

id

String

Specifies the task ID.

Minimum length: 0 characters

Maximum length: 255 characters

name

String

Specifies the task name.

Minimum length: 0 characters

Maximum length: 255 characters

type

String

Specifies the task type.

Minimum length: 0 characters

Maximum length: 255 characters

state

String

Specifies the task status.

Minimum length: 0 characters

Maximum length: 255 characters

start_date

Long

Specifies the start time.

Minimum value: 0

Maximum value: 9223372036854775807

speed_limit

Integer

Specifies the migration rate limit.

Minimum value: 0

Maximum value: 10000

migrate_speed

Double

Specifies the migration rate.

Minimum value: 0

Maximum value: 10000

start_target_server

Boolean

Specifies whether the target server is started.

vm_template_id

String

Specifies the ID of the template used for creating the target server.

Minimum length: 0 characters

Maximum length: 255 characters

region_id

String

region_id

Minimum length: 0 characters

Maximum length: 255 characters

project_name

String

Specifies the project name.

Minimum length: 0 characters

Maximum length: 255 characters

project_id

String

Specifies the project ID.

Minimum length: 0 characters

Maximum length: 255 characters

target_server

TargetServerById object

Specifies the information about the target server.

log_collect_status

String

Specifies the log collection status.

Minimum length: 0 characters

Maximum length: 255 characters

exist_server

Boolean

Specifies whether an existing ECS is used as the target server.

use_public_ip

Boolean

Specifies whether to use a public IP address for migration.

clone_server

CloneServer object

Specifies the information about the cloned server.

Table 7 TargetServerById field description

Parameter

Type

Description

vm_id

String

Specifies the target server ID.

Minimum length: 0 characters

Maximum length: 255 characters

name

String

Specifies the name of the target server.

Minimum length: 0 characters

Maximum length: 255 characters

Table 8 CloneServer field description

Parameter

Type

Description

vm_id

String

Specifies the cloned server ID.

Minimum length: 0 characters

Maximum length: 255 characters

name

String

Specifies the name of the cloned server.

Minimum length: 0 characters

Maximum length: 255 characters

clone_error

String

Specifies the error message returned for cloning failure.

Minimum length: 0 characters

Maximum length: 255 characters

clone_state

String

Specifies the cloning status.

Minimum length: 0 characters

Maximum length: 255 characters

error_msg

String

Specifies the error message returned for cloning failure.

Minimum length: 0 characters

Maximum length: 1,024 characters

Table 9 ServerDisk field description

Parameter

Type

Description

name

String

Specifies the disk name.

Minimum length: 0 characters

Maximum length: 255 characters

partition_style

String

Specifies the disk partition type. This parameter is mandatory for source server registration.

The value can be:

  • MBR
  • GPT

device_use

String

Specifies the disk type.

The value can be:

  • BOOT
  • OS

size

Long

Specifies the disk size, in bytes.

Minimum value: 0

Maximum value: 9223372036854775807

used_size

Long

Specifies the used disk space, in bytes.

Minimum value: 0

Maximum value: 9223372036854775807

physical_volumes

Array of PhysicalVolume objects

Specifies the physical partition information of the disk.

os_disk

Boolean

Specifies whether the disk is the system disk.

relation_name

String

Specifies the name of the corresponding disk on the target server running Linux.

Minimum length: 0 characters

Maximum length: 255 characters

Table 10 PhysicalVolume field description

Parameter

Type

Description

device_use

String

Specifies the partition type. The value can be NORMAL, BOOT, or OS.

Minimum length: 0 characters

Maximum length: 255 characters

file_system

String

Specifies the file system type.

Minimum length: 0 characters

Maximum length: 255 characters

index

Integer

Specifies the serial number of the volume.

Minimum value: 0

Maximum value: 2147483647

mount_point

String

Specifies the mount point.

Minimum length: 0 characters

Maximum length: 255 characters

name

String

Specifies the volume name. In Windows, it indicates the drive letter, and in Linux, it indicates the device ID.

Minimum length: 0 characters

Maximum length: 255 characters

size

Long

Specifies the volume size.

Minimum value: 0

Maximum value: 9223372036854775807

used_size

Long

Specifies the used space.

Minimum value: 0

Maximum value: 9223372036854775807

uuid

String

Specifies the GUID of the volume, which can be obtained from the source server.

Minimum length: 0 characters

Maximum length: 255 characters

size_per_cluster

Integer

Specifies the size of each cluster.

Minimum value: 0

Maximum value: 2147483647

Table 11 VolumeGroups field description

Parameter

Type

Description

components

String

Specifies the physical volume information.

Minimum length: 0 characters

Maximum length: 255 characters

free_size

Long

Specifies the available space.

Minimum value: 0

Maximum value: 9223372036854775807

logical_volumes

Array of LogicalVolumes objects

Specifies the logical volume information.

name

String

Specifies the volume group name.

Minimum length: 0 characters

Maximum length: 255 characters

size

Long

Specifies the volume size.

Minimum value: 0

Maximum value: 9223372036854775807

Table 12 LogicalVolumes field description

Parameter

Type

Description

block_count

Integer

Specifies the number of blocks.

Minimum value: 0

Maximum value: 4294967296

Default value: 0

block_size

Long

Specifies the block size.

Minimum value: 0

Maximum value: 1048576

Default value: 0

file_system

String

Specifies the file system.

Minimum length: 0 characters

Maximum length: 255 characters

inode_size

Integer

Specifies the number of inodes.

Minimum value: 0

Maximum value: 4294967296

mount_point

String

Specifies the mount point.

Minimum length: 0 characters

Maximum length: 256 characters

name

String

Specifies the volume group name.

Minimum length: 0 characters

Maximum length: 1,024 characters

size

Long

Specifies the volume size.

Minimum value: 0

Maximum value: 9223372036854775807

used_size

Long

Specifies the used space.

Minimum value: 0

Maximum value: 9223372036854775807

free_size

Long

Specifies the available space.

Minimum value: 0

Maximum value: 9223372036854775807

Table 13 BtrfsFileSystem field description

Parameter

Type

Description

name

String

Specifies the file system name.

Minimum length: 0 characters

Maximum length: 255 characters

label

String

Specifies the file system tag. If no tag exists, the value is an empty string.

Minimum length: 0 characters

Maximum length: 255 characters

uuid

String

Specifies the UUID of the file system.

Minimum length: 0 characters

Maximum length: 255 characters

device

String

Specifies the device name in the Btrfs.

Minimum length: 0 characters

Maximum length: 255 characters

size

Long

Specifies the space occupied by the file system.

Minimum value: 0

Maximum value: 9223372036854775807

nodesize

Long

Specifies the size of the Btrfs node.

Minimum value: 0

Maximum value: 9223372036854775807

sectorsize

Integer

Specifies the sector size.

Minimum value: 0

Maximum value: 2147483647

data_profile

String

Specifies the data profile (RAD).

Minimum length: 0 characters

Maximum length: 255 characters

system_profile

String

Specifies the file system profile (RAD).

Minimum length: 0 characters

Maximum length: 255 characters

metadata_profile

String

Specifies the metadata profile (RAD).

Minimum length: 0 characters

Maximum length: 255 characters

global_reserve1

String

Specifies the Btrfs file system information.

Minimum length: 0 characters

Maximum length: 255 characters

g_vol_used_size

Long

Specifies the used space of the Btrfs volume.

Minimum value: 0

Maximum value: 9223372036854775807

default_subvolid

String

Specifies the ID of the default subvolume.

Minimum length: 0 characters

Maximum length: 255 characters

default_subvol_name

String

Specifies the name of the default subvolume.

Minimum length: 0 characters

Maximum length: 255 characters

default_subvol_mountpath

String

Specifies the mount path of the default subvolume or Btrfs file system.

Minimum length: 0 characters

Maximum length: 255 characters

subvolumn

Array of BtrfsSubvolumn objects

Specifies the subvolume information.

Table 14 BtrfsFileSystem field description

Parameter

Type

Description

uuid

String

Specifies the UUID of the parent volume.

Minimum length: 0 characters

Maximum length: 255 characters

is_snapshot

String

Specifies whether the subvolume is a snapshot.

Minimum length: 0 characters

Maximum length: 255 characters

subvol_id

String

Specifies the subvolume ID.

Minimum length: 0 characters

Maximum length: 255 characters

parent_id

String

Specifies the parent volume ID.

Minimum length: 0 characters

Maximum length: 255 characters

subvol_name

String

Specifies the subvolume name.

Minimum length: 0 characters

Maximum length: 255 characters

subvol_mount_path

String

Specifies the mount path of the subvolume.

Minimum length: 0 characters

Maximum length: 255 characters

Table 15 NetWork field description

Parameter

Type

Description

name

String

Specifies the NIC name.

Minimum length: 0 characters

Maximum length: 255 characters

ip

String

Specifies the IP address bound to the NIC.

Minimum length: 0 characters

Maximum length: 255 characters

netmask

String

Specifies the subnet mask.

Minimum length: 0 characters

Maximum length: 255 characters

gateway

String

Specifies the gateway.

Minimum length: 0 characters

Maximum length: 255 characters

mtu

Integer

Specifies the NIC MTU. This parameter is mandatory for Linux.

Minimum value: 0

Maximum value: 2147483647

mac

String

Specifies the MAC address.

Minimum length: 0 characters

Maximum length: 255 characters

id

String

Specifies the database ID.

Minimum length: 0 characters

Maximum length: 255 characters

Table 16 NetWork field description

Parameter

Type

Description

id

Long

Specifies the check item ID.

Minimum value: 0

Maximum value: 9223372036854775807

params

Array of strings

Parameter

name

String

Specifies the check item name.

Minimum length: 0 characters

Maximum length: 255 characters

result

String

Specifies the check result.

Minimum length: 0 characters

Maximum length: 255 characters

The value can be:

  • OK
  • WARN
  • ERROR

error_code

String

Specifies the returned error code.

Minimum length: 0 characters

Maximum length: 255 characters

error_params

String

Specifies the parameters that failed the check.

Minimum length: 0 characters

Maximum length: 255 characters

Example Request

Query information about the source server whose ID is 211d7878-d7ba-4cac-acf1-a02ccfb8xxxx.

GET https://{endpoint}/v3/sources/211d7878-d7ba-4cac-acf1-a02ccfb8xxxx

Example Response

Status code: 200

OK

{
  "id" : "1cce5dab-df33-4abe-b2ac-e94fa05dxxxx",
  "ip" : "192.168.0.154",
  "name" : "sms-win16",
  "hostname" : "sms-win16",
  "add_date" : 1598435769000,
  "os_type" : "WINDOWS",
  "os_version" : "WINDOWS2016_64BIT",
  "oem_system" : false,
  "state" : "initialize",
  "connected" : true,
  "firmware" : "BIOS",
  "cpu_quantity" : 1,
  "memory" : 2146553856,
  "current_task" : {
    "id" : "1dcbf9f2-9f2a-4df8-88dc-27e5614axxxx",
    "name" : "MigrationTask",
    "type" : "MIGRATE_BLOCK",
    "state" : "RUNNING",
    "speed_limit" : 0,
    "start_target_server" : true,
    "vm_template_id" : "38d53ae9-70e3-4587-89c9-6219d3d4xxxx",
    "region_id" : "region_id",
    "project_name" : "project_name",
    "project_id" : "b276e6fb38c74aa2ba4598f04974xxxx",
    "target_server" : {
      "vm_id" : "",
      "name" : ""
    },
    "log_collect_status" : "INIT",
    "exist_server" : false,
    "use_public_ip" : true,
    "clone_server" : null
  },
  "disks" : [ {
    "name" : "Disk 0",
    "relation_name" : null,
    "partition_style" : "MBR",
    "size" : 42949672960,
    "used_size" : 42947575808,
    "device_use" : "BOOT",
    "os_disk" : false,
    "physical_volumes" : [ {
      "uuid" : "\\\\?\\Volume{586b7157-0000-0000-0000-100000000000}\\",
      "index" : 1,
      "name" : "(Reserved)",
      "device_use" : "BOOT",
      "file_system" : "NTFS",
      "mount_point" : null,
      "size" : 524288000,
      "used_size" : 410275840
    }, {
      "uuid" : "\\\\?\\Volume{586b7157-0000-0000-0000-501f00000000}\\",
      "index" : 2,
      "name" : "C:\\",
      "device_use" : "OS",
      "file_system" : "NTFS",
      "mount_point" : null,
      "size" : 42423287808,
      "used_size" : 23170301952
    } ]
  } ],
  "volume_groups" : [ ],
  "networks" : [ {
    "name" : null,
    "ip" : null,
    "netmask" : null,
    "gateway" : null,
    "mtu" : 0,
    "mac" : "dac20cd4f6318ca6458673b0046ddcc89e936df292d0806cb868ba63a817853c"
  } ],
  "checks" : [ {
    "id" : 524146,
    "params" : [ "" ],
    "name" : "OS_VERSION",
    "result" : "OK",
    "error_code" : null,
    "error_or_warn" : null,
    "error_params" : ""
  }, {
    "id" : 524147,
    "params" : [ "" ],
    "name" : "FIRMWARE",
    "result" : "OK",
    "error_code" : null,
    "error_or_warn" : null,
    "error_params" : ""
  }, {
    "id" : 524148,
    "params" : [ "" ],
    "name" : "CPU",
    "result" : "OK",
    "error_code" : null,
    "error_or_warn" : null,
    "error_params" : ""
  }, {
    "id" : 524149,
    "params" : [ "" ],
    "name" : "MEMORY",
    "result" : "OK",
    "error_code" : null,
    "error_or_warn" : null,
    "error_params" : ""
  }, {
    "id" : 524150,
    "params" : [ "" ],
    "name" : "SYSTEM_ROOT",
    "result" : "OK",
    "error_code" : null,
    "error_or_warn" : null,
    "error_params" : ""
  }, {
    "id" : 524151,
    "params" : [ "" ],
    "name" : "PARTITION_STYLE",
    "result" : "OK",
    "error_code" : null,
    "error_or_warn" : null,
    "error_params" : ""
  }, {
    "id" : 524152,
    "params" : [ "" ],
    "name" : "FILE_SYSTEM",
    "result" : "OK",
    "error_code" : null,
    "error_or_warn" : null,
    "error_params" : ""
  }, {
    "id" : 524153,
    "params" : [ "" ],
    "name" : "FREE_SPACE",
    "result" : "OK",
    "error_code" : null,
    "error_or_warn" : null,
    "error_params" : ""
  }, {
    "id" : 524154,
    "params" : [ "" ],
    "name" : "OEM_SYSTEM",
    "result" : "OK",
    "error_code" : null,
    "error_or_warn" : null,
    "error_params" : ""
  }, {
    "id" : 524155,
    "params" : [ "" ],
    "name" : "DRIVER_FILE",
    "result" : "OK",
    "error_code" : null,
    "error_or_warn" : null,
    "error_params" : ""
  }, {
    "id" : 524156,
    "params" : [ "" ],
    "name" : "SERVICE",
    "result" : "OK",
    "error_code" : null,
    "error_or_warn" : null,
    "error_params" : ""
  }, {
    "id" : 524157,
    "params" : [ "" ],
    "name" : "ACCOUNT_RIGHTS",
    "result" : "OK",
    "error_code" : null,
    "error_or_warn" : null,
    "error_params" : ""
  } ],
  "init_target_server" : {
    "disks" : [ {
      "name" : "Disk 0",
      "size" : 42949672960,
      "used_size" : 42947575808,
      "device_use" : "OS",
      "physical_volumes" : [ {
        "uuid" : "\\\\?\\Volume{586b7157-0000-0000-0000-100000000000}\\",
        "index" : 1,
        "name" : "(Reserved)",
        "device_use" : "BOOT",
        "file_system" : "NTFS",
        "mount_point" : null,
        "size" : 524288000,
        "used_size" : 410275840
      }, {
        "uuid" : "\\\\?\\Volume{586b7157-0000-0000-0000-501f00000000}\\",
        "index" : 2,
        "name" : "C:\\",
        "device_use" : "OS",
        "file_system" : "NTFS",
        "mount_point" : null,
        "size" : 42423287808,
        "used_size" : 23170301952
      } ]
    } ],
    "volume_groups" : [ ]
  },
  "replicatesize" : 0,
  "stage_action_time" : 1598435768945,
  "totalsize" : 0,
  "last_visit_time" : 1598435801422,
  "agent_version" : "6.1.8",
  "migration_cycle" : "replicating",
  "state_action_time" : 1598435783569
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.