doc-exports/docs/iam/api-ref/en-us_topic_0057845650.html
zhangyue 3b5a58b1fe IAM API 2.0.38
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2022-10-26 04:31:24 +00:00

201 lines
16 KiB
HTML

<a name="en-us_topic_0057845650"></a><a name="en-us_topic_0057845650"></a>
<h1 class="topictitle1">Creating a User Group</h1>
<div id="body1492670576086"><div class="section" id="en-us_topic_0057845650__section16448035101644"><h4 class="sectiontitle">Function</h4><p id="en-us_topic_0057845650__p16560429714">This API is used to create a user group.</p>
</div>
<div class="section" id="en-us_topic_0057845650__section60989708101648"><h4 class="sectiontitle">URI</h4><p id="en-us_topic_0057845650__en-us_topic_0032920307_p43556055">POST /v3/groups</p>
</div>
<div class="section" id="en-us_topic_0057845650__section763260110344"><h4 class="sectiontitle">Request Parameters</h4><ul id="en-us_topic_0057845650__ul64414954103539"><li id="en-us_topic_0057845650__li51706013103539">Parameters in the request header
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845650__en-us_topic_0032920307_table21736211" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845650__en-us_topic_0032920307_row48433347"><th align="left" class="cellrowborder" valign="top" width="19.49%" id="mcps1.3.3.2.1.1.1.5.1.1"><p id="en-us_topic_0057845650__en-us_topic_0032920307_p30787047"><strong id="en-us_topic_0057845650__a173ae121cc9e48328ca613e72f2a1504_1">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.86%" id="mcps1.3.3.2.1.1.1.5.1.2"><p id="en-us_topic_0057845650__en-us_topic_0032920307_p10722842"><strong id="en-us_topic_0057845650__a105e6ed8c3de4c5a9dde97ae5a71071e_1">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.57%" id="mcps1.3.3.2.1.1.1.5.1.3"><p id="en-us_topic_0057845650__en-us_topic_0032920307_p63243911"><strong id="en-us_topic_0057845650__b842352706143526_1">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.080000000000005%" id="mcps1.3.3.2.1.1.1.5.1.4"><p id="en-us_topic_0057845650__en-us_topic_0032920307_p22483156"><strong id="en-us_topic_0057845650__b20601766145329">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845650__en-us_topic_0032920307_row9196329"><td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845650__en-us_topic_0032920307_p6705199">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="18.86%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845650__en-us_topic_0032920307_p6250253">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845650__en-us_topic_0032920307_p36508524">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.080000000000005%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845650__en-us_topic_0032920307_p4400500">Fill <strong id="en-us_topic_0057845650__b842352706161331">application/json;charset=utf8</strong> in this field.</p>
</td>
</tr>
<tr id="en-us_topic_0057845650__en-us_topic_0032920307_row39604502"><td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845650__en-us_topic_0032920307_p53848109">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="18.86%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845650__en-us_topic_0032920307_p66729601">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845650__en-us_topic_0032920307_p36388601">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.080000000000005%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845650__p4433597211513">Authenticated token with the <strong id="en-us_topic_0057845650__b750798910387">Security Administrator</strong> permission.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0057845650__ul21793909103839"><li id="en-us_topic_0057845650__li61927459103839">Parameters in the request body
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845650__table20476227103839" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845650__row27191649103839"><th align="left" class="cellrowborder" valign="top" width="19.49%" id="mcps1.3.3.3.1.1.1.5.1.1"><p id="en-us_topic_0057845650__p55039964103839"><strong id="en-us_topic_0057845650__a173ae121cc9e48328ca613e72f2a1504_3">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.86%" id="mcps1.3.3.3.1.1.1.5.1.2"><p id="en-us_topic_0057845650__p29052075103839"><strong id="en-us_topic_0057845650__a105e6ed8c3de4c5a9dde97ae5a71071e_3">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.099999999999998%" id="mcps1.3.3.3.1.1.1.5.1.3"><p id="en-us_topic_0057845650__p4407863103839"><strong id="en-us_topic_0057845650__b842352706143526_3">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.55%" id="mcps1.3.3.3.1.1.1.5.1.4"><p id="en-us_topic_0057845650__p21492583103839"><strong id="en-us_topic_0057845650__b26002689171855_1">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845650__row6819406103839"><td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.3.3.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845650__p15501051103839">description</p>
</td>
<td class="cellrowborder" valign="top" width="18.86%" headers="mcps1.3.3.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845650__p47625608103839">No</p>
</td>
<td class="cellrowborder" valign="top" width="18.099999999999998%" headers="mcps1.3.3.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845650__p32469021103839">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.55%" headers="mcps1.3.3.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845650__p12745059103839">Description for a user group. The length is less than or equal to 255 characters.</p>
</td>
</tr>
<tr id="en-us_topic_0057845650__row29609315103946"><td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.3.3.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845650__p65157251103946">domain_id</p>
</td>
<td class="cellrowborder" valign="top" width="18.86%" headers="mcps1.3.3.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845650__p43245998103946">No</p>
</td>
<td class="cellrowborder" valign="top" width="18.099999999999998%" headers="mcps1.3.3.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845650__p13264962103946">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.55%" headers="mcps1.3.3.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845650__p720101103946">ID of the domain to which a user group belongs.</p>
</td>
</tr>
<tr id="en-us_topic_0057845650__row47644029103953"><td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.3.3.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845650__p26143083103953">name</p>
</td>
<td class="cellrowborder" valign="top" width="18.86%" headers="mcps1.3.3.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845650__p37214989103953">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.099999999999998%" headers="mcps1.3.3.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845650__p61624156103953">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.55%" headers="mcps1.3.3.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845650__p25500735103953">Name of a user group. The length is less than or equal to 64 characters.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="en-us_topic_0057845650__li182954221694">Example request<pre class="screen" id="en-us_topic_0057845650__screen629502214913"><em id="en-us_topic_0057845650__i1129411221695">curl -i -k -H 'Accept:application/json' -H 'Content-Type:application/json;charset=utf8' -H "X-Auth-Token:$token" -X POST -d'{"group": {"description": "Contract developers","domain_id": "d54061ebcb5145dd814f8eb3fe9b7ac0","name": "jixiang2"}}' https://sample.domain.com/v3/groups</em></pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0057845650__section7621113105350"><h4 class="sectiontitle">Response Parameters</h4><ul id="en-us_topic_0057845650__ul5464199010524"><li id="en-us_topic_0057845650__li6140614310524">Parameters in the response body
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845650__table1056195410010" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845650__row2747156110010"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.1.1.1.5.1.1"><p id="en-us_topic_0057845650__p447620910517"><strong id="en-us_topic_0057845650__a173ae121cc9e48328ca613e72f2a1504_5">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.32%" id="mcps1.3.4.2.1.1.1.5.1.2"><p id="en-us_topic_0057845650__p15423142105019"><strong id="en-us_topic_0057845650__a105e6ed8c3de4c5a9dde97ae5a71071e_5">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.56%" id="mcps1.3.4.2.1.1.1.5.1.3"><p id="en-us_topic_0057845650__p755696810517"><strong id="en-us_topic_0057845650__b842352706143526_5">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.120000000000005%" id="mcps1.3.4.2.1.1.1.5.1.4"><p id="en-us_topic_0057845650__p6407638510517"><strong id="en-us_topic_0057845650__b26002689171855_3">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845650__row809135110010"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845650__p53468292105715">description</p>
</td>
<td class="cellrowborder" valign="top" width="18.32%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845650__p34246211507">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.56%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845650__p852996010010">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.120000000000005%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845650__p1983818310010">Description for a user group.</p>
</td>
</tr>
<tr id="en-us_topic_0057845650__row23913924105725"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845650__p13898724105725">domain_id</p>
</td>
<td class="cellrowborder" valign="top" width="18.32%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845650__p1842462175011">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.56%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845650__p52054821105725">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.120000000000005%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845650__p55690967105725">ID of the domain to which a user group belongs.</p>
</td>
</tr>
<tr id="en-us_topic_0057845650__row43504723105810"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845650__p55998188105810">id</p>
</td>
<td class="cellrowborder" valign="top" width="18.32%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845650__p14424152175015">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.56%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845650__p39559385105810">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.120000000000005%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845650__p50193635105810">ID of a user group.</p>
</td>
</tr>
<tr id="en-us_topic_0057845650__row42687591105820"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845650__p48644001105820">links</p>
</td>
<td class="cellrowborder" valign="top" width="18.32%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845650__p11424629506">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.56%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845650__p1071821654919">JSON object</p>
</td>
<td class="cellrowborder" valign="top" width="43.120000000000005%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845650__p50648609105820">Links to a user group.</p>
</td>
</tr>
<tr id="en-us_topic_0057845650__row1704891105830"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845650__p15344026105830">name</p>
</td>
<td class="cellrowborder" valign="top" width="18.32%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845650__p1842462135019">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.56%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845650__p34906626105830">String</p>
</td>
<td class="cellrowborder" valign="top" width="43.120000000000005%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845650__p8864442105830">Name of a user group.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="en-us_topic_0057845650__li016112361092">Example response<pre class="screen" id="en-us_topic_0057845650__screen44775001112737">{
"group":{
"domain_id":"d54061ebcb5145dd814f8eb3fe9b7ac0",
"description":"Contract developers",
"id":"ab9f261180d746ef8624beb5ae39b5aa",
"links":{
"self":"https://sample.domain.com/v3/groups/ab9f261180d746ef8624beb5ae39b5aa"
},
"name":"abcdef"
}
}</pre>
</li></ul>
<p id="en-us_topic_0057845650__p256261112729"></p>
</div>
<div class="section" id="en-us_topic_0057845650__section49475145112813"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845650__en-us_topic_0032920307_table25927028" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845650__en-us_topic_0032920307_row10578662"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.1.3.1.1"><p id="en-us_topic_0057845650__en-us_topic_0032920307_p51565323"><strong id="en-us_topic_0057845650__b2474889171855">Status Code</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.1.3.1.2"><p id="en-us_topic_0057845650__en-us_topic_0032920307_p16041657"><strong id="en-us_topic_0057845650__b59363903171855">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845650__en-us_topic_0032920307_row24305815"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845650__en-us_topic_0032920307_p22613965">201</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845650__en-us_topic_0032920307_p19791876">The user group is successfully created.</p>
</td>
</tr>
<tr id="en-us_topic_0057845650__en-us_topic_0032920307_row43909159"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845650__en-us_topic_0032920307_p66980994">400</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845650__en-us_topic_0032920307_p56751409">The server failed to process the request.</p>
</td>
</tr>
<tr id="en-us_topic_0057845650__row460808479497"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845650__p120744399497">401</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845650__p385055099497">Authentication failed.</p>
</td>
</tr>
<tr id="en-us_topic_0057845650__en-us_topic_0032920307_row41000636"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845650__en-us_topic_0032920307_p32717189">403</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845650__en-us_topic_0032920307_p32846614">Access denied.</p>
</td>
</tr>
<tr id="en-us_topic_0057845650__row2520892414217"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845650__p2555372914217">409</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845650__p5658613514217">A resource conflict occurs.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0057845641.html">User Group Management</a></div>
</div>
</div>