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

256 lines
19 KiB
HTML

<a name="en-us_topic_0057845558"></a><a name="en-us_topic_0057845558"></a>
<h1 class="topictitle1">Querying the List of Projects Accessible to Users</h1>
<div id="body1492670576142"><div class="section" id="en-us_topic_0057845558__section37234380165120"><h4 class="sectiontitle">Function</h4><p id="en-us_topic_0057845558__p11514231303">This API is used to query the list of projects accessible to users.</p>
<p id="en-us_topic_0057845558__p63194805165120"></p>
</div>
<div class="section" id="en-us_topic_0057845558__section61801097192146"><h4 class="sectiontitle">URI</h4><p id="en-us_topic_0057845558__p35104473192156">GET /v3/auth/projects</p>
</div>
<div class="section" id="en-us_topic_0057845558__section63890395165120"><h4 class="sectiontitle">Request Parameters</h4><ul id="en-us_topic_0057845558__ul39833112165120"><li id="en-us_topic_0057845558__li3945384019369">Parameters in the request header
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845558__table6220953919369" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845558__row5697606319369"><th align="left" class="cellrowborder" valign="top" width="22.88%" id="mcps1.3.3.2.1.1.1.5.1.1"><p id="en-us_topic_0057845558__p5527391819369"><strong id="en-us_topic_0057845558__a6f95694edbbb43d8a152536754b86c82">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.81%" id="mcps1.3.3.2.1.1.1.5.1.2"><p id="en-us_topic_0057845558__p4800235119369"><strong id="en-us_topic_0057845558__a105e6ed8c3de4c5a9dde97ae5a71071e_1">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.48%" id="mcps1.3.3.2.1.1.1.5.1.3"><p id="en-us_topic_0057845558__p6298525419369"><strong id="en-us_topic_0057845558__a703d34a49a2f4162bc1a1a439f655f95_1">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="32.83%" id="mcps1.3.3.2.1.1.1.5.1.4"><p id="en-us_topic_0057845558__p153191219369"><strong id="en-us_topic_0057845558__a76acf34e8e7b48948763ec1b460ad92f">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845558__row61263798114243"><td class="cellrowborder" valign="top" width="22.88%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845558__p3477825114246">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845558__p13268390114246">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.48%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845558__p997820114246">String</p>
</td>
<td class="cellrowborder" valign="top" width="32.83%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845558__p13714602114246">Fill <strong id="en-us_topic_0057845558__b842352706161331">application/json;charset=utf8</strong> in this field.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__row1297318319369"><td class="cellrowborder" valign="top" width="22.88%" headers="mcps1.3.3.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845558__p5165841919369">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="21.81%" headers="mcps1.3.3.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845558__p2358241119369">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.48%" headers="mcps1.3.3.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845558__p3112715219369">String</p>
</td>
<td class="cellrowborder" valign="top" width="32.83%" headers="mcps1.3.3.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845558__p3310810221217">Authenticated token of the user.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="en-us_topic_0057845558__li22953690165120">Example request<pre class="screen" id="en-us_topic_0057845558__screen2718588421246"><em id="en-us_topic_0057845558__i13746989114334">curl -i -k -H 'Accept:application/json' -H 'Content-Type:application/json;charset=utf8' -H "X-Auth-Token:$token" -X GET /v3/auth/projects</em></pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0057845558__section23133376165120"><h4 class="sectiontitle">Response Parameters</h4><ul id="en-us_topic_0057845558__ul53205305193930"><li id="en-us_topic_0057845558__li23877125193930">Parameters in the response body
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845558__table61864177165120" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845558__row53394193165120"><th align="left" class="cellrowborder" valign="top" width="23.01%" id="mcps1.3.4.2.1.1.1.5.1.1"><p id="en-us_topic_0057845558__p29962347165120"><strong id="en-us_topic_0057845558__b9413284164823">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.55%" id="mcps1.3.4.2.1.1.1.5.1.2"><p id="en-us_topic_0057845558__p11031025165120"><strong id="en-us_topic_0057845558__a105e6ed8c3de4c5a9dde97ae5a71071e_3">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.61%" id="mcps1.3.4.2.1.1.1.5.1.3"><p id="en-us_topic_0057845558__p21097869165120"><strong id="en-us_topic_0057845558__a703d34a49a2f4162bc1a1a439f655f95_3">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="32.83%" id="mcps1.3.4.2.1.1.1.5.1.4"><p id="en-us_topic_0057845558__p31205796165120"><strong id="en-us_topic_0057845558__b50726443164823">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845558__row44641568165120"><td class="cellrowborder" valign="top" width="23.01%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845558__p59197289165120">projects</p>
</td>
<td class="cellrowborder" valign="top" width="21.55%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845558__p30251110165120">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.61%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845558__p34420864165120">JSONArray</p>
</td>
<td class="cellrowborder" valign="top" width="32.83%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845558__p36626590165120">List of projects.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__row61203858165120"><td class="cellrowborder" valign="top" width="23.01%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="en-us_topic_0057845558__p58565490165120">links</p>
</td>
<td class="cellrowborder" valign="top" width="21.55%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="en-us_topic_0057845558__p46184267165120">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.61%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="en-us_topic_0057845558__p49938116165120">Object</p>
</td>
<td class="cellrowborder" valign="top" width="32.83%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="en-us_topic_0057845558__p18455557165120">Project resource link.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0057845558__ul31882288165120"><li id="en-us_topic_0057845558__l86920d09d4224a93a4379c10a51077f0">Description for the project format
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845558__t3ef10d134105438f922a72ac36adbe13" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845558__ra836795da3204436ad115c6d63f33cb3"><th align="left" class="cellrowborder" valign="top" width="22.88%" id="mcps1.3.4.3.1.1.1.5.1.1"><p id="en-us_topic_0057845558__a915f4fa2492a4fa3b5fc5b52cb975ed3"><strong id="en-us_topic_0057845558__b24591867173012">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.55%" id="mcps1.3.4.3.1.1.1.5.1.2"><p id="en-us_topic_0057845558__aeb29128c8bc6489593aaf12297635c52"><strong id="en-us_topic_0057845558__a105e6ed8c3de4c5a9dde97ae5a71071e_5">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.68%" id="mcps1.3.4.3.1.1.1.5.1.3"><p id="en-us_topic_0057845558__a367df15999ce47aa8fa2550bb2d3df9a"><strong id="en-us_topic_0057845558__a703d34a49a2f4162bc1a1a439f655f95_5">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="32.89%" id="mcps1.3.4.3.1.1.1.5.1.4"><p id="en-us_topic_0057845558__a16a6b7e4145e4fbabf25e75163ec3f95"><strong id="en-us_topic_0057845558__b54537216173012">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845558__rb2ba995189ec478eb5d1181d3bb7be1c"><td class="cellrowborder" valign="top" width="22.88%" headers="mcps1.3.4.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845558__aa1005da54f2c4746ae99676d14ab012d">description</p>
</td>
<td class="cellrowborder" valign="top" width="21.55%" headers="mcps1.3.4.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845558__a6d0540b177e34775b18c670cf5cd46bc">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.68%" headers="mcps1.3.4.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845558__a65f6a6fc5a364d868072c58eeab90325">String</p>
</td>
<td class="cellrowborder" valign="top" width="32.89%" headers="mcps1.3.4.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845558__ababe5d21d4764e209d225a4cea9b9fa2">Project description.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__r41522dc2bd8d475b8d2a16af17d5213b"><td class="cellrowborder" valign="top" width="22.88%" headers="mcps1.3.4.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845558__a2501c5b12ff94e338c0930e6c321af90">id</p>
</td>
<td class="cellrowborder" valign="top" width="21.55%" headers="mcps1.3.4.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845558__af10224f581d946cb91a49683adf34271">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.68%" headers="mcps1.3.4.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845558__a0316e95fb756489a82f70ae562c523b4">String</p>
</td>
<td class="cellrowborder" valign="top" width="32.89%" headers="mcps1.3.4.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845558__af5ce8c5c520f468895f28d74f6eb4540">ID of a project.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__r1208cbb1496440d89eb758b2cd80d578"><td class="cellrowborder" valign="top" width="22.88%" headers="mcps1.3.4.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845558__a4504807eb899465fb0ce3ac82d7013dc">domain_id</p>
</td>
<td class="cellrowborder" valign="top" width="21.55%" headers="mcps1.3.4.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845558__en-us_topic_0026585113_p386591205643">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.68%" headers="mcps1.3.4.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845558__a293aacc9b5354786a8b30a063a186b02">String</p>
</td>
<td class="cellrowborder" valign="top" width="32.89%" headers="mcps1.3.4.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845558__aa1138dcdd40340039e621e7abf0332e1">ID of the domain where a project is located.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__rbe8775b4e77a4b08be093de05e7bcbf3"><td class="cellrowborder" valign="top" width="22.88%" headers="mcps1.3.4.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845558__acc4c499e1b2f4bdd98e5c7acd4e8861b">name</p>
</td>
<td class="cellrowborder" valign="top" width="21.55%" headers="mcps1.3.4.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845558__a4bf5dfe715d342e0a883343cbcf8181a">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.68%" headers="mcps1.3.4.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845558__a8c424bac7d93444dbc647a1d5c5c21e4">String</p>
</td>
<td class="cellrowborder" valign="top" width="32.89%" headers="mcps1.3.4.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845558__afc48731c8a2e4c66a56ac245f7a1e34e">Project name.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__row884150412952"><td class="cellrowborder" valign="top" width="22.88%" headers="mcps1.3.4.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845558__p4507320312952">links</p>
</td>
<td class="cellrowborder" valign="top" width="21.55%" headers="mcps1.3.4.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845558__p2705079812952">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.68%" headers="mcps1.3.4.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845558__p4363103412952">Object</p>
</td>
<td class="cellrowborder" valign="top" width="32.89%" headers="mcps1.3.4.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845558__p4445286212952">Project resource link.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__row19356972201441"><td class="cellrowborder" valign="top" width="22.88%" headers="mcps1.3.4.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845558__p29605601201441">is_domain</p>
</td>
<td class="cellrowborder" valign="top" width="21.55%" headers="mcps1.3.4.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845558__p21596807201441">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.68%" headers="mcps1.3.4.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845558__p39263216201441">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="32.89%" headers="mcps1.3.4.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845558__p59347844201441">Indicates whether the user calling the API is a tenant.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__row46028278201453"><td class="cellrowborder" valign="top" width="22.88%" headers="mcps1.3.4.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845558__p27327398201453">enabled</p>
</td>
<td class="cellrowborder" valign="top" width="21.55%" headers="mcps1.3.4.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845558__p1690706201453">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.68%" headers="mcps1.3.4.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845558__p57286369201453">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="32.89%" headers="mcps1.3.4.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845558__p30534075201453">Whether a project is available.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__row14242324201510"><td class="cellrowborder" valign="top" width="22.88%" headers="mcps1.3.4.3.1.1.1.5.1.1 "><p id="en-us_topic_0057845558__p35305259201510">parent_id</p>
</td>
<td class="cellrowborder" valign="top" width="21.55%" headers="mcps1.3.4.3.1.1.1.5.1.2 "><p id="en-us_topic_0057845558__p17738677201510">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.68%" headers="mcps1.3.4.3.1.1.1.5.1.3 "><p id="en-us_topic_0057845558__p53557531201510">String</p>
</td>
<td class="cellrowborder" valign="top" width="32.89%" headers="mcps1.3.4.3.1.1.1.5.1.4 "><p id="en-us_topic_0057845558__p62242884201510">Parent ID of the project.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="en-us_topic_0057845558__li18505143165120">Example response<pre class="screen" id="en-us_topic_0057845558__screen56574954192219">{
"links": {
"self": "<em id="en-us_topic_0057845558__i4973512021446">https://sample.domain.com</em>/v3/auth/projects",
"previous": null,
"next": null
},
"projects": [
{
"is_domain": false,
"description": "",
"links": {
"self": "https://sample.domain.com/v3/projects/9041929bcc6e4bfe85add4e7b96ffdd7"
},
"enabled": true,
"id": "9041929bcc6e4bfe85add4e7b96ffdd7",
"parent_id": "398998b5392f4150ad48fe456d6de4f1",
"domain_id": "398998b5392f4150ad48fe456d6de4f1",
"name": "region"
},
{
"is_domain": false,
"description": "",
"links": {
"self": "<em id="en-us_topic_0057845558__i186482509018">https://sample.domain.com</em>/v3/projects/ee65ca70d3cf43aaa1ea6492ce15f289"
},
"enabled": true,
"id": "ee65ca70d3cf43aaa1ea6492ce15f289",
"parent_id": "398998b5392f4150ad48fe456d6de4f1",
"domain_id": "398998b5392f4150ad48fe456d6de4f1",
"name": "{project_name}"
}
]
}</pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0057845558__section58962517165120"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0057845558__table11234582165120" frame="border" border="1" rules="all"><thead align="left"><tr id="en-us_topic_0057845558__row19742440165120"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.1.3.1.1"><p id="en-us_topic_0057845558__p55633806165120"><strong id="en-us_topic_0057845558__b84235270618317">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_0057845558__p10044408165120"><strong id="en-us_topic_0057845558__b15670140164823">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0057845558__row8290702165120"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845558__p458298165120">200</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845558__p37122145165120">The request is successful.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__row65663855165120"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845558__p17172061165120">400</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845558__p48759675165120">The server failed to process the request.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__row36183891165120"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845558__p45214077165120">401</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845558__p38461611165120">Authentication failed.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__row10610183165120"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845558__p54118519165120">403</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845558__p21523936165120">Access denied.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__row59497697165120"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845558__p54584113165120">405</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845558__p59237005165120">The method specified in the request is not allowed for the requested resource.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__row63371004165120"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845558__p32777686165120">413</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845558__p37746929165120">The request entity is too large.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__row4178046165120"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845558__p2877469165120">500</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845558__p31748432165120">Internal server error.</p>
</td>
</tr>
<tr id="en-us_topic_0057845558__row17300437165120"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.1 "><p id="en-us_topic_0057845558__p59158146165120">503</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.1.3.1.2 "><p id="en-us_topic_0057845558__p27080503165120">Service unavailable.</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>