Files
doc-exports/docs/ces/api-ref/CreateAlarmTemplate.html
qiujiandong1 e9265fb6b0 CES API Update -20250521 version
Reviewed-by: Ziuzko, Alevtina <alevtina.ziuzko@t-systems.com>
Co-authored-by: qiujiandong1 <qiujiandong1@huawei.com>
Co-committed-by: qiujiandong1 <qiujiandong1@huawei.com>
2025-12-05 10:48:24 +00:00

542 lines
58 KiB
HTML

<a name="CreateAlarmTemplate"></a><a name="CreateAlarmTemplate"></a>
<h1 class="topictitle1">Creating a Custom Alarm Template</h1>
<div id="body8662426"><div class="section" id="CreateAlarmTemplate__en-us_topic_0000001822079509_section17119562505"><h4 class="sectiontitle">Function</h4><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p17712456175013">This API is used to create a custom alarm template.</p>
</div>
<div class="section" id="CreateAlarmTemplate__en-us_topic_0000001822079509_section37121156125014"><h4 class="sectiontitle">URI</h4><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1571295619509">POST /v2/{project_id}/alarm-templates</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAlarmTemplate__en-us_topic_0000001822079509_table271212562500" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path parameters</caption><thead align="left"><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row147121556175013"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p471213565508">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1712145645015">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p67121356105017">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1371235618507">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row1971295617506"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p171285685012">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p2071310563501">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p271312568507">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="CreateAlarmTemplate__p42316702175455">Project ID.</p>
<p id="CreateAlarmTemplate__p191415137612">For details about how to obtain the project ID, see <a href="ces_03_0057.html">Obtaining a Project ID</a>.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001646899046_p18100524114814">Minimum: <strong id="CreateAlarmTemplate__b16118131823417">1</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001646899046_p81001524104817">Maximum: <strong id="CreateAlarmTemplate__b83925101383310">64</strong></p>
<p id="CreateAlarmTemplate__p4697184133915"><strong id="CreateAlarmTemplate__b165956231625129">Regular expression matching</strong>: ^[a-zA-Z0-9-]{1,64}$</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateAlarmTemplate__en-us_topic_0000001822079509_section107132056125018"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAlarmTemplate__en-us_topic_0000001822079509_HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row12713195613503"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p5713175645010">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1713115617506">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1271385655011">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p771320563507">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row8713185616503"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p177141756175016">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1714856165012">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1271415615508">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="CreateAlarmTemplate__p6926698363">User token. It is a response to the API for obtaining a user token. This API is the only one that does not require authentication. After a response is returned, the value of <strong id="CreateAlarmTemplate__b194366709633913">X-Subject-Token</strong> in the response header is the token.</p>
<p id="CreateAlarmTemplate__p19926209203614">Minimum: <strong id="CreateAlarmTemplate__b5857700513417">1</strong></p>
<p id="CreateAlarmTemplate__p18926691361">Maximum: <strong id="CreateAlarmTemplate__b237190334326">16384</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAlarmTemplate__en-us_topic_0000001822079509_request_CreateAlarmTemplateRequestBody" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameters</caption><thead align="left"><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row1171416562502"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p67141956155015">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p77147565501">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p14715185605018">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p9715165612500">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row12714656195015"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p4715175616505">template_name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1971514568502">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p18715256145010">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateAlarmTemplate__en-us_topic_0000001646733802_p1287545205118">Alarm template name. It must start with a letter and can contain letters, digits, underscores (_), hyphens (-), parentheses, and periods (.). Fuzzy match is supported.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001646733802_p0875105213511">Minimum: <strong id="CreateAlarmTemplate__b10781836053417">1</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001646733802_p687545218516">Maximum: <strong id="CreateAlarmTemplate__b11096308518023">128</strong></p>
<p id="CreateAlarmTemplate__p111021435171412"><strong id="CreateAlarmTemplate__b5358065675233">Regular expression matching</strong>:</p>
<pre class="codeblock" id="CreateAlarmTemplate__codeblock104174101411">^([\u4E00-\u9FFF]|[a-z]|[A-Z]|[0-9]|_|-|\(|\)|\.|\s)+$</pre>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row14714125665017"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p14715856165018">template_type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p17715195635018">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p137154561504">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1715756195014">Type of a custom alarm template.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p6715156145013">The value can be:</p>
<ul id="CreateAlarmTemplate__en-us_topic_0000001822079509_ul15715756125010"><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li771515645010"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p167151356145010"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li771515645010"></a><a name="en-us_topic_0000001822079509_li771515645010"></a><strong id="CreateAlarmTemplate__b12368429995037">0</strong>: metric template</p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li1471535655010"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p17156567506"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li1471535655010"></a><a name="en-us_topic_0000001822079509_li1471535655010"></a><strong id="CreateAlarmTemplate__b157205226531">2</strong>: event template</p>
</li></ul>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row167145568507"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p37150565502">template_description</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p157151556195017">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p2715175665011">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p14715135618502">Supplementary information about an alarm template. The description can contain 0 to 256 characters and is left blank by default.</p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row16714456165015"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p11716165618507">policies</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p571618568508">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p9716205635015">Array of <a href="#CreateAlarmTemplate__en-us_topic_0000001822079509_request_Policies">Policies</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p3716145614501">Alarm policies in an alarm template.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p3716856125020">Array length: <strong id="CreateAlarmTemplate__b155282320355056">1</strong> to <strong id="CreateAlarmTemplate__b192228013855056">50</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_request_Policies"></a><a name="en-us_topic_0000001822079509_request_Policies"></a><table cellpadding="4" cellspacing="0" summary="" id="CreateAlarmTemplate__en-us_topic_0000001822079509_request_Policies" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Policies</caption><thead align="left"><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row11716145615015"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.1"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p77171956145013">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.2"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p47171256165018">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.3"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p2717105605014">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.4.2.5.1.4"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p20717155635018">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row147167564502"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p137171956185015">namespace</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1071725605014">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1371745610502">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateAlarmTemplate__p121916497599">Namespace.</p>
<p id="CreateAlarmTemplate__p919124920592">Namespace of a service. For details about the namespace of each service, see <a href="ces_03_0059.html">Service Namespaces</a>. The namespace must be in the service.item format and contain 3 to 32 characters. <strong id="CreateAlarmTemplate__b164461714581618">service</strong> and <strong id="CreateAlarmTemplate__b131950173681618">item</strong> must start with a letter and can contain only letters, digits, and underscores (_).</p>
<p id="CreateAlarmTemplate__p21984965912">Minimum: <strong id="CreateAlarmTemplate__b79086069681642">3</strong></p>
<p id="CreateAlarmTemplate__p119144955918">Maximum: <strong id="CreateAlarmTemplate__b17995913628219">32</strong></p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row27161156115019"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p5717256125020">dimension_name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p167172056185017">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p97172561500">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p10718105611504">Resource dimension, which must start with a letter. A dimension allows a maximum of 32 characters can only contain digits, letters, underscores (_), and hyphens (-). If there are multiple dimensions, use commas (,) to separate them. <strong id="CreateAlarmTemplate__b19151975811505">DimensionName</strong> in event alarm templates must be left blank.</p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row117163564503"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p8718205616502">metric_name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p5718356165019">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p197186560503">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateAlarmTemplate__p958851895310">Metric name of a resource. For details about the metrics of each service, see <a href="ces_03_0059.html">Service Metric Names</a>. The value must start with a letter and can only contain digits, letters, underscores (_), and hyphens (-). It allows 1 to 96 characters. For example, the ECS metric <strong id="CreateAlarmTemplate__b1845817334616">cpu_util</strong> indicates the CPU usage of an ECS. The DDS metric <strong id="CreateAlarmTemplate__b926463615617">mongo001_command_ps</strong> indicates the command execution frequency.</p>
<p id="CreateAlarmTemplate__p11245355111017"><strong id="CreateAlarmTemplate__b178927022095610">Regular expression matching:</strong> ^([A-Za-z]){1}([0-9A-Za-z]|_|-)*$</p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row5716145610502"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p11718145611508">period</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p471815614503">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p5718185645018">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateAlarmTemplate__p195561319416">Interval (seconds) for checking whether the alarm rule conditions are met.</p>
<p id="CreateAlarmTemplate__p1651516168414"><strong id="CreateAlarmTemplate__b71331223143112">0</strong>: default value. For example, this value can be used for event alarms.</p>
<p id="CreateAlarmTemplate__p38591221154118"><strong id="CreateAlarmTemplate__b185315242323">1</strong>: original aggregation period of a metric. For example, if the original aggregation period of an RDS metric is 60s, its data point is calculated every 60 seconds. For details about the original aggregation period of each cloud service metric, see <a href="ces_03_0059.html">Services Interconnected with Cloud Eye</a>.</p>
<p id="CreateAlarmTemplate__p1425716292418"><strong id="CreateAlarmTemplate__b7482644103113">300</strong>: The metric data is collected and calculated every 5 minutes.</p>
<p id="CreateAlarmTemplate__p836743114114"><strong id="CreateAlarmTemplate__b798215317333">1200</strong>: The metric data is collected and calculated every 20 minutes.</p>
<p id="CreateAlarmTemplate__p18515432164116"><strong id="CreateAlarmTemplate__b16366737183313">3600</strong>: The metric data is collected and calculated every 1 hour.</p>
<p id="CreateAlarmTemplate__p17626153315416"><strong id="CreateAlarmTemplate__b17729743123319">14400</strong>: The metric data is collected and calculated every 4 hours.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p207181056115010"><strong id="CreateAlarmTemplate__b1122975016331">86400</strong>: The metric data is collected and calculated every day.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p127186563501">The value can be:</p>
<ul id="CreateAlarmTemplate__en-us_topic_0000001822079509_ul10718656135014"><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li11718145675018"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p127181569505"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li11718145675018"></a><a name="en-us_topic_0000001822079509_li11718145675018"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b771855614503">0</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li1271815611501"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1771875615502"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li1271815611501"></a><a name="en-us_topic_0000001822079509_li1271815611501"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b16718165614508">1</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li10718356145018"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p671835615017"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li10718356145018"></a><a name="en-us_topic_0000001822079509_li10718356145018"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b67181256165010">300</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li13718756135016"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p2071814565508"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li13718756135016"></a><a name="en-us_topic_0000001822079509_li13718756135016"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b13718156115013">1200</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li17187566507"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1071815610504"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li17187566507"></a><a name="en-us_topic_0000001822079509_li17187566507"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b15718195645014">3600</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li671865665018"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p18718356105017"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li671865665018"></a><a name="en-us_topic_0000001822079509_li671865665018"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b37197566503">14400</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li20719155645010"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p147191656105013"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li20719155645010"></a><a name="en-us_topic_0000001822079509_li20719155645010"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b137191562502">86400</strong></p>
</li></ul>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row371611568508"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p071917567508">filter</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p77191756185017">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p127193563508">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateAlarmTemplate__p18775217497">Data aggregation method. The value can be:</p>
<ul id="CreateAlarmTemplate__ul48771221184913"><li id="CreateAlarmTemplate__li987716216491"><strong id="CreateAlarmTemplate__b84066652423330">average</strong>: average value of metric data within an aggregation period.</li><li id="CreateAlarmTemplate__li168771321184920"><strong id="CreateAlarmTemplate__b36820835223425">max</strong>: maximum value of metric data in an aggregation period.</li><li id="CreateAlarmTemplate__li5877221204913"><strong id="CreateAlarmTemplate__b66330701951914">min</strong>: minimum value of metric data within an aggregation period.</li><li id="CreateAlarmTemplate__li118770211498"><strong id="CreateAlarmTemplate__b196218466332231">sum</strong>: sum of metric data within an aggregation period.</li><li id="CreateAlarmTemplate__li128773216498"><strong id="CreateAlarmTemplate__b44091116533250">variance</strong>: variance value of metric data within an aggregation period.</li></ul>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row117161956155017"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p137192056105010">comparison_operator</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p14719155675019">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1871913564507">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateAlarmTemplate__p175725158812">Operator of an alarm threshold.</p>
<p id="CreateAlarmTemplate__p125729151889"><strong id="CreateAlarmTemplate__b7739091645014">Regular expression matching:</strong> ^(&gt;|&lt;|&gt;=|&lt;=|=|!=)$</p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row19716256145015"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p18719656135018">value</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p27199566503">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p157195565507">Number</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p4719156195013">Alarm threshold.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1719756195010">Minimum: <strong id="CreateAlarmTemplate__b150550375444032">0</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p271915695016">Maximum: <strong id="CreateAlarmTemplate__b2135131214179">Number.MAX_VALUE</strong> (<strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b8719456205010">1.7976931348623156E108</strong>)</p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row19716656105012"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p47197563501">unit</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1072055611506">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p27202563502">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateAlarmTemplate__p271813179333">Data unit. The value can contain a maximum of 32 characters. You can set this parameter based on your service needs.</p>
<p id="CreateAlarmTemplate__p27181417153317">Minimum: <strong id="CreateAlarmTemplate__b7086057907485">0</strong></p>
<p id="CreateAlarmTemplate__p177192172338">Maximum: <strong id="CreateAlarmTemplate__b17784407118219">32</strong></p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row137172568503"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p172014562509">count</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p11720185615503">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p972055620508">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p4720356185011">Number of consecutive alarm triggering times. For event alarms, the value ranges from <strong id="CreateAlarmTemplate__b34382849115337">1</strong> to <strong id="CreateAlarmTemplate__b1774100314115337">180</strong>. For metric and website alarms, the value can be <strong id="CreateAlarmTemplate__b135437283115337">1</strong>, <strong id="CreateAlarmTemplate__b9510766115337">2</strong>, <strong id="CreateAlarmTemplate__b1742376913115337">3</strong>, <strong id="CreateAlarmTemplate__b2055444543115337">4</strong>, <strong id="CreateAlarmTemplate__b1716701455115337">5</strong>, <strong id="CreateAlarmTemplate__b1848692932115337">10</strong>, <strong id="CreateAlarmTemplate__b1571253972115337">15</strong>, <strong id="CreateAlarmTemplate__b990074687115337">30</strong>, <strong id="CreateAlarmTemplate__b1265236961115337">60</strong>, <strong id="CreateAlarmTemplate__b599241912115337">90</strong>, <strong id="CreateAlarmTemplate__b1166061524115337">120</strong>, or <strong id="CreateAlarmTemplate__b1679532788115337">180</strong>.</p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row571705611506"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p17720456165015">alarm_level</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p172015568509">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p37202565505">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p19720656135018">Alarm severity, which can be <strong id="CreateAlarmTemplate__b1321347624078">1</strong> (critical), <strong id="CreateAlarmTemplate__b1702106112078">2</strong> (major), <strong id="CreateAlarmTemplate__b1973396778078">3</strong> (minor), or <strong id="CreateAlarmTemplate__b1651860418078">4</strong> (warning). The default value is <strong id="CreateAlarmTemplate__b184604550654926">2</strong>.</p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row1871755614505"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p127209561505">suppress_duration</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p47201256165013">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p872025620505">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p9720145685016">Alarm suppression period, in seconds. When the period is <strong id="CreateAlarmTemplate__b145161316101918">0</strong>, only one alarm is generated.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p187201856155020">The value can be:</p>
<ul id="CreateAlarmTemplate__en-us_topic_0000001822079509_ul072111566504"><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li072145675018"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p187211256105016"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li072145675018"></a><a name="en-us_topic_0000001822079509_li072145675018"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b13721956145011">0</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li14721356165015"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p27211556135016"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li14721356165015"></a><a name="en-us_topic_0000001822079509_li14721356165015"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b47211356125019">300</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li272115614504"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1772120566504"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li272115614504"></a><a name="en-us_topic_0000001822079509_li272115614504"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b147211556135017">600</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li11721115613508"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p172165665014"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li11721115613508"></a><a name="en-us_topic_0000001822079509_li11721115613508"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b16721156155020">900</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li7721656115010"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p772135614508"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li7721656115010"></a><a name="en-us_topic_0000001822079509_li7721656115010"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b15721056195018">1800</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li07211056175020"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p272155616504"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li07211056175020"></a><a name="en-us_topic_0000001822079509_li07211056175020"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b17721156185019">3600</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li1721156175014"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1872115565504"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li1721156175014"></a><a name="en-us_topic_0000001822079509_li1721156175014"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b127211056115015">10800</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li197214560505"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p472117562509"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li197214560505"></a><a name="en-us_topic_0000001822079509_li197214560505"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b11721956125014">21600</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li1772175614500"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1272111562505"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li1772175614500"></a><a name="en-us_topic_0000001822079509_li1772175614500"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b1272145618506">43200</strong></p>
</li><li id="CreateAlarmTemplate__en-us_topic_0000001822079509_li272135695018"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p13722356165017"><a name="CreateAlarmTemplate__en-us_topic_0000001822079509_li272135695018"></a><a name="en-us_topic_0000001822079509_li272135695018"></a><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b11722105610503">86400</strong></p>
</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateAlarmTemplate__en-us_topic_0000001822079509_section10722156125015"><h4 class="sectiontitle">Response Parameters</h4><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p17722656175010"><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b8722356165014">Status code: 201</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAlarmTemplate__en-us_topic_0000001822079509_response_CreateAlarmTemplateResp" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response body parameters</caption><thead align="left"><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row2722175616508"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.1"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p572275614507">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.2"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p37229561500">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.2.4.1.3"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1772213568505">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row772255614503"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p272285655017">template_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p18722456155011">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1872225695016">ID of an alarm template. The ID starts with <strong id="CreateAlarmTemplate__b129501837102019">at</strong> and is followed by letters, digits, or a combination of both. The value can contain a maximum of 64 characters.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p157227563504"><strong id="CreateAlarmTemplate__b111088948654034">Status code: 400</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAlarmTemplate__en-us_topic_0000001822079509_response_GoAPIErrorResponseV2" frame="border" border="1" rules="all"><caption><b>Table 6 </b>Response body parameters</caption><thead align="left"><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row972313562501"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.1"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p57231156155014">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.2"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p97231456155015">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.5.2.4.1.3"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p107235561509">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row57231956175010"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1672395615503">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p157239562500">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1472312567507">Status code customized by each cloud service when a request error occurs.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1472365685019">Minimum: <strong id="CreateAlarmTemplate__b8054869327485">0</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p67231156195014">Maximum: <strong id="CreateAlarmTemplate__b204195435851233">256</strong></p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row57231556145016"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p172315675020">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p18723125615012">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1472314561502">Request error message.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1772465611504">Minimum: <strong id="CreateAlarmTemplate__b18906478307485">0</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p10724856105018">Maximum: <strong id="CreateAlarmTemplate__b156181093051233">256</strong></p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row2723155612508"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1072425616508">request_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p27243561500">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p10724145612508">Request ID.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p372419560508">Minimum: <strong id="CreateAlarmTemplate__b21067954767485">0</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p16724135615507">Maximum: <strong id="CreateAlarmTemplate__b77292930751233">256</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p15724165625015"><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b272412565506">Status code: 401</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAlarmTemplate__en-us_topic_0000001822079509_table2724165612508" frame="border" border="1" rules="all"><caption><b>Table 7 </b>Response body parameters</caption><thead align="left"><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row9724125618506"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.7.2.4.1.1"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p37241856175013">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.7.2.4.1.2"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p972485635019">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.7.2.4.1.3"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1672416566508">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row14724756195018"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p13725125675018">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p2725256145018">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p6725125645011">Status code customized by each cloud service when a request error occurs.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1672525615014">Minimum: <strong id="CreateAlarmTemplate__b7289267287485">0</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1872535665017">Maximum: <strong id="CreateAlarmTemplate__b188258100251233">256</strong></p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row11724165615018"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1672525645015">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p8725115619504">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p17250564504">Request error message.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1672565675011">Minimum: <strong id="CreateAlarmTemplate__b14004587307485">0</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p13725135635014">Maximum: <strong id="CreateAlarmTemplate__b31133255951233">256</strong></p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row272418566506"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1872535613509">request_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p2725135618501">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p157254561508">Request ID.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p6725115665018">Minimum: <strong id="CreateAlarmTemplate__b4926838857485">0</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p4725756115011">Maximum: <strong id="CreateAlarmTemplate__b107083541151233">256</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p0725156155012"><strong id="CreateAlarmTemplate__en-us_topic_0000001822079509_b872585645013">Status code: 403</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAlarmTemplate__en-us_topic_0000001822079509_table1672525645019" frame="border" border="1" rules="all"><caption><b>Table 8 </b>Response body parameters</caption><thead align="left"><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row3726756195010"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.9.2.4.1.1"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1572675616507">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.9.2.4.1.2"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p16726145685017">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.9.2.4.1.3"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1072625610501">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row15726145675010"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p67261256105012">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p2726256135019">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.9.2.4.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p172685618506">Status code customized by each cloud service when a request error occurs.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p972635619501">Minimum: <strong id="CreateAlarmTemplate__b13556542127485">0</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1972612564501">Maximum: <strong id="CreateAlarmTemplate__b202055573051233">256</strong></p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row872655615509"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p177265566509">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p5726155605019">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.9.2.4.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p15726185655018">Request error message.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1472635695020">Minimum: <strong id="CreateAlarmTemplate__b8207598097485">0</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p0726125675012">Maximum: <strong id="CreateAlarmTemplate__b8550104851233">256</strong></p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row6726135625015"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p98891556185013">request_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p16889175613500">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.9.2.4.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p19889456125018">Request ID.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1188905695017">Minimum: <strong id="CreateAlarmTemplate__b11187199987485">0</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p988955610506">Maximum: <strong id="CreateAlarmTemplate__b124040388151233">256</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p6889125617508"><strong id="CreateAlarmTemplate__b14715057631948">Status code: 500</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAlarmTemplate__en-us_topic_0000001822079509_table5728556175016" frame="border" border="1" rules="all"><caption><b>Table 9 </b>Response body parameters</caption><thead align="left"><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row13728165645010"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.11.2.4.1.1"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p128891056185014">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.11.2.4.1.2"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p12889356115018">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.11.2.4.1.3"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p8889185619508">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row14728105615017"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.11.2.4.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1088917566502">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.11.2.4.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p488955605010">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.11.2.4.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p488995675020">Status code customized by each cloud service when a request error occurs.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p198899564507">Minimum: <strong id="CreateAlarmTemplate__b3541753427485">0</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p388917564501">Maximum: <strong id="CreateAlarmTemplate__b118752332751233">256</strong></p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row16728256135017"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.11.2.4.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p388905675013">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.11.2.4.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1688913565509">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.11.2.4.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1888905615013">Request error message.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p158891656125017">Minimum: <strong id="CreateAlarmTemplate__b19317696297485">0</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1688995665012">Maximum: <strong id="CreateAlarmTemplate__b519371751233">256</strong></p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row272805605015"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.11.2.4.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p158893564508">request_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.11.2.4.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p108891356155018">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.11.2.4.1.3 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p8889135620507">Request ID.</p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p888985625016">Minimum: <strong id="CreateAlarmTemplate__b5351259367485">0</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p2088915613500">Maximum: <strong id="CreateAlarmTemplate__b45634310951233">256</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateAlarmTemplate__en-us_topic_0000001822079509_section20889105655019"><h4 class="sectiontitle">Example Requests</h4><div class="p" id="CreateAlarmTemplate__en-us_topic_0000001822079509_p188891956135011">Creating a custom alarm template whose <strong id="CreateAlarmTemplate__b53719158237">template_name</strong> is <strong id="CreateAlarmTemplate__b7767116102315">my_template</strong>, <strong id="CreateAlarmTemplate__b3111161816237">count</strong> is <strong id="CreateAlarmTemplate__b984051992319">2</strong>, <strong id="CreateAlarmTemplate__b9765721162313">suppress_duration</strong> is <strong id="CreateAlarmTemplate__b16106202492311">300</strong>, and <strong id="CreateAlarmTemplate__b127401325192314">alarm_level</strong> is <strong id="CreateAlarmTemplate__b63581227112311">2</strong><pre class="screen" id="CreateAlarmTemplate__en-us_topic_0000001822079509_screen5889135615019">{
"template_name" : "my_template",
"template_description" : "hello world",
"policies" : [ {
"namespace" : "SYS.ECS",
"dimension_name" : "instance_id",
"metric_name" : "cpu_util",
"period" : 300,
"filter" : "sum",
"comparison_operator" : "&gt;",
"value" : 2,
"unit" : "bit/s",
"count" : 2,
"alarm_level" : 2,
"suppress_duration" : 300
} ],
"template_type": 0
}</pre>
</div>
<p id="CreateAlarmTemplate__p19468123487">Creating an event template whose <strong id="CreateAlarmTemplate__b1462274022815">template_name</strong> is <strong id="CreateAlarmTemplate__b165162016112810">my_event_template</strong>, <strong id="CreateAlarmTemplate__b015973920349">metric_name</strong> is <strong id="CreateAlarmTemplate__b10919361343">rebootServer</strong>, <strong id="CreateAlarmTemplate__b1944419451298">count</strong> is <strong id="CreateAlarmTemplate__b13444114516299">1</strong>, and <strong id="CreateAlarmTemplate__b744418456292">alarm_level</strong> is <strong id="CreateAlarmTemplate__b1044484513297">2</strong></p>
<pre class="screen" id="CreateAlarmTemplate__screen847484417511">{
"template_name" : "my_event_template",
"template_description" : "hello world",
"policies" : [ {
"namespace" : "SYS.ECS",
"dimension_name" : "",
"metric_name" : "rebootServer",
"period" : 0,
"filter" : "average",
"comparison_operator" : "&gt;=",
"value" : 1,
"unit" : "count",
"count" : 1,
"alarm_level" : 2,
"suppress_duration" : 0
} ],
"template_type": 2
}</pre>
</div>
<div class="section" id="CreateAlarmTemplate__en-us_topic_0000001822079509_section11890956135011"><h4 class="sectiontitle">Example Responses</h4><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1289045617505"><strong id="CreateAlarmTemplate__b1418917132014">Status code: 201</strong></p>
<p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1889055618506">Created</p>
<pre class="screen" id="CreateAlarmTemplate__en-us_topic_0000001822079509_screen15890256155019">{
"template_id" : "at1628592157541dB1klWgY6"
}</pre>
</div>
<div class="section" id="CreateAlarmTemplate__en-us_topic_0000001822079509_section20890175610502"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateAlarmTemplate__en-us_topic_0000001822079509_status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row473095695015"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1389095655018">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p158907564506">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row1973045612505"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p8890155610508">201</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p5890756185012">Created</p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row0730856115019"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p14890135615015">400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p138901556185015">Parameter verification failed.</p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row1173012569506"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1489095625018">401</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p188903567508">Authentication failed.</p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row9730156105013"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p0890105675014">403</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p1389035614504">Authentication failed.</p>
</td>
</tr>
<tr id="CreateAlarmTemplate__en-us_topic_0000001822079509_row14730156145020"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p289085612506">500</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p2890135611509">Failed to complete the request because of an internal server error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateAlarmTemplate__en-us_topic_0000001822079509_section1989015619509"><h4 class="sectiontitle">Error Codes</h4><p id="CreateAlarmTemplate__en-us_topic_0000001822079509_p148902564503">See <a href="ErrorCode.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="topic_300000005.html">Alarm Templates</a></div>
</div>
</div>