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

Querying the List of Source Servers

Function

This API is used to query the list of source servers.

URI

GET /v1/sms/sources

Request

Request parameters

For details about the request parameters, see Table 1.

Table 1 Request parameters

Parameter

Mandatory

Type

Description

state

No

String

Specifies the source server status.

name

No

String

Specifies the name of the source server.

id

No

String

Specifies the source server ID.

ip

No

String

Specifies the IP address of the source server.

num_per_page

No

int

Specifies the number of source servers recorded on each page.

page_num

No

int

Specifies the page number (starting from 0).

Response

Response parameters

For details about the response parameters, see Table 2.

Table 2 Response parameters

Parameter

Type

Description

count

int

Specifies the number of source servers.

source_servers

JSON array

Specifies the list of source servers. For details, see Table 3.

Table 3 Data structure of source_servers

Parameter

Type

Description

id

String

Specifies the ID of the record in the SMS database.

ip

String

Specifies the IP address of the source server.

name

String

Specifies the name of the source server.

hostname

String

Specifies the name displayed after you log in to the source server.

add_date

long

Specifies the timestamp reported to SMS.

os_type

String

Specifies the operating system (OS) type of the source server. The value can be WINDOWS or LINUX.

os_version

String

Specifies the OS version, for example, WINDOWS7_64BIT.

oem_system

Boolean

Specifies whether the OS is an OEM OS.

state

String

Specifies the check status of the source server.

  • CHECKING: indicates that the source server is being checked.
  • AVAILABLE: indicates that the source server passes the check, and the OS and data on the source server can be migrated to the cloud.
  • UNAVAILABLE: indicates that the source server fails to pass the check, and the OS and data on the source server cannot be migrated to the cloud.

connected

Boolean

Specifies the status of the connection between the migration Agent on the source server and the SMS server.

  • true: indicates that the source server is properly connected to the SMS server.
  • false: indicates that the source server is disconnected from the SMS server.

current_task

JSON

Specifies the information about tasks bound to the source server. For details, see Table 6.

init_target_server

JSON

Specifies the recommended specifications of the target ECS to which data is to be migrated. For details, see Table 4.

Table 4 Objects of init_target_server

Parameter

Type

Description

disks

JSON array

Specifies the recommended disk information of the target ECS. For details, see Table 5.

Table 5 Structure members of the disks array

Parameter

Type

Description

name

String

Specifies the disk name.

size

long

Specifies the disk capacity (byte).

device_use

JSON

Specifies the disk function.

  • BOOT: indicates the boot disk.
  • OS: indicates the system disk.
  • NORMAL: indicates the common data disk.
Table 6 current_task information

Parameter

Type

Description

id

String

Specifies the ID of the task associated with the source server.

name

String

Specifies the name of the task associated with the source server.

state

String

Specifies the status of the task associated with the source server.

  • READY: indicates that the migration task is ready to start.
  • RUNNING: indicates that the migration task is being executed.
  • SYNCING: indicates that the incremental data is being synchronized from the source to target ECSs.
  • SUCCESS: indicates that the migration or synchronization task is successful.
  • FAIL: indicates that the migration or synchronization task fails.
  • ABORTING: indicating that the migration or synchronization task is being paused.
  • ABORT: indicates that the migration task has been stopped.

Example

  • Example request

    None

  • Example response
    {
      "count": 1,
      "source_servers": [
        {
          "id": "80d6d78d-3350-4c6e-92b1-3ad88b16d8d8",
          "ip": "x.x.x.x",
          "name": "first",
          "hostname": "hello",
          "add_date": 1528178836000,
          "os_type": "WINDOWS",
          "os_version": "WINDOWS7_64BIT",
          "os_description": null,
          "oem_system": false,
          "state": "UNAVAILABLE",
          "connected": false,
          "current_task": {
            "id": "dfedc7eb-cadc-4f27-ae3c-b5e4f05e1c83",
            "name": "sms_task_smssrc",
            "state": "SUCCESS"
          },
          "init_target_server": {
            "disks": [
              {
                "name": "Disk 0",
                "size": 171798691840,
                "device_use": "OS"
              },
              {
                "name": "Disk 1",
                "size": 215822106624,
                "device_use": "NORMAL"
              }
            ]
          }
        }
    }

Status Codes

See Status Codes.

Error Codes

See Out-of-Date Error Codes.