Changing the Cloud Phone Server for a Cloud Phone
Function
This API is used to switch to a new cloud phone server. After the switchover, the server name and server ID are the same as those of the original server, and the billing mode remains unchanged. When the server is switched, new mobile phones will be created on the new server, and the original user data will not be retained. The switchover requires additional resources and resource quotas.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
URI
POST /v2/{project_id}/cloud-phone/servers/{server_id}/change
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Specifies the project ID. |
|
server_id |
Yes |
String |
Specifies the unique identifier of the cloud phone server. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Specifies the user token. It can be obtained by calling an Identity and Access Management (IAM) API. The value of X-Subject-Token in the response header is the user token. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
phone_model_name |
Yes |
String |
Specifies the cloud phone flavor, which contains a maximum of 64 bytes. |
|
image_id |
Yes |
String |
Specifies the cloud phone image ID, which can contain a maximum of 32 bytes. |
|
keypair_name |
No |
String |
Specifies the key pair name. The name can contain a maximum of 64 bytes and is used for logging in to the cloud phone through ADB. |
|
availability_zone |
No |
String |
AZ where the cloud phone server is located. If this parameter is left blank, the original AZ remains unchanged. For example, the name for AZ 1 in the CN East-Shanghai1 region is cn-east-3a. |
|
ports |
No |
Array of Port objects |
Specifies the application port enabled on the cloud phone. The CPH service forwards requests to and from the port. |
|
extend_param |
No |
extend_param object |
Extended field |
|
tenant_vpc_id |
Yes |
String |
Specifies the ID of the VPC you select for the cloud phone server to be created. The VPC ID is in UUID format. |
|
nics |
Yes |
Array of Nic objects |
Specifies the structure of the NIC you customized, which defines the NIC information of the cloud phone server to be created. |
|
public_ip |
Yes |
public_ip object |
Specifies the structure of the EIP you specified. To bind an EIP to a cloud phone server, you can: Let the system automatically assign an EIP. You need to specify the EIP type. Use an existing EIP by specifying its ID. |
|
phone_count_per_ip |
No |
Integer |
Number of mobile phones that share a VIP. The default value is the number of mobile phones, indicating that all mobile phones share one VIP. The value ranges from 1 to the number of mobile phone specifications. |
|
phone_data_volume |
No |
phone_data_volume object |
Mobile phone disk structure. This parameter is mandatory for 2.0 specifications. |
|
server_share_data_volume |
No |
server_share_data_volume object |
Disk structure of shared storage. This parameter is optional for storage 2.0. Note: Cloud phones running on RX7 servers and using AOSP 11 images do not support shared applications. |
|
band_width |
Yes |
band_width object |
Specifies the bandwidth used by the cloud phone. |
|
property |
No |
String |
Specifies the cloud phone property list, which is a JSON string. Only modifiable properties can be preset in this list. The value contains 1 to 8,192 characters. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Specifies the application port name, which can contain a maximum of 16 bytes. The key service name cannot be adb or vnc. |
|
listen_port |
Yes |
Integer |
Specifies the port number, which ranges from 10000 to 50000. |
|
internet_accessible |
Yes |
String |
Specifies whether internet_accessible is enabled. When internet_accessible is set to true (case insensitive), you can access cloud phones over this port from the Internet. Otherwise, you cannot access cloud phones over this port from the Internet. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
enterprise_project_id |
No |
String |
Enterprise project ID If this parameter is not specified or is set to 0, resources will be bound to the default enterprise project. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
subnet_id |
Yes |
String |
Specifies the ID of the subnet you specified, which is the subnet where you will deploy your cloud phone server. The value must be the ID of the subnet created in the VPC (tenant_vpc_id) and in UUID format. |
|
ipv6_enable |
No |
Boolean |
Specifies whether the NIC supports IPv6 addresses. If this parameter is set to true, the NIC supports IPv6 addresses. |
|
ipv6_bandwidth |
No |
ipv6_bandwidth object |
Specifies the shared bandwidth bound to the NIC IPv6 addresses. For details, see the ipv6_bandwidth data structure. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
band_width_id |
Yes |
String |
Specifies the ID of the shared bandwidth bound to the NIC IPv6 addresses. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
ids |
No |
Array of strings |
Specifies the ID of the existing EIP selected for creating the cloud phone server. Only one existing EIP ID can be specified. |
|
eip |
No |
eip object |
Specifies the parameter for an EIP that will be automatically assigned. For details, see the EIP structure. |
|
count |
No |
Integer |
Number of EIPs. The default value is 1. If no EIP is required, set this parameter to 0. The value ranges from 0 to the number of mobile phone IP addresses. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
type |
Yes |
String |
EIP type.
|
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
volume_type |
Yes |
String |
Specifies the disk type. Only the following types are supported:
|
|
size |
Yes |
Integer |
Specifies the cloud phone disk size, in GiB. The value ranges from 10 GiB to 32,768 GiB. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
volume_type |
Yes |
String |
Specifies the disk type. Only the following types are supported:
|
|
size |
Yes |
Integer |
Specifies the shared storage size on the cloud phone server, in GiB. The value ranges from 10 GiB to 32,768 GiB. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
band_width_id |
No |
String |
Specifies the ID of the bandwidth used by the cloud phone server. This parameter is mandatory when shared bandwidth is selected. |
|
band_width_size |
No |
Integer |
Specifies the size of the bandwidth used by the cloud phone server. This parameter is mandatory when dedicated bandwidth is selected. |
|
band_width_charge_mode |
Yes |
Integer |
Specifies the billing mode of the cloud phone server bandwidth.
|
|
band_width_share_type |
Yes |
Integer |
Specifies the bandwidth type of the cloud phone server.
|
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
request_id |
String |
Specifies the request ID, which is unique. |
|
server_id |
String |
Specifies the server ID. |
|
job_id |
String |
Task ID |
|
error_msg |
String |
Specifies the error message returned for the task. |
|
error_code |
String |
Specifies the task error code. |
Example Requests
Changing the cloud phone server for a cloud phone
POST https://{CPH Endpoint}/v2/{project_id}/cloud-phone/servers/{server_id}/change
{
"phone_model_name" : "kg1.cp.c20.d64SSD.e1v1",
"image_id" : "20060220200717f201120a2300000e91",
"keypair_name" : "keypair",
"property" : "{\"sys.prop.writephonenum\":\"13666666666\",\"sys.prop.writeimsi\":\"460021624617113\",\"sys.prop.writewifissid\":\"test_wifi\"}",
"ports" : [ {
"name" : "myServer1",
"listen_port" : 20000,
"internet_accessible" : "false"
}, {
"name" : "myServer2",
"listen_port" : 20001,
"internet_accessible" : "true"
} ],
"extend_param" : {
"enterprise_project_id" : "0"
},
"tenant_vpc_id" : "fca063f6-b942-42a8-9004-e5545f58d6a2",
"nics" : [ {
"subnet_id" : "f1cbfc37-eb42-4357-a0ec-9e4f11950908"
} ],
"public_ip" : {
"eip" : {
"type" : "5_bgp"
}
},
"band_width" : {
"band_width_share_type" : 0,
"band_width_size" : 300,
"band_width_charge_mode" : 1
}
}
Example Responses
Status code: 200
OK
{
"request_id" : "1564567b8bab40f34711234cb80d8574",
"server_id" : "1234567b8bab40ffb711234cb80d0234",
"job_id" : "3648acdc113a44d39a95f95bf3b8b01e"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot