Querying the Target ECS Flavors to Which a Flavor Can Be Changed
Function
An ECS flavor cannot be changed to certain flavors. This API is used to query the target flavors to which a specified ECS flavor can be changed.
URI
GET /v1/{project_id}/cloudservers/resize_flavors?instance_uuid={instance_uuid}&source_flavor_id={source_flavor_id}&source_flavor_name={source_flavor_name}
Parameter |
Mandatory |
Description |
---|---|---|
project_id |
Yes |
Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. |
One of the instance_uuid, source_flavor_id, and source_flavor_name parameters must be configured. If multiple parameters are configured, the system processes the instance_uuid, source_flavor_id, and source_flavor_name parameters in descending order by default.
If instance_uuid is used to query the flavors that can be changed to, only the flavors supporting the image based on which the target ECS is created are returned. The reason is as follows: Images rely on flavors. If an ECS is created using a public image, the API filters the flavors supported by the image.
Table 2 describes the query parameters.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
instance_uuid |
No |
String |
Specifies the target ECS ID in UUID format. |
source_flavor_id |
No |
String |
Specifies the source flavor ID. |
source_flavor_name |
No |
String |
Specifies the source flavor name. |
sort_key |
No |
String |
Indicates the field for sorting. The default value is flavorid. Options:
|
sort_dir |
No |
String |
Ascending or descending sorting. The default value is asc. Options:
|
limit |
No |
Integer |
Specifies the maximum number of flavors that can be displayed on one page. The default value is 1,000. |
marker |
No |
String |
Specifies the ID of the last flavor on each page as the paging marker. |
Request
None
Response
Table 3 describes the response parameters.
Parameter |
Type |
Description |
---|---|---|
flavors |
Array of objects |
Specifies ECS flavors. For details, see Table 4. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Specifies the ECS flavor ID. |
name |
String |
Specifies the ECS flavor name. |
vcpus |
String |
Specifies the number of vCPUs in the ECS flavor. |
ram |
Integer |
Specifies the memory size (MB) in the ECS flavor. |
disk |
String |
Specifies the system disk size in the ECS flavor. This parameter has not been used. Its default value is 0. |
swap |
String |
Specifies the swap partition size required by the ECS flavor. This parameter has not been used. Its default value is "". |
OS-FLV-EXT-DATA:ephemeral |
Integer |
Specifies the temporary disk size. This is an extended attribute. This parameter has not been used. Its default value is 0. |
OS-FLV-DISABLED:disabled |
Boolean |
Specifies whether the ECS flavor has been disabled. This is an extended attribute. This parameter has not been used. Its default value is false. |
rxtx_factor |
Float |
Specifies the ratio of the available network bandwidth to the network hardware bandwidth of the ECS. This parameter has not been used. Its default value is 1. |
rxtx_quota |
String |
Specifies the software constraints of the network bandwidth that can be used by the ECS. This parameter has not been used. Its default value is null. |
rxtx_cap |
String |
Specifies the hardware constraints of the network bandwidth that can be used by the ECS. This parameter has not been used. Its default value is null. |
os-flavor-access:is_public |
Boolean |
Specifies whether a flavor is available to all tenants. This is an extended attribute.
Default value: true |
links |
Array of objects |
Specifies the shortcut link of the ECS flavor. For details, see Table 5. |
extra_specs |
Object |
Specifies the extended field of the ECS flavor. For details, see Table 6. |
instance_quota |
Object |
This is a reserved parameter. |
Example Request
Query the flavors that the ECS flavor c3.xlarge.2 can be changed to.
GET https://{endpoint}/v1/{project_id}/cloudservers/resize_flavors?source_flavor_id=c3.xlarge.2
Example Response
{ "flavors": [ { "id": "c3.15xlarge.2", "name": "c3.15xlarge.2", "vcpus": "60", "ram": 131072, "disk": "0", "swap": "", "links": [ { "rel": "self", "href": "https://ecs.region.example.com/v1.0/743b4c0428d94531b9f2add666642e6b/flavors/c3.15xlarge.2", "type": null }, { "rel": "bookmark", "href": "https://ecs.region.example.com/743b4c0428d94531b9f2add666642e6b/flavors/c3.15xlarge.2", "type": null } ], "OS-FLV-EXT-DATA:ephemeral": 0, "rxtx_factor": 1, "OS-FLV-DISABLED:disabled": false, "rxtx_quota": null, "rxtx_cap": null, "os-flavor-access:is_public": true, "extra_specs": { "ecs:virtualization_env_types": "CloudCompute", "ecs:generation": "c3", "ecs:performancetype": "computingv3", "resource_type": "IOoptimizedC3_2" } } ] }
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot