UpdateAlarmPolicy

BLS

  • Function Release Records
  • Product Description
    • Usage restrictions
    • Product Introduction
  • Product pricing
  • Quick Start
    • Introduction
    • Install agent
    • Create LogStore
    • Create Transmission Task
    • Log Analysis and Alerting
    • Create Delivery Task
  • Operation guide
    • Baidu Intelligent Cloud Environment Preparation
    • Overview
    • Identity and access management
    • Logset Management
    • Agent
      • Install Agent on Host
      • Install Agent in K8s Environment
      • Agent Management
      • Agent Release Version
      • Set Agent Startup Parameters
    • Log Collection
      • Transmission Task Collection
        • Create Transmission Task
        • Manage Transmission Task
      • Uploading Logs Using Kafka Protocol
    • Query analysis
      • Log query
      • SQL Syntax
      • Search Syntax
    • Dashboard
      • Overview
      • Management Dashboard
      • Management Dashboard Charts
    • Alarm management
      • Alert Overview
      • Alarm strategy
        • Management alarm strategy
        • Trigger conditions
      • Alarm history
      • Alert execution statistics
      • Alarm notification
        • Alarm Notification Template
        • Alarm callback
    • Data processing
      • Log Delivery
        • Log Delivery Overview
        • Create Delivery Task
        • Manage Delivery Task
      • Scheduled SQL Analysis
        • Manage Scheduled SQL Analysis Task
        • Create Scheduled SQL Analysis Task
      • Real-Time Consumption
      • Data processing
        • Data processing
          • Overview of data processing functions
          • Process control function
          • Mapping enrichment functions
          • Event operation functions
          • Field operation functions
          • Field value extraction functions
    • Log Applications
      • Intelligent Diagnostics
  • Best Practices
    • Use Year-Over-Year and Month-Over-Month as Alert Trigger Conditions
    • BLS Integration with Kibana
    • Use BLS via Grafana
  • Development Guide
    • API Reference
      • API function release records
      • API Overview
      • Interface Overview
      • General Description
      • Service domain
      • Common error codes
      • Terminology
      • Project Related APIs
        • Create Project
        • Update Project
        • Describe Project
        • Delete Project
        • List Project
      • LogStore Related APIs
        • Create LogStore
        • Update LogStore
        • Delete LogStore
        • Describe LogStore
        • Batch Get LogStore
        • List LogStore
      • LogStream Related APIs
        • List LogStream
      • LogRecord Related APIs
        • Push log PushLogRecord
        • Obtain logrecord PullLogRecord
        • Search analysis log QueryLogRecord
        • Histogram API QueryLogHistogram
      • Fast Query FastQuery Related Interfaces
        • Create Fast Query CreateFastQuery
        • Update Fast Query UpdateFastQuery
        • Delete Fast Query DeleteFastQuery
        • Get Fast Query Details DescribeFastQuery
        • Get Fast Query List ListFastQuery
      • Index Related APIs
        • Create Index
        • Update Index
        • Delete Index
        • Describe Index
      • Log Shipper LogShipper Related Interfaces
        • Create Log Shipper
        • Update Log Shipper
        • Set Single Log Shipper Status
        • Delete Single Log Shipper
        • Bulk Delete Log Shipper
        • List Log Shipper Records
        • List Log Shipper
        • Bulk Set Log Shipper Status
        • Get Log Shipper
      • Alarm-Related Interfaces
        • CreateAlarmPolicy
        • UpdateAlarmPolicy
        • DeleteAlarmPolicy
        • ValidateAlarmCondition
        • ValidateAlarmPolicySQL
        • EnableAlarmPolicy
        • DescribeAlarmRecord
        • DisableAlarmPolicy
        • DescribeAlarmPolicy
        • ListAlarmPolicy
        • ListAlarmRecord
        • ListAlarmExecutionStats
        • ListAlarmExecutions
      • LogStore Template-Related Interfaces
        • CreateLogStoreTemplate
        • UpdateLogStoreTemplate
        • DeleteLogStoreTemplates
        • DescribeLogStoreTemplates
        • DescribeLogStoreTemplate
      • Download Log Download Related Interfaces
        • Create Download Task CreateDownloadTask
        • Get Download Task List ListDownloadTask
        • Delete Download Task DeleteDownloadTask
        • Get Download Task Address GetDownloadTaskLink
        • Get Download Task Details DescribeDownloadTask
      • LogAlarm Related Interfaces
        • SetLogAlarmStatus
        • deleteLogAlarm
        • createLogAlarm
        • listLogAlarm
        • updateLogAlarm
        • BulkDeleteLogAlarm
        • PreviewAlarmLogRecord
        • getLogAlarm
        • BulkSetLogAlarmStatus
      • Transmission Task Related Interfaces
        • Create Task CreateTask
        • UpdateTask
      • Interfaces Compatible with Elasticsearch
        • ResolveIndex
        • FieldCaps
        • TermsEnum
        • AsyncSearch
    • SDK Reference
      • Go SDK
        • Overview
        • Initialization
        • Version Release Records
        • Project Operations
        • LogStore Operations
        • Install the SDK Package
        • LogStream Operations
        • LogRecord Operations
        • FastQuery Operations
        • LogShipper Operations
        • Index Operations
        • Download Task Operations
      • Java SDK
        • Overview
        • Install the SDK Package
        • LogRecord Operations
      • iOS SDK
        • Overview
        • Quick start
        • Version Release Records
      • Android SDK
        • Overview
        • Quick start
        • Version Release Records
      • Android & iOS SDK Download
      • SDK Privacy Policy
      • SDK Developer Personal Information Protection Compliance Guide
    • Importing SLS Collection Configuration
  • FAQs
    • Common Questions Overview
    • Fault-related questions
    • Configuration-related questions
  • Log Service Level Agreement SLA
All documents
menu
No results found, please re-enter

BLS

  • Function Release Records
  • Product Description
    • Usage restrictions
    • Product Introduction
  • Product pricing
  • Quick Start
    • Introduction
    • Install agent
    • Create LogStore
    • Create Transmission Task
    • Log Analysis and Alerting
    • Create Delivery Task
  • Operation guide
    • Baidu Intelligent Cloud Environment Preparation
    • Overview
    • Identity and access management
    • Logset Management
    • Agent
      • Install Agent on Host
      • Install Agent in K8s Environment
      • Agent Management
      • Agent Release Version
      • Set Agent Startup Parameters
    • Log Collection
      • Transmission Task Collection
        • Create Transmission Task
        • Manage Transmission Task
      • Uploading Logs Using Kafka Protocol
    • Query analysis
      • Log query
      • SQL Syntax
      • Search Syntax
    • Dashboard
      • Overview
      • Management Dashboard
      • Management Dashboard Charts
    • Alarm management
      • Alert Overview
      • Alarm strategy
        • Management alarm strategy
        • Trigger conditions
      • Alarm history
      • Alert execution statistics
      • Alarm notification
        • Alarm Notification Template
        • Alarm callback
    • Data processing
      • Log Delivery
        • Log Delivery Overview
        • Create Delivery Task
        • Manage Delivery Task
      • Scheduled SQL Analysis
        • Manage Scheduled SQL Analysis Task
        • Create Scheduled SQL Analysis Task
      • Real-Time Consumption
      • Data processing
        • Data processing
          • Overview of data processing functions
          • Process control function
          • Mapping enrichment functions
          • Event operation functions
          • Field operation functions
          • Field value extraction functions
    • Log Applications
      • Intelligent Diagnostics
  • Best Practices
    • Use Year-Over-Year and Month-Over-Month as Alert Trigger Conditions
    • BLS Integration with Kibana
    • Use BLS via Grafana
  • Development Guide
    • API Reference
      • API function release records
      • API Overview
      • Interface Overview
      • General Description
      • Service domain
      • Common error codes
      • Terminology
      • Project Related APIs
        • Create Project
        • Update Project
        • Describe Project
        • Delete Project
        • List Project
      • LogStore Related APIs
        • Create LogStore
        • Update LogStore
        • Delete LogStore
        • Describe LogStore
        • Batch Get LogStore
        • List LogStore
      • LogStream Related APIs
        • List LogStream
      • LogRecord Related APIs
        • Push log PushLogRecord
        • Obtain logrecord PullLogRecord
        • Search analysis log QueryLogRecord
        • Histogram API QueryLogHistogram
      • Fast Query FastQuery Related Interfaces
        • Create Fast Query CreateFastQuery
        • Update Fast Query UpdateFastQuery
        • Delete Fast Query DeleteFastQuery
        • Get Fast Query Details DescribeFastQuery
        • Get Fast Query List ListFastQuery
      • Index Related APIs
        • Create Index
        • Update Index
        • Delete Index
        • Describe Index
      • Log Shipper LogShipper Related Interfaces
        • Create Log Shipper
        • Update Log Shipper
        • Set Single Log Shipper Status
        • Delete Single Log Shipper
        • Bulk Delete Log Shipper
        • List Log Shipper Records
        • List Log Shipper
        • Bulk Set Log Shipper Status
        • Get Log Shipper
      • Alarm-Related Interfaces
        • CreateAlarmPolicy
        • UpdateAlarmPolicy
        • DeleteAlarmPolicy
        • ValidateAlarmCondition
        • ValidateAlarmPolicySQL
        • EnableAlarmPolicy
        • DescribeAlarmRecord
        • DisableAlarmPolicy
        • DescribeAlarmPolicy
        • ListAlarmPolicy
        • ListAlarmRecord
        • ListAlarmExecutionStats
        • ListAlarmExecutions
      • LogStore Template-Related Interfaces
        • CreateLogStoreTemplate
        • UpdateLogStoreTemplate
        • DeleteLogStoreTemplates
        • DescribeLogStoreTemplates
        • DescribeLogStoreTemplate
      • Download Log Download Related Interfaces
        • Create Download Task CreateDownloadTask
        • Get Download Task List ListDownloadTask
        • Delete Download Task DeleteDownloadTask
        • Get Download Task Address GetDownloadTaskLink
        • Get Download Task Details DescribeDownloadTask
      • LogAlarm Related Interfaces
        • SetLogAlarmStatus
        • deleteLogAlarm
        • createLogAlarm
        • listLogAlarm
        • updateLogAlarm
        • BulkDeleteLogAlarm
        • PreviewAlarmLogRecord
        • getLogAlarm
        • BulkSetLogAlarmStatus
      • Transmission Task Related Interfaces
        • Create Task CreateTask
        • UpdateTask
      • Interfaces Compatible with Elasticsearch
        • ResolveIndex
        • FieldCaps
        • TermsEnum
        • AsyncSearch
    • SDK Reference
      • Go SDK
        • Overview
        • Initialization
        • Version Release Records
        • Project Operations
        • LogStore Operations
        • Install the SDK Package
        • LogStream Operations
        • LogRecord Operations
        • FastQuery Operations
        • LogShipper Operations
        • Index Operations
        • Download Task Operations
      • Java SDK
        • Overview
        • Install the SDK Package
        • LogRecord Operations
      • iOS SDK
        • Overview
        • Quick start
        • Version Release Records
      • Android SDK
        • Overview
        • Quick start
        • Version Release Records
      • Android & iOS SDK Download
      • SDK Privacy Policy
      • SDK Developer Personal Information Protection Compliance Guide
    • Importing SLS Collection Configuration
  • FAQs
    • Common Questions Overview
    • Fault-related questions
    • Configuration-related questions
  • Log Service Level Agreement SLA
  • Document center
  • arrow
  • BLS
  • arrow
  • Development Guide
  • arrow
  • API Reference
  • arrow
  • Alarm-Related Interfaces
  • arrow
  • UpdateAlarmPolicy
Table of contents on this page
  • Description
  • Request
  • Response
  • Error code
  • Example

UpdateAlarmPolicy

Updated at:2025-11-03

Description

Update Alarm Strategy

Request

  • Request syntax
Text
1PUT /v1/alarm/policy HTTP/1.1
2Host: <Endpoint>
3Authorization: <Authorization String>
4Content-Type: application/json; charset=utf-8
5{
6  "name": <name>,
7  "id":  <id>,
8}
  • Request headers

No additional headers are required beyond the standard request headers.

  • Request parameters
Parameter name Types Required or not Parameter location Description
id String Yes RequestBody Alarm policy ID, unique
name String Yes RequestBody Alarm policy name, unique
objects List<LogStore> No RequestBody List of monitor objects. Fill in this field when all logstores share the target logstore.
targets List<Target> Yes RequestBody List of execution statements
triggerConditions List<TriggerCondition> Yes RequestBody List of trigger conditions
groups List<String> No RequestBody Group trigger
schedule Schedule Yes RequestBody Execution cycle
pendingCount Int Yes RequestBody Continuous trigger threshold, number of consecutive times the threshold is triggered before an alarm is raised
repeatIntervalMinute Int No RequestBody Repeat alarm interval, unit: minutes, default value: 0, which means repeat alarm is disabled
recoverWithoutNotice Bool No RequestBody Whether to notify after recovery, true: no notification, false: notification, defaulting to false
state String No RequestBody Policy activation status. ENABLED: Enabled; DISABLED: Disabled
noticeState String No RequestBody Notification activation status, ENABLED: Enabled; DISABLED: Disabled
notices List<Notice> Yes RequestBody Alarm notification template, reference: BCM Notification Template API
noticeRawLogs List<NoticeRawLog> No RequestBody Whether to include original logs in alarm notifications

Each LogStore element structure in the objects array is as follows:

Parameter name Types Required or not Description
project String No Logstore project, defaulting to "default"
logStoreName String Yes Logstore name

The element structure of each target in targets array is as follows:

Parameter name Types Required or not Description
query String Yes Execution statement
startTimeOffsetMinute Int Yes Query start time offset, value range: [-1440, 0)
endTimeOffsetMinute Int Yes Value range: (startTimeOffsetMinute, 0]
object LogStore No Fill in this field when each execution statement specifies a logstore individually

Each TriggerCondition element structure in the triggerConditions array is as follows:

Parameter name Types Required or not Description
level String Yes Alarm level, required. Options: INFO, WARN, and CRITICAL
condition String Yes Trigger condition expression

Schedule element structure is as follows:

Parameter name Types Required or not Description
intervalMinute Int No Fixed interval, unit: minutes, value range [1, 1440]
fixTimeMinute Int No Specified time, minutes of the day, value range [0, 1440)
dayOfWeek Int No Fixed time frequency; 0: Daily. 1~7 represents Monday to Sunday in a week

Notice element structure is as follows:

Parameter name Types Required or not Description
id String Yes BCM alarm template ID

The element structure of NoticeRawLog is as follows:

Parameter name Types Required or not Description
type String Yes Configuration type, REF: Associated execution statement, CUSTOM: Custom search statement
refTarget String No If type=REF, it represents the referenced execution statement sequence number, counting from 0
customTarget Target No If type=CUSTOM, fill in the custom execution statement
columns List<String> No List of field names displayed in the original logs. If not filled, all fields will be displayed
limit Int Yes Number of logs displayed, maximum: 5

Response

  • Response headers

No additional headers are required beyond the standard response headers.

  • Response parameters
Field Types Description
success Boolean Whether the request succeeded
code String Request code, OK for success, or a specific error code for failure
message String Empty for request success, or a specific error message for request failure

Error code

Apart from standard error codes, the following codes may be returned:

Error code Error message Description HTTP status code
InvalidParameter Request param invalid: [msg] Invalid parameter exception 400

Example

  • Request example
