Updated on 2024-12-16 GMT+08:00

Obtaining Configuration File Information

Function

This API is used to obtain the configuration file information.

URI

GET /v3/{project_id}/cas/configs

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant's project ID. See Obtaining a Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

name

No

String

Configuration file name.

config_group_id

No

String

Configuration group ID.

component_id

No

String

Component ID.

limit

No

integer

Number of records to be queried. Value range: 0–100.

offset

No

integer

Offset.

order_by

No

String

Sorting field. By default, query results are sorted by creation time.

  • create_time
  • name
  • update_time

order

No

String

Sorting order.

  • desc (default)
  • asc

Request

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format). Default value: application/json;charset=utf8.

X-Auth-Token

Yes

String

API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token. For details about how to obtain the token, see ServiceStage Error Codes.

Response

Table 4 Response parameters

Parameter

Type

Description

count

Integer

Total number of configuration files.

configs

Array of objects

Configuration file list. See Table 5.

Table 5 configs

Parameter

Type

Description

config_group_id

String

Configuration group ID.

id

String

Configuration file ID.

name

String

Configuration file name.

description

String

Configuration file description.

creator

String

Creator.

type

String

Configuration file type.

  • yaml
  • properties

content

String

Configuration file content.

version

String

Configuration file version.

project_id

String

Project ID.

sensitive

Boolean

Whether to encrypt the configuration file.

  • true: Encrypt.
  • false: Not encrypt.

components

Array of objects

List of the components to which the configuration file is bound. See Table 6.

create_time

Integer

Creation time.

update_time

Integer

Update time.

Table 6 components

Parameter

Type

Description

application_id

String

Application ID.

component_id

String

Component ID.

component_name

String

Component name.

environment_id

String

Environment ID.

Example Request

None

Example Response

{
	"configs": [{
		"id": "f5a52d93-1587-45cf-b8fe-5c7f204b98d1",
		"config_group_id": "4808b50d-d7f3-401b-9175-968cb4f9892b",
		"name": "test-config1",
		"description": null,
		"type": "properties",
		"content": "testKey = testValue",
		"version": "v1",
		"project_id": "2cfeefc3e4c54a5aa7548b8350e638d7",
		"sensitive": false,
		"create_time": 1717486892611,
		"update_time": 1717486892611,
		"components": [{
			"application_id": "8a3be48a-6401-4e8c-bbce-033745252227",
			"component_id": "4b611997-4acd-4538-a06b-32fd2475e057",
			"component_name": "component-test1",
			"environment_id": "d2d7180c-7739-4cbb-bd8e-0911ba31cf51"
		}],
		"creator": "ss-test"
	},
	{
		"id": "2cb1897e-c23b-48a5-993c-dc7ad3c552a0",
		"config_group_id": "f3e6d5b4-4d7d-4009-b806-22cfed2ac6ea",
		"name": "test-config2",
		"description": null,
		"type": "properties",
		"content": "testKey = testValue",
		"version": "v1",
		"project_id": "2cfeefc3e4c54a5aa7548b8350e638d7",
		"sensitive": false,
		"create_time": 1717486590467,
		"update_time": 1717486590467,
		"components": [],
		"creator": "ss-test"
	}],
	"count": 2
}

Status Code

Status Code

Description

200

OK

400

Bad Request

404

Not Found

500

Internal Server Error

Error Code

The error code format is SVCSTG.00100.[Error_ID], for example, SVCSTG.00100400. For details, see ServiceStage Error Codes.