You need to enable JavaScript to run this app.
Torch Log Service

Torch Log Service

Copy page
Download PDF
Alarm management API
ModifyAlarmContentTemplate
Copy page
Download PDF
ModifyAlarmContentTemplate
Call the ModifyAlarmContentTemplate API to modify the alarm notification content template.​
Notes​
The call frequency limit for this API is 20 times per second. If the frequency limit is exceeded, the error ExceedQPSLimit will be returned.​
Note​
  • Request method: PUT​
  • Request URL: https://{tls-endpoint}/ModifyAlarmContentTemplate​
Request parameters​
The table below lists only the request parameters unique to this interface and some common parameters. For more information, see public parameters.​
Body​
​
Parameter​
Type​
Required​
Example value​
Description​
AlarmContentTemplateId​
String​
Is​
5972a31a****​
Alert notification content template ID.​
AlarmContentTemplateName​
String​
Is​
test-alarm-content-template​
The name of the alarm notification content template. Please refer to Resource naming rules for naming rules.​
DingTalk​
No​
/​
DingTalk notification content template.​
Email​
No​
/​
The email notification content template.​
Lark​
No​
/​
A Feishu notification content template.​
NeedValidContent​
Boolean​
No​
true​
Is it necessary to validate content templates?​
Sms​
No​
/​
SMS notification content template.​
Vms​
No​
/​
Voice notification content templates​
WeChat​
No​
/​
WeCom notification content template.​
Webhook​
No​
/​
Webhook alert notification template.​
​
DingTalkContentTemplateInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
Title​
String​
No​
Alert notification​
The subject of the alert notification.​
Locale​
String​
No​
zh-CN​
The language of fixed content in alert notifications. Available values are zh-CN and en-US.​
Content​
String​
No​
Dear users, Hello!\nYour account (Master Account ID:{{AccountID}} )of log service{%if NotifyType==1%}trigger alarm{%else%}revover alarm{%endif%}\nAlarm Policy:{{Alarm}}\nAlarm topic:{{AlarmTopicName}}\nAlarm level:{{Severity}}\nFirst Trigger time:{{StartTime}}\nTriggering conditions:{{Condition}}\nCurrent query results:[{%-for x in TriggerParams-%}{{-x-}} {%-endfor-%}];\nAdditional Notification content:{{NotifyMsg|escapejs}}\n\nThanks for supporting Torch Log Service​
Alarm notification content supports plain text format and allows insertion of content variables, content functions, and more. For a detailed explanation, refer to content variable and content function.​
tip​
The maximum length of notification content after variable rendering is 8 KB. If the length exceeds this limit, the content will be truncated.​
Leaving the main content blank indicates that the default content will be used.​
​
EmailContentTemplateInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
Locale​
String​
No​
zh-CN​
The language of fixed content in alert notifications. The available values are zh-CN and en-US.​
Content​
String​
No​
​
Alarm policy: {{Alarm}}<br>Alarm project: {{ProjectName}}<br>​
​
Alarm notification content supports plain text format and supports the insertion of content variables, content functions, and more. For detailed explanations, please refer to content variables and content functions.​
tip​
The maximum length of notification content after variable rendering is 8 KB. If the length exceeds this limit, the content will be truncated.​
Leave the main text empty to use the default content.​
Subject​
String​
No​
Alert notification​
The email notification subject.​
​
LarkContentTemplateInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
Title​
String​
No​
Alert notification​
The subject of the alert notification.​
Locale​
String​
No​
zh-CN​
The language of fixed content in alarm notifications. Available values are zh-CN and en-US.​
Content​
String​
No​
Dear users, Hello!\nYour account (Master Account ID:{{AccountID}} )of log service{%if NotifyType==1%}trigger alarm{%else%}revover alarm{%endif%}\nAlarm Policy:{{Alarm}}\nAlarm topic:{{AlarmTopicName}}\nAlarm level:{{Severity}}\nFirst Trigger time:{{StartTime}}\nTriggering conditions:{{Condition}}\nCurrent query results:[{%-for x in TriggerParams-%}{{-x-}} {%-endfor-%}];\nAdditional Notification content:{{NotifyMsg|escapejs}}\n\nThanks for supporting Torch Log Service​
Alarm notification content supports plain text format and supports the insertion of content variables, content functions, and more. For detailed instructions, please refer to content variables and content functions.​
tip​
The maximum length of notification content after variable rendering is 8 KB. Any content that exceeds this limit will be truncated.​
Leaving the main text blank indicates that the default content will be used.​
​
SmsContentTemplateInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
Locale​
String​
No​
zh-CN​
The language of fixed content in alert notifications can be set to either zh-CN or en-US.​
Content​
String​
No​
Alarm Policy{{Alarm}}, Alarm project:{{ProjectName}}, Alarm topic:{{AlarmTopicName}}, Alarm level:{{Severity}}, notification type:{%if NotifyType==1%}trigger alarm{%else%}revover alarm{%endif%},First Trigger time:{{StartTime}}, Triggering conditions:{{Condition}}, Current query results:[{%-for x in TriggerParams-%}{{-x-}} {%-endfor-%}],Additional Notification content:{{NotifyMsg}}​
Alarm notification content supports plain text format and allows insertion of content variables, content functions, and more. For detailed explanations, refer to content variables and content functions.​
tip​
  • It is recommended to limit the length of the notification content after variable rendering to 256 characters or fewer; content that exceeds this limit may be truncated.​
  • Leaving the main content blank indicates that the default content will be used.​
