
# 更新指定ID的迁移任务 - UpdateTask
#### 功能介绍
更新指定ID的迁移任务
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-sms/sms_api_0007.html)。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-sms/sms_api_8001.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                   | 访问级别  | 资源类型（\*为必须） | 条件键                   | 别名                         | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | sms:server:updateTask | Write | server \*   | -                     | sms:server:migrationServer | -      |
  | sms:server:updateTask | Write | -           | g:EnterpriseProjectId | sms:server:migrationServer | -      |
     
  
 
#### URI
PUT /v3/tasks/{task_id}
表1路径参数 
| 参数      | 是否必选 | 参数类型   | 描述                                                                                        |
|:---|:---|:---|:---|
| task_id | 是    | String | 迁移任务ID 最小长度：**1** 最大长度：**36** |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                            |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度：**1** 最大长度：**16384** |
   
表3请求Body参数 
| 参数                     | 是否必选 | 参数类型                                                     | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|:---|:---|:---|:---|
| name                   | 否    | String                                                   | 任务名称（用户自定义） 仅由中文字符、下划线、短横线、数字、英文大小写字母组成 最小长度：**1** 最大长度：**64**                                                                                                                                                                                                                                                                                                                                                                                                                  |
| type                   | 否    | String                                                   | 任务类型，创建时必选，更新时可选 MIGRATE_FILE:文件级迁移 MIGRATE_BLOCK:块级迁移 最小长度：**0** 最大长度：**255** 枚举值： - **MIGRATE_FILE**   - **MIGRATE_BLOCK**    |
| region_id              | 否    | String                                                   | 目的端服务器的区域ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| region_name            | 否    | String                                                   | 目的端服务器的区域名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| exist_server           | 否    | Boolean                                                  | 目的端服务器是否存在。true代表已有目的端服务器，false代表需要新建目的端服务器                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| migration_ip           | 否    | String                                                   | 目的端服务器的IP地址。 公网迁移时请填写弹性IP地址 专线迁移时请填写私有IP地址 如果use_ipv6是true，则需要满足ipv6的格式，如果use_ipv6是false，则需要满足ipv4的格式 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                       |
| use_ipv6               | 否    | Boolean                                                  | 目的端服务器的IP地址是否使用ipv6 缺省值：**false**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| use_public_ip          | 否    | Boolean                                                  | 是否为公网                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| speed_limit            | 否    | Integer                                                  | 限制迁移速率，单位：Mbps 最小值：**0** 最大值：**1000**                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| project_name           | 否    | String                                                   | 目的端服务器所在项目名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| project_id             | 否    | String                                                   | 目的端服务器所在项目ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| enterprise_project     | 否    | String                                                   | 企业项目ID 最小长度：**0** 最大长度：**36**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| image_disk_id          | 否    | String                                                   | 目的端服务器镜像代理磁盘ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| vm_template_id         | 否    | String                                                   | 模板ID 最小长度：**0** 最大长度：**100**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| target_disk_ids        | 否    | String                                                   | 目的端服务器磁盘ID数组，用空格分隔，单个id长度不超过255 最小长度：**0** 最大长度：**16384**                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| snapshot_ids           | 否    | String                                                   | 目的端的快照ID，id之间";"分隔 最小长度：**0** 最大长度：**1024**                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| cutovered_snapshot_ids | 否    | String                                                   | 割接的快照ID 最小长度：**0** 最大长度：**1024**                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| target_server          | 否    | [TargetServer] object | 目的端服务器                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| clone_server           | 否    | [CloneServer] object   | 克隆服务器 当仅当源端服务器实时状态处于"持续同步"、"暂停中"、"已暂停"、"启动中"、"迁移已完成"、"错误"状态时才能更新克隆服务器参数。                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
   
 表4TargetServer 
| 参数                     | 是否必选 | 参数类型                                                                     | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|:---|:---|:---|:---|
| id                     | 否    | String                                                                   | 服务器在SMS数据库中的ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                            |
| ip                     | 否    | String                                                                   | 服务器IP，注册源端时必选，更新非必选 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                       |
| name                   | 否    | String                                                                   | 用来区分不同服务器的名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                              |
| hostname               | 否    | String                                                                   | 主机名，注册源端必选，更新非必选 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                          |
| os_type                | 否    | String                                                                   | 服务器的OS类型，分为Windows和Linux，注册必选，更新非必选 最小长度：**0** 最大长度：**255** 枚举值： - **WINDOWS**   - **LINUX**    |
| os_version             | 否    | String                                                                   | 操作系统版本，注册必选，更新非必选 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                         |
| firmware               | 否    | String                                                                   | 服务器启动类型，如BIOS或者UEFI 最小长度：**0** 最大长度：**255** 枚举值： - **BIOS**   - **UEFI**                        |
| cpu_quantity           | 否    | Integer                                                                  | CPU个数，单位vCPU 最小值：**0** 最大值：**65535**                                                                                                                                                                                                                                                                                                                                                                              |
| memory                 | 否    | Long                                                                     | 内存大小，单位MB 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                   |
| btrfs_list             | 否    | Array of [BtrfsFileSystem] objects | Linux 必选，服务器的Btrfs信息。如果不存在Btrfs，则为\[\] 数组长度：**0 - 65535**                                                                                                                                                                                                                                                                                                                                                                                       |
| networks               | 否    | Array of [NetWork] objects                 | 服务器的网卡信息 数组长度：**0 - 65535**                                                                                                                                                                                                                                                                                                                                                                                                                     |
| domain_id              | 否    | String                                                                   | 租户的domainId 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                               |
| has_rsync              | 否    | Boolean                                                                  | 是否安装rsync组件，Linux系统此参数为必选                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| paravirtualization     | 否    | Boolean                                                                  | Linux场景必选，源端是否是半虚拟化                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| raw_devices            | 否    | String                                                                   | Linux必选，裸设备列表 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                             |
| driver_files           | 否    | Boolean                                                                  | Windows 必选，是否缺少驱动文件                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| system_services        | 否    | Boolean                                                                  | Windows必选，是否存在不正常服务                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| account_rights         | 否    | Boolean                                                                  | Windows必选，权限是否满足要求                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| boot_loader            | 否    | String                                                                   | Linux必选，系统引导类型，BOOT_LOADER(GRUB/LILO) 枚举值： - **GRUB**   - **LILO**                                                                                          |
| system_dir             | 否    | String                                                                   | Windows必选，系统目录 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                            |
| volume_groups          | 否    | Array of [VolumeGroups] objects       | Linux必选，如果没有卷组，输入\[\] 数组长度：**0 - 65535**                                                                                                                                                                                                                                                                                                                                                                                                        |
| vm_id                  | 否    | String                                                                   | 目的端服务器ID，自动创建虚拟机不需要这个参数 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                   |
| flavor                 | 否    | String                                                                   | 目的端服务器的规格 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                 |
| disks                  | 否    | Array of [TargetDisk] objects           | 目的端磁盘信息，一般和源端保持一致 数组长度：**0 - 65535**                                                                                                                                                                                                                                                                                                                                                                                                            |
| image_disk_id          | 否    | String                                                                   | 目的端代理镜像磁盘ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                               |
| snapshot_ids           | 否    | String                                                                   | 目的端快照ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                   |
| cutovered_snapshot_ids | 否    | String                                                                   | 目的端回滚快照ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                 |
   
 表5BtrfsFileSystem 
| 参数                       | 是否必选 | 参数类型                                                                   | 描述                                                                                                              |
|:---|:---|:---|:---|
| name                     | 否    | String                                                                 | 文件系统名称 最小长度：**0** 最大长度：**255**                      |
| label                    | 否    | String                                                                 | 文件系统标签，若无标签为空字符串 最小长度：**0** 最大长度：**255**            |
| uuid                     | 否    | String                                                                 | 文件系统的uuid 最小长度：**0** 最大长度：**255**                   |
| device                   | 否    | String                                                                 | btrfs包含的设备名称 最小长度：**0** 最大长度：**255**                |
| size                     | 否    | Long                                                                   | 文件系统数据占用大小 最小值：**0** 最大值：**9223372036854775807**    |
| nodesize                 | 否    | Long                                                                   | btrfs节点大小 最小值：**0** 最大值：**9223372036854775807**     |
| sectorsize               | 否    | Integer                                                                | 扇区大小 最小值：**0** 最大值：**2147483647**                   |
| data_profile             | 否    | String                                                                 | 数据配置（RAD） 最小长度：**0** 最大长度：**255**                   |
| system_profile           | 否    | String                                                                 | 文件系统配置（RAD） 最小长度：**0** 最大长度：**255**                 |
| metadata_profile         | 否    | String                                                                 | 元数据配置（RAD） 最小长度：**0** 最大长度：**255**                  |
| global_reserve1          | 否    | String                                                                 | Btrfs文件系统信息 最小长度：**0** 最大长度：**255**                 |
| g_vol_used_size          | 否    | Long                                                                   | Btrfs卷已使用空间大小 最小值：**0** 最大值：**9223372036854775807** |
| default_subvolid         | 否    | String                                                                 | 默认子卷ID 最小长度：**0** 最大长度：**255**                      |
| default_subvol_name      | 否    | String                                                                 | 默认子卷名称 最小长度：**0** 最大长度：**255**                      |
| default_subvol_mountpath | 否    | String                                                                 | 默认子卷挂载路径/BTRFS文件系统的挂载路径 最小长度：**0** 最大长度：**255**     |
| subvolumn                | 否    | Array of [BtrfsSubvolumn] objects | 子卷信息 数组长度：**0 - 65535**                                                           |
   
 表6BtrfsSubvolumn 
| 参数                | 是否必选 | 参数类型   | 描述                                                                                          |
|:---|:---|:---|:---|
| uuid              | 否    | String | 父卷的uuid 最小长度：**0** 最大长度：**255** |
| is_snapshot       | 否    | String | 子卷是否为快照 最小长度：**0** 最大长度：**255** |
| subvol_id         | 否    | String | 子卷的ID 最小长度：**0** 最大长度：**255**   |
| parent_id         | 否    | String | 父卷ID 最小长度：**0** 最大长度：**255**    |
| subvol_name       | 否    | String | 子卷的名称 最小长度：**0** 最大长度：**255**   |
| subvol_mount_path | 否    | String | 子卷的挂载路径 最小长度：**0** 最大长度：**255** |
   
 表7NetWork 
| 参数      | 是否必选 | 参数类型    | 描述                                                                                                      |
|:---|:---|:---|:---|
| name    | 否    | String  | 网卡的名称 最小长度：**0** 最大长度：**255**               |
| ip      | 否    | String  | 该网卡绑定的IP 最小长度：**0** 最大长度：**255**            |
| ipv6    | 否    | String  | IPv6地址 最小长度：**0** 最大长度：**255**              |
| netmask | 否    | String  | 掩码 最小长度：**0** 最大长度：**255**                  |
| gateway | 否    | String  | 网关 最小长度：**0** 最大长度：**255**                  |
| mtu     | 否    | Integer | Linux必选，网卡的MTU 最小值：**0** 最大值：**2147483647** |
| mac     | 是    | String  | 列表中第一个Mac地址必须非空 最小长度：**0** 最大长度：**255**     |
| id      | 否    | String  | 数据库ID 最小长度：**0** 最大长度：**255**               |
   
 表8VolumeGroups 
| 参数              | 是否必选 | 参数类型                                                                   | 描述                                                                                                     |
|:---|:---|:---|:---|
| components      | 否    | String                                                                 | Pv信息 最小长度：**0** 最大长度：**255**               |
| free_size       | 否    | Long                                                                   | 剩余空间 最小值：**0** 最大值：**9223372036854775807** |
| logical_volumes | 否    | Array of [LogicalVolumes] objects | lv信息 数组长度：**0 - 50**                                                     |
| name            | 否    | String                                                                 | 名称 最小长度：**0** 最大长度：**255**                 |
| size            | 否    | Long                                                                   | 大小 最小值：**0** 最大值：**9223372036854775807**   |
   
 表9LogicalVolumes 
