Updating a Migration Task
Function
This API is used to update a migration task with a specified ID.
Calling Method
For details, see Calling APIs.
URI
PUT /v3/tasks/{task_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
task_id |
Yes |
String |
The migration task ID. Minimum: 1 Maximum: 36 |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. The token can be obtained by calling the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the user token. Minimum: 1 Maximum: 16384 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
No |
String |
Task name (customizable). The value can contain only letters, digits, underscores (_), and hyphens (-). Minimum: 1 Maximum: 64 |
|
type |
No |
String |
The task type. This parameter is mandatory for creating a task and optional for updating a task. MIGRATE_FILE MIGRATE_BLOCK Minimum: 0 Maximum: 255 Enumeration values: |
|
region_id |
No |
String |
The ID of the region where the target server is located. Minimum: 0 Maximum: 255 |
|
region_name |
No |
String |
The name of the region where the target server is located. Minimum: 0 Maximum: 255 |
|
exist_server |
No |
Boolean |
Indicates whether an existing server is used as the target server. true indicates that an existing server is used as the target server. false indicates that the target server is newly created. |
|
migration_ip |
No |
String |
The IP address of the target server. For public network migration, enter the EIP. For Direct Connect migration, enter the private IP address. If use_ipv6 is set to true, the value must be in the IPv6 format. If use_ipv6 is set to false, the value must be in the IPv4 format. Minimum: 0 Maximum: 255 |
|
use_ipv6 |
No |
Boolean |
Whether the IP address of the destination server uses IPv6. Default: false |
|
use_public_ip |
No |
Boolean |
Public network or not. |
|
speed_limit |
No |
Integer |
The migration rate limit, in Mbit/s. Minimum: 0 Maximum: 1000 |
|
project_name |
No |
String |
The name of the project to which the target server belongs. Minimum: 0 Maximum: 255 |
|
project_id |
No |
String |
The ID of the project to which the target server belongs. Minimum: 0 Maximum: 255 |
|
enterprise_project |
No |
String |
Enterprise project ID. Minimum: 0 Maximum: 36 |
|
image_disk_id |
No |
String |
Disk ID of the image agent on the target server. Minimum: 0 Maximum: 255 |
|
vm_template_id |
No |
String |
The template ID. Minimum: 0 Maximum: 100 |
|
target_disk_ids |
No |
String |
Disk ID array of the target server. Separate IDs with spaces. The length of a single ID cannot exceed 255 characters. Minimum: 0 Maximum: 16384 |
|
snapshot_ids |
No |
String |
Snapshot ID of the target server. Separate IDs with semicolons (;). Minimum: 0 Maximum: 1024 |
|
cutovered_snapshot_ids |
No |
String |
ID of the snapshot for cutover. Minimum: 0 Maximum: 1024 |
|
target_server |
No |
TargetServer object |
The target server information. |
|
clone_server |
No |
CloneServer object |
Clone server. The modification on the clone server takes effect only when the source server is in the syncing, stopping, stopped, cutovering, finished, or error state. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
id |
No |
String |
The ID of the server in the SMS database. Minimum: 0 Maximum: 255 |
|
ip |
No |
String |
The IP address of the server. This parameter is mandatory for registration and optional for updates. Minimum: 0 Maximum: 255 |
|
name |
No |
String |
The server name. Minimum: 0 Maximum: 255 |
|
hostname |
No |
String |
The hostname of the server. This parameter is mandatory for registration and optional for updates. Minimum: 0 Maximum: 255 |
|
os_type |
No |
String |
The OS type of the server, which can be Windows or Linux. This parameter is mandatory for source server registration and optional for source server updates. Minimum: 0 Maximum: 255 Enumeration values: |
|
os_version |
No |
String |
The OS version. This parameter is mandatory for registration and optional for updates. Minimum: 0 Maximum: 255 |
|
firmware |
No |
String |
The boot mode of the server, which can be BIOS or UEFI. Minimum: 0 Maximum: 255 Enumeration values: |
|
cpu_quantity |
No |
Integer |
The number of vCPUs. Minimum: 0 Maximum: 65535 |
|
memory |
No |
Long |
The memory size, in MB. Minimum: 0 Maximum: 9223372036854775807 |
|
btrfs_list |
No |
Array of BtrfsFileSystem objects |
The Btrfs information of the server, which is mandatory for Linux. If there are no Btrfs file systems on the server, the value is an empty array []. Array Length: 0 - 65535 |
|
networks |
No |
Array of NetWork objects |
The information about NICs on the server. Array Length: 0 - 65535 |
|
domain_id |
No |
String |
The tenant domain ID. Minimum: 0 Maximum: 255 |
|
has_rsync |
No |
Boolean |
Indicates whether rsync is installed. This parameter is mandatory for Linux. |
|
paravirtualization |
No |
Boolean |
Indicates whether the source server is paravirtualized. This parameter is mandatory for Linux. |
|
raw_devices |
No |
String |
The list of raw devices. This parameter is mandatory for Linux. Minimum: 0 Maximum: 255 |
|
driver_files |
No |
Boolean |
Indicates whether any driver files are missing. This parameter is mandatory for Windows. |
|
system_services |
No |
Boolean |
Indicates whether there are abnormal services. This parameter is mandatory for Windows. |
|
account_rights |
No |
Boolean |
Indicates whether the account has the required permissions. This parameter is mandatory for Windows. |
|
boot_loader |
No |
String |
The system boot loader, which can be GRUB or LILO. This parameter is mandatory for Linux. Enumeration values: |
|
system_dir |
No |
String |
The system directory. This parameter is mandatory for Windows. Minimum: 0 Maximum: 255 |
|
volume_groups |
No |
Array of VolumeGroups objects |
This parameter is mandatory for Linux. If there are no volume groups, the value is an empty array []. Array Length: 0 - 65535 |
|
vm_id |
No |
String |
The ID of the target server. This parameter is not required for automatically created target servers. Minimum: 0 Maximum: 255 |
|
flavor |
No |
String |
The flavor of the target server. Minimum: 0 Maximum: 255 |
|
disks |
No |
Array of TargetDisk objects |
The information about target server disks, which is generally the same as that of the source server. Array Length: 0 - 65535 |
|
image_disk_id |
No |
String |
The ID of the disk that hosts the agent image on the target server. Minimum: 0 Maximum: 255 |
|
snapshot_ids |
No |
String |
The ID of the snapshot for the target server. Minimum: 0 Maximum: 255 |
|
cutovered_snapshot_ids |
No |
String |
The ID of the snapshot used for rollback on the target server. Minimum: 0 Maximum: 255 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
No |
String |
The file system name. Minimum: 0 Maximum: 255 |
|
label |
No |
String |
The file system tags. If no tag exists, the value is an empty string. Minimum: 0 Maximum: 255 |
|
uuid |
No |
String |
The file system UUID. Minimum: 0 Maximum: 255 |
|
device |
No |
String |
The device names of the Btrfs file system. Minimum: 0 Maximum: 255 |
|
size |
No |
Long |
The space occupied by the file system data. Minimum: 0 Maximum: 9223372036854775807 |
|
nodesize |
No |
Long |
The Btrfs node size. Minimum: 0 Maximum: 9223372036854775807 |
|
sectorsize |
No |
Integer |
The sector size. Minimum: 0 Maximum: 2147483647 |
|
data_profile |
No |
String |
The data profile (RAD). Minimum: 0 Maximum: 255 |
|
system_profile |
No |
String |
The file system profile (RAD). Minimum: 0 Maximum: 255 |
|
metadata_profile |
No |
String |
The metadata profile (RAD). Minimum: 0 Maximum: 255 |
|
global_reserve1 |
No |
String |
The Btrfs file system information. Minimum: 0 Maximum: 255 |
|
g_vol_used_size |
No |
Long |
The used space of the Btrfs volume. Minimum: 0 Maximum: 9223372036854775807 |
|
default_subvolid |
No |
String |
The ID of the default subvolume. Minimum: 0 Maximum: 255 |
|
default_subvol_name |
No |
String |
The name of the default subvolume. Minimum: 0 Maximum: 255 |
|
default_subvol_mountpath |
No |
String |
The mount path of the default subvolume or Btrfs file system. Minimum: 0 Maximum: 255 |
|
subvolumn |
No |
Array of BtrfsSubvolumn objects |
The subvolume information. Array Length: 0 - 65535 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
uuid |
No |
String |
The UUID of the parent volume. Minimum: 0 Maximum: 255 |
|
is_snapshot |
No |
String |
Indicates whether the subvolume is a snapshot. Minimum: 0 Maximum: 255 |
|
subvol_id |
No |
String |
The subvolume ID. Minimum: 0 Maximum: 255 |
|
parent_id |
No |
String |
The parent volume ID. Minimum: 0 Maximum: 255 |
|
subvol_name |
No |
String |
The subvolume name. Minimum: 0 Maximum: 255 |
|
subvol_mount_path |
No |
String |
The mount path of the subvolume. Minimum: 0 Maximum: 255 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
No |
String |
The NIC name. Minimum: 0 Maximum: 255 |
|
ip |
No |
String |
The IP address bound to the NIC. Minimum: 0 Maximum: 255 |
|
ipv6 |
No |
String |
The IPv6 address. Minimum: 0 Maximum: 255 |
|
netmask |
No |
String |
The subnet mask. Minimum: 0 Maximum: 255 |
|
gateway |
No |
String |
Gateway. Minimum: 0 Maximum: 255 |
|
mtu |
No |
Integer |
The NIC MTU. This parameter is mandatory for Linux. Minimum: 0 Maximum: 2147483647 |
|
mac |
Yes |
String |
The first MAC address in the list must not be empty. Minimum: 0 Maximum: 255 |
|
id |
No |
String |
The database record ID. Minimum: 0 Maximum: 255 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
components |
No |
String |
The physical volume information. Minimum: 0 Maximum: 255 |
|
free_size |
No |
Long |
The available space. Minimum: 0 Maximum: 9223372036854775807 |
|
logical_volumes |
No |
Array of LogicalVolumes objects |
The logical volume information. Array Length: 0 - 50 |
|
name |
No |
String |
Name. Minimum: 0 Maximum: 255 |
|
size |
No |
Long |
Size. Minimum: 0 Maximum: 9223372036854775807 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
block_count |
No |
Integer |
The number of blocks. Minimum: 0 Maximum: 2147483647 Default: 0 |
|
block_size |
No |
Long |
Block size. Minimum: 0 Maximum: 1048576 Default: 0 |
|
file_system |
No |
String |
The file system. Minimum: 0 Maximum: 255 |
|
inode_size |
No |
Integer |
The number of inodes. Minimum: 0 Maximum: 2147483647 |
|
inode_nums |
No |
Long |
The number of inodes. Minimum: 0 Maximum: 9223372036854775807 |
|
device_use |
No |
String |
Partition type. This is not mandatory and can be left blank. The common values are as follows: NORMAL OS: system device BOOT VOLUME_GROUP BTRFS Minimum: 0 Maximum: 255 |
|
mount_point |
No |
String |
The mount point. Minimum: 0 Maximum: 256 |
|
name |
No |
String |
Name. Minimum: 0 Maximum: 1024 |
|
size |
No |
Long |
The size. Minimum: 0 Maximum: 9223372036854775807 |
|
used_size |
No |
Long |
The used space. Minimum: 0 Maximum: 9223372036854775807 |
|
free_size |
No |
Long |
The available space. Minimum: 0 Maximum: 9223372036854775807 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
id |
No |
Long |
The disk ID. Minimum: 0 Maximum: 9223372036854775807 |
|
device_use |
No |
String |
The partition function. The partition can be a general, boot, or OS partition. BOOT: boot device OS: system device NORMAL: general device Default: NORMAL Enumeration values: |
|
disk_id |
No |
String |
The disk ID. Minimum: 0 Maximum: 255 |
|
name |
No |
String |
The disk name. Minimum: 0 Maximum: 255 |
|
physical_volumes |
No |
Array of TargetPhysicalVolumes objects |
The logical volume information. Array Length: 0 - 65535 |
|
size |
No |
Long |
The size. Minimum: 0 Maximum: 9223372036854775807 |
|
used_size |
No |
Long |
The used space. Minimum: 0 Maximum: 9223372036854775807 |
|
disk_index |
No |
String |
The disk index. Minimum: 0 Maximum: 255 |
|
os_disk |
No |
Boolean |
Indicates whether the disk is the system disk. |
|
partition_style |
No |
String |
The disk partition type. This parameter is mandatory for source server registration. MBR: Master Boot Record GPT: GUID Partition Table Enumeration values: |
|
relation_name |
No |
String |
The name of the paired disk on the Linux target ECS server. Minimum: 0 Maximum: 255 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
id |
No |
Long |
The logical volume ID. Minimum: 0 Maximum: 9223372036854775807 |
|
device_use |
No |
String |
The partition function. NORMAL: general device OS: system device BOOT: boot device Default: NORMAL Enumeration values: |
|
file_system |
No |
String |
The file system. Minimum: 0 Maximum: 255 |
|
index |
No |
Integer |
No. Minimum: 0 Maximum: 2147483647 |
|
mount_point |
No |
String |
The mount point. Minimum: 0 Maximum: 255 |
|
name |
No |
String |
Name. Minimum: 0 Maximum: 255 |
|
size |
No |
Long |
The size. Minimum: 0 Maximum: 9223372036854775807 |
|
used_size |
No |
Long |
The used space. Minimum: 0 Maximum: 9223372036854775807 |
|
uuid |
No |
String |
uuid Minimum: 0 Maximum: 255 |
|
relation_name |
No |
String |
The name of the paired disk on the Linux target ECS server. Minimum: 0 Maximum: 255 |
|
free_size |
No |
Long |
The idle partition space. Minimum: 0 Maximum: 9223372036854775807 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
vm_id |
No |
String |
The ID of the cloned server. Minimum: 0 Maximum: 255 |
|
name |
No |
String |
The name of the cloned server. Minimum: 0 Maximum: 255 |
|
clone_error |
No |
String |
The error code returned for a clone failure. Minimum: 0 Maximum: 255 |
|
clone_state |
No |
String |
The clone status. NOT_READY READY PREPARING CREATING ERROR FINISHED Enumeration values: |
|
error_msg |
No |
String |
The error message returned for a clone failure. Minimum: 0 Maximum: 1024 |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
The task ID. Minimum: 1 Maximum: 255 |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
The error code. Minimum: 0 Maximum: 255 |
|
error_msg |
String |
The error message. Minimum: 0 Maximum: 255 |
|
encoded_authorization_message |
String |
The encrypted authorization information. Minimum: 0 Maximum: 65535 |
|
error_param |
Array of strings |
Error parameters. Minimum: 0 Maximum: 65535 Array Length: 1 - 20 |
|
details |
Array of details objects |
The error details. Array Length: 1 - 20 |
Example Requests
This example updates the migration task whose ID is ef3b9722-07a0-40ae-89b0-889ee96dxxxx.
put https://{endpoint}/v3/tasks/ef3b9722-07a0-40ae-89b0-889ee96dxxxx
{
"name" : "MigrationTask",
"type" : "MIGRATE_BLOCK",
"os_type" : "WINDOWS",
"state" : "RUNNING",
"estimate_complete_time" : null,
"create_date" : 1598435778000,
"start_date" : 1598435784000,
"finish_date" : null,
"priority" : 1,
"speed_limit" : 0,
"migrate_speed" : 0.0,
"start_target_server" : true,
"error_json" : "",
"total_time" : 115,
"float_ip" : null,
"migration_ip" : null,
"vm_template_id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001",
"region_name" : "region name",
"region_id" : "region id",
"project_name" : "project name",
"project_id" : "xxxxxxxxxxxxxxxxxxxxxxxx00000001",
"sub_tasks" : [ {
"id" : 7278,
"name" : "CREATE_CLOUD_SERVER",
"progress" : 0,
"start_date" : 1598435802000,
"end_date" : null,
"user_op" : "REPLICATE"
}, {
"id" : 7279,
"name" : "SSL_CONFIG",
"progress" : 0,
"start_date" : null,
"end_date" : null,
"user_op" : "REPLICATE"
}, {
"id" : 7280,
"name" : "ATTACH_AGENT_IMAGE",
"progress" : 0,
"start_date" : null,
"end_date" : null,
"user_op" : "REPLICATE"
}, {
"id" : 7281,
"name" : "FORMAT_DISK_WINDOWS",
"progress" : 0,
"start_date" : null,
"end_date" : null,
"user_op" : "REPLICATE"
}, {
"id" : 7282,
"name" : "MIGRATE_WINDOWS_BLOCK",
"progress" : 0,
"start_date" : null,
"end_date" : null,
"user_op" : "REPLICATE"
} ],
"source_server" : {
"id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001",
"ip" : "192.168.0.154",
"name" : "name-win16",
"os_type" : "WINDOWS",
"os_version" : "WINDOWS2016_64BIT",
"agent_version" : "1.2.0",
"oem_system" : false,
"state" : "initialize",
"migration_cycle" : "replicating"
},
"target_server" : {
"id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001",
"vm_id" : "",
"name" : "",
"ip" : null,
"os_type" : "WINDOWS",
"os_version" : "WINDOWS2016_64BIT",
"system_dir" : "Y:\\Windows\\System32",
"disks" : [ {
"id" : 88008,
"name" : "Disk 1",
"relation_name" : null,
"disk_id" : "0",
"partition_style" : "MBR",
"size" : 42949672960,
"used_size" : 42947575808,
"device_use" : "OS",
"os_disk" : true,
"physical_volumes" : [ {
"id" : 135055,
"uuid" : "\\\\?\\Volume{586b7157-0000-0000-0000-100000000000}\\",
"index" : 1,
"name" : "Z:",
"relation_name" : null,
"device_use" : "BOOT",
"file_system" : "NTFS",
"mount_point" : null,
"size" : 524288000,
"used_size" : 410275840,
"free_size" : 114012160
}, {
"id" : 135056,
"uuid" : "\\\\?\\Volume{586b7157-0000-0000-0000-501f00000000}\\",
"index" : 2,
"name" : "Y:",
"relation_name" : null,
"device_use" : "OS",
"file_system" : "NTFS",
"mount_point" : null,
"size" : 42423287808,
"used_size" : 23170301952,
"free_size" : 19252985856
} ],
"disk_index" : "0"
} ],
"volume_groups" : [ ],
"image_disk_id" : null,
"cutovered_snapshot_ids" : null
},
"clone_server" : null
}
Example Responses
Status code: 200
This API is used to update a migration task with a specified ID.
{
"id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001"
}
Status code: 403
Authentication failed.
{
"error_code" : "SMS.9004",
"error_msg" : "The current account does not have the permission to execute policy. You do not have permission to perform action XXX on resource XXX.",
"encoded_authorization_message" : "XXXXXX",
"error_param" : [ "You do not have permission to perform action XXX on resource XXX." ],
"details" : [ {
"error_code" : "SMS.9004",
"error_msg" : "You do not have permission to perform action XXX on resource XXX."
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
This API is used to update a migration task with a specified ID. |
|
403 |
Authentication failed. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.