Modifying the Specifications of an ECS (Pay-per-Use)
Function
ECS specifications can be modified, for example, upgrading the vCPUs and memory, to meet service requirements. 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.
Constraints
- You can modify the ECS specifications only when the ECS is stopped.
- This API cannot be used to modify the specifications of a yearly/monthly ECS. For details about how to modify the specifications of a yearly/monthly ECS, see Modifying the Specifications of an ECS.
- Spot ECSs do not support specifications modification.
URI
POST /v1/{project_id}/cloudservers/{server_id}/resize
|
Parameter |
Mandatory |
Description |
|---|---|---|
|
project_id |
Yes |
Definition Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
|
server_id |
Yes |
Definition Specifies the ECS ID. Constraints N/A Range N/A Default Value N/A |
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 the system checks the request. If this parameter is set to true, the system checks the request, but no instances will be 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 Listing Supported Flavor Changes to query the target flavors to which a specified ECS flavor can be changed. Constraints N/A Range N/A Default Value N/A |
|
mode |
No |
String |
Definition The specification modification request can be submitted at ECS runtime. Constraints N/A Range When mode is set to withStopServer, the system will stop the running ECS first before modifying specifications and then start the ECS after the modification is complete. Default Value N/A |
Response
Table 4 describes the response parameters.
|
Parameter |
Type |
Description |
|---|---|---|
|
job_id |
String |
Definition Specifies the job ID returned after a job is delivered. The job ID can be used to query the job execution progress. For details about how to query the job execution status based on job_id, see Job Status Management. Range N/A |
For details about abnormal responses, see Responses (Jobs).
Example Request
Change the ECS flavor to c3.15xlarge.2.
POST https://{endpoint}/v1/{project_id}/cloudservers/{server_id}/resize
{
"resize": {
"flavorRef": "c3.15xlarge.2"
}
}
Example Response
{
"job_id": "ff80808288d41e1b018990260955686a"
}
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.