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

396 lines
28 KiB
HTML

<a name="CreateLogStream"></a><a name="CreateLogStream"></a>
<h1 class="topictitle1">Creating a Log Stream</h1>
<div id="body1708331107508"><div class="section" id="CreateLogStream__section719564333"><h4 class="sectiontitle">Function</h4><p id="CreateLogStream__p111946183315">This API is used to create a log stream in a specified log group.</p>
</div>
<div class="section" id="CreateLogStream__section162046163317"><h4 class="sectiontitle">URI</h4><p id="CreateLogStream__p112186153318">POST /v2/{project_id}/groups/{log_group_id}/streams</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateLogStream__table17229615331" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="CreateLogStream__row182118643315"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="CreateLogStream__p172210618331">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="CreateLogStream__p4222618333">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="CreateLogStream__p9229663311">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="CreateLogStream__p323176183316">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateLogStream__row9211163330"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="CreateLogStream__p182316617334">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="CreateLogStream__p523156173311">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="CreateLogStream__p9231063331">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="CreateLogStream__p112446183320">Project ID. For details about how to obtain a project ID, see <a href="lts_api_0006.html">Obtaining the Project ID, Account ID, Log Group ID, and Log Stream ID</a>.</p>
<p id="CreateLogStream__p1724861333">Minimum: <strong id="CreateLogStream__b7241461336">32</strong></p>
<p id="CreateLogStream__p2247623319">Maximum: <strong id="CreateLogStream__b9257618337">32</strong></p>
</td>
</tr>
<tr id="CreateLogStream__row32196183316"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="CreateLogStream__p425186133315">log_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="CreateLogStream__p725146173312">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="CreateLogStream__p62514615335">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="CreateLogStream__p32610663316">Log group ID. For details about how to obtain a log group ID, see <a href="lts_api_0006.html">Obtaining the Project ID, Account ID, Log Group ID, and Log Stream ID</a>.</p>
<p id="CreateLogStream__p14261569332">Minimum: <strong id="CreateLogStream__b102619603319">36</strong></p>
<p id="CreateLogStream__p22612673311">Maximum: <strong id="CreateLogStream__b22646183315">36</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateLogStream__section82796133310"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateLogStream__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="CreateLogStream__row327106113312"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="CreateLogStream__p142811611334">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="CreateLogStream__p122811693313">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="CreateLogStream__p72876143312">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="CreateLogStream__p19291261334">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateLogStream__row102796133310"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="CreateLogStream__p7296613312">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="CreateLogStream__p32966153319">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="CreateLogStream__p72956113314">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="CreateLogStream__p4301562337">User token obtained from IAM. For details about how to obtain a user token, see <a href="lts_api_0004.html">Obtaining a User Token</a>.</p>
<p id="CreateLogStream__p13306633310">Minimum: <strong id="CreateLogStream__b20300613332">1000</strong></p>
<p id="CreateLogStream__p1330962339">Maximum: <strong id="CreateLogStream__b1830206133318">2000</strong></p>
</td>
</tr>
<tr id="CreateLogStream__row1027116143311"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="CreateLogStream__p531669331">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="CreateLogStream__p1131136163319">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="CreateLogStream__p16319615331">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="CreateLogStream__p1832116163315">Set this parameter to application/json;charset=UTF-8.</p>
<p id="CreateLogStream__p632126153319">Minimum: <strong id="CreateLogStream__b11325619331">30</strong></p>
<p id="CreateLogStream__p163210643313">Maximum: <strong id="CreateLogStream__b1232166163317">30</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateLogStream__request_CreateLogStreamParams" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameters</caption><thead align="left"><tr id="CreateLogStream__row23216643319"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="CreateLogStream__p1433662339">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="CreateLogStream__p233761337">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="CreateLogStream__p9341568339">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="CreateLogStream__p1341068336">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateLogStream__row17321963332"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateLogStream__p183416153311">log_stream_name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateLogStream__p53436193318">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateLogStream__p2035668330">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateLogStream__p1835366336">Name of the log stream to be created.</p>
<p id="CreateLogStream__p435106103310">Minimum: <strong id="CreateLogStream__b1736866338">1</strong></p>
<p id="CreateLogStream__p17361265338">Maximum: <strong id="CreateLogStream__b20361166338">64</strong></p>
</td>
</tr>
<tr id="CreateLogStream__row1932146143316"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateLogStream__p43618633311">ttl_in_days</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateLogStream__p14367618336">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateLogStream__p73717653320">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateLogStream__p113736193311">Log retention duration.</p>
<p id="CreateLogStream__p153712673316">Minimum value: <strong id="CreateLogStream__b16373610338">1</strong></p>
<p id="CreateLogStream__p9381565338">Maximum value: <strong id="CreateLogStream__b4382653317">365</strong></p>
</td>
</tr>
<tr id="CreateLogStream__row183212683310"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateLogStream__p5384617336">tags</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateLogStream__p11388611331">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateLogStream__p113916617339">Array of <a href="#CreateLogStream__request_tagsBody">tagsBody</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateLogStream__p14391869337">Tag field information.</p>
</td>
</tr>
<tr id="CreateLogStream__row33246163318"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateLogStream__p133913603319">log_stream_name_alias</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateLogStream__p73914613334">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateLogStream__p24011693310">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateLogStream__p15407643311">Log stream alias.</p>
<p id="CreateLogStream__p34056163315">Minimum: <strong id="CreateLogStream__b104066153311">1</strong></p>
<p id="CreateLogStream__p94117611338">Maximum: <strong id="CreateLogStream__b141863335">64</strong></p>
</td>
</tr>
<tr id="CreateLogStream__row43296183313"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateLogStream__p44110663320">enterprise_project_name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateLogStream__p1141126123310">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateLogStream__p1841156123312">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateLogStream__p19422612337">Enterprise project name.</p>
<div class="note" id="CreateLogStream__note17420633318"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="CreateLogStream__p2433612336">A project name can only contain letters, digits, underscores (_), and hyphens (-). It cannot contain the word <strong id="CreateLogStream__b124310610334">default</strong> in any form.</p>
<p id="CreateLogStream__p943163331">The description can contain up to 512 characters.</p>
</div></div>
<p id="CreateLogStream__p124315633319">Minimum: <strong id="CreateLogStream__b134317603318">1</strong></p>
<p id="CreateLogStream__p5441065332">Maximum: <strong id="CreateLogStream__b844663334">255</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreateLogStream__request_tagsBody"></a><a name="request_tagsBody"></a><table cellpadding="4" cellspacing="0" summary="" id="CreateLogStream__request_tagsBody" frame="border" border="1" rules="all"><caption><b>Table 4 </b>tagsBody</caption><thead align="left"><tr id="CreateLogStream__row15441062336"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.1"><p id="CreateLogStream__p64514619331">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.2"><p id="CreateLogStream__p184506173310">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.3"><p id="CreateLogStream__p64514693318">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.4.2.5.1.4"><p id="CreateLogStream__p245261336">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateLogStream__row134413613338"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateLogStream__p17469623319">key</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateLogStream__p7465673318">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateLogStream__p11467673318">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateLogStream__p547186183313">Tag key. Use only UTF-8 letters, digits, spaces, and the following characters: .:=+-@. Do not start with an underscore (). Max 128 characters are allowed.</p>
</td>
</tr>
<tr id="CreateLogStream__row24412611332"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateLogStream__p547563339">value</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateLogStream__p94712611334">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateLogStream__p84718613312">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateLogStream__p184896163313">Tag value. Use only UTF-8 letters, digits, spaces, and the following characters: _.:/=+-@. Max 255 characters are allowed.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateLogStream__section248367335"><h4 class="sectiontitle">Response Parameters</h4><p id="CreateLogStream__p54917617335"><strong id="CreateLogStream__b1649167333">Status code: 201</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateLogStream__response_CreateLogStreamResponseBody" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response body parameters</caption><thead align="left"><tr id="CreateLogStream__row74917610337"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.1"><p id="CreateLogStream__p155056143318">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.2"><p id="CreateLogStream__p1504619331">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.2.4.1.3"><p id="CreateLogStream__p450156173316">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateLogStream__row19491462334"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateLogStream__p35014617337">log_stream_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateLogStream__p55113623313">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateLogStream__p351186143310">ID of the created log stream.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateLogStream__p1951206113317"><strong id="CreateLogStream__b451156113311">Status code: 400</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateLogStream__response_LogGroupErrorResultInfo400" frame="border" border="1" rules="all"><caption><b>Table 6 </b>Response body parameters</caption><thead align="left"><tr id="CreateLogStream__row20517603311"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.1"><p id="CreateLogStream__p165219620331">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.2"><p id="CreateLogStream__p4521867334">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.5.2.4.1.3"><p id="CreateLogStream__p165326153310">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateLogStream__row175166183310"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreateLogStream__p1053106103312">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreateLogStream__p35414614338">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreateLogStream__p195416183311">Error code.</p>
</td>
</tr>
<tr id="CreateLogStream__row165119619338"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreateLogStream__p954867331">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreateLogStream__p85546183314">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreateLogStream__p125546173310">Error message.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateLogStream__p6551161336"><strong id="CreateLogStream__b25536103310">Status code: 401</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateLogStream__table8552619339" frame="border" border="1" rules="all"><caption><b>Table 7 </b>Response body parameters</caption><thead align="left"><tr id="CreateLogStream__row95556193316"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.7.2.4.1.1"><p id="CreateLogStream__p155617643313">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.7.2.4.1.2"><p id="CreateLogStream__p2561562339">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.7.2.4.1.3"><p id="CreateLogStream__p1956463331">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateLogStream__row85510613318"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="CreateLogStream__p13579620336">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="CreateLogStream__p135746193316">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="CreateLogStream__p185713613335">Error code.</p>
</td>
</tr>
<tr id="CreateLogStream__row155146193319"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="CreateLogStream__p358106123320">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="CreateLogStream__p95846103310">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="CreateLogStream__p75846113317">Error message.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateLogStream__p45820663315"><strong id="CreateLogStream__b19583633314">Status code: 403</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateLogStream__table125911619331" frame="border" border="1" rules="all"><caption><b>Table 8 </b>Response body parameters</caption><thead align="left"><tr id="CreateLogStream__row159136163320"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.9.2.4.1.1"><p id="CreateLogStream__p7591061331">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.9.2.4.1.2"><p id="CreateLogStream__p1459116173315">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.9.2.4.1.3"><p id="CreateLogStream__p2604643319">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateLogStream__row2592643318"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.1 "><p id="CreateLogStream__p12601653314">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.2 "><p id="CreateLogStream__p36006123315">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.9.2.4.1.3 "><p id="CreateLogStream__p116196103310">Error code.</p>
</td>
</tr>
<tr id="CreateLogStream__row6593623311"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.1 "><p id="CreateLogStream__p66117612333">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.2 "><p id="CreateLogStream__p126119617330">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.9.2.4.1.3 "><p id="CreateLogStream__p19617673312">Error message.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateLogStream__p176376143315"><strong id="CreateLogStream__b16376163314">Status code: 500</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateLogStream__table196319683313" frame="border" border="1" rules="all"><caption><b>Table 9 </b>Response body parameters</caption><thead align="left"><tr id="CreateLogStream__row196313615331"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.11.2.4.1.1"><p id="CreateLogStream__p96316612334">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.11.2.4.1.2"><p id="CreateLogStream__p1864136123311">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.11.2.4.1.3"><p id="CreateLogStream__p9649610338">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateLogStream__row186314613311"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.11.2.4.1.1 "><p id="CreateLogStream__p14648613312">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.11.2.4.1.2 "><p id="CreateLogStream__p116517643318">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.11.2.4.1.3 "><p id="CreateLogStream__p10652613316">Error code.</p>
</td>
</tr>
<tr id="CreateLogStream__row1636616333"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.11.2.4.1.1 "><p id="CreateLogStream__p1656643320">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.11.2.4.1.2 "><p id="CreateLogStream__p126520617339">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.11.2.4.1.3 "><p id="CreateLogStream__p566169330">Error message.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateLogStream__section4661610331"><h4 class="sectiontitle">Example Requests</h4><p id="CreateLogStream__p16660613334">Creating a log stream</p>
<pre class="screen" id="CreateLogStream__screen1867196153316">POST https://{endpoint}/v2/{project_id}/groups/{log_group_id}/streams
{
"log_stream_name" : "lts-stream-02kh"
}</pre>
</div>
<div class="section" id="CreateLogStream__section8695673311"><h4 class="sectiontitle">Example Responses</h4><p id="CreateLogStream__p1269764334"><strong id="CreateLogStream__b6694616333">Status code: 201</strong></p>
<p id="CreateLogStream__p146910643311">The request is successful and the log stream has been created.</p>
<pre class="screen" id="CreateLogStream__screen9706618339">{
"log_stream_id" : "c54dbc58-0fd8-48ed-b007-6d54981427a7"
}</pre>
<p id="CreateLogStream__p37056133310"><strong id="CreateLogStream__b11701668337">Status code: 400</strong></p>
<p id="CreateLogStream__p137146143319">BadRequest. The request is invalid. Modify the request based on the description in <strong id="CreateLogStream__b16711617338">error_msg</strong> before a retry.</p>
<pre class="screen" id="CreateLogStream__screen17110653316">{
"error_code" : "LTS.0009",
"error_msg" : "Failed to validate the request body"
}</pre>
<p id="CreateLogStream__p67215653316"><strong id="CreateLogStream__b12721463336">Status code: 401</strong></p>
<p id="CreateLogStream__p7721763333">AuthFailed. Authentication failed. Check the token and try again.</p>
<pre class="screen" id="CreateLogStream__screen10725611333">{
"error_code" : "LTS.0003",
"error_msg" : "Invalid token"
}</pre>
<p id="CreateLogStream__p37386133320"><strong id="CreateLogStream__b127336133313">Status code: 403</strong></p>
<p id="CreateLogStream__p1473265338">Forbidden.The request has been rejected.The server has received the request and understood it, but refuses to respond to it. The client should not repeat the request without modifications.</p>
<pre class="screen" id="CreateLogStream__screen107416612333">{
"error_code" : "LTS.0001",
"error_msg" : "Invalid projectId"
}</pre>
<p id="CreateLogStream__p2748613336"><strong id="CreateLogStream__b57518614338">Status code: 500</strong></p>
<p id="CreateLogStream__p11754663318">InternalServerError.</p>
<p id="CreateLogStream__p11751610337">The server has received the request but encountered an internal error.</p>
<pre class="screen" id="CreateLogStream__screen275667338">{
"error_code" : "LTS.0202",
"error_msg" : "Failed to create Log stream"
}</pre>
</div>
<div class="section" id="CreateLogStream__section187613614335"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateLogStream__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="CreateLogStream__row17761562330"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="CreateLogStream__p27718633311">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="CreateLogStream__p16771864337">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateLogStream__row77719612330"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateLogStream__p197810616330">201</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateLogStream__p9781643317">The request is successful and the log stream has been created.</p>
</td>
</tr>
<tr id="CreateLogStream__row77716611332"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateLogStream__p37814673312">400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateLogStream__p12781865336">BadRequest. The request is invalid. Modify the request based on the description in <strong id="CreateLogStream__b12795619336">error_msg</strong> before a retry.</p>
</td>
</tr>
<tr id="CreateLogStream__row77717683318"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateLogStream__p11299367336">401</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateLogStream__p16299966339">AuthFailed. Authentication failed. Check the token and try again.</p>
</td>
</tr>
<tr id="CreateLogStream__row27766133318"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateLogStream__p1299116163319">403</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateLogStream__p5299269335">Forbidden.The request has been rejected.The server has received the request and understood it, but refuses to respond to it. The client should not repeat the request without modifications.</p>
</td>
</tr>
<tr id="CreateLogStream__row14779623312"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateLogStream__p152996610337">500</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateLogStream__p112993619331">InternalServerError.</p>
<p id="CreateLogStream__p13299360338">The server has received the request but encountered an internal error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateLogStream__section182993615339"><h4 class="sectiontitle">Error Codes</h4><p id="CreateLogStream__p19299106193318">See <a href="ErrorCode.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="lts_api_0015.html">Log Stream Management</a></div>
</div>
</div>