Modifying the Specifications of an ECS
Function
This API is used to modify ECS specifications.
This API is an asynchronous API. After the specifications modification request is successfully delivered, a job ID is returned. This does not mean the modification is complete. You need to call the API by referring to Querying Job Execution Status to query the job status. The SUCCESS status indicates that the modification is successful.
The V1.1 API supports all functions (see Modifying the Specifications of an ECS (Pay-per-Use)) provided by the V1 API. Additionally, the V1.1 API supports the modification of yearly/monthly ECSs.
Constraints
- You can modify the ECS specifications only when the ECS is stopped.
- Spot ECSs do not support specifications modification.
URI
POST /v1.1/{project_id}/cloudservers/{server_id}/resize
Parameter |
Mandatory |
Description |
---|---|---|
project_id |
Yes |
Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. |
server_id |
Yes |
Specifies the ECS ID. You can obtain the ECS ID from the console or by following the instructions provided in "Querying Details About an ECS". |
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
resize |
Yes |
Object |
Definition Specifies the operation to modify ECS specifications. For details, see Table 3. Constraints N/A Range N/A Default Value N/A |
dry_run |
No |
Boolean |
Definition Specifies whether to check the request. If this parameter is set to true, no instance is created. Constraints N/A Range
Default Value false |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
flavorRef |
Yes |
String |
Definition Specifies the flavor ID of the ECS after the modification. You can view Querying the Target ECS Flavors to Which a Flavor Can Be Changed to query the target flavors to which a specified ECS flavor can be changed. Constraints
Range N/A Default Value N/A |
dedicated_host_id |
No |
String |
Definition Specifies the DeH ID after the modification. Constraints This parameter is mandatory only for ECSs deployed on DeHs. Constraints N/A Range N/A Default Value N/A |
extendparam |
No |
Object |
Definition Specifies the extended information about an ECS after the modification. For details, see Table 4. Constraints N/A Range N/A Default Value N/A |
mode |
No |
String |
Definition Species whether specifications can be modified at ECS runtime. Constraints N/A Range If the parameter value is withStopServer, the modification process is as follows: The system automatically stops the ECS, modifies ECS specifications, and starts the ECS after the modification is complete. Default Value N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
isAutoPay |
No |
String |
Definition Specifies whether the order is automatically or manually paid. Constraints This parameter is valid only when the ECS is billed on a yearly/monthly basis. Range
Default Value If this parameter is left blank, the order is manually paid by default. |
Response
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
job_id |
No |
String |
Definition Specifies the task ID. This parameter is returned when you modify the specifications of a pay-per-use ECS. For details about task statuses, see Querying Job Execution Status. Range N/A |
order_id |
No |
String |
Definition Specifies the order ID. This parameter is returned when you modify the specifications of a yearly/monthly ECS. Range N/A |
Example Request
Change the flavor of an ECS on a DeH to s3.large.2, enable automatic payment, and allow specifications to be modified when the ECS is running.
POST https://{endpoint}/v1.1/{project_id}/cloudservers/{server_id}/resize { "resize": { "flavorRef": "s3.large.2", "dedicated_host_id": "459a2b9d-804a-4745-ab19-a113bb1b4ddc", "extendparam":{ "isAutoPay": "true" }, } }
Example Response
{ "job_id": "ff80808288d41e1b018990260955686a" }
Or
{ "order_id": "CS1711152257C60TL", "job_id": "ff80808288d41e1b018990260955686a" }
Or
{ "error": { "message": "XXXX", "code": "XXX" } }
Returned Values
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.