Help Center/ Cloud Phone Host/ API Reference/ Cloud Phone Server APIs/ Cloud Phone Servers/ Changing the Flavor of a Cloud Phone Server
Updated on 2024-08-09 GMT+08:00

Changing the Flavor of a Cloud Phone Server

Function

This API is used to change the flavor of a cloud phone server. The target flavor must be a special one. After the API is successfully invoked, the flavor change will be completed in about 2 minutes. On the My Orders page of the management console, you can view that the order status is Successful. Also, if you query the server details on the My Orders page, you can see that the new flavor has been applied.

URI

POST /v1/{project_id}/cloud-phone/servers/change-server-model

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

Request Parameters

Table 2 Request header 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.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

server_id

Yes

String

Specifies the unique identifier of the cloud phone server. You can modify the specifications of only specified servers.

server_model_name

Yes

String

Specifies the specifications of the target cloud phone server. The value contains a maximum of 64 bytes. Specifications can be switched only between servers of the same generation.

phone_model_name

Yes

String

Specifies the target flavor of the cloud phone. The cloud phone quantity must be the same as that before the change. The cloud phone flavor must match the flavor of the target cloud phone server.

extend_param

No

extend_param object

Specifies the purchase mode parameter.

Table 4 extend_param

Parameter

Mandatory

Type

Description

is_auto_pay

No

Integer

Indicates whether to enable automatic payment. By default, automatic payment is disabled. If the specifications are upgraded, you need to pay extra fees. If the specifications are degraded, you will be automatically refunded.

  • 1: automatic payment

  • 0: no

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the unique request ID.

order_id

String

Specifies the order ID. The value can contain a maximum of 64 characters.

product_id

String

Specifies the product ID, which can contain a maximum of 64 characters.

Example Requests

Changing flavors of cloud phone servers

POST https://{CPH Endpoint}/v1/{project_id}/cloud-phone/servers/change-server-model

{
  "server_id" : "a176d8625981453bbafbc0a321d8d6a1",
  "server_model_name" : "physical.rx1.xlarge.special",
  "phone_model_name" : "rx1.cp.sp.c105.d8.e5v5",
  "extend_param" : {
    "is_auto_pay" : 1
  }
}

Example Responses

Status code: 200

OK

{
  "request_id" : "1564567b8bab40f34711234cb80d8574",
  "order_id" : "CS1710111105S8IPB",
  "product_id" : "00301-25217-0--0"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.