Purchasing a Cloud Phone Server
Function
This API is used to purchase a cloud phone server. You can use existing VPCs to manage your cloud phone servers and reuse resources such as the shared bandwidth you have purchased.
-
Your account must have the CPH AgencyDependencyAccess permissions.
-
You must have sufficient server and network quotas. If the quota verification fails, the creation will fail.
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
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Specifies the project ID. |
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 |
|---|---|---|---|
|
server_name |
Yes |
String |
Cloud phone server name.The value can contain a maximum of 60 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.A sequence number is added to the end of each server name automatically if servers are purchased in a batch . For example, if this parameter is set to server-1, the name of each created cloud phone server is automatically suffixed with a number in sequence, like server-1-0001. |
|
server_model_name |
Yes |
String |
Specifies the flavor of the cloud phone server. The flavor can contain a maximum of 64 bytes. |
|
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. |
|
count |
Yes |
Integer |
Number of cloud phone servers to be purchased. You can purchase 10 servers at most. |
|
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. |
|
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 |
Yes |
extend_param object |
Specifies parameters related to the billing mode. |
|
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 |
Indicates the EIP structure customized by the tenant. Specifies the method of configuring the EIP of the ECS, Automatically assigned. You need to specify the information about the new EIP. If you use an existing EIP, you need to specify the EIP ID that has been [purchased] (tag:hws,hws_hk,cmcc). |
|
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. |
|
availability_zone |
No |
String |
Name of the AZ where the cloud phone server is to be created. For example, the name for AZ 1 in the CN East-Shanghai1 region is cn-east-3a. |
|
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 |
|---|---|---|---|
|
charging_mode |
Yes |
Integer |
Billing mode. [- 0: yearly/monthly] (tag:hws,hws_hk,cmcc,ctc) |
|
period_type |
Yes |
Integer |
Specifies the subscription period.
|
|
period_num |
Yes |
Integer |
Number of subscription periods. If the subscription period is a month, the value ranges from 1 to 9. If the subscription period is a year, the value ranges from 1 to 10. |
|
is_auto_pay |
No |
Integer |
Specifies whether to automatically pay fees. By default, automatic payment is disabled.
|
|
is_auto_renew |
No |
Integer |
Specifies whether auto renew is enabled. By default, auto renewal is disabled.
|
|
enterprise_project_id |
No |
String |
Specifies the 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 unique request ID. |
|
order_id |
String |
Specifies the order ID, which can contain a maximum of 64 bytes. |
|
product_id |
String |
Specifies the product ID, which can contain a maximum of 64 bytes. |
|
server_ids |
Array of strings |
Specifies the server ID list. |
|
error_msg |
String |
Specifies the error message returned for the task. |
|
error_code |
String |
Specifies the task error code. |
Example Requests
Purchasing a cloud phone server
POST https://{CPH Endpoint}/v2/{project_id}/cloud-phone/servers
{
"server_name" : "cph-kertus-1110",
"server_model_name" : "physical.kg1.4xlarge.cp",
"phone_model_name" : "kg1.cp.c20.d64SSD.e1v1",
"image_id" : "20060220200717f201120a2300000e91",
"count" : 1,
"keypair_name" : "keypair",
"ports" : [ {
"name" : "myServer1",
"listen_port" : 20000,
"internet_accessible" : "false"
}, {
"name" : "myServer2",
"listen_port" : 20001,
"internet_accessible" : "true"
} ],
"extend_param" : {
"charging_mode" : 0,
"period_type" : 2,
"period_num" : 1,
"is_auto_pay" : 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",
"order_id" : "CS1710111105S8IPB",
"product_id" : "00301-25217-0--0",
"server_ids" : [ "1234567b8bab40ffb711234cb80d0234", "1678567b8bab40f93711234cb80d0764" ]
}
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