Creating a Configuration File
Function
This API is used to create a configuration file.
URI
POST /v3/{project_id}/cas/configs
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Tenant's project ID. See Obtaining a Project ID. |
Request
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 Authentication. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
config_group_id |
Yes |
String |
Configuration group ID. |
name |
Yes |
String |
Configuration file name. 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. |
content |
Yes |
String |
Configuration file content. |
description |
No |
String |
Configuration file description. The value can contain up to 128 characters. |
type |
Yes |
String |
Configuration file format.
|
sensitive |
Yes |
Boolean |
Whether to encrypt the configuration file.
|
Response
Parameter |
Type |
Description |
---|---|---|
id |
String |
Configuration file ID. |
name |
String |
Configuration file name. |
description |
String |
Configuration description. |
creator |
String |
Creator. |
project_id |
String |
Project ID. |
type |
String |
Configuration file format.
|
sensitive |
Boolean |
Whether to encrypt the configuration file.
|
components |
Array of objects |
Component to which the configuration file is bound. See Table 5. |
create_time |
Integer |
Creation time. |
update_time |
Integer |
Update time. |
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
The error code format is SVCSTG.00100.[Error_ID], for example, SVCSTG.00100400. For details, see ServiceStage Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot