Help Center/ TaurusDB/ API Reference/ APIs (Recommended)/ HTAP (Standard Edition)/ Querying Specifications of an HTAP Instance
Updated on 2026-01-05 GMT+08:00

Querying Specifications of an HTAP Instance

Function

This API is used to query specifications of an HTAP instance. Before calling this API:

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependency

    gaussdbformysql:instance:listSpec

    List

    -

    -

    gaussdb:instance:list

    -

URI

GET /v3/{project_id}/htap/flavors/{engine_name}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

Constraints

N/A

Range

The value contains 32 characters. Only letters and digits are allowed.

Default Value

N/A

engine_name

Yes

String

Definition

HTAP engine type.

Constraints

N/A

Range

  • star-rocks

  • click-house

Default Value

star-rocks

Table 2 Query parameters

Parameter

Mandatory

Type

Description

availability_zone_mode

No

String

Definition

AZ type.

Constraints

N/A

Range

Only single is supported.

Default Value

single

spec_code

No

String

Definition

Specification code. If this parameter is specified, only the specified specification code is queried.

Constraints

N/A

Range

N/A

Default Value

N/A

version_name

No

String

Definition

HTAP database version.

Constraints

N/A

Range

N/A

Default Value

3.1.6.0

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. To obtain this value, call the IAM API for obtaining a user token.

The value of X-Subject-Token in the response header is the token value.

Constraints

N/A

Range

N/A

Default Value

N/A

Content-Type

Yes

String

Definition

Content type.

Constraints

N/A

Range

application/json

Default Value

application/json

X-Language

No

String

Definition

Request language type.

Constraints

N/A

Range

  • en-us

  • zh-cn

Default Value

en-us

Response Parameters

Status code: 200

Table 4 Response body parameter

Parameter

Type

Description

flavors

Array of flavors objects

Definition

Specification information.

Range

N/A

Table 5 flavors

Parameter

Type

Description

type

String

Definition

CPU architecture.

Range

  • arm: exclusive Arm
  • x86: exclusive x86
  • generalX86: general-purpose x86

vcpus

String

Definition

Number of vCPUs. For example, the value 1 indicates 1 vCPU.

Range

N/A

ram

String

Definition

Memory size, in GB.

Range

N/A

id

String

Definition

Specification ID. The value is unique.

Range

N/A

spec_code

String

Definition

Resource specification code. Its value is same as the value of flavor_ref. Example: gaussdb.sr-be.xlarge.x86.4

gaussdb.sr indicates the product.

xlarge indicates the compute specifications (4 vCPUs).

x86 indicates the x86 architecture.

4 indicates the ratio of vCPUs to memory is 1:4.

Range

N/A

version_name

String

Definition

DB version number.

Range

N/A

instance_mode

String

Definition

Instance type. The value can be Cluster or Single.

Range

N/A

az_status

Map<String,String>

Definition

Specification status in an AZ.

Range

  • normal: The specifications are available in the AZ.
  • unsupported: The specifications are not supported.
  • sellout: The specifications are sold out.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Querying StarRocks specifications

GET https://{endpoint}/v3/23a50154cf494ec9ad6883979a12db0a/htap/flavors/star-rocks?availability_zone_mode=single

Example Response

Status code: 200

Success.

