Modifying Alarm Configurations
Function
This API is used to modify alarm configurations.
URI
PUT /v1/{project_id}/cfw/alarm/config
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID, which can be obtained by calling an API or from the console. You can obtain it by referring to 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 |
|---|---|---|---|
| account_name | No | String | account name. |
| alarm_id | No | String | account ID. |
| alarm_time_period | No | Integer | Alarm period: 0 (all day), 1 (8:00 to 22:00). |
| alarm_type | No | Integer | Alarm type: 0 (attack), 1 (traffic threshold crossing), 2 (EIP unprotected), 3 (suspicious external connection) |
| enable_status | No | Integer | Alarm status: 0 (invalid), 1 (valid). |
| frequency_count | No | Integer | Alarm triggering frequency. |
| frequency_time | No | Integer | Alarm frequency time range, in minutes. |
| language | No | String | Alarm language: zh-cn (Chinese), en-us (English). |
| severity | No | String | Alarm severity. If the value of type is 0 or 4, the value of severity can be one or more values of CRITICAL, HIGH, MEDIUM, and LOW combined. If the value of type is 1, severity is 2. If the value of type is 2, severity can only be 3. |
| topic_urn | No | String | Alarm URN. |
| username | No | String | Username. Its value is cfw. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| data | ResponseData object | Common response body. |
Example Requests
Configure the firewall alarms of the project whose ID is 408972e72dcd4c1a9b033e955802a36b. The firewall ID is 8de37729-026d-412f-ba82-80c46f388d14. The alarm type is 1, alarm period is 0, status is 0, and severity is 0. The alarm policy is that an alarm is generated once a day when the protection bandwidth usage reaches 80%. The alarm name is test-wyl, and the topic URN is urn:smn:xx-xxx-x:408972e72dcd4c1a9b033e955802a36b:test-wyl.
https://{Endpoint}/v1/408972e72dcd4c1a9b033e955802a36b/cfw/alarm/config?fw_instance_id=8de37729-026d-412f-ba82-80c46f388d14
{
"alarm_time_period" : 0,
"alarm_type" : 1,
"enable_status" : 0,
"severity" : "0",
"frequency_count" : 1,
"frequency_time" : 1,
"topic_urn" : "urn:smn:xx-xxx-x:408972e72dcd4c1a9b033e955802a36b:test-wyl",
"username" : "cfw"
} Example Responses
Status code: 200
OK
{
"data" : {
"id" : "8de37729-026d-412f-ba82-80c46f388d14"
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 401 | Unauthorized: Request error. |
| 403 | Forbidden: Access forbidden. |
| 404 | Not Found: Web page not found. |
Error Codes
See Error Codes.
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