• Elastic Cloud Server

ecs
  1. Help Center
  2. Elastic Cloud Server
  3. API Reference
  4. Extension ECS APIs
  5. Flavor Management
  6. Querying Details About Flavors and Extended Flavor Information

Querying Details About Flavors and Extended Flavor Information

Function Description

This interface is used to query details about ECS flavors and extended flavor information.

URI

GET /v1/{project_id}/cloudservers/flavors{?availability_zone}

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

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

Request

Request parameters

Table 2 describes the request parameters.

Table 2 Request parameters

Parameter

Mandatory

Type

Description

availability_zone

No

String

Specifies the AZ name.

Response

Response parameters

Table 3 describes the response parameters.
Table 3 Response parameters

Parameter

Type

Description

flavors

List data structure

Specifies ECS flavors. For details, see Table 4.

Table 4 flavors field description

Parameter

Type

Description

id

String

Specifies the ID of ECS specifications.

name

String

Specifies the name of the ECS specifications.

vcpus

String

Specifies the number of CPU cores in the ECS specifications.

ram

Integer

Specifies the memory size (MB) in the ECS specifications.

disk

String

Specifies the system disk size in the ECS specifications. The value 0 indicates that the disk size is not limited.

The field is invalid in this system.

swap

String

Reserved

OS-FLV-EXT-DATA:ephemeral

Integer

Reserved

OS-FLV-DISABLED:disabled

Boolean

Reserved

rxtx_factor

Integer

Reserved

rxtx_quota

String

Reserved

rxtx_cap

String

Reserved

os-flavor-access:is_public

Boolean

Reserved

links

List data structure

Specifies shortcut links for ECS flavors. For details, see Table 5.

os_extra_specs

Dictionary data structure

Specifies extended ECS specifications. For details, see Table 6.

Table 5 links field description

Parameter

Type

Description

rel

String

Specifies the shortcut link marker name.

href

String

Provides the corresponding shortcut link.

type

String

Specifies the shortcut link type.

Table 6 os_extra_specs field description

Parameter

Type

Description

ecs:performancetype

String

Specifies the ECS specifications types:

  • normal: general-purpose
  • cpuv1: computing I
  • cpuv2: computing II
  • highmem: memory-optimized
  • highcpu: high-performance
  • diskintensive: disk-intensive
  • saphana: large-memory
  • gpu: GPU-optimized

resource_type

String

Specifies the resource type.

instance_vnic:type

String

Specifies the NIC type, which is consistently enhanced.

instance_vnic:instance_bandwidth

Int

Specifies the maximum bandwidth in the unit of Mbit/s. The maximum value of this parameter is 10000.

instance_vnic:max_count

Int

Specifies the maximum number of NICs. The maximum value of this parameter is 4.

quota:local_disk

String

The value of this parameter is in format of "{type}:{count}:{size}:{safeFormat}", where,

  • type specifies the disk type, which can only be HDD.
  • count specifies the number of local disks. Its value can be 3/6/12/24 for d1 type of disks, 2/4/8/12/16/24 for d2 type of disks, or 2/4/8/12/16/24/28 for d3 type of disks.
  • size specifies the capacity of a single disk, in GB. Currently, only 1675 is supported. The actual disk size is 1800, and the available size after formatting is 1675.
  • safeFormat: specifies whether the local disks of an ECS have been securely formatted. The value of this parameter can only be FALSE for d1 types of disks or True for d2 and d3 types of disks.
NOTE:

This field is dedicated for disk-intensive ECSs.

extra_spec:io:persistent_grant

Boolean

Specifies whether persistence is supported. The value of this parameter is true.

NOTE:

This field is dedicated for disk-intensive ECSs.

ecs:generation

String

Specifies the generation of an ECS type.

  • s1: General-purpose first-generation ECSs
  • s2: General-purpose second-generation ECSs
  • m1: Memory-optimized first-generation ECSs
  • m2: Memory-optimized second-generation ECSs
  • h1: High-performance first-generation ECSs
  • h2: High-performance second-generation ECSs
  • d1: Disk-intensive first-generation ECSs
  • d2: Disk-intensive second-generation ECSs
  • g1: GPU-optimized first-generation ECSs
  • g2: GPU-optimized second-generation ECSs
NOTE:

This field is optional.

ecs:virtualization_env_types

String

Specifies a virtualization type.

  • If the parameter value is FusionCompute, the ECS uses XEN-based virtualization.
  • If the parameter value is CloudCompute, the ECS uses KVM-based virtualization.
NOTE:

This field is optional.

pci_passthrough:enable_gpu

Boolean

Indicates whether the GPU is passthrough.

If the value is true, the GPU is passthrough.

pci_passthrough:gpu_specs

String

Indicates the technology used on the G1 and G2 ECSs, including GPU virtualization and GPU passthrough.

  • If the ECS with specified specifications uses GPU virtualization and the GPU model is M60-1Q, the parameter value can be m60_1q:virt:1.
  • If the ECS with specified specifications uses GPU passthrough and the GPU model is M60, the parameter value can be m60:direct_graphics:1.

pci_passthrough:alias

String

Indicates the model and quantity of passthrough-enabled GPUs on P1 ECSs. The parameter value can be set to nvidia-p100:1, indicating that the ECS using this specification will occupy one NVIDIA P100 GPU.

cond:operation:status

String

This parameter takes effect region-wide. If an AZ is not configured in the cond:operation:az parameter, the value of this parameter is used by default. If this parameter is not set or used, the meaning of normal applies. Options:

  • normal: indicates normal commercial use of the flavor.
  • abandon: indicates that the flavor has been canceled (not displayed).
  • sellout: indicates that the flavor has been sold out.
  • obt: indicates that the flavor is under OBT.
  • promotion: indicates the recommended flavor (commercial use, which is similar to normal).

cond:operation:az

String

This parameter takes effect AZ-wide. If an AZ is not configured in this parameter, the value of the cond:operation:status parameter is used by default. This parameter is in the format of "az(xx)". The value in parentheses is the flavor status in an AZ. If the parentheses are left blank, the configuration is invalid. The cond:operation:az options are the same as the cond:operation:status options.

For example, a flavor is sold out in AZ 0, shielded in AZ 1, and available in other AZs of a region, configure the following parameters:

  • Set cond:operation:status to normal.
  • Set cond:operation:az to az0(sellout), az1(abandon).
NOTE:

Configure this parameter if the flavor status in an AZ is different from the cond:operation:status value.

NOTE:

For a list of ECS specifications, see "Instances and Application Scenarios" in Elastic Cloud Server User Guide.

Examples

  • Example response
    {
        "flavors": [
            {
                "id": "104",
                "name": "m1.large",
                "vcpus": "4",
                "ram": 8192,
                "disk": "0",
                "swap": "",
                "OS-FLV-EXT-DATA:ephemeral": 0,
                "rxtx_factor": null,
                "OS-FLV-DISABLED:disabled": null,
                "rxtx_quota": null,
                "rxtx_cap": null,
                "os-flavor-access:is_public": null,
                "os_extra_specs": {
                    "ecs:performancetype": "normal"
                }
            },
        ]
    }

Returned Values

See General Request Returned Values.

Error Code

See Error Code Description.