Help Center/ TaurusDB/ API Reference/ APIs (Recommended)/ Instance Management/ Querying a Dynamic Serverless Compute Policy
Updated on 2026-06-12 GMT+08:00

Querying a Dynamic Serverless Compute Policy

Function

This API is used to query the dynamic serverless compute policy of an instance. Before calling this API:

Constraints

This API is in the OBT phase. To use it, submit a service ticket.

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:serverless:getDynamicPolicy

    Read

    instance *

    • g:EnterpriseProjectId

    • g:ResourceTag/<tag-key>

    gaussdb:serverless:getDynamicPolicy

    -

URI

GET /v3/{project_id}/instances/{instance_id}/serverless/dynamic-policy

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

instance_id

Yes

String

Definition

Instance ID, which uniquely identifies an instance.

To obtain this value, see Querying DB Instances.

Constraints

N/A

Range

The value contains 36 characters with a suffix of in07. Only letters and digits are allowed.

Default Value

N/A

Request Parameters

Table 2 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

X-Language

No

String

Definition

Request language type.

Constraints

N/A

Range

  • en-us: English

  • zh-cn: Chinese

Default Value

en-us

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

current_vcpus

String

Definition

Current dynamic serverless compute.

Range

The value must be within the range of available_vcpus. It must be no less than min_vcpus and no greater than max_vcpus. If dynamic serverless is not enabled, the value is null.

min_vcpus

String

Definition

Minimum dynamic serverless compute.

Range

The value must be within the range of available_vcpus and be no greater than max_vcpus. If dynamic serverless is not enabled, the value is null.

max_vcpus

String

Definition

Maximum dynamic serverless compute.

Range

The value must be within the range of available_vcpus and be no less than min_vcpus. If dynamic serverless is not enabled, the value is null.

available_vcpus

Array of strings

Definition

List of available dynamic serverless compute options. This list is empty for instances that do not support dynamic serverless.

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Querying the dynamic serverless compute policy of an instance

GET https://{endpoint}/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/a23fb62bd61e4e9e9636fd2225f395bein07/serverless/dynamic-policy

Example Response

Status code: 200

Success.

  • Querying the dynamic serverless compute policy of an instance that does not support dynamic serverless

    {
      "current_vcpus" : null,
      "min_vcpus" : null,
      "max_vcpus" : null,
      "available_vcpus" : [ ]
    }
  • Querying the dynamic serverless compute policy of an instance that supports dynamic serverless but has dynamic serverless disabled

    {
      "current_vcpus" : null,
      "min_vcpus" : null,
      "max_vcpus" : null,
      "available_vcpus" : [ "2", "4", "8", "12", "16", "20", "24", "28", "32" ]
    }
  • Querying the dynamic serverless compute policy of an instance with dynamic serverless enabled

    {
      "current_vcpus" : 4,
      "min_vcpus" : 2,
      "max_vcpus" : 32,
      "available_vcpus" : [ "2", "4", "8", "12", "16", "20", "24", "28", "32" ]
    }

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.