Updated on 2022-11-30 GMT+08:00

Migrating a Cloud Phone

Function Description

  • API name

    BatchMigrateCloudPhone

  • Function

    This API is used to migrate the entire cloud phone in batches, including migrating data on the system disks and data disks of the cloud phones. This API is an asynchronous API. The migration time required depends on the data volume of the cloud phones. If the data volume of a cloud phone is 11 GB, the migration of one cloud phone takes about 3 to 5 minutes. Before the migration, stop the cloud phone. You can call the Querying the Task Execution Status and Querying the Task Execution Status List APIs to query the migration task execution result.

URI

POST /v1/{project_id}/cloud-phone/phones/batch-migrate

For details, see Table 1.
Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

For details about how to obtain the project ID, see Obtaining a Project ID.

Request

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    migrate_infos

    Yes

    Array of objects

    Specifies information about the cloud phone for which the data is to be migrated. For details, see Table 2.

    Table 2 Data structure description of migrate_info

    Parameter

    Mandatory

    Type

    Description

    source_phone_id

    Yes

    String

    Specifies the ID of the source cloud phone.

    target_phone_id

    Yes

    String

    Specifies the ID of the target cloud phone.

    is_migrate_property

    No

    String

    Specifies whether to migrate the attributes of the source cloud phone to the target cloud phone. If this parameter is set to true (case-insensitive), migration is performed. If this parameter is left blank or set to another value, migration is not performed.

  • Example request
    POST /v1/{project_id}/cloud-phone/phones/batch-migrate
    {
       "migrate_infos": [ 
            { 
                "source_phone_id": "1234567b8bab40ffb711234cb80d0234", 
                "target_phone_id": "6837531fd3f54550927b930180a706bf", 
                "is_migrate_property": "true" 
            } 
        ] 
    }

Response

  • Response parameters

    Parameter

    Type

    Description

    request_id

    String

    Specifies the request ID, which is unique.

    jobs

    Array of objects

    Specifies the task information. For details, see Table 3.

    Table 3 job structure

    Parameter

    Type

    Description

    source_phone_id

    String

    Specifies the ID of the source cloud phone.

    target_phone_id

    String

    Specifies the ID of the target cloud phone.

    job_id

    String

    Specifies the unique ID of a task.

    error_code

    String

    Specifies the error code. For details, see Error Codes.

    error_msg

    String

    Specifies the error message.

  • Example response
    {  
        "request_id": "6837531fd3f54550927b930180a706bf",
        "jobs":  [    
            {
                "source_phone_id": "1234567b8bab40ffb711234cb80d0234", 
                "target_phone_id": "6637531fd3f54550927b930180a706cf",
                "job_id":  "1564567b8bab40f34711234cb80d0123"
            },
            {
                "source_phone_id": "1678567b8bab", 
                "target_phone_id": "6837531fd3f54550927b930180a706bf", 
                "error_code": "CPS.0232", 
                "error_msg": "Parameter: source_phone_id is invalid." 
            }
         ]
    }

Returned Values

See Returned Values.

Error Codes

See Error Codes.