Modifying a Configuration File Based on the Configuration File ID
Function
This API is used to modify a configuration file based on the configuration file ID.
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:modify
write
config *
-
-
URI
PUT /v3/{project_id}/cas/configs/{config_id}
| 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 |
| config_id | Yes | String | Definition Configuration file ID. See Obtaining Configuration File Information. Constraints N/A Range N/A Default Value N/A |
Request
| 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 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| config_group_id | Yes | String | Definition Configuration group ID. Range N/A 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 N/A Default Value N/A |
| sensitive | No | Boolean | Definition Whether to encrypt the configuration file. Range
Default Value N/A |
| config_encryption | No | Object | Definition Set the encryption key in the configuration file. See Table 4. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| key_id | Yes | String | Definition User key ID in DEW. Range N/A Default Value N/A |
Response
| Parameter | Type | Description |
|---|---|---|
| config_group_id | String | Definition Configuration group ID. Range N/A |
| id | String | Definition Configuration file ID. Range N/A |
| name | String | Definition Configuration file name. Range N/A |
| description | String | Definition Configuration file description. Range N/A |
| creator | String | Definition Creator. Range N/A |
| type | String | Definition Configuration file type. Range
|
| content | String | Definition Configuration file content. Range N/A |
| version | String | Definition Configuration file version. Range N/A |
| project_id | String | Definition Project ID. Range N/A |
| sensitive | Boolean | Definition Whether to encrypt the configuration file. Range
|
| components | Array of objects | Definition List of the components 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 |
| enterprise_project_id | String | Definition Enterprise project ID. Range N/A |
| config_encryption | Object | Definition Set the encryption key in the configuration file. See Table 7. |
Example Request
Change the group ID of the configuration file to 4808b50d-d7f3-401b-9175-968cb4f9892b, type to properties, and content to testKey = testModify, and do not encrypt the file content.
{
"config_group_id": "4808b50d-d7f3-401b-9175-968cb4f9892b",
"description": "",
"type": "properties",
"content": "testKey = testModify",
"sensitive": false
} Example Response
{
"id": "f5a52d93-1587-45cf-b8fe-5c7f204b98d1",
"config_group_id": "4808b50d-d7f3-401b-9175-968cb4f9892b",
"name": "test-config1",
"description": "",
"type": "properties",
"content": "testKey = testModify",
"version": "v2",
"project_id": "2cfeefc3e4c54a5aa7548b8350e638d7",
"sensitive": false,
"create_time": 1717486892611,
"update_time": 1717491574202,
"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"
} Status Code
| Status Code | Description |
|---|---|
| 204 | OK |
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Internal Server Error |
Error Code
What is your overall rating for this page?
Thank 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