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>
34 lines
4.7 KiB
HTML
34 lines
4.7 KiB
HTML
<a name="EN-US_TOPIC_0110300593"></a><a name="EN-US_TOPIC_0110300593"></a>
|
|
|
|
<h1 class="topictitle1">Updating the Image Sharing Status</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0110300593__en-us_topic_0110299939_section13251620"><h4 class="sectiontitle">Scenario</h4><p class="MsoNormal" id="EN-US_TOPIC_0110300593__en-us_topic_0110299939_p49639248">The status of a shared image can be updated after the tenant accepts or rejects the image.</p>
|
|
<div class="note" id="EN-US_TOPIC_0110300593__note021013252910"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0110300593__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_0110300593__en-us_topic_0110299939_section52155720"><h4 class="sectiontitle">Involved APIs</h4><p class="litext" id="EN-US_TOPIC_0110300593__p23385131">If you use a token for authentication, you must obtain the token and add <strong id="EN-US_TOPIC_0110300593__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_0110300593__ul1840113419200"><li id="EN-US_TOPIC_0110300593__li6754315">IAM API used to obtain the token<p id="EN-US_TOPIC_0110300593__en-us_topic_0109822381_p1833933634"><a name="EN-US_TOPIC_0110300593__li6754315"></a><a name="li6754315"></a>URI format: POST https://<em id="EN-US_TOPIC_0110300593__en-us_topic_0109822381_i15500165112426">IAM endpoint</em>/v3/auth/tokens</p>
|
|
</li><li id="EN-US_TOPIC_0110300593__en-us_topic_0110299939_li45123001">IMS API used to update the image sharing status (Native OpenStack API)<p id="EN-US_TOPIC_0110300593__p690704244611"><a name="EN-US_TOPIC_0110300593__en-us_topic_0110299939_li45123001"></a><a name="en-us_topic_0110299939_li45123001"></a>URI format: PUT https://<em id="EN-US_TOPIC_0110300593__i1375972285416">IMS endpoint</em>/v2/images/<em id="EN-US_TOPIC_0110300593__i276018223541">Image ID</em>/members/<em id="EN-US_TOPIC_0110300593__i20300350165410">Member ID</em></p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0110300593__en-us_topic_0110299939_section66748299"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0110300593__en-us_topic_0110299939_ol31084503"><li id="EN-US_TOPIC_0110300593__li1837051910476">Obtain the token.</li><li id="EN-US_TOPIC_0110300593__en-us_topic_0110299939_li51228725">Send <strong id="EN-US_TOPIC_0110300593__b842352706162610">PUT https://</strong><em id="EN-US_TOPIC_0110300593__i842352697162616">IMS endpoint</em><strong id="EN-US_TOPIC_0110300593__b842352706162621">/v2/images/</strong><em id="EN-US_TOPIC_0110300593__i842352697162648">Image ID</em><strong id="EN-US_TOPIC_0110300593__b1269673461162643">/members/</strong><em id="EN-US_TOPIC_0110300593__i842352697162629">Member ID</em>. <em id="EN-US_TOPIC_0110300593__i842352697162714">Member ID</em> indicates the project ID of the image recipient.</li><li id="EN-US_TOPIC_0110300593__en-us_topic_0110299939_li58405349">Add <strong id="EN-US_TOPIC_0110300593__b84235270615255">X-Auth-Token</strong> to the request header.</li><li id="EN-US_TOPIC_0110300593__en-us_topic_0110299939_li55886094">Specify the following parameters in the request body:<pre class="screen" id="EN-US_TOPIC_0110300593__screen15328184114189">{
|
|
"status": "accepted" //Value: <strong id="EN-US_TOPIC_0110300593__b1747601621514">accepted</strong> or <strong id="EN-US_TOPIC_0110300593__b0670121921512">rejected</strong>
|
|
}</pre>
|
|
</li><li id="EN-US_TOPIC_0110300593__en-us_topic_0110299939_li52942405">Check the response parameters.<pre class="screen" id="EN-US_TOPIC_0110300593__screen18984175161815">{
|
|
"status": "accepted", //Sharing status (value: <strong id="EN-US_TOPIC_0110300593__b18295134012320">accepted</strong> or <strong id="EN-US_TOPIC_0110300593__b13828174412317">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_0110300593__p104514441366">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>
|
|
|