Adding Log Configurations
Function
This API is used to add log configurations.
URI
POST /v1/{project_id}/cfw/logs/configuration
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID, which can be obtained by calling an API or from the console. For details, see Obtaining a Project ID. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| fw_instance_id | Yes | String | Firewall ID, which can be obtained by referring to Obtaining a Firewall ID. |
| enterprise_project_id | No | String | Enterprise project ID, which is the ID of a project planned based on organizations. If the enterprise project function is not enabled, the value is 0. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header). |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| fw_instance_id | Yes | String | Firewall ID, which can be obtained by referring to Obtaining a Firewall ID. |
| lts_enable | Yes | Integer | Whether to enable LTS: 1 (yes), 0 (no). |
| lts_log_group_id | Yes | String | Log Tank Service (LTS) log group ID, which can be obtained by calling the API for querying all the log groups of an account in LTS. Find the value in log_groups.log_group_id (The period [.] is used to separate different levels of objects). |
| lts_attack_log_stream_id | No | String | Attack log stream ID, which can be obtained by calling the API for querying all the log streams in a specified log group in LTS. Find the value in log_streams.log_stream_id (The period [.] is used to separate different levels of objects). |
| lts_attack_log_stream_enable | No | Integer | Whether to enable the attack log stream: 1 (yes), 0 (no). |
| lts_access_log_stream_id | No | String | Access control log stream ID, which can be obtained by calling the API for querying all the log streams in a specified log group in LTS. Find the value in log_streams.log_stream_id (The period [.] is used to separate different levels of objects). |
| lts_access_log_stream_enable | No | Integer | Whether to enable the access control stream: 1 (yes), 0 (no). |
| lts_flow_log_stream_id | No | String | Traffic log ID, which can be obtained by calling the API for querying all the log streams in a specified log group in LTS. Find the value in log_streams.log_stream_id (The period [.] is used to separate different levels of objects). |
| lts_flow_log_stream_enable | No | Integer | Whether to enable the traffic log function: 1 (yes), 0 (no). |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| data | String | Return value for adding log configurations. Its value is a firewall ID. |
Example Requests
Add log stream configurations for firewall 4d6c860a-0338-49e8-ac64-fcaeb4182ba5 in project 408972e72dcd4c1a9b033e955802a36b. The LTS group ID is 20282428-a8f9-4e75-8246-165e64cf8ba8. The access control log stream, traffic log stream, attack log stream, and LTS are disabled.
https://{Endpoint}/v1/408972e72dcd4c1a9b033e955802a36b/cfw/logs/configuration?fw_instance_id=4d6c860a-0338-49e8-ac64-fcaeb4182ba5&enterprise_project_id=default
{
"fw_instance_id" : "4d6c860a-0338-49e8-ac64-fcaeb4182ba5",
"lts_enable" : 0,
"lts_log_group_id" : "20282428-a8f9-4e75-8246-165e64cf8ba8",
"lts_attack_log_stream_enable" : 0,
"lts_access_log_stream_enable" : 0,
"lts_flow_log_stream_enable" : 0
} Example Responses
Status code: 200
OK
{
"data" : "4d6c860a-0338-49e8-ac64-fcaeb4182ba5"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
Error Codes
See 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