{"id":"f6e6a53e-4d61-42c9-8c16-c99dcc90a785","shortId":"fkC5tQ","kind":"skill","title":"tencentcloud-cls-alarm","tagline":"Manage Tencent Cloud CLS alarm policies, notice groups, shields and\nalarm execution logs. Use when the user asks to: list / create /\nmodify / delete CLS alarms, enable or disable alarms, manage notice\nrecipients (SMS / email / webhook), mute alarms during deploys, or\nview which a","description":"# Tencent Cloud CLS — Alarm Management\n\nCRUD on CLS alarm policies, notice groups, mute shields, and the alarm execution log.\n\n> **Setup:** See [tencentcloud authentication](../_shared/tencentcloud.md). Defaults to `TENCENTCLOUD_REGION` from env; CLS alarms live per-region.\n>\n> **Companion skill:** `tencentcloud-cls` for log content search.\n\n## CLI (preferred)\n\nThe skill ships [`scripts/cls_alarm.py`](scripts/cls_alarm.py) — wraps every alarm / notice / shield operation as a subcommand.\n\n```bash\nA=$SKILL_DIR/scripts/cls_alarm.py\n\npython3 $A alarms                              # list policies\npython3 $A alarm <alarm-id>                    # full detail\npython3 $A alarm-disable <alarm-id>            # quick mute (Status=false)\npython3 $A alarm-enable  <alarm-id>\npython3 $A alarm-create --json /tmp/alarm.json --dry-run\npython3 $A alarm-modify <alarm-id> --condition '$1.cnt > 20'\npython3 $A alarm-delete <alarm-id> --yes       # destructive\n\npython3 $A notices                             # notice groups\npython3 $A notice <notice-id>\n\npython3 $A shields                             # mute rules\npython3 $A shield-create --notice-id <notice-id> --start $(date +%s) --end $(date -v+2H +%s) --type 1 --reason \"deploy\"\n\npython3 $A alarm-log --time 6h                 # firing history\n```\n\nFor the rare schema field the CLI doesn't surface, fall through to the raw SDK examples below.\n\n## When to Use\n\n- Inspect existing alarm policies (filter by name, enabled flag)\n- Create a new log-based alarm: CQL/SQL query → trigger condition → notice group\n- Modify thresholds, query, period, recipients\n- Quick enable / disable to mute during incidents\n- Manage notice groups (recipients: users, groups, webhooks, with escalation)\n- Time-bounded shield rules to mute during deploys\n- Pull the alarm execution log to see *which* alarms fired and when\n\n## Dependencies\n\n```bash\npip install tencentcloud-sdk-python\n```\n\n## Quick start\n\n```python\nimport os\nimport json\nfrom tencentcloud.common import credential\nfrom tencentcloud.cls.v20201016 import cls_client, models\n\ncred = credential.EnvironmentVariableCredential().get_credential()\nclient = cls_client.ClsClient(cred, os.environ[\"TENCENTCLOUD_REGION\"])\n```\n\n## Key concepts\n\n| Object | API methods | What it is |\n|---|---|---|\n| Alarm policy | `DescribeAlarms` / `CreateAlarm` / `ModifyAlarm` / `DeleteAlarm` | Query against one or more topics + condition + notice groups |\n| Notice group | `DescribeAlarmNotices` / `CreateAlarmNotice` / … | Recipients (users / groups / webhooks) + escalation |\n| Shield | `DescribeAlarmShields` / `CreateAlarmShield` / … | Time-bounded mute scoped to a notice group |\n| Alarm log | `GetAlarmLog` | Firing history |\n\n## Workflows\n\n### List alarm policies\n\n```python\nreq = models.DescribeAlarmsRequest()\nreq.Limit = 100\n# Optional filters: req.Filters = [{\"Key\": \"name\", \"Values\": [\"DeepSeek\"]}]\nresp = client.DescribeAlarms(req)\nfor a in resp.Alarms:\n    print(a.AlarmId, a.Name, \"Enable=\", a.Enable, \"Status=\", a.Status)\n```\n\n### Get a single alarm policy in full\n\n```python\nreq = models.DescribeAlarmsRequest()\nreq.Filters = [{\"Key\": \"alarmId\", \"Values\": [\"<alarm-id>\"]}]\nresp = client.DescribeAlarms(req)\nprint(json.dumps(resp.Alarms[0]._serialize(), indent=2, ensure_ascii=False))\n```\n\n### Create an alarm\n\n```python\nreq = models.CreateAlarmRequest()\nreq.Name = \"OpenAI 5xx burst\"\nreq.AlarmTargets = [{\n    \"TopicId\": \"<trace-topic-id>\",\n    \"Query\": \"* | select count(*) as cnt where status_code >= 500\",\n    \"Number\": 1,\n    \"StartTimeOffset\": -5,\n    \"EndTimeOffset\": 0,\n    \"SyntaxRule\": 1,             # 1 = CQL, 0 = Lucene\n}]\nreq.MonitorTime = {\"Type\": \"Period\", \"Time\": 1}\nreq.Condition = \"$1.cnt > 10\"\nreq.AlarmPeriod = 5              # evaluate every 5 minutes\nreq.TriggerCount = 1             # fire after 1 consecutive match\nreq.AlarmLevel = 2               # 0=Notice, 1=Warning, 2=Critical\nreq.AlarmNoticeIds = [\"<notice-id-a>\", \"<notice-id-b>\"]\nreq.MonitorObjectType = 0\nreq.Enable = True\n\nresp = client.CreateAlarm(req)\nprint(\"Created\", resp.AlarmId)\n```\n\n### Quick enable / disable\n\n```python\nreq = models.ModifyAlarmRequest()\nreq.AlarmId = \"<alarm-id>\"\nreq.Status = False               # mute (Status — runtime), keep Enable=True\nclient.ModifyAlarm(req)\n```\n\n> **`Enable` vs `Status`** are different fields. `Enable=False` archives the alarm definition; `Status=False` is the everyday on/off switch you want for muting.\n\n### Modify thresholds without rewriting the whole payload\n\n```python\nreq = models.ModifyAlarmRequest()\nreq.AlarmId = \"<alarm-id>\"\nreq.Condition = \"$1.cnt > 20\"\nreq.AlarmPeriod = 10\nclient.ModifyAlarm(req)\n```\n\n### Delete (destructive)\n\n```python\n# Confirm with the user first — there's no undo.\nreq = models.DeleteAlarmRequest()\nreq.AlarmId = \"<alarm-id>\"\nclient.DeleteAlarm(req)\n```\n\n### Manage notice groups\n\n```python\n# List\nreq = models.DescribeAlarmNoticesRequest()\nreq.Limit = 100\nfor n in client.DescribeAlarmNotices(req).AlarmNotices:\n    print(n.AlarmNoticeId, n.Name, n.Type)\n\n# Create\nreq = models.CreateAlarmNoticeRequest()\nreq.Name = \"Ops on-call\"\nreq.Type = \"Trigger\"             # Trigger | Recovery | All\nreq.NoticeReceivers = [{\n    \"ReceiverType\": \"Uin\",\n    \"ReceiverIds\": [123456],\n    \"ReceiverChannels\": [\"Email\", \"Sms\"],\n    \"StartTime\": \"00:00:00\",\n    \"EndTime\": \"23:59:59\",\n}]\nreq.WebCallbacks = [{\n    \"Url\": \"https://hooks.example.com/cls\",\n    \"CallbackType\": \"WeCom\",\n    \"Method\": \"POST\",\n}]\nresp = client.CreateAlarmNotice(req)\n```\n\n### Time-bounded shield (mute during deploy)\n\n```python\nimport time\nreq = models.CreateAlarmShieldRequest()\nreq.AlarmNoticeId = \"<notice-id>\"\nreq.StartTime = int(time.time())\nreq.EndTime = int(time.time()) + 7200       # 2 hours\nreq.Type = 1                                # 1 = full shield, 2 = partial\nreq.Reason = \"Deploy <git-sha>\"\nclient.CreateAlarmShield(req)\n```\n\n### Inspect alarm firing history\n\n```python\nreq = models.GetAlarmLogRequest()\nreq.From = int((time.time() - 86400) * 1000)\nreq.To = int(time.time() * 1000)\nreq.Query = 'alarm_name:\"OpenAI*\"'\nreq.Limit = 100\nresp = client.GetAlarmLog(req)\nfor line in resp.Results:\n    print(line.Time, line.LogJson)\n```\n\n## Cloning an alarm\n\nThe fastest way to create a similar alarm is to read the existing one, strip read-only fields, tweak, and re-create:\n\n```python\nimport json\nexisting = client.DescribeAlarms(models.DescribeAlarmsRequest(Filters=[{\"Key\": \"alarmId\", \"Values\": [\"<src-id>\"]}])).Alarms[0]\npayload = json.loads(json.dumps(existing._serialize()))      # deep clone\nfor k in (\"AlarmId\", \"CreateTime\", \"UpdateTime\"):\n    payload.pop(k, None)\npayload[\"Name\"] = \"OpenAI 5xx burst v2\"\n# ...edit other fields...\nreq = models.CreateAlarmRequest()\nreq.from_json_string(json.dumps(payload))\nprint(client.CreateAlarm(req).AlarmId)\n```\n\n## Important reminders\n\n- **Always preview the payload** (`json.dumps(req._serialize(), indent=2)`) before `CreateAlarm` / `ModifyAlarm` — schema is strict and errors are unhelpful.\n- Destructive ops (`DeleteAlarm`, `DeleteAlarmNotice`, `DeleteAlarmShield`) need explicit user confirmation in chat before running.\n- `Enable` (archived?) vs `Status` (currently on?) are *different* fields. Use `Status` for everyday muting.\n- Shield rules are scoped to a single `AlarmNoticeId`. Iterate over all notice IDs to list all shields globally.\n- Default region is `ap-hongkong`; pass another region via `cls_client.ClsClient(cred, \"ap-singapore\")` if needed.\n\n## Console links\n\n- Alarm console: <https://console.cloud.tencent.com/cls/alarm/list>\n- Alarm API reference: <https://www.tencentcloud.com/document/product/614/56473>","tags":["tencentcloud","cls","alarm","skills","acedatacloud","acedata-cloud","agent-skills","agentskills","ai-image","ai-music","ai-tools","ai-video"],"capabilities":["skill","source-acedatacloud","skill-tencentcloud-cls-alarm","topic-acedata-cloud","topic-agent-skills","topic-agentskills","topic-ai-image","topic-ai-music","topic-ai-tools","topic-ai-video","topic-claude-code","topic-cursor","topic-gemini-cli","topic-github-copilot","topic-mcp"],"categories":["Skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/AceDataCloud/Skills/tencentcloud-cls-alarm","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add AceDataCloud/Skills","source_repo":"https://github.com/AceDataCloud/Skills","install_from":"skills.sh"}},"qualityScore":"0.453","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 7 github stars · SKILL.md body (7,606 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:14:04.137Z","embedding":null,"createdAt":"2026-05-18T13:21:35.204Z","updatedAt":"2026-05-18T19:14:04.137Z","lastSeenAt":"2026-05-18T19:14:04.137Z","tsv":"'+2':189 '-5':456 '/_shared/tencentcloud.md':71 '/cls':632 '/cls/alarm/list':867 '/document/product/614/56473':873 '/tmp/alarm.json':143 '0':425,458,463,488,496,743 '00':621,622,623 '1':193,454,460,461,469,480,483,490,663,664 '1.cnt':153,471,557 '10':472,560 '100':383,588,694 '1000':684,688 '123456':616 '2':428,487,492,660,667,788 '20':154,558 '23':625 '5':474,477 '500':452 '59':626,627 '5xx':440,762 '6h':202 '7200':659 '86400':683 'a.alarmid':399 'a.enable':402 'a.name':400 'a.status':404 'alarm':4,9,15,29,33,41,51,56,64,79,102,115,120,126,135,140,150,158,199,228,241,280,286,334,370,377,408,434,532,674,690,707,715,742,863,868 'alarm-cr':139 'alarm-delet':157 'alarm-dis':125 'alarm-en':134 'alarm-log':198 'alarm-modifi':149 'alarmid':417,740,753,778 'alarmnotic':594 'alarmnoticeid':833 'alway':781 'anoth':851 'ap':848,857 'ap-hongkong':847 'ap-singapor':856 'api':329,869 'archiv':530,813 'ascii':430 'ask':22 'authent':70 'base':240 'bash':109,291 'bound':271,363,642 'burst':441,763 'call':606 'callbacktyp':633 'chat':809 'cli':93,211 'client':314,320 'client.createalarm':500,776 'client.createalarmnotice':638 'client.createalarmshield':671 'client.deletealarm':578 'client.describealarmnotices':592 'client.describealarms':392,420,736 'client.getalarmlog':696 'client.modifyalarm':520,561 'clone':705,749 'cloud':7,49 'cls':3,8,28,50,55,78,88,313 'cls_client.clsclient':321,854 'cnt':448 'code':451 'companion':84 'concept':327 'condit':152,245,346 'confirm':566,807 'consecut':484 'consol':861,864 'console.cloud.tencent.com':866 'console.cloud.tencent.com/cls/alarm/list':865 'content':91 'count':446 'cql':462 'cql/sql':242 'creat':25,141,179,235,432,503,599,712,731 'createalarm':337,790 'createalarmnotic':352 'createalarmshield':360 'createtim':754 'cred':316,322,855 'credenti':308,319 'credential.environmentvariablecredential':317 'critic':493 'crud':53 'current':816 'date':184,187 'deep':748 'deepseek':390 'default':72,844 'definit':533 'delet':27,159,563 'deletealarm':339,801 'deletealarmnotic':802 'deletealarmshield':803 'depend':290 'deploy':43,195,277,646,670 'describealarm':336 'describealarmnotic':351 'describealarmshield':359 'destruct':161,564,799 'detail':122 'differ':526,819 'dir/scripts/cls_alarm.py':112 'disabl':32,127,255,507 'doesn':212 'dri':145 'dry-run':144 'edit':765 'email':38,618 'enabl':30,136,233,254,401,506,518,522,528,812 'end':186 'endtim':624 'endtimeoffset':457 'ensur':429 'env':77 'error':796 'escal':268,357 'evalu':475 'everi':101,476 'everyday':538,824 'exampl':221 'execut':16,65,281 'exist':227,720,735 'existing._serialize':747 'explicit':805 'fall':215 'fals':131,431,513,529,535 'fastest':709 'field':209,527,726,767,820 'filter':230,385,738 'fire':203,287,373,481,675 'first':570 'flag':234 'full':121,411,665 'get':318,405 'getalarmlog':372 'global':843 'group':12,59,166,247,262,265,348,350,355,369,582 'h':190 'histori':204,374,676 'hongkong':849 'hooks.example.com':631 'hooks.example.com/cls':630 'hour':661 'id':182,838 'import':301,303,307,312,648,733,779 'incid':259 'indent':427,787 'inspect':226,673 'instal':293 'int':654,657,681,686 'iter':834 'json':142,304,734,771 'json.dumps':423,746,773,785 'json.loads':745 'k':751,757 'keep':517 'key':326,387,416,739 'line':699 'line.logjson':704 'line.time':703 'link':862 'list':24,116,376,584,840 'live':80 'log':17,66,90,200,239,282,371 'log-bas':238 'lucen':464 'manag':5,34,52,260,580 'match':485 'method':330,635 'minut':478 'model':315 'models.createalarmnoticerequest':601 'models.createalarmrequest':437,769 'models.createalarmshieldrequest':651 'models.deletealarmrequest':576 'models.describealarmnoticesrequest':586 'models.describealarmsrequest':381,414,737 'models.getalarmlogrequest':679 'models.modifyalarmrequest':510,554 'modifi':26,151,248,545 'modifyalarm':338,791 'mute':40,60,129,173,257,275,364,514,544,644,825 'n':590 'n.alarmnoticeid':596 'n.name':597 'n.type':598 'name':232,388,691,760 'need':804,860 'new':237 'none':758 'notic':11,35,58,103,164,165,169,181,246,261,347,349,368,489,581,837 'notice-id':180 'number':453 'object':328 'on-cal':604 'on/off':539 'one':342,721 'op':603,800 'openai':439,692,761 'oper':105 'option':384 'os':302 'os.environ':323 'partial':668 'pass':850 'payload':551,744,759,774,784 'payload.pop':756 'per':82 'per-region':81 'period':251,467 'pip':292 'polici':10,57,117,229,335,378,409 'post':636 'prefer':94 'preview':782 'print':398,422,502,595,702,775 'pull':278 'python':297,300,379,412,435,508,552,565,583,647,677,732 'python3':113,118,123,132,137,147,155,162,167,170,175,196 'queri':243,250,340,444 'quick':128,253,298,505 'rare':207 'raw':219 're':730 're-creat':729 'read':718,724 'read-on':723 'reason':194 'receiverchannel':617 'receiverid':615 'receivertyp':613 'recipi':36,252,263,353 'recoveri':610 'refer':870 'region':75,83,325,845,852 'remind':780 'req':380,393,413,421,436,501,509,521,553,562,575,579,585,593,600,639,650,672,678,697,768,777 'req._serialize':786 'req.alarmid':511,555,577 'req.alarmlevel':486 'req.alarmnoticeid':652 'req.alarmnoticeids':494 'req.alarmperiod':473,559 'req.alarmtargets':442 'req.condition':470,556 'req.enable':497 'req.endtime':656 'req.filters':386,415 'req.from':680,770 'req.limit':382,587,693 'req.monitorobjecttype':495 'req.monitortime':465 'req.name':438,602 'req.noticereceivers':612 'req.query':689 'req.reason':669 'req.starttime':653 'req.status':512 'req.to':685 'req.triggercount':479 'req.type':607,662 'req.webcallbacks':628 'resp':391,419,499,637,695 'resp.alarmid':504 'resp.alarms':397,424 'resp.results':701 'rewrit':548 'rule':174,273,827 'run':146,811 'runtim':516 'schema':208,792 'scope':365,829 'scripts/cls_alarm.py':98,99 'sdk':220,296 'search':92 'see':68,284 'select':445 'serial':426 'setup':67 'shield':13,61,104,172,178,272,358,643,666,826,842 'shield-creat':177 'ship':97 'similar':714 'singapor':858 'singl':407,832 'skill':85,96,111 'skill-tencentcloud-cls-alarm' 'sms':37,619 'source-acedatacloud' 'start':183,299 'starttim':620 'starttimeoffset':455 'status':130,403,450,515,524,534,815,822 'strict':794 'string':772 'strip':722 'subcommand':108 'surfac':214 'switch':540 'syntaxrul':459 'tencent':6,48 'tencentcloud':2,69,74,87,295,324 'tencentcloud-cl':86 'tencentcloud-cls-alarm':1 'tencentcloud-sdk-python':294 'tencentcloud.cls':310 'tencentcloud.common':306 'threshold':249,546 'time':201,270,362,468,641,649 'time-bound':269,361,640 'time.time':655,658,682,687 'topic':345 'topic-acedata-cloud' 'topic-agent-skills' 'topic-agentskills' 'topic-ai-image' 'topic-ai-music' 'topic-ai-tools' 'topic-ai-video' 'topic-claude-code' 'topic-cursor' 'topic-gemini-cli' 'topic-github-copilot' 'topic-mcp' 'topicid':443 'trigger':244,608,609 'true':498,519 'tweak':727 'type':192,466 'uin':614 'undo':574 'unhelp':798 'updatetim':755 'url':629 'use':18,225,821 'user':21,264,354,569,806 'v':188 'v2':764 'v20201016':311 'valu':389,418,741 'via':853 'view':45 'vs':523,814 'want':542 'warn':491 'way':710 'webhook':39,266,356 'wecom':634 'whole':550 'without':547 'workflow':375 'wrap':100 'www.tencentcloud.com':872 'www.tencentcloud.com/document/product/614/56473':871 'yes':160","prices":[{"id":"7e51d835-807e-4fff-94f8-b67f1b3b04f4","listingId":"f6e6a53e-4d61-42c9-8c16-c99dcc90a785","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"AceDataCloud","category":"Skills","install_from":"skills.sh"},"createdAt":"2026-05-18T13:21:35.204Z"}],"sources":[{"listingId":"f6e6a53e-4d61-42c9-8c16-c99dcc90a785","source":"github","sourceId":"AceDataCloud/Skills/tencentcloud-cls-alarm","sourceUrl":"https://github.com/AceDataCloud/Skills/tree/main/skills/tencentcloud-cls-alarm","isPrimary":false,"firstSeenAt":"2026-05-18T13:21:35.204Z","lastSeenAt":"2026-05-18T19:14:04.137Z"}],"details":{"listingId":"f6e6a53e-4d61-42c9-8c16-c99dcc90a785","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"AceDataCloud","slug":"tencentcloud-cls-alarm","github":{"repo":"AceDataCloud/Skills","stars":7,"topics":["acedata-cloud","agent-skills","agentskills","ai-image","ai-music","ai-tools","ai-video","claude-code","cursor","gemini-cli","github-copilot","mcp","npm","openai-codex","roo-code"],"license":"other","html_url":"https://github.com/AceDataCloud/Skills","pushed_at":"2026-05-18T07:35:03Z","description":"Agent Skills for AceDataCloud AI services — music, image, video generation, web search, and more. Compatible with Claude Code, GitHub Copilot, Gemini CLI, and all agentskills.io-compatible agents.","skill_md_sha":"a57faa5ee2ba33088a4beb14ff2164e5839072ee","skill_md_path":"skills/tencentcloud-cls-alarm/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/AceDataCloud/Skills/tree/main/skills/tencentcloud-cls-alarm"},"layout":"multi","source":"github","category":"Skills","frontmatter":{"name":"tencentcloud-cls-alarm","license":"Apache-2.0","description":"Manage Tencent Cloud CLS alarm policies, notice groups, shields and\nalarm execution logs. Use when the user asks to: list / create /\nmodify / delete CLS alarms, enable or disable alarms, manage notice\nrecipients (SMS / email / webhook), mute alarms during deploys, or\nview which alarms fired and when. For searching the underlying log\ncontent, use the companion `tencentcloud-cls` skill."},"skills_sh_url":"https://skills.sh/AceDataCloud/Skills/tencentcloud-cls-alarm"},"updatedAt":"2026-05-18T19:14:04.137Z"}}