forked from docs/doc-exports
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com> Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com> Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
181 lines
16 KiB
HTML
181 lines
16 KiB
HTML
<a name="EN-US_TOPIC_0036994315"></a><a name="EN-US_TOPIC_0036994315"></a>
|
|
|
|
<h1 class="topictitle1">Exporting an Image</h1>
|
|
<div id="body1472781317544"><div class="section" id="EN-US_TOPIC_0036994315__section11046056154747"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0036994315__p5801968895613">This is an extension API and used to export a private image to an OBS bucket.</p>
|
|
<div class="note" id="EN-US_TOPIC_0036994315__note666119145185"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0036994315__p26613144183">Before exporting an image, ensure that you have the Tenant Administrator permission for OBS.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0036994315__section921963105411"><h4 class="sectiontitle">Constraints</h4><ul id="EN-US_TOPIC_0036994315__en-us_topic_0034011241_ul3544255069"><li id="EN-US_TOPIC_0036994315__en-us_topic_0034011241_li16677912155520">An image can only be exported to a Standard bucket that is in the same region as the image.</li><li id="EN-US_TOPIC_0036994315__en-us_topic_0034011241_li1754519555613">The following private images cannot be exported:<ul id="EN-US_TOPIC_0036994315__en-us_topic_0034011241_ul3991132155017"><li id="EN-US_TOPIC_0036994315__en-us_topic_0034011241_li19476191413112">Full-ECS images</li><li id="EN-US_TOPIC_0036994315__en-us_topic_0034011241_li181721313173017">ISO images</li><li id="EN-US_TOPIC_0036994315__en-us_topic_0034011241_li4006317915441"><span id="EN-US_TOPIC_0036994315__en-us_topic_0034011241_ph112785316171">Private images created from a Windows, SUSE, Red Hat, Ubuntu, or Oracle Linux public image</span></li></ul>
|
|
</li><li id="EN-US_TOPIC_0036994315__en-us_topic_0034011241_li5325121314326">The image size must be less than 1 TB. Images larger than 128 GB support only fast export.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0036994315__section66620681154747"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0036994315__p1631075693910">POST /v1/cloudimages/{image_id}/file</p>
|
|
<div class="p" id="EN-US_TOPIC_0036994315__p229017303119"><a href="#EN-US_TOPIC_0036994315__table23910047154747">Table 1</a> lists the parameters in the URI.
|
|
<div class="tablenoborder"><a name="EN-US_TOPIC_0036994315__table23910047154747"></a><a name="table23910047154747"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036994315__table23910047154747" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0036994315__row24965460154747"><th align="left" class="cellrowborder" valign="top" width="19.918008199180083%" id="mcps1.3.3.3.2.2.5.1.1"><p id="EN-US_TOPIC_0036994315__p8936346154747">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="22.17778222177782%" id="mcps1.3.3.3.2.2.5.1.2"><p id="EN-US_TOPIC_0036994315__p4072498116916">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16.348365163483653%" id="mcps1.3.3.3.2.2.5.1.3"><p id="EN-US_TOPIC_0036994315__p52755425154747">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="41.55584441555845%" id="mcps1.3.3.3.2.2.5.1.4"><p id="EN-US_TOPIC_0036994315__p57477321154747">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0036994315__row25151394154747"><td class="cellrowborder" valign="top" width="19.918008199180083%" headers="mcps1.3.3.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0036994315__p23996995154747">image_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="22.17778222177782%" headers="mcps1.3.3.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0036994315__p1038913616916">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16.348365163483653%" headers="mcps1.3.3.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0036994315__p64708437154747">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.55584441555845%" headers="mcps1.3.3.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0036994315__p54354750154747">Specifies the image ID.</p>
|
|
<p id="EN-US_TOPIC_0036994315__p127065072116">For details about how to obtain the image ID, see <a href="en-us_topic_0020091565.html">Querying Images</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0036994315__section29704853154747"><h4 class="sectiontitle">Request</h4><ul id="EN-US_TOPIC_0036994315__ul48754330102731"><li id="EN-US_TOPIC_0036994315__li60272794102731">Request parameters
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036994315__table57282886154747" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0036994315__row33194661154747"><th align="left" class="cellrowborder" valign="top" width="20.200000000000003%" id="mcps1.3.4.2.1.1.1.5.1.1"><p id="EN-US_TOPIC_0036994315__p4413036154747">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="21.32%" id="mcps1.3.4.2.1.1.1.5.1.2"><p id="EN-US_TOPIC_0036994315__p15244109154747">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.01%" id="mcps1.3.4.2.1.1.1.5.1.3"><p id="EN-US_TOPIC_0036994315__p4364817210345">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="41.47%" id="mcps1.3.4.2.1.1.1.5.1.4"><p id="EN-US_TOPIC_0036994315__p26813302154747">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0036994315__row24393852154747"><td class="cellrowborder" valign="top" width="20.200000000000003%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0036994315__p5109612910120">bucket_url</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.32%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0036994315__p4514577610120">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.01%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0036994315__p3292926410120">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.47%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0036994315__p5002474510120">Specifies the URL of the image file in the format of <em id="EN-US_TOPIC_0036994315__i84235269795256">Bucket name</em>:<em id="EN-US_TOPIC_0036994315__i84235269795259">File name</em>.</p>
|
|
<div class="note" id="EN-US_TOPIC_0036994315__note5552125083518"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="EN-US_TOPIC_0036994315__p1555325043517">The storage class of the OBS bucket must be <strong id="EN-US_TOPIC_0036994315__b191162313017">Standard</strong>.</p>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0036994315__row835962711950"><td class="cellrowborder" valign="top" width="20.200000000000003%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0036994315__p604120411950">file_format</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.32%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0036994315__p1957548511950">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.01%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0036994315__p4211041411950">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.47%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0036994315__p5550036811950">Specifies the file format. The value can be <strong id="EN-US_TOPIC_0036994315__b842352706101048">qcow2</strong>, <strong id="EN-US_TOPIC_0036994315__b842352706101053">vhd</strong>, <strong id="EN-US_TOPIC_0036994315__b842352706101056">zvhd</strong>, or <strong id="EN-US_TOPIC_0036994315__b84235270610111">vmdk</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0036994315__row724516813520"><td class="cellrowborder" valign="top" width="20.200000000000003%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0036994315__p42465815358">is_quick_export</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="21.32%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0036994315__p92468810356">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.01%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0036994315__p4246168163515">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.47%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0036994315__p1624688153517">Whether to enable fast export. The value can be <strong id="EN-US_TOPIC_0036994315__b1437361018476">true</strong> or <strong id="EN-US_TOPIC_0036994315__b499514112478">false</strong>.</p>
|
|
<div class="note" id="EN-US_TOPIC_0036994315__note10129165413356"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="EN-US_TOPIC_0036994315__p11129195493511">If fast export is enabled, <strong id="EN-US_TOPIC_0036994315__b72428298441">file_format</strong> cannot be specified. The exported image file is in the ZVHD2 format.</p>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0036994315__section95966353537"><h4 class="sectiontitle">Example Request</h4><div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0036994315__screen151291214153918"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">POST</span><span class="w"> </span><span class="n">https</span><span class="p">:</span><span class="c1">//{Endpoint}/v1/cloudimages/d164b5df-1bc3-4c3f-893e-3e471fd16e64/file</span>
|
|
<span class="p">{</span>
|
|
<span class="w"> </span><span class="s">"bucket_url"</span><span class="p">:</span><span class="w"> </span><span class="s">"ims-image:centos7_5.qcow2"</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s">"file_format"</span><span class="p">:</span><span class="w"> </span><span class="s">"qcow2"</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="s">"is_quick_export"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span>
|
|
<span class="p">}</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0036994315__section42338041154747"><h4 class="sectiontitle">Response</h4><ul id="EN-US_TOPIC_0036994315__ul2321569510447"><li id="EN-US_TOPIC_0036994315__li761467110447">Response parameters
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036994315__table142317910447" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0036994315__row3520294810447"><th align="left" class="cellrowborder" valign="top" width="30.486951304869514%" id="mcps1.3.6.2.1.1.1.4.1.1"><p id="EN-US_TOPIC_0036994315__p3286650610447">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.078292170782923%" id="mcps1.3.6.2.1.1.1.4.1.2"><p id="EN-US_TOPIC_0036994315__p1636902410447">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="52.434756524347556%" id="mcps1.3.6.2.1.1.1.4.1.3"><p id="EN-US_TOPIC_0036994315__p5082259210447">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0036994315__row2298930510447"><td class="cellrowborder" valign="top" width="30.486951304869514%" headers="mcps1.3.6.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0036994315__p5019438610447">job_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.078292170782923%" headers="mcps1.3.6.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0036994315__p2217101310447">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="52.434756524347556%" headers="mcps1.3.6.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0036994315__p5102161510447">Specifies the asynchronous job ID.</p>
|
|
<p id="EN-US_TOPIC_0036994315__p19968122117312">For details, see <a href="en-us_topic_0022473688.html">Querying the Status of an Asynchronous Job</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0036994315__li15938806104956">Example response<pre class="codeblock" id="EN-US_TOPIC_0036994315__codeblock18899654104956">STATUS CODE 200</pre>
|
|
<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0036994315__screen35879165104956"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><span class="p">{</span>
|
|
<span class="w"> </span><span class="s">"job_id"</span><span class="p">:</span><span class="w"> </span><span class="s">"edc89b490d7d4392898e19b2deb34797"</span>
|
|
<span class="p">}</span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0036994315__section40084941"><h4 class="sectiontitle">Returned Values</h4><ul id="EN-US_TOPIC_0036994315__ul4445458"><li id="EN-US_TOPIC_0036994315__li40009126">Normal<p id="EN-US_TOPIC_0036994315__p24537816"><a name="EN-US_TOPIC_0036994315__li40009126"></a><a name="li40009126"></a>200</p>
|
|
</li><li id="EN-US_TOPIC_0036994315__li19513753">Abnormal
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0036994315__table1069408417333" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0036994315__row4772021317333"><th align="left" class="cellrowborder" valign="top" width="46.54%" id="mcps1.3.7.2.2.1.1.3.1.1"><p id="EN-US_TOPIC_0036994315__p4013206717333">Returned Value</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="53.459999999999994%" id="mcps1.3.7.2.2.1.1.3.1.2"><p id="EN-US_TOPIC_0036994315__p2947196917333">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0036994315__row3841925517333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994315__p2495195017333">400 Bad Request</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994315__p784206117333">Request error. For details about the returned error code, see <a href="en-us_topic_0022473689.html">Error Codes</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0036994315__row3122722917333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994315__p4637763817333">401 Unauthorized</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994315__p6560116717333">Authentication failed.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0036994315__row5353959117333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994315__p4173958717333">403 Forbidden</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994315__p2546341217333">You do not have the rights to perform the operation.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0036994315__row5197513192250"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994315__p21898657192252">404 Not Found</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994315__p28960832192252">The requested resource was not found.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0036994315__row2784412417333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994315__p4078159117333">500 Internal Server Error</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994315__p1497458717333">Internal service error.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0036994315__row55355517333"><td class="cellrowborder" valign="top" width="46.54%" headers="mcps1.3.7.2.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0036994315__p4483799017333">503 Service Unavailable</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="53.459999999999994%" headers="mcps1.3.7.2.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0036994315__p799858217333">The service is unavailable.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0135460761.html">Image</a></div>
|
|
</div>
|
|
</div>
|
|
|