| 参数          | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                       |
|:---|:---|:---|:---|
| block_count | 否    | Integer | 块数量 最小值：**0** 最大值：**2147483647** 缺省值：**0**                                                                                                                                                                                                                                     |
| block_size  | 否    | Long    | 块大小 最小值：**0** 最大值：**1048576** 缺省值：**0**                                                                                                                                                                                                                                        |
| file_system | 否    | String  | 文件系统 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                 |
| inode_size  | 否    | Integer | inode数量 最小值：**0** 最大值：**2147483647**                                                                                                                                                                                                                                                                         |
| inode_nums  | 否    | Long    | inode节点数量 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                              |
| device_use  | 否    | String  | 分区类型 无强约束，可为空值，常见取值如下 NORMAL：平常 OS：系统设备 BOOT：BOOT设备 VOLUME_GROUP：VolumeGroup组成设备 BTRFS：BTRFS组成设备 最小长度：**0** 最大长度：**255** |
| mount_point | 否    | String  | 挂载点 最小长度：**0** 最大长度：**256**                                                                                                                                                                                                                                                                                  |
| name        | 否    | String  | 名称 最小长度：**0** 最大长度：**1024**                                                                                                                                                                                                                                                                                  |
| size        | 否    | Long    | 大小 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                     |
| used_size   | 否    | Long    | 使用大小 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                   |
| free_size   | 否    | Long    | 剩余空间 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                   |
   
 表10TargetDisk 
| 参数               | 是否必选 | 参数类型                                                                                 | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|:---|
| id               | 否    | Long                                                                                 | 磁盘标识ID 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| device_use       | 否    | String                                                                               | 判断是普通分区，启动分区还是系统分区 BOOT：BOOT设备 OS：系统设备 NORMAL:平常 缺省值：**NORMAL** 枚举值： - **NORMAL**   - **OS**   - **BOOT**    |
| disk_id          | 否    | String                                                                               | 磁盘ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| name             | 否    | String                                                                               | 磁盘名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| physical_volumes | 否    | Array of [TargetPhysicalVolumes] objects | 逻辑卷信息 数组长度：**0 - 65535**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| size             | 否    | Long                                                                                 | 大小 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| used_size        | 否    | Long                                                                                 | 已使用大小 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| disk_index       | 否    | String                                                                               | 磁盘索引 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| os_disk          | 否    | Boolean                                                                              | 是否为系统盘                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| partition_style  | 否    | String                                                                               | 磁盘的分区类型，添加源端时源端磁盘必选 MBR：mbr格式 GPT：gpt格式 枚举值： - **MBR**   - **GPT**                                                                                                                                                                                                                   |
| relation_name    | 否    | String                                                                               | Linux系统 目的端ECS中与源端关联的磁盘名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
   
 表11TargetPhysicalVolumes 
| 参数            | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|:---|:---|:---|:---|
| id            | 否    | Long    | 逻辑卷ID 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| device_use    | 否    | String  | 分区类型 NORMAL:平常 OS：系统设备 BOOT：BOOT设备 缺省值：**NORMAL** 枚举值： - **NORMAL**   - **OS**   - **BOOT**    |
| file_system   | 否    | String  | 文件系统 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| index         | 否    | Integer | 编号 最小值：**0** 最大值：**2147483647**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| mount_point   | 否    | String  | 挂载点 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| name          | 否    | String  | 名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| size          | 否    | Long    | 大小 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| used_size     | 否    | Long    | 使用大小 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| uuid          | 否    | String  | uuid 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| relation_name | 否    | String  | Linux系统 目的端ECS中与源端关联的磁盘名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| free_size     | 否    | Long    | 分区空闲大小 最小值：**0** 最大值：**9223372036854775807**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
   
 表12CloneServer 
| 参数          | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|:---|:---|:---|:---|
| vm_id       | 否    | String | 克隆服务器ID 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| name        | 否    | String | 克隆虚拟机的名称 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| clone_error | 否    | String | 克隆错误信息 最小长度：**0** 最大长度：**255**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| clone_state | 否    | String | 克隆状态 NOT_READY: 未准备好 READY: 就绪 PREPARING: 准备创建中 CREATING: 创建中 ERROR: 克隆错误 FINISHED: 克隆结束 枚举值： - **NOT_READY**   - **READY**   - **PREPARING**   - **CREATING**   - **ERROR**   - **FINISHED**    |
| error_msg   | 否    | String | 克隆错误信息描述 最小长度：**0** 最大长度：**1024**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
   
#### 响应参数
**状态码：200**
表13响应Body参数 
| 参数 | 参数类型   | 描述                                                                                       |
|:---|:---|:---|
| id | String | 任务ID 最小长度：**1** 最大长度：**255** |
   
**状态码：403**
表14响应Body参数 
| 参数                            | 参数类型                                                      | 描述                                                                                                                                       |
|:---|:---|:---|
| error_code                    | String                                                    | 错误代码 最小长度：**0** 最大长度：**255**                                                 |
| error_msg                     | String                                                    | 错误信息 最小长度：**0** 最大长度：**255**                                                 |
| encoded_authorization_message | String                                                    | 加密授权信息 最小长度：**0** 最大长度：**65535**                                             |
| error_param                   | Array of strings                                          | 错误参数 最小长度：**0** 最大长度：**65535** 数组长度：**1 - 20** |
| details                       | Array of [details] objects | 详细错误信息 数组长度：**1 - 20**                                                                                     |
   
 表15details 
| 参数         | 参数类型   | 描述                                                                                            |
|:---|:---|:---|
| error_code | String | SMS错误代码 最小长度：**0** 最大长度：**65535** |
| error_msg  | String | SMS错误信息 最小长度：**0** 最大长度：**65535** |
   
