Files
doc-exports/docs/lts/api-ref/lts_02_0003.html
liusiying77 fdbbe7547a LTS API 20240130 version.
Reviewed-by: Bobkova, Natalia <natalia.bobkova@t-systems.com>
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: liusiying77 <liusiying@huawei.com>
Co-committed-by: liusiying77 <liusiying@huawei.com>
2025-03-12 12:37:01 +00:00

125 lines
11 KiB
HTML

<a name="lts_02_0003"></a><a name="lts_02_0003"></a>
<h1 class="topictitle1">Creating a Log Group</h1>
<div id="body8662426"><p class="msonormal" id="lts_02_0003__en-us_topic_0169936666_p15426562">This API is used to create a log group. All API URLs described in this section must be case-sensitive.</p>
<div class="section" id="lts_02_0003__en-us_topic_0169936666_section4621333"><h4 class="sectiontitle">Function</h4><p class="msonormal" id="lts_02_0003__en-us_topic_0169936666_p48189318">This function describes how to create a log group for log storage and query. You can create a maximum of 100 log groups.</p>
</div>
<div class="section" id="lts_02_0003__en-us_topic_0169936666_section41592000"><h4 class="sectiontitle">URI</h4><ul id="lts_02_0003__en-us_topic_0169936666_ul165395536212"><li id="lts_02_0003__en-us_topic_0169936666_li5269929173052">URI format<p class="msonormal" id="lts_02_0003__en-us_topic_0169936666_p63135782"><a name="lts_02_0003__en-us_topic_0169936666_li5269929173052"></a><a name="en-us_topic_0169936666_li5269929173052"></a>POST /v2.0/{project_id}/log-groups</p>
</li></ul>
<ul id="lts_02_0003__en-us_topic_0169936666_ul0109191102213"><li class="msonormal" id="lts_02_0003__en-us_topic_0169936666_li21091415229">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="lts_02_0003__en-us_topic_0169936666_table48105459" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="lts_02_0003__en-us_topic_0169936666_row60866610"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.3.1.1.2.5.1.1"><p id="lts_02_0003__en-us_topic_0169936666_p31248367"><strong id="lts_02_0003__en-us_topic_0169936666_b1337963223918">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.3.1.1.2.5.1.2"><p id="lts_02_0003__en-us_topic_0169936666_p48089780"><strong id="lts_02_0003__en-us_topic_0169936666_b481373363911">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.3.1.1.2.5.1.3"><p id="lts_02_0003__en-us_topic_0169936666_p2958122"><strong id="lts_02_0003__en-us_topic_0169936666_b18346435193915">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.3.1.1.2.5.1.4"><p id="lts_02_0003__en-us_topic_0169936666_p38281336"><strong id="lts_02_0003__en-us_topic_0169936666_b2026411366395">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="lts_02_0003__en-us_topic_0169936666_row13780551"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.3.1.1.2.5.1.1 "><p id="lts_02_0003__en-us_topic_0169936666_p42482879">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.3.1.1.2.5.1.2 "><p id="lts_02_0003__en-us_topic_0169936666_p18561159">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.3.1.1.2.5.1.3 "><p id="lts_02_0003__en-us_topic_0169936666_p27058887">String</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.3.1.1.2.5.1.4 "><p id="lts_02_0003__en-us_topic_0169936666_p44286248">Project ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="lts_02_0003__en-us_topic_0169936666_section38783684"><h4 class="sectiontitle">Request</h4><ul id="lts_02_0003__en-us_topic_0169936666_ul30416337"><li id="lts_02_0003__en-us_topic_0169936666_li5311585">Request parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="lts_02_0003__en-us_topic_0169936666_table47804267" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="lts_02_0003__en-us_topic_0169936666_row48525468"><th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.4.2.1.1.2.6.1.1"><p id="lts_02_0003__en-us_topic_0169936666_p38248803"><strong id="lts_02_0003__en-us_topic_0169936666_b1124318619407">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.4.2.1.1.2.6.1.2"><p id="lts_02_0003__en-us_topic_0169936666_p11145359"><strong id="lts_02_0003__en-us_topic_0169936666_afd1c772bc0d34dd0954eb451c30339a1">Sub-Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.4.2.1.1.2.6.1.3"><p id="lts_02_0003__en-us_topic_0169936666_p30358920"><strong id="lts_02_0003__en-us_topic_0169936666_b07871114164011">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12%" id="mcps1.3.4.2.1.1.2.6.1.4"><p id="lts_02_0003__en-us_topic_0169936666_p43153461"><strong id="lts_02_0003__en-us_topic_0169936666_b24681157403">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.4.2.1.1.2.6.1.5"><p id="lts_02_0003__en-us_topic_0169936666_p5769471"><strong id="lts_02_0003__en-us_topic_0169936666_b05215168400">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="lts_02_0003__en-us_topic_0169936666_row64673997"><td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.1.1.2.6.1.1 "><p id="lts_02_0003__en-us_topic_0169936666_p4102408">log_group_name</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.1.1.2.6.1.2 "><p id="lts_02_0003__en-us_topic_0169936666_p63859607">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.1.1.2.6.1.3 "><p id="lts_02_0003__en-us_topic_0169936666_p5245667">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.4.2.1.1.2.6.1.4 "><p id="lts_02_0003__en-us_topic_0169936666_p22245843">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.1.1.2.6.1.5 "><p id="lts_02_0003__en-us_topic_0169936666_p57082831">Log group name.</p>
<p id="lts_02_0003__en-us_topic_0169936666_a85abdc81ab8744b69765ad68746d242f">The configuration rules are as follows:</p>
<ul id="lts_02_0003__en-us_topic_0169936666_u171738f158ec47de86f1dcc16cd98255"><li id="lts_02_0003__en-us_topic_0169936666_li18572153114310">Must be a string of 1 to 64 characters.</li><li id="lts_02_0003__en-us_topic_0169936666_l08ec7850d87f46e6800de42bb4822bef">Only allows uppercase and lowercase letters, digits, underscores (_), hyphens (-), and periods (.). The name cannot start with a period or underscore, or end with a period.</li></ul>
</td>
</tr>
<tr id="lts_02_0003__en-us_topic_0169936666_row43983438"><td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.1.1.2.6.1.1 "><p id="lts_02_0003__en-us_topic_0169936666_p5888712">ttl_in_days</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.1.1.2.6.1.2 "><p id="lts_02_0003__en-us_topic_0169936666_p7223683">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.1.1.2.6.1.3 "><p id="lts_02_0003__en-us_topic_0169936666_p48247463">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12%" headers="mcps1.3.4.2.1.1.2.6.1.4 "><p id="lts_02_0003__en-us_topic_0169936666_p15730394">Int</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.1.1.2.6.1.5 "><p id="lts_02_0003__p13665145134016">Log retention duration. (default: 30 days)</p>
<p id="lts_02_0003__p166654451407">Minimum value: <strong id="lts_02_0003__b17802639155211">1</strong></p>
<p id="lts_02_0003__p116651455400">Maximum value: <strong id="lts_02_0003__b12458171365315">365</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="lts_02_0003__en-us_topic_0169936666_ul58951042"><li id="lts_02_0003__en-us_topic_0169936666_li60797332">Example request<pre class="screen" id="lts_02_0003__en-us_topic_0169936666_screen10305078">POST /v2.0/{project_id}/log-groups
{
"log_group_name":"test01",
"ttl_in_days": 7
}</pre>
</li></ul>
</div>
<div class="section" id="lts_02_0003__en-us_topic_0169936666_section13508843"><h4 class="sectiontitle">Response</h4><ul id="lts_02_0003__en-us_topic_0169936666_ul29404983"><li id="lts_02_0003__en-us_topic_0169936666_li63318255">Response parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="lts_02_0003__en-us_topic_0169936666_table32993388" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameter description</caption><thead align="left"><tr id="lts_02_0003__en-us_topic_0169936666_row9385709"><th align="left" class="cellrowborder" valign="top" width="25.742574257425744%" id="mcps1.3.5.2.1.1.2.5.1.1"><p id="lts_02_0003__en-us_topic_0169936666_p22044993"><strong id="lts_02_0003__en-us_topic_0169936666_b129413310598">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.772277227722775%" id="mcps1.3.5.2.1.1.2.5.1.2"><p id="lts_02_0003__en-us_topic_0169936666_p40814009"><strong id="lts_02_0003__b586460771">Sub-Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.792079207920793%" id="mcps1.3.5.2.1.1.2.5.1.3"><p id="lts_02_0003__en-us_topic_0169936666_p17600446"><strong id="lts_02_0003__en-us_topic_0169936666_b151384295920">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="30.693069306930692%" id="mcps1.3.5.2.1.1.2.5.1.4"><p id="lts_02_0003__en-us_topic_0169936666_p16350007"><strong id="lts_02_0003__en-us_topic_0169936666_b2021484365911">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="lts_02_0003__en-us_topic_0169936666_row49282189"><td class="cellrowborder" valign="top" width="25.742574257425744%" headers="mcps1.3.5.2.1.1.2.5.1.1 "><p id="lts_02_0003__en-us_topic_0169936666_p32434343">log_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="22.772277227722775%" headers="mcps1.3.5.2.1.1.2.5.1.2 "><p id="lts_02_0003__en-us_topic_0169936666_p9936109">N/A</p>
</td>
<td class="cellrowborder" valign="top" width="20.792079207920793%" headers="mcps1.3.5.2.1.1.2.5.1.3 "><p id="lts_02_0003__en-us_topic_0169936666_p66627401">String</p>
</td>
<td class="cellrowborder" valign="top" width="30.693069306930692%" headers="mcps1.3.5.2.1.1.2.5.1.4 "><p id="lts_02_0003__en-us_topic_0169936666_p28110368">Log group ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="lts_02_0003__en-us_topic_0169936666_ul51666726"><li id="lts_02_0003__en-us_topic_0169936666_li62347356">Example response<pre class="screen" id="lts_02_0003__en-us_topic_0169936666_screen24255300">{
"log_group_id":"56b4b31f-3024-11e9-9023-286ed488ce71"
} </pre>
</li></ul>
</div>
<div class="section" id="lts_02_0003__en-us_topic_0169936666_section54470724"><h4 class="sectiontitle">Returned Value</h4><ul id="lts_02_0003__en-us_topic_0169936666_ul18522258"><li id="lts_02_0003__en-us_topic_0169936666_li32482594">Normal<p id="lts_02_0003__en-us_topic_0169936666_p17682175254410"><a name="lts_02_0003__en-us_topic_0169936666_li32482594"></a><a name="en-us_topic_0169936666_li32482594"></a>201</p>
</li></ul>
<ul id="lts_02_0003__en-us_topic_0169936666_ul3583115"><li id="lts_02_0003__en-us_topic_0169936666_li44860134">Abnormal<p id="lts_02_0003__en-us_topic_0169936666_p8911139194318"><a name="lts_02_0003__en-us_topic_0169936666_li44860134"></a><a name="en-us_topic_0169936666_li44860134"></a>For details, see <a href="lts_api_0020.html">Status Codes</a>.</p>
</li></ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="lts_02_0002.html">Log Group Management (Old Version)</a></div>
</div>
</div>