Files
doc-exports/docs/ecs/api-ref/en-us_topic_0020212653.html
wanghuijuan738 effc5e0a2f ECS API 250919 verison. Updating dependent actions.
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com>
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: wanghuijuan738 <wanghuijuan738@huawei.com>
Co-committed-by: wanghuijuan738 <wanghuijuan738@huawei.com>
2025-11-14 18:58:00 +00:00

13 KiB

Modifying the Specifications of an ECS

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.

An ECS flavor cannot be changed to certain flavors. For details, see Querying the Target Flavors to Which an ECS Flavor Can Be Changed.

Constraints

  • You can modify the ECS specifications only when the ECS is stopped.

URI

POST /v1/{project_id}/cloudservers/{server_id}/resize

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

server_id

Yes

Specifies the ECS ID.

Request

Table 2 describes the request parameters.
Table 2 Request parameters

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

  • true: Check the request. Check items include the mandatory parameters and request format.
    • If the check fails, the system returns an error.
    • If the check is successful, the system returns status code 202.
  • false: Send the request without checking the request body.

Default Value

false

Table 3 resize field description

Parameter

Mandatory

Type

Description

flavorRef

Yes

String

Definition

Specifies the flavor ID of the ECS after the modification.

Constraints

N/A

Range

N/A

Default Value

N/A

Response

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" 
} 

Error Codes

See Error Codes.