Configuring LTS for WAF Logging
Function
This API is used to enable or disable Log Tank Service (LTS) for WAF logging and to configure log groups and streams. You can obtain the log group ID and log stream ID from LTS. The log stream ID must belong to the log group you configure.
URI
PUT /v1/{project_id}/waf/config/lts/{ltsconfig_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. To obtain it, go to Cloud management console and hover the cursor over your username. On the displayed window, choose My Credentials.Then, in the Projects area, view Project ID of the corresponding project. |
ltsconfig_id |
Yes |
String |
ID of the LTS configuration. The ID can be obtained by calling the ShowLtsInfoConfig API. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enterprise_project_id |
No |
String |
You can obtain the ID by calling the ListEnterpriseProject API of EPS. |
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). |
Content-Type |
Yes |
String |
Content type. Default: application/json;charset=utf8 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enabled |
No |
Boolean |
Whether to enable LTS for WAF logging\n - false: LTS is disabled for WAF.\n - true: LTS is enabled for WAF. |
ltsIdInfo |
No |
LtsIdInfo object |
Log group and log stream IDs. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
id |
String |
LTS configuration information ID. Each enterprise project has a unique ID. |
enabled |
Boolean |
Whether to enable LTS for WAF logging\n - false: LTS is disabled for WAF.\n - true: LTS is enabled for WAF. |
ltsIdInfo |
LtsIdInfo object |
Log group and log stream IDs. |
Parameter |
Type |
Description |
---|---|---|
ltsGroupId |
String |
Log group ID. |
ltsAccessStreamID |
String |
Log stream ID for access logs |
ltsAttackStreamID |
String |
Log stream ID for attack logs |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code |
error_msg |
String |
Error message |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code |
error_msg |
String |
Error message |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code |
error_msg |
String |
Error message |
Example Requests
The following example shows how to update the LTS configuration in a project. The project ID is specified by project_id. The new LTS configuration ID is c89a667487734f6a95e9967d1f373c77. LTS for WAF logging is enabled. Log group ID: 4bcff74d-f649-41c8-8325-1b0a264ff683. Access og stream ID: 0a7ef713-cc3e-418d-abda-85df04db1a3c. Attack log stream ID: f4fa07f6-277b-4e4a-a257-26508ece81e6
GET https://{Endpoint}/v1/{project_id}/waf/config/lts/c89a667487734f6a95e9967d1f373c77?enterprise_project_id=0 { "enabled" : true, "ltsIdInfo" : { "ltsAccessStreamID" : "4bcff74d-f649-41c8-8325-1b0a264ff683", "ltsAttackStreamID" : "0a7ef713-cc3e-418d-abda-85df04db1a3c", "ltsGroupId" : "f4fa07f6-277b-4e4a-a257-26508ece81e6" } }
Example Responses
Status code: 200
Request succeeded.
{ "enabled" : true, "id" : "c89a667487734f6a95e9967d1f373c77", "ltsIdInfo" : { "ltsAccessStreamID" : "4bcff74d-f649-41c8-8325-1b0a264ff683", "ltsAttackStreamID" : "0a7ef713-cc3e-418d-abda-85df04db1a3c", "ltsGroupId" : "f4fa07f6-277b-4e4a-a257-26508ece81e6" } }
Status Codes
Status Code |
Description |
---|---|
200 |
Request succeeded. |
400 |
Request failed. |
401 |
The token does not have required permissions. |
500 |
Internal server error. |
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.