#### 请求示例
更新任务ID为ef3b9722-07a0-40ae-89b0-889ee96dxxxx的迁移任务的信息。
```
put https://{endpoint}/v3/tasks/ef3b9722-07a0-40ae-89b0-889ee96dxxxx
{
  "name" : "MigrationTask",
  "type" : "MIGRATE_BLOCK",
  "speed_limit" : 0,
  "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",
  "target_server" : {
    "id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001",
    "vm_id" : "",
    "name" : "",
    "ip" : null,
    "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
}
```
#### 响应示例
**状态码：200**
更新指定ID的迁移任务
```
{
  "id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001"
}
```
**状态码：403**
鉴权失败
```
{
  "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."
  } ]
}
```
#### SDK代码示例
SDK代码示例如下。
- [Java]
  更新任务ID为ef3b9722-07a0-40ae-89b0-889ee96dxxxx的迁移任务的信息。
  ```
  package com.huaweicloud.sdk.test;
  import com.huaweicloud.sdk.core.auth.ICredential;
  import com.huaweicloud.sdk.core.auth.GlobalCredentials;
  import com.huaweicloud.sdk.core.exception.ConnectionException;
  import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
  import com.huaweicloud.sdk.core.exception.ServiceResponseException;
  import com.huaweicloud.sdk.sms.v3.region.SmsRegion;
  import com.huaweicloud.sdk.sms.v3.*;
  import com.huaweicloud.sdk.sms.v3.model.*;
  import java.util.List;
  import java.util.ArrayList;
  public class UpdateTaskSolution {
      public static void main(String[] args) {
          // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
          // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
          String ak = System.getenv("CLOUD_SDK_AK");
          String sk = System.getenv("CLOUD_SDK_SK");
          ICredential auth = new GlobalCredentials()
                  .withAk(ak)
                  .withSk(sk);
          SmsClient client = SmsClient.newBuilder()
                  .withCredential(auth)
                  .withRegion(SmsRegion.valueOf("<YOUR REGION>"))
                  .build();
          UpdateTaskRequest request = new UpdateTaskRequest();
          request.withTaskId("{task_id}");
          PutTaskReq body = new PutTaskReq();
          List<TargetPhysicalVolumes> listDisksPhysicalVolumes = new ArrayList<>();
          listDisksPhysicalVolumes.add(
              new TargetPhysicalVolumes()
                  .withId(135055L)
                  .withDeviceUse(TargetPhysicalVolumes.DeviceUseEnum.fromValue("BOOT"))
                  .withFileSystem("NTFS")
                  .withIndex(1)
                  .withName("Z:")
                  .withSize(524288000L)
                  .withUsedSize(410275840L)
                  .withUuid("\\?\Volume{586b7157-0000-0000-0000-100000000000}\")
                  .withFreeSize(114012160L)
          );
          listDisksPhysicalVolumes.add(
              new TargetPhysicalVolumes()
                  .withId(135056L)
                  .withDeviceUse(TargetPhysicalVolumes.DeviceUseEnum.fromValue("OS"))
                  .withFileSystem("NTFS")
                  .withIndex(2)
                  .withName("Y:")
                  .withSize(42423287808L)
                  .withUsedSize(23170301952L)
                  .withUuid("\\?\Volume{586b7157-0000-0000-0000-501f00000000}\")
                  .withFreeSize(19252985856L)
          );
          List<TargetDisk> listTargetServerDisks = new ArrayList<>();
          listTargetServerDisks.add(
              new TargetDisk()
                  .withId(88008L)
                  .withDeviceUse(TargetDisk.DeviceUseEnum.fromValue("OS"))
                  .withDiskId("0")
                  .withName("Disk 1")
                  .withPhysicalVolumes(listDisksPhysicalVolumes)
                  .withSize(42949672960L)
                  .withUsedSize(42947575808L)
                  .withDiskIndex("0")
                  .withOsDisk(true)
                  .withPartitionStyle(TargetDisk.PartitionStyleEnum.fromValue("MBR"))
          );
          TargetServer targetServerbody = new TargetServer();
          targetServerbody.withDisks(listTargetServerDisks)
              .withVolumeGroups()
              .withVmId("")
              .withId("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001")
              .withOsVersion("WINDOWS2016_64BIT")
              .withSystemDir("Y:\Windows\System32")
              .withName("");
          body.withTargetServer(targetServerbody);
          body.withVmTemplateId("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001");
          body.withProjectId("xxxxxxxxxxxxxxxxxxxxxxxx00000001");
          body.withProjectName("project name");
          body.withSpeedLimit(0);
          body.withRegionName("region name");
          body.withRegionId("region id");
          body.withType(PutTaskReq.PutTaskReq.fromValue("MIGRATE_BLOCK"));
          body.withName("MigrationTask");
          request.withBody(body);
          try {
              UpdateTaskResponse response = client.updateTask(request);
              System.out.println(response.toString());
          } catch (ConnectionException e) {
              e.printStackTrace();
          } catch (RequestTimeoutException e) {
              e.printStackTrace();
          } catch (ServiceResponseException e) {
              e.printStackTrace();
              System.out.println(e.getHttpStatusCode());
              System.out.println(e.getRequestId());
              System.out.println(e.getErrorCode());
              System.out.println(e.getErrorMsg());
          }
      }
  }
  ```
- [Python]
  更新任务ID为ef3b9722-07a0-40ae-89b0-889ee96dxxxx的迁移任务的信息。
  ```
  # coding: utf-8
  import os
  from huaweicloudsdkcore.auth.credentials import GlobalCredentials
  from huaweicloudsdksms.v3.region.sms_region import SmsRegion
  from huaweicloudsdkcore.exceptions import exceptions
  from huaweicloudsdksms.v3 import *
  if __name__ == "__main__":
      # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak = os.environ["CLOUD_SDK_AK"]
      sk = os.environ["CLOUD_SDK_SK"]
      credentials = GlobalCredentials(ak, sk)
      client = SmsClient.new_builder() \
          .with_credentials(credentials) \
          .with_region(SmsRegion.value_of("<YOUR REGION>")) \
          .build()
      try:
          request = UpdateTaskRequest()
          request.task_id = "{task_id}"
          listPhysicalVolumesDisks = [
              TargetPhysicalVolumes(
                  id=135055,
                  device_use="BOOT",
                  file_system="NTFS",
                  index=1,
                  name="Z:",
                  size=524288000,
                  used_size=410275840,
                  uuid="\\?\Volume{586b7157-0000-0000-0000-100000000000}\",
                  free_size=114012160
              ),
              TargetPhysicalVolumes(
                  id=135056,
                  device_use="OS",
                  file_system="NTFS",
                  index=2,
                  name="Y:",
                  size=42423287808,
                  used_size=23170301952,
                  uuid="\\?\Volume{586b7157-0000-0000-0000-501f00000000}\",
                  free_size=19252985856
              )
          ]
          listDisksTargetServer = [
              TargetDisk(
                  id=88008,
                  device_use="OS",
                  disk_id="0",
                  name="Disk 1",
                  physical_volumes=listPhysicalVolumesDisks,
                  size=42949672960,
                  used_size=42947575808,
                  disk_index="0",
                  os_disk=True,
                  partition_style="MBR"
              )
          ]
          targetServerbody = TargetServer(
              disks=listDisksTargetServer,
              vm_id="",
              id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001",
              os_version="WINDOWS2016_64BIT",
              system_dir="Y:\Windows\System32",
              name=""
          )
          request.body = PutTaskReq(
              target_server=targetServerbody,
              vm_template_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001",
              project_id="xxxxxxxxxxxxxxxxxxxxxxxx00000001",
              project_name="project name",
              speed_limit=0,
              region_name="region name",
              region_id="region id",
              type="MIGRATE_BLOCK",
              name="MigrationTask"
          )
          response = client.update_task(request)
          print(response)
      except exceptions.ClientRequestException as e:
          print(e.status_code)
          print(e.request_id)
          print(e.error_code)
          print(e.error_msg)
  ```