​
VmsContentTemplateInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
Locale​
String​
No​
zh-CN​
The language of fixed content in alarm notifications. Available values are zh-CN and en-US.​
Content​
String​
No​
Notification type: {%if NotifyType==1%}Alert triggered{%else%}Alert recovered{%endif%}​
Alarm notification content supports plain text format and the insertion of content variables, content functions, and more. For detailed information, refer to content variables and content functions.​
tip​
  • It is recommended to keep the length of the notification content after variable rendering within 256 characters, as content exceeding this limit may be truncated.​
  • Leaving the main text blank indicates that the default content will be used.​
​
WeChatContentTemplateInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
Title​
String​
No​
Alert notification​
The subject of the alarm notification.​
Locale​
String​
No​
zh-CN​
The language of fixed content in alarm notifications. The selectable values are zh-CN and en-US.​
Content​
String​
No​
Dear users, Hello!\nYour account (Master Account ID:{{AccountID}} )of log service{%if NotifyType==1%}trigger alarm{%else%}revover alarm{%endif%}\nAlarm Policy:{{Alarm}}\nAlarm topic:{{AlarmTopicName}}\nAlarm level:{{Severity}}\nFirst Trigger time:{{StartTime}}\nTriggering conditions:{{Condition}}\nCurrent query results:[{%-for x in TriggerParams-%}{{-x-}} {%-endfor-%}];\nAdditional Notification content:{{NotifyMsg|escapejs}}\n\nThanks for supporting Torch Log Service​
Alarm notification content supports plain text format and supports inserting content variables, content functions, and more. For detailed information, refer to content variables and content functions.​
tip​
The maximum length of notification content after variable rendering is 8 KB. Content that exceeds this limit will be truncated. If the main text is left blank, the default content will be used.​
​
WebhookContentTemplateInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
Content​
String​
No​
​
{​
"msg_type": "interactive",​
"card": {​
"config": {​
"wide_screen_mode": true​
},​
"elements": [​
{​
"content": "Dear users, Hello!\nYour account (Master Account ID:{{AccountID}} )of log service{%if NotifyType==1%}trigger alarm{%else%}revover alarm{%endif%}\nAlarm Policy:{{Alarm}}\nAlarm topic:{{AlarmTopicName}}\nFirst Trigger time:{{StartTime}}\nTriggering conditions:{{Condition}}\nCurrent query results:[{%-for x in TriggerParams-%}{{-x-}} {%-endfor-%}];\nAdditional Notification content:{{NotifyMsg|escapejs}}\n\nThanks for supporting Torch Log Service",​
"tag": "markdown"​
}​
],​
"header": {​
"template": "{%if NotifyType==1%}red{%else%}green{%endif%}",​
"title": {​
"content": "【Torch Log Service】【Log Service】{%if NotifyType==1%}trigger alarm{%else%}revover alarm{%endif%}",​
"tag": "plain_text"​
}​
}​
}​
}​
​
The content of alert notifications is usually in JSON format and supports the insertion of content variables, content functions, and more. For more details, please refer to content variables and content functions.​
tip​
The maximum length of notification content after variable rendering is 16 KB. Any content that exceeds this limit will be truncated. Leaving the main text blank indicates that the default content will be used.​
​
Return parameters​
This API does not have any specific return parameters. For more information, see Return structure.​
Request example​
​
PUT https://{tls-endpoint}/ModifyAlarmContentTemplate HTTP/1.1​
Content-Type: application/json​
{​
"AlarmContentTemplateName": "test001",​
"DingTalk": {​
"Content": "Dear users, Hello!\nYour account (Master Account ID:{{AccountID}} )of log service{%if NotifyType==1%}trigger alarm{%else%}revover alarm{%endif%}\nAlarm Policy:{{Alarm}}\nAlarm topic:{{AlarmTopicName}}\nAlarm level:{{Severity}}\nFirst Trigger time:{{StartTime}}\nTriggering conditions:{{Condition}}\nCurrent query results:[{%-for x in TriggerParams-%}{{-x-}} {%-endfor-%}];\nAdditional Notification content:{{NotifyMsg|escapejs}}\n\nThanks for supporting Torch Log Service",​
"Title": "TLS Alarm",​
"Locale": "zh-CN"​
},​
"Email": {​
"Content": "Alarm Policy:{{Alarm}}<br> ​
Alarm project:{{ProjectName}}<br> ​
Alarm topic:{{AlarmTopicName}}<br> ​
Alarm level:{{Severity}}<br> ​
First Trigger time:{{StartTime}}<br> ​
Triggering conditions:{{Condition}}<br> ​
notification type:{%if NotifyType==1%}trigger alarm{%else%}revover alarm{%endif%} <br> ​
Alarm duration:{{Duration}}<br> ​
Additional Notification content:{{NotifyMsg}}",​
"Subject": "TLS Alarm",​
"Locale": "zh-CN"​
},​
"Lark": {​
"Content": "Dear users, Hello!\nYour account (Master Account ID:{{AccountID}} )of log service{%if NotifyType==1%}trigger alarm{%else%}revover alarm{%endif%}\nAlarm Policy:{{Alarm}}\nAlarm topic:{{AlarmTopicName}}\nAlarm level:{{Severity}}\nFirst Trigger time:{{StartTime}}\nTriggering conditions:{{Condition}}\nCurrent query results:[{%-for x in TriggerParams-%}{{-x-}} {%-endfor-%}];\nAdditional Notification content:{{NotifyMsg|escapejs}}\n\nThanks for supporting Torch Log Service",​
"Title": "TLS Alarm",​
"Locale": "zh-CN"​
},​
"WeChat": {​
"Content": "Dear users, Hello!\nYour account (Master Account ID:{{AccountID}} )of log service{%if NotifyType==1%}trigger alarm{%else%}revover alarm{%endif%}\nAlarm Policy:{{Alarm}}\nAlarm topic:{{AlarmTopicName}}\nAlarm level:{{Severity}}\nFirst Trigger time:{{StartTime}}\nTriggering conditions:{{Condition}}\nCurrent query results:[{%-for x in TriggerParams-%}{{-x-}} {%-endfor-%}];\nAdditional Notification content:{{NotifyMsg|escapejs}}\n\nThanks for supporting Torch Log Service",​
"Title": "TLS Alarm",​
"Locale": "zh-CN"​
},​
"Webhook": {​
"Content": "{\n \"msg_type\": \"interactive\",\n \"card\": {\n \"config\": {\n \"wide_screen_mode\": true\n },\n \"elements\": [\n {\n \"content\": \"Dear users, Hello!\nYour account (Master Account ID:{{AccountID}} )of log service{%if NotifyType==1%}trigger alarm{%else%}revover alarm{%endif%}\nAlarm Policy:{{Alarm}}\nAlarm topic:{{AlarmTopicName}}\nFirst Trigger time:{{StartTime}}\nTriggering conditions:{{Condition}}\nCurrent query results:[{%-for x in TriggerParams-%}{{-x-}} {%-endfor-%}];\nAdditional Notification content:{{NotifyMsg|escapejs}}\n\nThanks for supporting Torch Log Service\",\n \"tag\": \"markdown\"\n }\n ],\n \"header\": {\n \"template\": \"{%if NotifyType==1%}red{%else%}green{%endif%}\",\n \"title\": {\n \"content\": \"【Torch Log Service】【Log Service】{%if NotifyType==1%}trigger alarm{%else%}revover alarm{%endif%}\",\n \"tag\": \"plain_text\"\n }\n }\n }\n}"​
},​
"Vms": {​
"Content": "Notification Type:{%if NotifyType==1%}Triggering an alarm{%else%}Alarm recovery{%endif%}",​
"Locale": "zh-CN"​
},​
"Sms": {​
"Content": "Alarm Policy{{Alarm}}, Alarm project:{{ProjectName}}, Alarm topic:{{AlarmTopicName}}, Alarm level:{{Severity}}, notification type:{%if NotifyType==1%}trigger alarm{%else%}revover alarm{%endif%},First Trigger time:{{StartTime}}, Triggering conditions:{{Condition}}, Current query results:[{%-for x in TriggerParams-%}{{-x-}} {%-endfor-%}],Additional Notification content:{{NotifyMsg}}",​
"Locale": "zh-CN"​
},​
"NeedValidContent": true,​
"AlarmContentTemplateId": "28e1c037-****"​
}​
​
Return example​
​
HTTP/1.1 200 OK​
Content-Type: application/json; charset=utf-8​
​
Error codes​
You can visit public error codes for more information.​
Last updated: 2025.10.28 18:42:03