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>
31 lines
4.6 KiB
HTML
31 lines
4.6 KiB
HTML
<a name="EN-US_TOPIC_0109822369"></a><a name="EN-US_TOPIC_0109822369"></a>
|
|
|
|
<h1 class="topictitle1">Exporting an Image</h1>
|
|
<div id="body55493126"><div class="section" id="EN-US_TOPIC_0109822369__section54806415"><h4 class="sectiontitle">Scenario</h4><p id="EN-US_TOPIC_0109822369__p15305721142">If you need to use a private image in a storage device or on other platforms, you can export the image.</p>
|
|
<p id="EN-US_TOPIC_0109822369__p103051821416">All available private images can be exported to an OBS bucket in a specific format. After you have exported an image, you can download it from the OBS bucket to the specified storage device.</p>
|
|
<p id="EN-US_TOPIC_0109822369__p17305721848">Images exported in different formats may vary in size. You will be charged for the space used to store these images.</p>
|
|
<div class="note" id="EN-US_TOPIC_0109822369__note1568074818297"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0109822369__ul724132118342"><li id="EN-US_TOPIC_0109822369__li14244213349">The storage class of the OBS bucket must be <strong id="EN-US_TOPIC_0109822369__b84235270695634">Standard</strong>.</li><li id="EN-US_TOPIC_0109822369__li9147183901514">The token obtained from Identity and Access Management (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.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0109822369__section10134624"><h4 class="sectiontitle">Involved APIs</h4><p class="litext" id="EN-US_TOPIC_0109822369__p23385131">If you use a token for authentication, you must obtain the token and add <strong id="EN-US_TOPIC_0109822369__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_0109822369__ul1840113419200"><li id="EN-US_TOPIC_0109822369__li6754315">IAM API used to obtain the token<p id="EN-US_TOPIC_0109822369__en-us_topic_0109822381_p1833933634"><a name="EN-US_TOPIC_0109822369__li6754315"></a><a name="li6754315"></a>URI format: POST https://<em id="EN-US_TOPIC_0109822369__en-us_topic_0109822381_i15500165112426">IAM endpoint</em>/v3/auth/tokens</p>
|
|
</li><li id="EN-US_TOPIC_0109822369__li51316583">IMS API used to export an image<p id="EN-US_TOPIC_0109822369__p587584773910"><a name="EN-US_TOPIC_0109822369__li51316583"></a><a name="li51316583"></a>URI format: POST https://<em id="EN-US_TOPIC_0109822369__i16143131922613">IMS endpoint</em>/v1/cloudimages/<em id="EN-US_TOPIC_0109822369__i161307124273">Image ID</em>/file</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0109822369__section24102752"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0109822369__ol18137125365016"><li id="EN-US_TOPIC_0109822369__li1837051910476">Obtain the token.</li><li class="msonormal" id="EN-US_TOPIC_0109822369__li2356162325111">Send <strong id="EN-US_TOPIC_0109822369__b12538102216284">POST https://</strong><em id="EN-US_TOPIC_0109822369__i281521812287">IMS endpoint</em><strong id="EN-US_TOPIC_0109822369__b1141618262282">/v1/cloudimages/</strong><em id="EN-US_TOPIC_0109822369__i834761514103348">Image ID</em><strong id="EN-US_TOPIC_0109822369__b188677664210340">/file</strong>.</li><li class="msonormal" id="EN-US_TOPIC_0109822369__li3356192315118">Add <strong id="EN-US_TOPIC_0109822369__b84235270615255">X-Auth-Token</strong> to the request header.</li><li class="msonormal" id="EN-US_TOPIC_0109822369__li173561623105116">Specify the following parameters in the request body:<pre class="screen" id="EN-US_TOPIC_0109822369__screen754824465215">{
|
|
"bucket_url":"ims-image:centos7_5.qcow2", //URL of the target file in the format of <Bucket name>:<File name> (mandatory, string)
|
|
"file_format":"qcow2" //File format, which can be qcow2, vhd, zvhd, or vmdk (mandatory, string)
|
|
}</pre>
|
|
<p class="msonormal" id="EN-US_TOPIC_0109822369__p356234915712">If the request is successful, a job ID is returned.</p>
|
|
</li><li id="EN-US_TOPIC_0109822369__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_0109822369__p411722533511">If the job status is <strong id="EN-US_TOPIC_0109822369__b8423527061586">SUCCESS</strong>, the private image is successfully created.</p>
|
|
<p id="EN-US_TOPIC_0109822369__p19843953175711">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>
|
|
|