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>
33 lines
4.3 KiB
HTML
33 lines
4.3 KiB
HTML
<a name="EN-US_TOPIC_0110300598"></a><a name="EN-US_TOPIC_0110300598"></a>
|
|
|
|
<h1 class="topictitle1">Updating the Image Sharing Status in Batches</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0110300598__en-us_topic_0110299945_section65045669"><h4 class="sectiontitle">Scenario</h4><p class="MsoNormal" id="EN-US_TOPIC_0110300598__en-us_topic_0110299945_p26965262">The image sharing status can be updated in batches after a tenant accepts or rejects multiple shared images. The API used is an extension API.</p>
|
|
<div class="note" id="EN-US_TOPIC_0110300598__note021013252910"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0110300598__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_0110300598__en-us_topic_0110299945_section48540109"><h4 class="sectiontitle">Involved APIs</h4><p class="litext" id="EN-US_TOPIC_0110300598__p23385131">If you use a token for authentication, you must obtain the token and add <strong id="EN-US_TOPIC_0110300598__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_0110300598__ul1840113419200"><li id="EN-US_TOPIC_0110300598__li6754315">IAM API used to obtain the token<p id="EN-US_TOPIC_0110300598__en-us_topic_0109822381_p1833933634"><a name="EN-US_TOPIC_0110300598__li6754315"></a><a name="li6754315"></a>URI format: POST https://<em id="EN-US_TOPIC_0110300598__en-us_topic_0109822381_i15500165112426">IAM endpoint</em>/v3/auth/tokens</p>
|
|
</li><li id="EN-US_TOPIC_0110300598__en-us_topic_0110299945_li64754634">IMS API used to update the image sharing status in batches<p id="EN-US_TOPIC_0110300598__p18994441155517"><a name="EN-US_TOPIC_0110300598__en-us_topic_0110299945_li64754634"></a><a name="en-us_topic_0110299945_li64754634"></a>URI format: PUT https://<em id="EN-US_TOPIC_0110300598__i1706164201117">IMS endpoint</em>/v1/cloudimages/members</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0110300598__en-us_topic_0110299945_section34207804"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0110300598__en-us_topic_0110299945_ol10634019"><li id="EN-US_TOPIC_0110300598__li1837051910476">Obtain the token.</li><li id="EN-US_TOPIC_0110300598__en-us_topic_0110299945_li43129175">Send <strong id="EN-US_TOPIC_0110300598__b5545201091210">PUT https://</strong><em id="EN-US_TOPIC_0110300598__i12744155931118">IMS endpoint</em><strong id="EN-US_TOPIC_0110300598__b13945111371210">/v1/cloudimages/members</strong>.</li><li id="EN-US_TOPIC_0110300598__en-us_topic_0110299945_li52618256">Add <strong id="EN-US_TOPIC_0110300598__b84235270615255">X-Auth-Token</strong> to the request header.</li><li id="EN-US_TOPIC_0110300598__en-us_topic_0110299945_li3802258">Configure the request parameters. (The values are examples only.)<pre class="screen" id="EN-US_TOPIC_0110300598__screen1145614516236">{
|
|
"images": [
|
|
"d164b5df-1bc3-4c3f-893e-3e471fd16e64",
|
|
"0b680482-acaa-4045-b14c-9a8c7dfe9c70"
|
|
], //Image IDs (mandatory, list<string>)
|
|
"project_id": "edc89b490d7d4392898e19b2deb34797", //Project IDs (mandatory, string)
|
|
"status": "accepted" //Image sharing status which can be <strong id="EN-US_TOPIC_0110300598__b16267438121616">accepted</strong> or <strong id="EN-US_TOPIC_0110300598__b17789154111613">rejected</strong> (mandatory, string)
|
|
}</pre>
|
|
<p id="EN-US_TOPIC_0110300598__p1432212256584">If the request is successful, a job ID is returned.</p>
|
|
</li><li id="EN-US_TOPIC_0110300598__li514842411357">Query job details using the job ID by referring to <a href="en-us_topic_0109822371.html">Querying Job Details</a>.<p id="EN-US_TOPIC_0110300598__p411722533511">If the job status is <strong id="EN-US_TOPIC_0110300598__b8423527061586">SUCCESS</strong>, the private image is successfully created.</p>
|
|
<p id="EN-US_TOPIC_0110300598__p96422825818">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>
|
|
|