Files
doc-exports/docs/ims/dev/en-us_topic_0109822404.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

24 lines
3.5 KiB
HTML

<a name="EN-US_TOPIC_0109822404"></a><a name="EN-US_TOPIC_0109822404"></a>
<h1 class="topictitle1">Queries Details About an Image</h1>
<div id="body30066318"><div class="section" id="EN-US_TOPIC_0109822404__section29247490"><h4 class="sectiontitle">Scenario</h4><p id="EN-US_TOPIC_0109822404__p1811773673820">Details about a private or public image can be queried.</p>
<div class="note" id="EN-US_TOPIC_0109822404__note3850899166"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="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_0109822404__section20236457"><h4 class="sectiontitle">Involved APIs</h4><p class="litext" id="EN-US_TOPIC_0109822404__p23385131">If you use a token for authentication, you must obtain the token and add <strong id="EN-US_TOPIC_0109822404__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_0109822404__ul1840113419200"><li id="EN-US_TOPIC_0109822404__li6754315">IAM API used to obtain the token<p id="EN-US_TOPIC_0109822404__en-us_topic_0109822381_p1833933634"><a name="EN-US_TOPIC_0109822404__li6754315"></a><a name="li6754315"></a>URI format: POST https://<em id="EN-US_TOPIC_0109822404__en-us_topic_0109822381_i15500165112426">IAM endpoint</em>/v3/auth/tokens</p>
</li><li id="EN-US_TOPIC_0109822404__li59230505">IMS API used to query image details (Native OpenStack API)<p id="EN-US_TOPIC_0109822404__p1353604793016"><a name="EN-US_TOPIC_0109822404__li59230505"></a><a name="li59230505"></a>URI format: GET https://<em id="EN-US_TOPIC_0109822404__i17682131714510">IMS endpoint</em>/v2/images/<em id="EN-US_TOPIC_0109822404__i153793361757">Image ID</em></p>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0109822404__section47910391"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0109822404__ol1897794143816"><li id="EN-US_TOPIC_0109822404__li1837051910476">Obtain the token.</li><li id="EN-US_TOPIC_0109822404__li11801239392">Send <strong id="EN-US_TOPIC_0109822404__b13671133413619">GET https://</strong><em id="EN-US_TOPIC_0109822404__i0779014066">IMS endpoint</em><strong id="EN-US_TOPIC_0109822404__b980919390613">/v2/images/</strong><em id="EN-US_TOPIC_0109822404__i199142312617">Image ID</em>.</li><li class="msonormal" id="EN-US_TOPIC_0109822404__li11180123143915">Add <strong id="EN-US_TOPIC_0109822404__b84235270615255">X-Auth-Token</strong> to the request header.<p class="msonormal" id="EN-US_TOPIC_0109822404__p9248124021917">An example request is as follows: https://<em id="EN-US_TOPIC_0109822404__i25732078715">IMS endpoint</em>/v2/images/33ad552d-1149-471c-8190-ff6776174a00.</p>
</li><li class="msonormal" id="EN-US_TOPIC_0109822404__li111803343910">Refer to "Querying Image Details (Native OpenStack API)" in <em id="EN-US_TOPIC_0109822404__i54213259810">Image Management Service API Reference</em> for parameter descriptions and response details.<p id="EN-US_TOPIC_0109822404__p82771181316">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_0219492328.html">Common Scenarios</a></div>
</div>
</div>