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>
30 lines
4.1 KiB
HTML
30 lines
4.1 KiB
HTML
<a name="EN-US_TOPIC_0109822370"></a><a name="EN-US_TOPIC_0109822370"></a>
|
|
|
|
<h1 class="topictitle1">Replicating an Images Within a Region</h1>
|
|
<div id="body3758325"><div class="section" id="EN-US_TOPIC_0109822370__section21602115"><h4 class="sectiontitle">Scenario</h4><p id="EN-US_TOPIC_0109822370__p198331939145317">A private image can be copied within a region as another one. The API used is an extension API. When replicating an image, you can change the image attributes to meet the requirements of different scenarios.</p>
|
|
<div class="note" id="EN-US_TOPIC_0109822370__note021013252910"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0109822370__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_0109822370__section4940914"><h4 class="sectiontitle">Involved APIs</h4><p class="litext" id="EN-US_TOPIC_0109822370__p23385131">If you use a token for authentication, you must obtain the token and add <strong id="EN-US_TOPIC_0109822370__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_0109822370__ul1840113419200"><li id="EN-US_TOPIC_0109822370__li6754315">IAM API used to obtain the token<p id="EN-US_TOPIC_0109822370__en-us_topic_0109822381_p1833933634"><a name="EN-US_TOPIC_0109822370__li6754315"></a><a name="li6754315"></a>URI format: POST https://<em id="EN-US_TOPIC_0109822370__en-us_topic_0109822381_i15500165112426">IAM endpoint</em>/v3/auth/tokens</p>
|
|
</li><li id="EN-US_TOPIC_0109822370__li971443012400">IMS API used to copy an image within a region<p id="EN-US_TOPIC_0109822370__p196531432154010"><a name="EN-US_TOPIC_0109822370__li971443012400"></a><a name="li971443012400"></a>URI format: POST https://<em id="EN-US_TOPIC_0109822370__i515952213343">IMS endpoint</em>/v1/cloudimages/<em id="EN-US_TOPIC_0109822370__i8159172213342">Image ID</em>/copy</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0109822370__section44468229"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0109822370__ol1889584595318"><li id="EN-US_TOPIC_0109822370__li1837051910476">Obtain the token.</li><li id="EN-US_TOPIC_0109822370__li1639781265417">Send <strong id="EN-US_TOPIC_0109822370__b762834153511">POST https://</strong><em id="EN-US_TOPIC_0109822370__i6526621183514">IMS endpoint</em>/v1/cloudimages/<em id="EN-US_TOPIC_0109822370__i1190623653511">Image ID</em><strong id="EN-US_TOPIC_0109822370__b17385174493510">/copy</strong>.</li><li class="msonormal" id="EN-US_TOPIC_0109822370__li1839791217543">Add <strong id="EN-US_TOPIC_0109822370__b84235270615255">X-Auth-Token</strong> to the request header.</li><li class="msonormal" id="EN-US_TOPIC_0109822370__li163971612185410">Specify the following parameters in the request body:<pre class="screen" id="EN-US_TOPIC_0109822370__screen1688714170555">{
|
|
"name": "ims_encrypted_copy3", //Image name (mandatory, string)
|
|
"description": "test copy", //Image description (optional, string)
|
|
"cmk_id": "bd66288c-9081-460a-8227-4cbd0c814cb4" //Encryption key (optional, string)
|
|
}</pre>
|
|
<p class="msonormal" id="EN-US_TOPIC_0109822370__p16929557185717">If the request is successful, a job ID is returned.</p>
|
|
</li><li id="EN-US_TOPIC_0109822370__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_0109822370__p411722533511">If the job status is <strong id="EN-US_TOPIC_0109822370__b8423527061586">SUCCESS</strong>, the image is successfully replicated.</p>
|
|
<p id="EN-US_TOPIC_0109822370__p12436959135710">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>
|
|
|