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

417 lines
29 KiB
HTML

<a name="CreateHostGroup"></a><a name="CreateHostGroup"></a>
<h1 class="topictitle1">Creating a Host Group</h1>
<div id="body1708331107508"><div class="section" id="CreateHostGroup__section1439816552313"><h4 class="sectiontitle">Function</h4><p id="CreateHostGroup__p6398205517313">Create a host group.</p>
</div>
<div class="section" id="CreateHostGroup__section1939955516312"><h4 class="sectiontitle">URI</h4><p id="CreateHostGroup__p83999556319">POST /v3/{project_id}/lts/host-group</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateHostGroup__table20399135513316" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="CreateHostGroup__row339995553116"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="CreateHostGroup__p639945517313">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="CreateHostGroup__p13399125520312">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="CreateHostGroup__p15399755133113">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="CreateHostGroup__p183991553311">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateHostGroup__row1839965523111"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="CreateHostGroup__p13400145593111">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="CreateHostGroup__p124001552318">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="CreateHostGroup__p54001550311">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="CreateHostGroup__p04001355203116">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="CreateHostGroup__p34001755193116">Minimum: <strong id="CreateHostGroup__b13400125533119">1</strong></p>
<p id="CreateHostGroup__p1540016553312">Maximum: <strong id="CreateHostGroup__b1240055514319">64</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateHostGroup__section1840095593117"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateHostGroup__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="CreateHostGroup__row10400955113120"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="CreateHostGroup__p3400455193120">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="CreateHostGroup__p1440175516314">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="CreateHostGroup__p1540145503115">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="CreateHostGroup__p114014555315">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateHostGroup__row64001455163110"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="CreateHostGroup__p10401955103110">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="CreateHostGroup__p10401165517316">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="CreateHostGroup__p184014551317">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="CreateHostGroup__p1740165515312">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="CreateHostGroup__p14011355183110">Minimum: <strong id="CreateHostGroup__b4401755123116">1</strong></p>
<p id="CreateHostGroup__p24012551315">Maximum: <strong id="CreateHostGroup__b74011955123111">10000</strong></p>
</td>
</tr>
<tr id="CreateHostGroup__row194000551318"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="CreateHostGroup__p348225519314">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="CreateHostGroup__p14831555113117">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="CreateHostGroup__p14831855103114">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="CreateHostGroup__p3483165519311">Set this parameter to application/json;charset=UTF-8.</p>
<p id="CreateHostGroup__p748335516315">Minimum: <strong id="CreateHostGroup__b248305573111">30</strong></p>
<p id="CreateHostGroup__p64838553315">Maximum: <strong id="CreateHostGroup__b4483115516315">30</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateHostGroup__request_CreateHostGroupRequestBody" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameters</caption><thead align="left"><tr id="CreateHostGroup__row4483125518319"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="CreateHostGroup__p184841055203119">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="CreateHostGroup__p12484115513116">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="CreateHostGroup__p20484195583116">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="CreateHostGroup__p5484205543117">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateHostGroup__row1648365563115"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateHostGroup__p8484195513318">host_group_name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateHostGroup__p348475511319">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateHostGroup__p16484105513112">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateHostGroup__p134845557317">Host group name. Use only letters, digits, underscores (_), hyphens (-), and periods (.). Do not start with a period or underscore or end with a period.</p>
<p id="CreateHostGroup__p84844552314">Minimum: <strong id="CreateHostGroup__b1748455518319">1</strong></p>
<p id="CreateHostGroup__p16484155523116">Maximum: <strong id="CreateHostGroup__b14484195518312">64</strong></p>
</td>
</tr>
<tr id="CreateHostGroup__row848365513313"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateHostGroup__p144841155113114">host_group_type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateHostGroup__p164842055183112">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateHostGroup__p20484165512315">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateHostGroup__p2048485563116">Host group type.</p>
<ul id="CreateHostGroup__ul1348465515313"><li id="CreateHostGroup__li14484195553119">Windows</li><li id="CreateHostGroup__li3484185563113">Linux</li></ul>
</td>
</tr>
<tr id="CreateHostGroup__row948305513114"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateHostGroup__p114848554319">host_id_list</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateHostGroup__p1748485519319">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateHostGroup__p144840556318">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateHostGroup__p24841855113117">List of host group IDs. The host type must be the same as the host group type.</p>
<p id="CreateHostGroup__p1248475519317">Minimum: <strong id="CreateHostGroup__b15484755103117">36</strong></p>
<p id="CreateHostGroup__p9484155513118">Maximum: <strong id="CreateHostGroup__b94844554316">36</strong></p>
</td>
</tr>
<tr id="CreateHostGroup__row8483155113115"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateHostGroup__p248516559318">host_group_tag</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateHostGroup__p184852554311">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateHostGroup__p1648595593117">Array of <a href="#CreateHostGroup__request_HostGroupTag">HostGroupTag</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateHostGroup__p15485755113114">Tag information. You can add up to 20 tags.</p>
</td>
</tr>
<tr id="CreateHostGroup__row14831755123110"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateHostGroup__p348515552315">agent_access_type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateHostGroup__p9485185511311">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateHostGroup__p1348545573118">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateHostGroup__p15485195593120">Host access type.</p>
<ul id="CreateHostGroup__ul4485175515311"><li id="CreateHostGroup__li1748513551310"><strong id="CreateHostGroup__b64859558311">LABEL</strong></li><li id="CreateHostGroup__li1148535513314"><strong id="CreateHostGroup__b14851555163115">IP</strong></li></ul>
</td>
</tr>
<tr id="CreateHostGroup__row94831955123112"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateHostGroup__p144851355183113">labels</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateHostGroup__p548514558317">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateHostGroup__p3485115520317">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateHostGroup__p154854556319">Host group identifier. If the host access type is <strong id="CreateHostGroup__b948505503116">LABEL</strong>, this field saves the host group identifier.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreateHostGroup__request_HostGroupTag"></a><a name="request_HostGroupTag"></a><table cellpadding="4" cellspacing="0" summary="" id="CreateHostGroup__request_HostGroupTag" frame="border" border="1" rules="all"><caption><b>Table 4 </b>HostGroupTag</caption><thead align="left"><tr id="CreateHostGroup__row1148525553118"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.1"><p id="CreateHostGroup__p10486135512319">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.2"><p id="CreateHostGroup__p16486105515319">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.3"><p id="CreateHostGroup__p2486255163119">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.4.2.5.1.4"><p id="CreateHostGroup__p1848617553314">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateHostGroup__row8485115553114"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateHostGroup__p13486205523117">key</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateHostGroup__p114861555103118">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateHostGroup__p2048685519315">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateHostGroup__p1248695513316">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="CreateHostGroup__row164851955103113"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateHostGroup__p1248618558316">value</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateHostGroup__p2048655514310">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateHostGroup__p124861955153120">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateHostGroup__p16486165553118">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="CreateHostGroup__section2486175593114"><h4 class="sectiontitle">Response Parameters</h4><p id="CreateHostGroup__p17486145510317"><strong id="CreateHostGroup__b9486055153111">Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateHostGroup__response_GetHostGroupInfo" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response body parameters</caption><thead align="left"><tr id="CreateHostGroup__row7486145563117"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.1"><p id="CreateHostGroup__p348775517315">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.2"><p id="CreateHostGroup__p11487455193110">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.2.4.1.3"><p id="CreateHostGroup__p448710551313">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateHostGroup__row2486555133119"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateHostGroup__p1248765583112">host_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateHostGroup__p848735510312">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateHostGroup__p11487185553116">Host group ID.</p>
</td>
</tr>
<tr id="CreateHostGroup__row1648615513319"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateHostGroup__p74871755163116">host_group_name</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateHostGroup__p12487115513311">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateHostGroup__p3487455153110">Host group name.</p>
</td>
</tr>
<tr id="CreateHostGroup__row164861255123113"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateHostGroup__p3487145516310">host_group_type</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateHostGroup__p648714558315">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateHostGroup__p84874555312">Host group type.</p>
</td>
</tr>
<tr id="CreateHostGroup__row13487145513314"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateHostGroup__p1348712551317">host_id_list</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateHostGroup__p8487555203118">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateHostGroup__p74871355103117">Host ID list.</p>
</td>
</tr>
<tr id="CreateHostGroup__row1348718556318"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateHostGroup__p2487555103116">host_group_tag</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateHostGroup__p6487115543112">Array of <a href="#CreateHostGroup__response_HostGroupTagResBody">HostGroupTagResBody</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateHostGroup__p1548813556318">Tag information.</p>
</td>
</tr>
<tr id="CreateHostGroup__row17487255163119"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateHostGroup__p114887557315">create_time</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateHostGroup__p2488125523111">Long</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateHostGroup__p18488145514315">Creation time.</p>
</td>
</tr>
<tr id="CreateHostGroup__row848775513114"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateHostGroup__p1548855563119">update_time</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateHostGroup__p13488655153118">Long</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateHostGroup__p7488255193114">Update time.</p>
</td>
</tr>
<tr id="CreateHostGroup__row1648755563113"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateHostGroup__p1048885512319">labels</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateHostGroup__p34881855123118">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateHostGroup__p948865510311">Host group ID.</p>
</td>
</tr>
<tr id="CreateHostGroup__row1748745514311"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateHostGroup__p1948845543115">agent_access_type</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateHostGroup__p1348810551312">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateHostGroup__p1048835533114">Host access type.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreateHostGroup__response_HostGroupTagResBody"></a><a name="response_HostGroupTagResBody"></a><table cellpadding="4" cellspacing="0" summary="" id="CreateHostGroup__response_HostGroupTagResBody" frame="border" border="1" rules="all"><caption><b>Table 6 </b>HostGroupTagResBody</caption><thead align="left"><tr id="CreateHostGroup__row1148815513313"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.4.2.4.1.1"><p id="CreateHostGroup__p248875573115">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.4.2.4.1.2"><p id="CreateHostGroup__p5488145543117">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.4.2.4.1.3"><p id="CreateHostGroup__p10488255203118">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateHostGroup__row15488205518315"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreateHostGroup__p1248945517316">key</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreateHostGroup__p1048995517317">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreateHostGroup__p8489165573118">Tag key.</p>
</td>
</tr>
<tr id="CreateHostGroup__row34881855103115"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreateHostGroup__p1848955563112">value</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreateHostGroup__p648919551312">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreateHostGroup__p1948985516312">Tag value.</p>
</td>
</tr>
<tr id="CreateHostGroup__row2488955113111"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreateHostGroup__p94891555103111">tags_to_streams_enable</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreateHostGroup__p134892055173111">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreateHostGroup__p114891955113114">Whether to apply the tag to the log stream. Only a tag of a log group can be directly applied to its log stream.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateHostGroup__p54891755153110"><strong id="CreateHostGroup__b1948955513113">Status code: 400</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateHostGroup__response_ErrorResultInfo400" frame="border" border="1" rules="all"><caption><b>Table 7 </b>Response body parameters</caption><thead align="left"><tr id="CreateHostGroup__row10489165543119"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.6.2.4.1.1"><p id="CreateHostGroup__p54891655153119">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.6.2.4.1.2"><p id="CreateHostGroup__p5489135523110">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.6.2.4.1.3"><p id="CreateHostGroup__p13489175511316">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateHostGroup__row17489185533110"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.1 "><p id="CreateHostGroup__p18489135533118">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.2 "><p id="CreateHostGroup__p8489145553118">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.6.2.4.1.3 "><p id="CreateHostGroup__p124891555203119">Error code</p>
</td>
</tr>
<tr id="CreateHostGroup__row2489165593118"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.1 "><p id="CreateHostGroup__p18490145513110">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.2 "><p id="CreateHostGroup__p84901455193113">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.6.2.4.1.3 "><p id="CreateHostGroup__p9490555193116">Error description</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateHostGroup__p11490105513113"><strong id="CreateHostGroup__b1949075593118">Status code: 500</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateHostGroup__table549055510316" frame="border" border="1" rules="all"><caption><b>Table 8 </b>Response body parameters</caption><thead align="left"><tr id="CreateHostGroup__row11490355143112"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.8.2.4.1.1"><p id="CreateHostGroup__p3490205513114">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.8.2.4.1.2"><p id="CreateHostGroup__p124916554315">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.8.2.4.1.3"><p id="CreateHostGroup__p19491105510314">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateHostGroup__row049075518316"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.8.2.4.1.1 "><p id="CreateHostGroup__p1949112558314">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.8.2.4.1.2 "><p id="CreateHostGroup__p249116552317">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.8.2.4.1.3 "><p id="CreateHostGroup__p114911552316">Error code</p>
</td>
</tr>
<tr id="CreateHostGroup__row1049020551313"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.8.2.4.1.1 "><p id="CreateHostGroup__p6491175511319">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.8.2.4.1.2 "><p id="CreateHostGroup__p1149119553319">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.8.2.4.1.3 "><p id="CreateHostGroup__p10491195515315">Error description</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateHostGroup__section649119551312"><h4 class="sectiontitle">Example Requests</h4><p id="CreateHostGroup__p104917557310">Create a host group. Parameters host_group_name and host_group_type are mandatory.</p>
<pre class="screen" id="CreateHostGroup__screen1249114552310">POST https://{endpoint}/v3/{project_id}/lts/host-group
{
"host_group_name" : "APIxx3",
"host_group_type" : "linux",
"host_id_list" : [ "dc1dab7e-b045-4e77xxd1bf7", "713a9fxx2df-24c4ca599def" ],
"host_group_tag" : [ {
"key" : "xxx",
"value" : "xxx",
"tags_to_streams_enable" : false
} ]
}</pre>
</div>
<div class="section" id="CreateHostGroup__section1749220552317"><h4 class="sectiontitle">Example Responses</h4><p id="CreateHostGroup__p13492195513311"><strong id="CreateHostGroup__b14492165563110">Status code: 200</strong></p>
<p id="CreateHostGroup__p2492105513119">The host group is created.</p>
<pre class="screen" id="CreateHostGroup__screen4492195515311">{
"host_group_id" : "598c77aa-c69b-42f0-8cb8-983178ad5b38",
"host_group_name" : "APIxx3",
"host_group_type" : "linux",
"host_id_list" : [ "dc1dab7e-b045-4e77-bda4-914d083d1bf7" ],
"host_group_tag" : [ {
"key" : "xxx",
"value" : "xxx",
"tags_to_streams_enable" : true
} ],
"create_time" : 1635149410332,
"update_time" : 1635149410332
}</pre>
<p id="CreateHostGroup__p24921355113113"><strong id="CreateHostGroup__b15492145553110">Status code: 400</strong></p>
<p id="CreateHostGroup__p15492155573118">Invalid request. Modify the request based on the description in <strong id="CreateHostGroup__b649245583115">error_msg</strong> before a retry.</p>
<pre class="screen" id="CreateHostGroup__screen1049212555317">{
"error_code" : "LTS.1812",
"error_msg" : "Invalid host group id"
}</pre>
<p id="CreateHostGroup__p549245516319"><strong id="CreateHostGroup__b1449216551311">Status code: 500</strong></p>
<p id="CreateHostGroup__p1949395523119">The server has received the request but encountered an internal error.</p>
<pre class="screen" id="CreateHostGroup__screen4640195517318">{
"error_code" : "LTS.0010",
"error_msg" : "Internal Server Error"
}</pre>
</div>
<div class="section" id="CreateHostGroup__section10641855193120"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateHostGroup__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="CreateHostGroup__row1649385563112"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="CreateHostGroup__p1464115515316">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="CreateHostGroup__p12641205553113">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateHostGroup__row1549317557315"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateHostGroup__p1641145553112">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateHostGroup__p56411556318">The host group is created.</p>
</td>
</tr>
<tr id="CreateHostGroup__row1849315556312"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateHostGroup__p264155516312">400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateHostGroup__p15641195543110">Invalid request. Modify the request based on the description in <strong id="CreateHostGroup__b11641955133120">error_msg</strong> before a retry.</p>
</td>
</tr>
<tr id="CreateHostGroup__row6494135511310"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateHostGroup__p116411555103115">500</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateHostGroup__p16411255133110">The server has received the request but encountered an internal error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateHostGroup__section2641165583112"><h4 class="sectiontitle">Error Codes</h4><p id="CreateHostGroup__p146411255133111">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_1015.html">Host Group Management</a></div>
</div>
</div>