forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: guoyanyan <guoyanyan3@huawei.com> Co-committed-by: guoyanyan <guoyanyan3@huawei.com>
31 lines
4.1 KiB
HTML
31 lines
4.1 KiB
HTML
<a name="EN-US_TOPIC_0110300595"></a><a name="EN-US_TOPIC_0110300595"></a>
|
|
|
|
<h1 class="topictitle1">Querying Tenants</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0110300595__en-us_topic_0110299941_section16689200"><h4 class="sectiontitle">Scenario</h4><p class="MsoNormal" id="EN-US_TOPIC_0110300595__en-us_topic_0110299941_p17300225">Tenants with whom you have shared an image can be filtered using search criteria and displayed in a list.</p>
|
|
<div class="note" id="EN-US_TOPIC_0110300595__note021013252910"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0110300595__en-us_topic_0109822404_p88501497167">The token obtained from IAM is valid for only 24 hours. If you want to use a token for authentication, you can cache it to avoid frequently calling the IAM API.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0110300595__en-us_topic_0110299941_section15985080"><h4 class="sectiontitle">Involved APIs</h4><p class="litext" id="EN-US_TOPIC_0110300595__p23385131">If you use a token for authentication, you must obtain the token and add <strong id="EN-US_TOPIC_0110300595__en-us_topic_0109822381_b842352706134841">X-Auth-Token</strong> to the request header of the IMS API when making an API call.</p>
|
|
<ul id="EN-US_TOPIC_0110300595__ul1840113419200"><li id="EN-US_TOPIC_0110300595__li6754315">IAM API used to obtain the token<p id="EN-US_TOPIC_0110300595__en-us_topic_0109822381_p1833933634"><a name="EN-US_TOPIC_0110300595__li6754315"></a><a name="li6754315"></a>URI format: POST https://<em id="EN-US_TOPIC_0110300595__en-us_topic_0109822381_i15500165112426">IAM endpoint</em>/v3/auth/tokens</p>
|
|
</li><li id="EN-US_TOPIC_0110300595__en-us_topic_0110299941_li35559222">IMS API used to query image members (Native OpenStack API)<p id="EN-US_TOPIC_0110300595__p141574355489"><a name="EN-US_TOPIC_0110300595__en-us_topic_0110299941_li35559222"></a><a name="en-us_topic_0110299941_li35559222"></a>URI format: GET https://<em id="EN-US_TOPIC_0110300595__i139991716542">IMS endpoint</em>/v2/images/<em id="EN-US_TOPIC_0110300595__i10317344">Image ID</em>/members</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0110300595__en-us_topic_0110299941_section9647994"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0110300595__en-us_topic_0110299941_ol61724767"><li id="EN-US_TOPIC_0110300595__li1837051910476">Obtain the token.</li><li id="EN-US_TOPIC_0110300595__en-us_topic_0110299941_li57311924">Send <strong id="EN-US_TOPIC_0110300595__b202761056945">GET https://</strong><em id="EN-US_TOPIC_0110300595__i1031564919411">IMS endpoint</em><strong id="EN-US_TOPIC_0110300595__b898616521748">/v2/images/</strong><em id="EN-US_TOPIC_0110300595__i842352697172926">Image ID</em><strong id="EN-US_TOPIC_0110300595__b1034289154172917">/members/</strong>.</li><li id="EN-US_TOPIC_0110300595__en-us_topic_0110299941_li46045275">Add <strong id="EN-US_TOPIC_0110300595__b84235270615255">X-Auth-Token</strong> to the request header.</li><li id="EN-US_TOPIC_0110300595__en-us_topic_0110299941_li11754296">Check the response parameters.<pre class="screen" id="EN-US_TOPIC_0110300595__screen730511578205">{
|
|
"status": "accepted", //Sharing status (value: <strong id="EN-US_TOPIC_0110300595__b86911026241">accepted</strong> or <strong id="EN-US_TOPIC_0110300595__b1069722152410">rejected</strong>)
|
|
"created_at": "2016-09-01T02:05:14Z", //Time when the image is shared
|
|
"updated_at": "2016-09-01T02:37:11Z", //Time when the image status is updated
|
|
"image_id": "d164b5df-1bc3-4c3f-893e-3e471fd16e64", //Image ID
|
|
"member_id": "edc89b490d7d4392898e19b2deb34797" //Member ID (that is, project ID of the image recipient)
|
|
"schema": "/v2/schemas/member" //Image sharing schema
|
|
}</pre>
|
|
<p id="EN-US_TOPIC_0110300595__p103872115382">For details about status codes for request errors, see <a href="en-us_topic_0124290300.html">Status Codes</a>.</p>
|
|
</li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0110300591.html">Sharing an Image</a></div>
|
|
</div>
|
|
</div>
|
|
|