Updated on 2026-04-10 GMT+08:00

Creating a Configuration File

Function

This API is used to create a configuration file.

Authorization Information

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

  • If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
  • If you are using identity policy-based authorization, the permission listed below is required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    servicestage:config:create

    write

    config *

    g:EnterpriseProjectId

    -

    -

URI

POST /v3/{project_id}/cas/configs

Table 1 Path parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

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

Constraints

N/A

Range

N/A

Default Value

N/A

Request

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Definition

Message body type (or format).

Constraints

N/A

Range

application/json;charset=utf8

Default Value

N/A

X-Auth-Token

Yes

String

Definition

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 Authentication.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 3 Request body parameter

Parameter

Mandatory

Type

Description

config_group_id

Yes

String

Definition

Configuration group ID.

Range

N/A

Default Value

N/A

name

Yes

String

Definition

Configuration file name.

Range

The value contains 2 to 64 characters consisting of letters, digits, hyphens (-), and underscores (_). It starts with a letter and ends with a letter or digit.

Default Value

N/A

content

Yes

String

Definition

Configuration file content.

Range

N/A

Default Value

N/A

description

No

String

Definition

Configuration file description.

Range

The value is a string of a maximum of 128 characters.

Default Value

N/A

type

Yes

String

Definition

Configuration file format.

Range

  • yaml
  • properties

Default Value

N/A

sensitive

Yes

Boolean

Definition

Whether to encrypt the configuration file.

Range

  • true: yes
  • false: no

Default Value

N/A

config_encryption

No

Object

Definition

Set the encryption key in the configuration file. See Table 4.

Table 4 config_encryption

Parameter

Mandatory

Type

Description

key_id

Yes

String

Definition

User key ID in DEW.

Range

N/A

Default Value

N/A

Response

Table 5 Response parameters

Parameter

Type

Description

id

String

Definition

Configuration file ID.

Range

N/A

name

String

Definition

Configuration file name.

Range

N/A

description

String

Definition

Configuration description.

Range

N/A

creator

String

Definition

Creator.

Range

N/A

project_id

String

Definition

Project ID.

Range

N/A

type

String

Definition

Configuration file format.

Range

  • yaml
  • properties

sensitive

Boolean

Definition

Whether to encrypt the configuration file.

Range

  • true: yes
  • false: no

components

Array of objects

Definition

Component to which the configuration file is bound. See Table 6.

create_time

Integer

Definition

Creation time.

Range

N/A

update_time

Integer

Definition

Update time.

Range

N/A

version

String

Definition

Configuration file version.

Range

N/A

content

String

Definition

Configuration file content.

Range

N/A

config_group_id

String

Definition

Configuration group ID.

Range

N/A

Table 6 components

Parameter

Type

Description

application_id

String

Definition

Application ID.

Range

N/A

component_id

String

Definition

Component ID.

Range

N/A

component_name

String

Definition

Component name.

Range

N/A

environment_id

String

Definition

Environment ID.

Range

N/A

Example Request

Create a configuration file named test-config. Do not encrypt the content and set the file format to properties.

{
	"config_group_id": "f3e6d5b4-4d7d-4009-b806-22cfed2ac6ea",
	"name": "test-config",
	"description": "",
	"type": "properties",
	"content": "test-key = test-value",
	"sensitive": false
}

Example Response

{
	"id": "d5821100-9a82-4d1c-9468-fc6b2b9ccdad",
	"config_group_id": "f3e6d5b4-4d7d-4009-b806-22cfed2ac6ea",
	"name": "test-config",
	"description": "",
	"type": "properties",
	"content": "testkey = testvalue",
	"version": "v1",
	"project_id": "2cfeefc3e4c54a5aa7548b8350e638d7",
	"sensitive": false,
	"create_time": 1717485580152,
	"update_time": 1717485580152,
	"components": [],
	"creator": "ss-test"
}

Status Code

Status Code

Description

200

OK

400

Bad Request

404

Not Found

500

Internal Server Error

Error Code

See ServiceStage Error Codes.