Files
doc-exports/docs/ims/dev/en-us_topic_0110300594.html
guoyanyan b3547b53d8 ims_dev_1109
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: guoyanyan <guoyanyan3@huawei.com>
Co-committed-by: guoyanyan <guoyanyan3@huawei.com>
2022-11-16 09:00:55 +00:00

31 lines
4.3 KiB
HTML

<a name="EN-US_TOPIC_0110300594"></a><a name="EN-US_TOPIC_0110300594"></a>
<h1 class="topictitle1">Querying Details About an Image Member</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0110300594__en-us_topic_0110299940_section29135036"><h4 class="sectiontitle">Scenario</h4><p class="MsoNormal" id="EN-US_TOPIC_0110300594__en-us_topic_0110299940_p19372405">Details about a tenant with whom you have shared images can be queried.</p>
<div class="note" id="EN-US_TOPIC_0110300594__note021013252910"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0110300594__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_0110300594__en-us_topic_0110299940_section60888739"><h4 class="sectiontitle">Involved APIs</h4><p class="litext" id="EN-US_TOPIC_0110300594__p23385131">If you use a token for authentication, you must obtain the token and add <strong id="EN-US_TOPIC_0110300594__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_0110300594__ul1840113419200"><li id="EN-US_TOPIC_0110300594__li6754315">IAM API used to obtain the token<p id="EN-US_TOPIC_0110300594__en-us_topic_0109822381_p1833933634"><a name="EN-US_TOPIC_0110300594__li6754315"></a><a name="li6754315"></a>URI format: POST https://<em id="EN-US_TOPIC_0110300594__en-us_topic_0109822381_i15500165112426">IAM endpoint</em>/v3/auth/tokens</p>
</li><li id="EN-US_TOPIC_0110300594__en-us_topic_0110299940_li43556055">IMS API used to query details about an image member (Native OpenStack API)<p id="EN-US_TOPIC_0110300594__p651112574719"><a name="EN-US_TOPIC_0110300594__en-us_topic_0110299940_li43556055"></a><a name="en-us_topic_0110299940_li43556055"></a>URI format: GET https://<em id="EN-US_TOPIC_0110300594__i2043712288113">IMS endpoint</em>/v2/images/<em id="EN-US_TOPIC_0110300594__i84384281918">Image ID</em>/members/<em id="EN-US_TOPIC_0110300594__i174388282116">Member ID</em></p>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0110300594__en-us_topic_0110299940_section11127745"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0110300594__en-us_topic_0110299940_ol38379555"><li id="EN-US_TOPIC_0110300594__li1837051910476">Obtain the token.</li><li id="EN-US_TOPIC_0110300594__en-us_topic_0110299940_li43938279">Send <strong id="EN-US_TOPIC_0110300594__b842352706163157">GET https://</strong><em id="EN-US_TOPIC_0110300594__i84235269716322">IMS endpoint</em><strong id="EN-US_TOPIC_0110300594__b84235270616329">/v2/images/</strong><em id="EN-US_TOPIC_0110300594__i928543420163218">Image ID</em><strong id="EN-US_TOPIC_0110300594__b842352706163227">/members/</strong><em id="EN-US_TOPIC_0110300594__i842352697163231">Member ID</em>. <em id="EN-US_TOPIC_0110300594__i84235269716330">Member ID</em> indicates the project ID of the image recipient.</li><li id="EN-US_TOPIC_0110300594__en-us_topic_0110299940_li59900193">Add <strong id="EN-US_TOPIC_0110300594__b84235270615255">X-Auth-Token</strong> to the request header.</li><li id="EN-US_TOPIC_0110300594__en-us_topic_0110299940_li2230829">Check the response parameters.<pre class="screen" id="EN-US_TOPIC_0110300594__screen5688104616197">{
"status": "accepted", //Sharing status (value: <strong id="EN-US_TOPIC_0110300594__b1299105762317">accepted</strong> or <strong id="EN-US_TOPIC_0110300594__b1799257182312">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_0110300594__p10445182563713">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>