Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com> Co-authored-by: Huijuan, Wang <wanghuijuan738@noreply.gitea.eco.tsi-dev.otc-service.com> Co-committed-by: Huijuan, Wang <wanghuijuan738@noreply.gitea.eco.tsi-dev.otc-service.com>
24 KiB
Querying Details About ECS Flavors
Function
This API is used to query details about ECS flavors.
URI
GET /v2.1/{project_id}/flavors/detail?minDisk={minDisk}&minRam={minRam}&sort_key={sort_key}&sort_dir={sort_dir}
GET /v2/{project_id}/flavors/detail?minDisk={minDisk}&minRam={minRam}&sort_key={sort_key}&sort_dir={sort_dir}
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
minDisk |
No |
String |
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 |
String |
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. Options: asc and desc |
Request
None
Response
Table 3 describes the response parameters.
Parameter |
Type |
Description |
|---|---|---|
flavors |
Array of objects |
Specifies ECS flavors. For details, see Table 4. |
flavors_links |
Array of objects |
Specifies data links for querying the next pages in pagination query. For details, see Table 5. |
Parameter |
Type |
Description |
|---|---|---|
id |
String |
Specifies the ID of the ECS flavor. |
name |
String |
Specifies the name of the ECS flavor. |
description |
String |
Describes the ECS flavor. This parameter is supported in microversion 2.55 and later. |
vcpus |
Integer |
Specifies the number of vCPUs in the ECS flavor. |
ram |
Integer |
Specifies the memory size (MB) in the ECS flavor. |
disk |
Integer |
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.0. |
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 shortcut links for ECS flavors. For details, see Table 5. |
Example Request
Query details about ECS flavors.
GET https://{endpoint}/v2/743b4c0428d94531b9f2add666642e6b/flavors/detail
GET https://{endpoint}/v2.1/743b4c0428d94531b9f2add666642e6b/flavors/detail
Example Response
{
"flavors": [
{
"name": "c3.2xlarge.2",
"links": [
{
"href": "https://compute.region.example.com/v2.1/743b4c0428d94531b9f2add666642e6b/flavors/c3.2xlarge.2",
"rel": "self"
},
{
"href": "https://compute.region.example.com/743b4c0428d94531b9f2add666642e6b/flavors/c3.2xlarge.2",
"rel": "bookmark"
}
],
"ram": 16384,
"OS-FLV-DISABLED:disabled": false,
"vcpus": 8,
"swap": "",
"os-flavor-access:is_public": true,
"rxtx_factor": 1,
"OS-FLV-EXT-DATA:ephemeral": 0,
"disk": 0,
"id": "c3.2xlarge.2"
},
{
"name": "c3.2xlarge.4",
"links": [
{
"href": "https://compute.region.example.com/v2.1/743b4c0428d94531b9f2add666642e6b/flavors/c3.2xlarge.4",
"rel": "self"
},
{
"href": "https://compute.region.example.com/743b4c0428d94531b9f2add666642e6b/flavors/c3.2xlarge.4",
"rel": "bookmark"
}
],
"ram": 32768,
"OS-FLV-DISABLED:disabled": false,
"vcpus": 8,
"swap": "",
"os-flavor-access:is_public": true,
"rxtx_factor": 1,
"OS-FLV-EXT-DATA:ephemeral": 0,
"disk": 0,
"id": "c3.2xlarge.4"
}
]
}