Querying ECS Flavors
Function
This API is used to query available ECS flavors. After receiving the request, Nova uses nova-api to view the flavors from the database.
URI
GET /v2.1/{project_id}/flavors?minDisk={minDisk}&minRam={minRam}&sort_key={sort_key}&sort_dir={sort_dir}
Table 1 describes the parameters in the URI.
Parameter | Mandatory | Description |
---|---|---|
project_id | Yes | Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. |
Pagination query is supported. For details, see Querying Data in Pages.
Parameters in the following table can be used as URI parameters to filter query results. Usage: /v2/{project_id}/flavors?minDisk={minDisk}&minRam={minRam}
Table 2 describes the query parameters.
Parameter | Mandatory | Type | Description |
---|---|---|---|
minDisk | No | Integer | Specifies the minimum disk specification in the unit of GB. Only the ECSs with the disk specification greater than or equal to the minimum specification can be queried. |
minRam | No | Integer | Specifies the minimum RAM in the unit of MB. Only the ECSs with the RAM specification greater than or equal to the minimum specification can be queried. |
sort_key | No | String | Indicates a sorting field, the default value of which is flavorid. The value of this parameter can also be name, memory_mb, vcpus, root_gb, or flavorid. |
sort_dir | No | String | Specifies the ascending (asc) or descending (desc) sorting. The default value is asc. |
Request
None
Response
Table 4 describes the response parameters.
Parameter | Type | Description |
---|---|---|
id | String | Specifies the flavor ID. |
links | Array of objects | Specifies the shortcut link of the ECS flavor. For details, see Table 5. |
name | String | Specifies the flavor name. |
Parameter | Type | Description |
---|---|---|
rel | String | Specifies the shortcut link marker name. |
href | String | Specifies the shortcut link. |
Example Request
GET https://{endpoint}/v2.1/743b4c0428d94531b9f2add666642e6b/flavors
Example Response
{"flavors": [{"id": "c3.medium","links": [{"href": "https://compute.region.xxx.com/v2.1/743b4c0428d94531b9f2add666642e6b/flavors/c3.medium","rel": "self"},{"href": "https://compute.region.xxx.com/743b4c0428d94531b9f2add666642e6b/flavors/c3.medium","rel": "bookmark"}],"name": "c3.medium"},{"id": "c3.xlarge","links": [{"href": "https://compute.region.xxx.com/v2.1/743b4c0428d94531b9f2add666642e6b/flavors/c3.xlarge","rel": "self"},{"href": "https://compute.region.x.com/743b4c0428d94531b9f2add666642e6b/flavors/c3.xlarge","rel": "bookmark"}],"name": "c3.xlarge"}]}
Returned Values
- Function
- URI
- Request
- Response
- Example Request
- Example Response
- Returned Values