forked from docs/doc-exports
Reviewed-by: Ziuzko, Alevtina <alevtina.ziuzko@t-systems.com> Co-authored-by: qiujiandong1 <qiujiandong1@huawei.com> Co-committed-by: qiujiandong1 <qiujiandong1@huawei.com>
238 lines
17 KiB
HTML
238 lines
17 KiB
HTML
<a name="ces_03_0070"></a><a name="ces_03_0070"></a>
|
|
|
|
<h1 class="topictitle1">Creating a Resource Group</h1>
|
|
<div id="body1606895824428"><div class="section" id="ces_03_0070__section66578044"><h4 class="sectiontitle">Function</h4><p id="ces_03_0070__p7134161517543">This API is used to create a resource group. You can use resource groups to manage resources by service, and view monitoring and alarm information by group to ease O&M.</p>
|
|
</div>
|
|
<div class="section" id="ces_03_0070__section62331491"><h4 class="sectiontitle">URI</h4><p id="ces_03_0070__p12899174762418">POST /V1.0/{project_id}/resource-groups</p>
|
|
<ul id="ces_03_0070__ul17767104113451"><li id="ces_03_0070__li137671541194520">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ces_03_0070__table14767174164512" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="ces_03_0070__row127676417456"><th align="left" class="cellrowborder" valign="top" width="18.488151184881513%" id="mcps1.3.2.3.1.1.2.5.1.1"><p id="ces_03_0070__p676711419453">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="14.308569143085691%" id="mcps1.3.2.3.1.1.2.5.1.2"><p id="ces_03_0070__p1376813412455">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.568743125687432%" id="mcps1.3.2.3.1.1.2.5.1.3"><p id="ces_03_0070__p1076844113459">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="54.634536546345366%" id="mcps1.3.2.3.1.1.2.5.1.4"><p id="ces_03_0070__p1376834114454">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="ces_03_0070__row47681941134516"><td class="cellrowborder" valign="top" width="18.488151184881513%" headers="mcps1.3.2.3.1.1.2.5.1.1 "><p id="ces_03_0070__p11768124114515">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.308569143085691%" headers="mcps1.3.2.3.1.1.2.5.1.2 "><p id="ces_03_0070__p576844134515">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.568743125687432%" headers="mcps1.3.2.3.1.1.2.5.1.3 "><p id="ces_03_0070__p1376810419457">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.634536546345366%" headers="mcps1.3.2.3.1.1.2.5.1.4 "><p id="ces_03_0070__p42316702175455">Specifies the project ID.</p>
|
|
<p id="ces_03_0070__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="ces_03_0070__en-us_topic_0000001646899046_p18100524114814">Minimum: <strong id="ces_03_0070__b53679262943832">1</strong></p>
|
|
<p id="ces_03_0070__en-us_topic_0000001646899046_p81001524104817">Maximum: <strong id="ces_03_0070__b170584195783239">64</strong></p>
|
|
<p id="ces_03_0070__p4697184133915"><strong id="ces_03_0070__b16603204625036">Regular expression matching</strong>: ^[a-zA-Z0-9-]{1,64}$</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="ces_03_0070__li114998310465">Request example<pre class="screen" id="ces_03_0070__screen17642956164510">POST https://{Cloud Eye endpoint}/V1.0/{project_id}/resource-groups</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="ces_03_0070__section14198712184410"><h4 class="sectiontitle">Request</h4><ul id="ces_03_0070__ul8883693"><li id="ces_03_0070__li4138653192418">Request parameters
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ces_03_0070__table31681753175455" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="ces_03_0070__row39882175175455"><th align="left" class="cellrowborder" valign="top" width="18.488151184881513%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="ces_03_0070__p9230722175455">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="14.308569143085691%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="ces_03_0070__p13675618230">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.568743125687432%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="ces_03_0070__p9490989175455">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="54.634536546345366%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="ces_03_0070__p30572649175455">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="ces_03_0070__row1124612531976"><td class="cellrowborder" valign="top" width="18.488151184881513%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="ces_03_0070__p206515579219">group_name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.308569143085691%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="ces_03_0070__p5671562232">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.568743125687432%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="ces_03_0070__p106515713215">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.634536546345366%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="ces_03_0070__p4651571217">Specifies the resource group name. Enter 1 to 128 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. Example: <strong id="ces_03_0070__b366610322303">ResourceGroup-Test01</strong></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="ces_03_0070__row186581855073"><td class="cellrowborder" valign="top" width="18.488151184881513%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="ces_03_0070__p116517574212">resources</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="14.308569143085691%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="ces_03_0070__p66713682311">Array of objects</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.568743125687432%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="ces_03_0070__p165896147227">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.634536546345366%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="ces_03_0070__p1965185716210">Select one or more resources for the resource group to be created.</p>
|
|
<p id="ces_03_0070__p1563619457398">For details, see <a href="#ces_03_0070__table39152528252">Table 3</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="ces_03_0070__table39152528252"></a><a name="table39152528252"></a><table cellpadding="4" cellspacing="0" summary="" id="ces_03_0070__table39152528252" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="ces_03_0070__b17999125843012">resources</strong> data structure description</caption><thead align="left"><tr id="ces_03_0070__row12915452182518"><th align="left" class="cellrowborder" valign="top" width="21.14%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="ces_03_0070__p191575220251">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.24%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="ces_03_0070__p59152524257">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="10.61%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="ces_03_0070__p552275152618">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="56.010000000000005%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="ces_03_0070__p1691555282518">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="ces_03_0070__row19158528251"><td class="cellrowborder" valign="top" width="21.14%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="ces_03_0070__p091585242518">namespace</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.24%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="ces_03_0070__p2915165219251">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.61%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="ces_03_0070__p9522175122612">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="ces_03_0070__p8915135219253">Specifies the resource namespace. For example, the ECS namespace is <strong id="ces_03_0070__b92332364716">SYS.ECS</strong>. To view the namespace of each service, see <a href="ces_03_0059.html">Services Interconnected with Cloud Eye</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="ces_03_0070__row14915155272515"><td class="cellrowborder" valign="top" width="21.14%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="ces_03_0070__p591515292515">dimensions</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.24%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="ces_03_0070__p119159527255">Array of objects</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="10.61%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="ces_03_0070__p8522451122619">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="56.010000000000005%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="ces_03_0070__p5915155216259">Specifies one or more resource dimensions.</p>
|
|
<p id="ces_03_0070__p10949586391">For details, see <a href="#ces_03_0070__table9206172582612">Table 4</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="ces_03_0070__table9206172582612"></a><a name="table9206172582612"></a><table cellpadding="4" cellspacing="0" summary="" id="ces_03_0070__table9206172582612" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="ces_03_0070__b1616165163118">dimensions</strong> data structure description</caption><thead align="left"><tr id="ces_03_0070__row42061225192614"><th align="left" class="cellrowborder" valign="top" width="18.990000000000002%" id="mcps1.3.3.2.1.3.2.5.1.1"><p id="ces_03_0070__p19207102512612">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.15%" id="mcps1.3.3.2.1.3.2.5.1.2"><p id="ces_03_0070__p15207925122611">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="9.950000000000001%" id="mcps1.3.3.2.1.3.2.5.1.3"><p id="ces_03_0070__p734513133275">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="58.91%" id="mcps1.3.3.2.1.3.2.5.1.4"><p id="ces_03_0070__p62071225102614">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="ces_03_0070__row320782552614"><td class="cellrowborder" valign="top" width="18.990000000000002%" headers="mcps1.3.3.2.1.3.2.5.1.1 "><p id="ces_03_0070__p16207122552613">name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.15%" headers="mcps1.3.3.2.1.3.2.5.1.2 "><p id="ces_03_0070__p6207725112619">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.3.3.2.1.3.2.5.1.3 "><p id="ces_03_0070__p234512132274">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="58.91%" headers="mcps1.3.3.2.1.3.2.5.1.4 "><p id="ces_03_0070__p1207102522620">Specifies the resource dimension. For example, the ECS dimension is <strong id="ces_03_0070__b73867431879">instance_id</strong>. To view the dimension of each resource, see <a href="ces_03_0059.html">Services Interconnected with Cloud Eye</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="ces_03_0070__row52072259269"><td class="cellrowborder" valign="top" width="18.990000000000002%" headers="mcps1.3.3.2.1.3.2.5.1.1 "><p id="ces_03_0070__p8207192512616">value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.15%" headers="mcps1.3.3.2.1.3.2.5.1.2 "><p id="ces_03_0070__p420732512618">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.3.3.2.1.3.2.5.1.3 "><p id="ces_03_0070__p63455137277">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="58.91%" headers="mcps1.3.3.2.1.3.2.5.1.4 "><p id="ces_03_0070__p18207132519266">Specifies the resource dimension value, which is the instance ID. Example: <strong id="ces_03_0070__b6928102533215">4270ff17-aba3-4138-89fa-820594c39755</strong></p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="ces_03_0070__section1625556295"><h4 class="sectiontitle">Example Requests</h4><pre class="screen" id="ces_03_0070__screen56262522914">{
|
|
"group_name" : "Resource-Group-Test01",
|
|
"resources" : [ {
|
|
"namespace" : "SYS.ECS",
|
|
"dimensions" : [ {
|
|
"name" : "instance_id",
|
|
"value" : "063a83da-a2b5-4630-ab6b-9b4fcfc261ea"
|
|
} ]
|
|
}, {
|
|
"namespace" : "SYS.ECS",
|
|
"dimensions" : [ {
|
|
"name" : "instance_id",
|
|
"value" : "518ace88-abde-46bf-829b-0d1f0f2fb2e9"
|
|
} ]
|
|
} ]
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="ces_03_0070__section15686020"><h4 class="sectiontitle">Response</h4><ul id="ces_03_0070__ul5769005"><li id="ces_03_0070__li27068104152742">Response parameters
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ces_03_0070__table42286344152742" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response parameters</caption><thead align="left"><tr id="ces_03_0070__row38095364152742"><th align="left" class="cellrowborder" valign="top" width="22.86%" id="mcps1.3.5.2.1.1.2.4.1.1"><p id="ces_03_0070__p65825661152742">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16.520000000000003%" id="mcps1.3.5.2.1.1.2.4.1.2"><p id="ces_03_0070__p36622711152742">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="60.62%" id="mcps1.3.5.2.1.1.2.4.1.3"><p id="ces_03_0070__p13649609152742">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="ces_03_0070__row185671917132310"><td class="cellrowborder" valign="top" width="22.86%" headers="mcps1.3.5.2.1.1.2.4.1.1 "><p id="ces_03_0070__p856818563156">group_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.520000000000003%" headers="mcps1.3.5.2.1.1.2.4.1.2 "><p id="ces_03_0070__p19568356121515">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.62%" headers="mcps1.3.5.2.1.1.2.4.1.3 "><p id="ces_03_0070__p2568356161512">Specifies the resource group ID, for example, <strong id="ces_03_0070__b20154343193213">rg1603786526428bWbVmk4rP</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="ces_03_0070__section186279572916"><h4 class="sectiontitle">Example Responses</h4><p id="ces_03_0070__p20628155162917"><strong id="ces_03_0070__b1435556911112010">Status code: 201</strong></p>
|
|
<p id="ces_03_0070__p17628135172910">OK</p>
|
|
<pre class="screen" id="ces_03_0070__screen662817592912">{
|
|
"group_id" : "rg1606377637506DmVOENVyL"
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="ces_03_0070__section6956456"><h4 class="sectiontitle">Returned Values</h4><ul id="ces_03_0070__ul20226985"><li id="ces_03_0070__li47825138">Normal<p id="ces_03_0070__p27773061"><a name="ces_03_0070__li47825138"></a><a name="li47825138"></a>201</p>
|
|
</li><li id="ces_03_0070__li48630964">Abnormal
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ces_03_0070__table9852173623812" frame="border" border="1" rules="all"><thead align="left"><tr id="ces_03_0070__row985213612382"><th align="left" class="cellrowborder" valign="top" width="32.1%" id="mcps1.3.7.2.2.1.1.3.1.1"><p id="ces_03_0070__p1849030182924">Returned Value</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="67.9%" id="mcps1.3.7.2.2.1.1.3.1.2"><p id="ces_03_0070__p15553712182924">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="ces_03_0070__row4852193611387"><td class="cellrowborder" valign="top" width="32.1%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="ces_03_0070__p581987519168">400 Bad Request</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67.9%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="ces_03_0070__p164784039168">Request error.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="ces_03_0070__row188531636193819"><td class="cellrowborder" valign="top" width="32.1%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="ces_03_0070__p2691669168">401 Unauthorized</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67.9%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="ces_03_0070__p218024949168">The authentication information is not provided or is incorrect.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="ces_03_0070__row118531636123816"><td class="cellrowborder" valign="top" width="32.1%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="ces_03_0070__p563264059168">403 Forbidden</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67.9%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="ces_03_0070__p661449719168">Access to the requested page is forbidden.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="ces_03_0070__row4853436123812"><td class="cellrowborder" valign="top" width="32.1%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="ces_03_0070__p355199299168">408 Request Timeout</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67.9%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="ces_03_0070__p585420329168">The request timed out.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="ces_03_0070__row1285303673812"><td class="cellrowborder" valign="top" width="32.1%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="ces_03_0070__p630127129168">429 Too Many Requests</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67.9%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="ces_03_0070__p37560249168">Concurrent requests are excessive.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="ces_03_0070__row1853336203811"><td class="cellrowborder" valign="top" width="32.1%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="ces_03_0070__p537873819168">500 Internal Server Error</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67.9%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="ces_03_0070__p618106189168">Failed to complete the request because of an internal service error.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="ces_03_0070__row38537365385"><td class="cellrowborder" valign="top" width="32.1%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="ces_03_0070__p298930079168">503 Service Unavailable</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="67.9%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="ces_03_0070__p54144829168">The service is currently unavailable.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="ces_03_0070__section121612204463"><h4 class="sectiontitle">Error Codes</h4><p id="ces_03_0070__en-us_topic_0171212585_p91851023153416">See <a href="ErrorCode.html">Error Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="ces_03_0067.html">Resource Groups</a></div>
|
|
</div>
|
|
</div>
|
|
|