- [Go]
  更新任务ID为ef3b9722-07a0-40ae-89b0-889ee96dxxxx的迁移任务的信息。
  ```
  package main
  import (
  "fmt"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/global"
      sms "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/sms/v3"
  "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/sms/v3/model"
      region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/sms/v3/region"
  )
  func main() {
      // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
      // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
      ak := os.Getenv("CLOUD_SDK_AK")
      sk := os.Getenv("CLOUD_SDK_SK")
      auth, err := global.NewCredentialsBuilder().
          WithAk(ak).
          WithSk(sk).
          SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      hcClient, err := sms.SmsClientBuilder().
           WithRegion(region.ValueOf("<YOUR REGION>")).
           WithCredential(auth).
           SafeBuild()
      if err != nil {
          fmt.Println(err)
          return
      }
      client := sms.NewSmsClient(hcClient)
      request := &model.UpdateTaskRequest{}
  request.TaskId = "{task_id}"
  idPhysicalVolumes:= int64(135055)
  deviceUsePhysicalVolumes:= model.GetTargetPhysicalVolumesDeviceUseEnum().BOOT
  fileSystemPhysicalVolumes:= "NTFS"
  indexPhysicalVolumes:= int32(1)
  namePhysicalVolumes:= "Z:"
  sizePhysicalVolumes:= int64(524288000)
  usedSizePhysicalVolumes:= int64(410275840)
  uuidPhysicalVolumes:= "\\?\Volume{586b7157-0000-0000-0000-100000000000}\"
  freeSizePhysicalVolumes:= int64(114012160)
  idPhysicalVolumes1:= int64(135056)
  deviceUsePhysicalVolumes1:= model.GetTargetPhysicalVolumesDeviceUseEnum().OS
  fileSystemPhysicalVolumes1:= "NTFS"
  indexPhysicalVolumes1:= int32(2)
  namePhysicalVolumes1:= "Y:"
  sizePhysicalVolumes1:= int64(42423287808)
  usedSizePhysicalVolumes1:= int64(23170301952)
  uuidPhysicalVolumes1:= "\\?\Volume{586b7157-0000-0000-0000-501f00000000}\"
  freeSizePhysicalVolumes1:= int64(19252985856)
  var listPhysicalVolumesDisks = []model.TargetPhysicalVolumes{
          {
              Id: &idPhysicalVolumes,
              DeviceUse: &deviceUsePhysicalVolumes,
              FileSystem: &fileSystemPhysicalVolumes,
              Index: &indexPhysicalVolumes,
              Name: &namePhysicalVolumes,
              Size: &sizePhysicalVolumes,
              UsedSize: &usedSizePhysicalVolumes,
              Uuid: &uuidPhysicalVolumes,
              FreeSize: &freeSizePhysicalVolumes,
          },
          {
              Id: &idPhysicalVolumes1,
              DeviceUse: &deviceUsePhysicalVolumes1,
              FileSystem: &fileSystemPhysicalVolumes1,
              Index: &indexPhysicalVolumes1,
              Name: &namePhysicalVolumes1,
              Size: &sizePhysicalVolumes1,
              UsedSize: &usedSizePhysicalVolumes1,
              Uuid: &uuidPhysicalVolumes1,
              FreeSize: &freeSizePhysicalVolumes1,
          },
      }
  idDisks:= int64(88008)
  deviceUseDisks:= model.GetTargetDiskDeviceUseEnum().OS
  diskIdDisks:= "0"
  nameDisks:= "Disk 1"
  sizeDisks:= int64(42949672960)
  usedSizeDisks:= int64(42947575808)
  diskIndexDisks:= "0"
  osDiskDisks:= true
  partitionStyleDisks:= model.GetTargetDiskPartitionStyleEnum().MBR
  var listDisksTargetServer = []model.TargetDisk{
          {
              Id: &idDisks,
              DeviceUse: &deviceUseDisks,
              DiskId: &diskIdDisks,
              Name: &nameDisks,
              PhysicalVolumes: &listPhysicalVolumesDisks,
              Size: &sizeDisks,
              UsedSize: &usedSizeDisks,
              DiskIndex: &diskIndexDisks,
              OsDisk: &osDiskDisks,
              PartitionStyle: &partitionStyleDisks,
          },
      }
  vmIdTargetServer:= ""
  idTargetServer:= "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001"
  osVersionTargetServer:= "WINDOWS2016_64BIT"
  systemDirTargetServer:= "Y:\Windows\System32"
  nameTargetServer:= ""
  targetServerbody := &model.TargetServer{
  Disks: &listDisksTargetServer,
  VmId: &vmIdTargetServer,
  Id: &idTargetServer,
  OsVersion: &osVersionTargetServer,
  SystemDir: &systemDirTargetServer,
  Name: &nameTargetServer,
  }
  vmTemplateIdPutTaskReq:= "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0001"
  projectIdPutTaskReq:= "xxxxxxxxxxxxxxxxxxxxxxxx00000001"
  projectNamePutTaskReq:= "project name"
  speedLimitPutTaskReq:= int32(0)
  regionNamePutTaskReq:= "region name"
  regionIdPutTaskReq:= "region id"
  typePutTaskReq:= model.GetPutTaskReqTypeEnum().MIGRATE_BLOCK
  namePutTaskReq:= "MigrationTask"
  request.Body = &model.PutTaskReq{
  TargetServer: targetServerbody,
  VmTemplateId: &vmTemplateIdPutTaskReq,
  ProjectId: &projectIdPutTaskReq,
  ProjectName: &projectNamePutTaskReq,
  SpeedLimit: &speedLimitPutTaskReq,
  RegionName: &regionNamePutTaskReq,
  RegionId: &regionIdPutTaskReq,
  Type: &typePutTaskReq,
  Name: &namePutTaskReq,
  }
  response, err := client.UpdateTask(request)
  if err == nil {
          fmt.Printf("%+v\n", response)
      } else {
          fmt.Println(err)
      }
  }
  ```
- [更多]
  更多编程语言的SDK代码示例，请参见[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/SMS/sdk?api=UpdateTask)的代码示例页签，可生成自动对应的SDK代码示例。
#### 状态码
| 状态码 | 描述          |
|:---|:---|
| 200 | 更新指定ID的迁移任务 |
| 403 | 鉴权失败        |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-sms/ErrorCode.html)。