Text
1PUT /v1/alarm/policy HTTP/1.1
2Host: bls-log.bj.baidubce.com
3Authorization:bce-auth-v1/18717522d39411e9b721df098b0b908c/2019-09-10T07:00:20Z/1800/content-type;host;x-bce-date;x-bce-request-id/6a7cb6c9ac7ec156c805e55e7d0bcfc443b47feee97cf099c1c0d93a0b4c8304
4Content-Type: application/json; charset=utf-8
5{
6    // Policy ID
7    "id": "p-nRyKJOpr",
8    
9    // Alarm policy name, unique under the same user, required
10    "name": "policy-name",
11    
12    // List of monitor objects, optional. When all logstores share the target logstore, fill in this field
13    "objects": [
14        {
15            "project": "default", // Logstore project, default
16            "logStoreName": "test-logstore-52"  // Logstore name
17        },
18    ],
19    
20    // List of execution statements, required
21    "targets": [
22        {
23            // Execution statement, required
24            "query": "select sum(age) as age",
25            // Query start time offset, required, value range: [-1440, 0)
26            "startTimeOffsetMinute": -1440,
27            // Query end time offset, required, value range: (startTimeOffsetMinute, 0]
28            "endTimeOffsetMinute": 0,
29            
30            // Target logstore, optional. When each execution statement specifies a logstore separately, fill in this field
31            "object": {
32                "logStoreName": "test-logstore-52"  // Logstore name
33            }
34        }
35    ],
36    
37    // List of trigger conditions, required
38    "triggerConditions": [
39        {
40            // Alarm level, required, options:
41            // INFO     - Notification,
42            // WARN     - Warning
43            // CRITICAL - Critical
44            "level": "WARN",
45            
46            // Trigger condition expression, required
47            "condition": "$1.age > 1"
48        }
49    ],
50    
51    // Group trigger, optional
52    "groups": ["$1.age", "$1.salary"],
53    
54    // Execution cycle, required. Either fixed interval or specified time must be set, but not both
55    "schedule": {
56        // Fixed interval, unit: minutes, value range [1, 1440]
57        "intervalMinute": 1,
58        
59        // Specified time, minutes of the day, value range [0, 1440)
60        "fixTimeMinute": 120, // In the example, 120 represents the 120th minute of the day, i.e., 2:00 AM
61        // Fixed time frequency; 0: Daily  1~7 represents a specific day in a week
62        "dayOfWeek": 0
63    },
64    
65    // Continuous trigger threshold, number of consecutive times the threshold is triggered before an alarm is raised, required
66    "pendingCount": 1,
67    
68    // Repeat alarm interval, unit: minutes, default value: 0, which means repeat alarm is disabled
69    "repeatIntervalMinute": 5,
70    
71    // Whether to notify after recovery, true: no notification, false: notification, default
72    "recoverWithoutNotice": true,
73    
74    // Policy activation status, options:
75    // ENABLED  - Enabled
76    // DISABLED - Disabled
77    "state": "ENABLED",
78        
79    // Notification activation status, options:
80    // ENABLED  - Enabled
81    // DISABLED - Disabled
82    "noticeState": "ENABLED",
83    
84    // Alarm notification template list, required
85    "notices": [
86        {
87            // BCM alarm template ID, required
88            "id": "testNotice"  
89        }
90    ],
91    
92    // Whether to include original logs in alarm notifications, optional
93    "noticeRawLogs" : [
94        {    
95            // Configuration type, required
96            // REF    - Associated execution statement
97            // CUSTOM - Custom search statement
98            "type" : "CUSTOM",
99            
100            // If type=REF, required, indicating the referenced execution statement sequence number, counting from 0
101            "refTarget" : 1,
102            
103            // If type=CUSTOM, fill in the custom execution statement
104            "customTarget": {
105                // Execution statement, required
106                "query": "select sum(age) as age",
107                // Query start time offset, required, value range: [-1440, 0)
108                "startTimeOffsetMinute": -1440,
109            // Query end time offset, required, value range: (startTimeOffsetMinute, 0]
110                "endTimeOffsetMinute": 0,
111            
112                // Target logstore, optional. When each execution statement specifies a logstore separately, fill in this field
113                "object": {
114                    "logStoreName": "test-logstore-52"  // Logstore name
115                }
116            }
117                        
118            // List of field names displayed in the original logs, optional. If not filled, all fields will be displayed.
119            "columns": ["requestid", "status"],
120            
121            // Number of logs displayed, maximum: 5, required
122            "limit" : 4,
123        }
124    ]
125}
  • Response example
Text
1HTTP/1.1 201
2Content-Type: application/json; charset=utf-8
3X-Bce-Request-Id: 2eeba101-4cc7-4cfe-b5ac-a3be8d060e33
4Date: Fri, 10 Apr 2020 04:42:37 GMT
5{
6    "success": true,
7    "code": "OK",
8    "message": ""
9}

Previous
CreateAlarmPolicy
Next
DeleteAlarmPolicy