{
  "flavors" : [ {
    "type" : "x86",
    "vcpus" : "4",
    "ram" : "16",
    "id" : "de565db8-0a96-37ea-9388-61167624712c",
    "spec_code" : "gaussdb.sr-be.xlarge.x86.4",
    "version_name" : "8.0",
    "instance_mode" : "Cluster",
    "az_status" : {
      "az1" : "normal",
      "az2" : "normal",
      "az3" : "normal",
      "az4" : "unsupported"
    }
  }, {
    "type" : "x86",
    "vcpus" : "4",
    "ram" : "16",
    "id" : "afef3bfd-ac7c-32e1-ba44-c388acbb196a",
    "spec_code" : "gaussdb.sr-fe.xlarge.x86.4",
    "version_name" : "8.0",
    "instance_mode" : "Cluster",
    "az_status" : {
      "az1" : "normal",
      "az2" : "normal",
      "az3" : "normal",
      "az4" : "unsupported"
    }
  }, {
    "type" : "x86",
    "vcpus" : "8",
    "ram" : "32",
    "id" : "c50e8e15-f2fc-3b40-aca6-c98f07ce2ce0",
    "spec_code" : "gaussdb.sr-be.2xlarge.x86.4",
    "version_name" : "8.0",
    "instance_mode" : "Cluster",
    "az_status" : {
      "az1" : "normal",
      "az2" : "normal",
      "az3" : "normal",
      "az4" : "unsupported"
    }
  }, {
    "type" : "x86",
    "vcpus" : "8",
    "ram" : "32",
    "id" : "24059750-4280-3ee5-a44b-488b924633b4",
    "spec_code" : "gaussdb.sr-fe.2xlarge.x86.4",
    "version_name" : "8.0",
    "instance_mode" : "Cluster",
    "az_status" : {
      "az1" : "normal",
      "az2" : "normal",
      "az3" : "normal",
      "az4" : "unsupported"
    }
  }, {
    "type" : "x86",
    "vcpus" : "16",
    "ram" : "64",
    "id" : "a48c63dc-5563-3813-9e13-39d3301e56f4",
    "spec_code" : "gaussdb.sr-be.4xlarge.x86.4",
    "version_name" : "8.0",
    "instance_mode" : "Cluster",
    "az_status" : {
      "az1" : "normal",
      "az2" : "normal",
      "az3" : "normal",
      "az4" : "unsupported"
    }
  }, {
    "type" : "x86",
    "vcpus" : "16",
    "ram" : "64",
    "id" : "0ef44c01-f7a1-30f5-9f05-9e47094e8c1f",
    "spec_code" : "gaussdb.sr-fe.4xlarge.x86.4",
    "version_name" : "8.0",
    "instance_mode" : "Cluster",
    "az_status" : {
      "az1" : "normal",
      "az2" : "normal",
      "az3" : "normal",
      "az4" : "unsupported"
    }
  }, {
    "type" : "x86",
    "vcpus" : "32",
    "ram" : "128",
    "id" : "2bf6aa50-50da-3f27-91af-a8c873070537",
    "spec_code" : "gaussdb.sr-fe.8xlarge.x86.4",
    "version_name" : "8.0",
    "instance_mode" : "Cluster",
    "az_status" : {
      "az1" : "normal",
      "az2" : "normal",
      "az3" : "normal",
      "az4" : "normal"
    }
  }, {
    "type" : "x86",
    "vcpus" : "32",
    "ram" : "128",
    "id" : "9f52a065-aa93-371a-9975-959fedf6e24f",
    "spec_code" : "gaussdb.sr-be.8xlarge.x86.4",
    "version_name" : "8.0",
    "instance_mode" : "Cluster",
    "az_status" : {
      "az1" : "normal",
      "az2" : "normal",
      "az3" : "normal",
      "az4" : "normal"
    }
  }, {
    "type" : "x86",
    "vcpus" : "64",
    "ram" : "256",
    "id" : "709822e4-567f-3e85-b4af-cb099206c8e2",
    "spec_code" : "gaussdb.sr-fe.16xlarge.x86.4",
    "version_name" : "8.0",
    "instance_mode" : "Cluster",
    "az_status" : {
      "az1" : "normal",
      "az2" : "normal",
      "az3" : "normal",
      "az4" : "unsupported"
    }
  }, {
    "type" : "x86",
    "vcpus" : "64",
    "ram" : "256",
    "id" : "4e56e208-0226-34bb-b84d-035ab0497824",
    "spec_code" : "gaussdb.sr-be.16xlarge.x86.4",
    "version_name" : "8.0",
    "instance_mode" : "Cluster",
    "az_status" : {
      "az1" : "normal",
      "az2" : "normal",
      "az3" : "normal",
      "az4" : "unsupported"
    }
  } ]
}

Status code: 400

Client error.

{
  "error_msg" : "Invalid specification code.",
  "error_code" : "DBS.280434"
}

SDK Sample Code

The SDK sample code is as follows.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.gaussdb.v3.region.GaussDBRegion;
import com.huaweicloud.sdk.gaussdb.v3.*;
import com.huaweicloud.sdk.gaussdb.v3.model.*;


public class ListHtapFlavorSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");
        String projectId = "{project_id}";

        ICredential auth = new BasicCredentials()
                .withProjectId(projectId)
                .withAk(ak)
                .withSk(sk);

        GaussDBClient client = GaussDBClient.newBuilder()
                .withCredential(auth)
                .withRegion(GaussDBRegion.valueOf("<YOUR REGION>"))
                .build();
        ListHtapFlavorRequest request = new ListHtapFlavorRequest();
        request.withEngineName("{engine_name}");
        try {
            ListHtapFlavorResponse response = client.listHtapFlavor(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkgaussdb.v3.region.gaussdb_region import GaussDBRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkgaussdb.v3 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]
    projectId = "{project_id}"

    credentials = BasicCredentials(ak, sk, projectId)

    client = GaussDBClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(GaussDBRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ListHtapFlavorRequest()
        request.engine_name = "{engine_name}"
        response = client.list_htap_flavor(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    gaussdb "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/gaussdb/v3"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/gaussdb/v3/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/gaussdb/v3/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")
    projectId := "{project_id}"

    auth := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        WithProjectId(projectId).
        Build()

    client := gaussdb.NewGaussDBClient(
        gaussdb.GaussDBClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.ListHtapFlavorRequest{}
	request.EngineName = "{engine_name}"
	response, err := client.ListHtapFlavor(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.