Updated on 2022-08-15 GMT+08:00

Querying Configurations

Function

This API is used to query configurations in the configuration center.

URI

GET /v3/{project_id}/configuration/items

Table 1 Path parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Fixed value: default.

Table 2 Query parameters

Parameter

Type

Mandatory

Description

dimensionsInfo

String

Yes

Service information, which consists of the service name (mandatory), application (mandatory), and version (optional). The combination format is as follows (note that @ and # must be escaped when being added to the HTTP URL. @ is escaped to %40, and # is escaped to %23):

{serviceName}@{appId}#{version} or {serviceName}@{appId}

The value cannot contain spaces or the following special characters: $%^&+/\

keyFilter

String

No

key filter criteria. A regular expression is supported. If special characters are contained, escape them.

revision

String

No

Version of a configuration item.

If the input revision value is the same as the current revision value, status code 304 is returned, but no body is returned. If they are inconsistent, both revision values are returned.

Request

Request parameters

Table 3 Request header parameter

Parameter

Type

Mandatory

Description

x-environment

String

No

Environment whose configurations need to be queried. Value: development, testing, acceptance, or production. Other values are regarded as null.

Response

Response parameters

Table 4 describes the parameters. (If the input revision value is the same as the current revision value, no response message is returned.)

Table 4 Parameters

Parameter

Type

Description

{dimension} (The parameter name and number of parameters are not fixed.)

Map<String, String>

Configuration content.

revision

Table 5

revision

Table 5 revision

Parameter

Type

Description

version

String

Version.

Example

Example request

GET /v3/default/configuration/items?dimensionsInfo=service%40app%231.0.0

Example response

{
    "service@app": {
        "k1": "v1"
    },
    "service@app#1.0.0": {
        "k2": "v2"
    }
}

Status Code

See Status Codes.

Error Code

See CSE Error Codes.