Files
doc-exports/docs/lts/api-ref/lts_02_0007.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

111 lines
10 KiB
HTML

<a name="lts_02_0007"></a><a name="lts_02_0007"></a>
<h1 class="topictitle1">Creating a Log Stream</h1>
<div id="body8662426"><div class="section" id="lts_02_0007__en-us_topic_0169936636_section15294573"><h4 class="sectiontitle">Function</h4><p class="msonormal" id="lts_02_0007__en-us_topic_0169936636_p24606130">This function describes how to create a log stream under a created log group. You can view and query raw logs under a log stream.</p>
</div>
<div class="section" id="lts_02_0007__en-us_topic_0169936636_section3433433"><h4 class="sectiontitle">URI</h4><ul id="lts_02_0007__en-us_topic_0169936636_ul165395536212"><li id="lts_02_0007__en-us_topic_0169936636_li5269929173052">URI format<p id="lts_02_0007__en-us_topic_0169936636_p156121313133"><a name="lts_02_0007__en-us_topic_0169936636_li5269929173052"></a><a name="en-us_topic_0169936636_li5269929173052"></a>POST /v2.0/{project_id}/log-groups/{group_id}/log-topics</p>
</li></ul>
<ul id="lts_02_0007__en-us_topic_0169936636_ul0109191102213"><li class="msonormal" id="lts_02_0007__en-us_topic_0169936636_li21091415229">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="lts_02_0007__en-us_topic_0169936636_table7695029" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="lts_02_0007__en-us_topic_0169936636_row45779900"><th align="left" class="cellrowborder" valign="top" width="20.202020202020204%" id="mcps1.3.2.3.1.1.2.5.1.1"><p id="lts_02_0007__en-us_topic_0169936636_p17184445"><strong id="lts_02_0007__en-us_topic_0169936636_b10725142516429">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.171717171717173%" id="mcps1.3.2.3.1.1.2.5.1.2"><p id="lts_02_0007__en-us_topic_0169936636_p49762843"><strong id="lts_02_0007__en-us_topic_0169936636_b27837266429">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.161616161616163%" id="mcps1.3.2.3.1.1.2.5.1.3"><p id="lts_02_0007__en-us_topic_0169936636_p4258493"><strong id="lts_02_0007__en-us_topic_0169936636_b5744132774212">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="46.46464646464647%" id="mcps1.3.2.3.1.1.2.5.1.4"><p id="lts_02_0007__en-us_topic_0169936636_p9393676"><strong id="lts_02_0007__en-us_topic_0169936636_b1260018287429">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="lts_02_0007__en-us_topic_0169936636_row22690287"><td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.2.3.1.1.2.5.1.1 "><p id="lts_02_0007__en-us_topic_0169936636_p25973967">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.171717171717173%" headers="mcps1.3.2.3.1.1.2.5.1.2 "><p id="lts_02_0007__en-us_topic_0169936636_p23516563">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.161616161616163%" headers="mcps1.3.2.3.1.1.2.5.1.3 "><p id="lts_02_0007__en-us_topic_0169936636_p25793444">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.46464646464647%" headers="mcps1.3.2.3.1.1.2.5.1.4 "><p id="lts_02_0007__en-us_topic_0169936636_p8894185">Project ID</p>
</td>
</tr>
<tr id="lts_02_0007__en-us_topic_0169936636_row12938802"><td class="cellrowborder" valign="top" width="20.202020202020204%" headers="mcps1.3.2.3.1.1.2.5.1.1 "><p id="lts_02_0007__en-us_topic_0169936636_p41410081">group_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.171717171717173%" headers="mcps1.3.2.3.1.1.2.5.1.2 "><p id="lts_02_0007__en-us_topic_0169936636_p65882297">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.161616161616163%" headers="mcps1.3.2.3.1.1.2.5.1.3 "><p id="lts_02_0007__en-us_topic_0169936636_p34865825">String</p>
</td>
<td class="cellrowborder" valign="top" width="46.46464646464647%" headers="mcps1.3.2.3.1.1.2.5.1.4 "><p id="lts_02_0007__en-us_topic_0169936636_p5559553">ID of a created log group</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="lts_02_0007__en-us_topic_0169936636_section30900897"><h4 class="sectiontitle">Request</h4><ul id="lts_02_0007__en-us_topic_0169936636_ul47670658"><li id="lts_02_0007__en-us_topic_0169936636_li26382742">Request parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="lts_02_0007__en-us_topic_0169936636_table36118091" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="lts_02_0007__en-us_topic_0169936636_row15629542"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="lts_02_0007__en-us_topic_0169936636_p58033394"><strong id="lts_02_0007__en-us_topic_0169936636_b172971544164215">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="lts_02_0007__en-us_topic_0169936636_p3084470"><strong id="lts_02_0007__en-us_topic_0169936636_b5113445204213">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="lts_02_0007__en-us_topic_0169936636_p48515547"><strong id="lts_02_0007__en-us_topic_0169936636_b3117164694218">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="46%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="lts_02_0007__en-us_topic_0169936636_p37445257"><strong id="lts_02_0007__en-us_topic_0169936636_b1680247144218">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="lts_02_0007__en-us_topic_0169936636_row13166951"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="lts_02_0007__en-us_topic_0169936636_p59890077">log_topic_name</p>
</td>
<td class="cellrowborder" valign="top" width="18%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="lts_02_0007__en-us_topic_0169936636_p19258068">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="lts_02_0007__en-us_topic_0169936636_p16399667">String</p>
</td>
<td class="cellrowborder" valign="top" width="46%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="lts_02_0007__en-us_topic_0169936636_p53304675">Log stream name.</p>
<p id="lts_02_0007__en-us_topic_0169936636_ae7552ec5f29b4af9b0ceb23ca7befc5a">The configuration rules are as follows:</p>
<ul id="lts_02_0007__en-us_topic_0169936636_ul16409171764511"><li id="lts_02_0007__en-us_topic_0169936636_li11409121764510">Must be a string of 1 to 64 characters.</li><li id="lts_02_0007__en-us_topic_0169936636_li154098174455">Only letters, digits, underscores (_), hyphens (-), and periods (.) are allowed. The name cannot start or end with a period.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="lts_02_0007__en-us_topic_0169936636_ul9980033"><li id="lts_02_0007__en-us_topic_0169936636_li22711436">Example request<pre class="screen" id="lts_02_0007__en-us_topic_0169936636_screen3076333">POST
/v2.0/{project_id}/log-groups/{group_id}/log-topics
{
"log_topic_name":"testTopic01"
}</pre>
</li></ul>
</div>
<div class="section" id="lts_02_0007__en-us_topic_0169936636_section9672624"><h4 class="sectiontitle">Response</h4><ul id="lts_02_0007__en-us_topic_0169936636_ul47856381"><li id="lts_02_0007__en-us_topic_0169936636_li28054246">Response parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="lts_02_0007__en-us_topic_0169936636_table51161625" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameter description</caption><thead align="left"><tr id="lts_02_0007__en-us_topic_0169936636_row50747809"><th align="left" class="cellrowborder" valign="top" width="23.23%" id="mcps1.3.4.2.1.1.2.4.1.1"><p id="lts_02_0007__en-us_topic_0169936636_p16931828"><strong id="lts_02_0007__en-us_topic_0169936636_b20337741439">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25.25%" id="mcps1.3.4.2.1.1.2.4.1.2"><p id="lts_02_0007__en-us_topic_0169936636_p29300865"><strong id="lts_02_0007__en-us_topic_0169936636_b13520165194317">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="51.519999999999996%" id="mcps1.3.4.2.1.1.2.4.1.3"><p id="lts_02_0007__en-us_topic_0169936636_p24559854"><strong id="lts_02_0007__en-us_topic_0169936636_b952510604318">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="lts_02_0007__en-us_topic_0169936636_row43191139"><td class="cellrowborder" valign="top" width="23.23%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="lts_02_0007__en-us_topic_0169936636_p8821385">log_topic_id</p>
</td>
<td class="cellrowborder" valign="top" width="25.25%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="lts_02_0007__en-us_topic_0169936636_p43443591">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.519999999999996%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="lts_02_0007__en-us_topic_0169936636_p29270022">ID of a log stream</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="lts_02_0007__en-us_topic_0169936636_ul22061614"><li id="lts_02_0007__en-us_topic_0169936636_li64336800">Example response<pre class="screen" id="lts_02_0007__en-us_topic_0169936636_screen42160294">{
"log_topic_id":"a25d64c8-3028-11e9-9660-286ed488ce71"
}</pre>
</li></ul>
</div>
<div class="section" id="lts_02_0007__en-us_topic_0169936636_section19944758"><h4 class="sectiontitle">Returned Value</h4><ul id="lts_02_0007__en-us_topic_0169936636_ul59540630"><li id="lts_02_0007__en-us_topic_0169936636_li66103627">Normal<p id="lts_02_0007__en-us_topic_0169936636_p624873812616"><a name="lts_02_0007__en-us_topic_0169936636_li66103627"></a><a name="en-us_topic_0169936636_li66103627"></a>201</p>
</li><li id="lts_02_0007__en-us_topic_0169936636_li44860134">Abnormal<p id="lts_02_0007__en-us_topic_0169936636_p8911139194318"><a name="lts_02_0007__en-us_topic_0169936636_li44860134"></a><a name="en-us_topic_0169936636_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_0006.html">Log Stream Management (Old Version)</a></div>
</div>
</div>