doc-exports/docs/iam/api-ref/en-us_topic_0066154565.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

155 lines
12 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="en-us_topic_0066154565"></a><a name="en-us_topic_0066154565"></a>
<h1 class="topictitle1">Creating a Project</h1>
<div id="body1499771471794"><div class="section" id="en-us_topic_0066154565__section14840153773114"><h4 class="sectiontitle">Function</h4><p id="en-us_topic_0066154565__p9735543101">This API is used to create a project.</p>
</div>
<div class="section" id="en-us_topic_0066154565__section784163713116"><h4 class="sectiontitle">URI</h4><p id="en-us_topic_0066154565__p384113376314">POST /v3/projects</p>
</div>
<div class="section" id="en-us_topic_0066154565__section1984123716317"><h4 class="sectiontitle">Request Parameters</h4><ul id="en-us_topic_0066154565__ul10841163719319"><li id="en-us_topic_0066154565__li78411737203117">Parameters in the request header
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0066154565__table6841837173110" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0066154565__row58413376318"><th align="left" class="cellrowborder" valign="top" width="18.48%" id="mcps1.3.3.2.1.1.1.5.1.1"><p id="en-us_topic_0066154565__p584143715313"><strong id="en-us_topic_0066154565__b865896518147">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.709999999999997%" id="mcps1.3.3.2.1.1.1.5.1.2"><p id="en-us_topic_0066154565__p58421837173119"><strong id="en-us_topic_0066154565__b55396190181415">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.360000000000003%" id="mcps1.3.3.2.1.1.1.5.1.3"><p id="en-us_topic_0066154565__p1284203773111"><strong id="en-us_topic_0066154565__b29996550181423">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.45%" id="mcps1.3.3.2.1.1.1.5.1.4"><p id="en-us_topic_0066154565__p1584293703114"><strong id="en-us_topic_0066154565__b19141093181431">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0066154565__row11842637153116"><td class="cellrowborder" valign="top" width="18.48%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0066154565__p68421237153116">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="18.709999999999997%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0066154565__p198428375319">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.360000000000003%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0066154565__p158426375311">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.45%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0066154565__p784213783118">Fill <strong id="en-us_topic_0066154565__b842352706161331">application/json;charset=utf8</strong> in this field.</p>
</td>
</tr>
<tr id="en-us_topic_0066154565__row984253713313"><td class="cellrowborder" valign="top" width="18.48%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0066154565__p1484219377311">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="18.709999999999997%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0066154565__p484223783118">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.360000000000003%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0066154565__p1884233733118">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.45%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0066154565__p379833091312">Authenticated token with the <strong id="en-us_topic_0066154565__b750798910387">Security Administrator</strong> permission.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0066154565__ul178428373313"><li id="en-us_topic_0066154565__li784283733111">Parameters in the request body
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0066154565__table1584218378319" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0066154565__row784312379318"><th align="left" class="cellrowborder" valign="top" width="18.35%" id="mcps1.3.3.3.1.1.1.5.1.1"><p id="en-us_topic_0066154565__p1084319374318"><strong id="en-us_topic_0066154565__b19889620181855">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.09%" id="mcps1.3.3.3.1.1.1.5.1.2"><p id="en-us_topic_0066154565__p1584373753111"><strong id="en-us_topic_0066154565__b36317923181829">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.490000000000002%" id="mcps1.3.3.3.1.1.1.5.1.3"><p id="en-us_topic_0066154565__p188431437173116"><strong id="en-us_topic_0066154565__b37271989181838">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="44.07%" id="mcps1.3.3.3.1.1.1.5.1.4"><p id="en-us_topic_0066154565__p2084323733114"><strong id="en-us_topic_0066154565__b64170555181845">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0066154565__row484363763114"><td class="cellrowborder" valign="top" width="18.35%" headers="mcps1.3.3.3.1.1.1.5.1.1 "><p id="en-us_topic_0066154565__p10866102274714">name</p>
</td>
<td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.3.3.1.1.1.5.1.2 "><p id="en-us_topic_0066154565__p8866182254710">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.490000000000002%" headers="mcps1.3.3.3.1.1.1.5.1.3 "><p id="en-us_topic_0066154565__p98661522154710">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.07%" headers="mcps1.3.3.3.1.1.1.5.1.4 "><p id="en-us_topic_0066154565__p2866922184715">Project name, which must start with "<em id="en-us_topic_0066154565__i842352697134716">ID of an existing region</em>_" and be less than or equal to 64 characters.</p>
<p id="en-us_topic_0066154565__p8866172211473">Example: <em id="en-us_topic_0066154565__i1531907502113130">{region_id}</em>_test1</p>
</td>
</tr>
<tr id="en-us_topic_0066154565__row9843637103110"><td class="cellrowborder" valign="top" width="18.35%" headers="mcps1.3.3.3.1.1.1.5.1.1 "><p id="en-us_topic_0066154565__p2171222476">parent_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.3.3.1.1.1.5.1.2 "><p id="en-us_topic_0066154565__p1216152218474">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.490000000000002%" headers="mcps1.3.3.3.1.1.1.5.1.3 "><p id="en-us_topic_0066154565__p615132216471">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.07%" headers="mcps1.3.3.3.1.1.1.5.1.4 "><p id="en-us_topic_0066154565__p1813172216475">Parent project ID to which a project belongs.</p>
</td>
</tr>
<tr id="en-us_topic_0066154565__row11331310194713"><td class="cellrowborder" valign="top" width="18.35%" headers="mcps1.3.3.3.1.1.1.5.1.1 "><p id="en-us_topic_0066154565__p10715201514476">domain_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.3.3.1.1.1.5.1.2 "><p id="en-us_topic_0066154565__p371581515472">No</p>
</td>
<td class="cellrowborder" valign="top" width="18.490000000000002%" headers="mcps1.3.3.3.1.1.1.5.1.3 "><p id="en-us_topic_0066154565__p1171551574715">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.07%" headers="mcps1.3.3.3.1.1.1.5.1.4 "><p id="en-us_topic_0066154565__p12715215114715">ID of the domain that a project belongs to.</p>
</td>
</tr>
<tr id="en-us_topic_0066154565__row47961920510"><td class="cellrowborder" valign="top" width="18.35%" headers="mcps1.3.3.3.1.1.1.5.1.1 "><p id="en-us_topic_0066154565__p479719754">description</p>
</td>
<td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.3.3.1.1.1.5.1.2 "><p id="en-us_topic_0066154565__p117971296516">No</p>
</td>
<td class="cellrowborder" valign="top" width="18.490000000000002%" headers="mcps1.3.3.3.1.1.1.5.1.3 "><p id="en-us_topic_0066154565__p5324113519">String</p>
</td>
<td class="cellrowborder" valign="top" width="44.07%" headers="mcps1.3.3.3.1.1.1.5.1.4 "><p id="en-us_topic_0066154565__p73174114511">Project description, which can contain a maximum of 255 characters.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0066154565__ul11844153743114"><li id="en-us_topic_0066154565__li584483713311">Example request<pre class="screen" id="en-us_topic_0066154565__screen1484413714310"><em id="en-us_topic_0066154565__i5844137113119">curl -i -k -H "X-Auth-Token:$token" -H 'Content-Type:application/json;charset=utf8' -X POST d '{"project":{"domain_id":"acf2ffabba974fae8f30378ffde2c...","name":"region_test1"}}' https://sample.domain.com/v3/projects</em></pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0066154565__section78443371318"><h4 class="sectiontitle">Response Parameters</h4><p id="en-us_topic_0066154565__p61281107184757"> Example response</p>
<pre class="screen" id="en-us_topic_0066154565__screen184463783118">{
"project": {
"is_domain": false,
"description": "",
"links": {
"self": "<em id="en-us_topic_0066154565__i187641411145711">https://sample.domain.com</em>/v3/projects/3de1461665f045ef91ba1efe8121b979"
},
"enabled": true,
"id": "3de1461665f045ef91ba1efe8121b979",
"parent_id": "d1294857fdf64251994892b344f53e88",
"domain_id": "d1294857fdf64251994892b344f53e88",
"name": "region_test1"
}
}</pre>
</div>
<div class="section" id="en-us_topic_0066154565__section584413370311"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0066154565__table138451637163117" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0066154565__row3845183773112"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.1.3.1.1"><p id="en-us_topic_0066154565__p13845103743114"><strong id="en-us_topic_0066154565__b5536438181756">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_0066154565__p11845037143110"><strong id="en-us_topic_0066154565__b4379203118184">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0066154565__row4845203710315"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0066154565__p158454371316">201</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0066154565__p1684518374319">The request is successful.</p>
</td>
</tr>
<tr id="en-us_topic_0066154565__row9845133753118"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0066154565__p48451037173111">400</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0066154565__p98451237183119">The server failed to process the request.</p>
</td>
</tr>
<tr id="en-us_topic_0066154565__row384518375310"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0066154565__p284583733115">401</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0066154565__p584543743117">Authentication failed.</p>
</td>
</tr>
<tr id="en-us_topic_0066154565__row1620125915310"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0066154565__p421115903114">403</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0066154565__p821135963116">Access denied.</p>
</td>
</tr>
<tr id="en-us_topic_0066154565__row118451837143115"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0066154565__p88458372318">409</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0066154565__p48451637123118">Duplicate project name.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0057845642.html">Project Management</a></div>
</div>
</div>