doc-exports/docs/ims/api-ref/en-us_topic_0049147856.html
Zaoxu, Li c236478734 IMS API DOC
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>
2024-06-05 07:22:50 +00:00

187 lines
17 KiB
HTML

<a name="EN-US_TOPIC_0049147856"></a><a name="EN-US_TOPIC_0049147856"></a>
<h1 class="topictitle1">Replicating an Image Within a Region</h1>
<div id="body1487557997659"><div class="section" id="EN-US_TOPIC_0049147856__section57853128105524"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0049147856__p55591821105524">This API is an extension one and is used to copy an existing image to another image. When replicating an image, you can change the image attributes to meet the requirements of different scenarios.</p>
<p id="EN-US_TOPIC_0049147856__p7229911386">This API is an asynchronous one. If <strong id="EN-US_TOPIC_0049147856__b151411637415">job_id</strong> is returned, the task is successfully delivered. You need to query the status of the asynchronous task. If the status is <strong id="EN-US_TOPIC_0049147856__b41423376118">success</strong>, the task is successfully executed. If the status is <strong id="EN-US_TOPIC_0049147856__b181429370117">failed</strong>, the task fails. For details about how to query the status of an asynchronous task, see <a href="en-us_topic_0022473688.html">Querying the Status of an Asynchronous Job</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0049147856__section183915210102"><h4 class="sectiontitle">Constraints</h4><ul id="EN-US_TOPIC_0049147856__en-us_topic_0049177180_ul387552164812"><li id="EN-US_TOPIC_0049147856__en-us_topic_0049177180_li31741057174710">Full-ECS images cannot be replicated.</li><li id="EN-US_TOPIC_0049147856__en-us_topic_0049177180_li2087572113481">Private images created using ISO files do not support in-region replication.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0049147856__section30564347105524"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0049147856__p11400993105524">POST /v1/cloudimages/{image_id}/copy</p>
<div class="p" id="EN-US_TOPIC_0049147856__p3737171414421"><a href="#EN-US_TOPIC_0049147856__table51065259105524">Table 1</a> lists the parameters in the URI.
<div class="tablenoborder"><a name="EN-US_TOPIC_0049147856__table51065259105524"></a><a name="table51065259105524"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0049147856__table51065259105524" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0049147856__row36742558105524"><th align="left" class="cellrowborder" valign="top" width="19.388061193880613%" id="mcps1.3.3.3.2.2.5.1.1"><p id="EN-US_TOPIC_0049147856__p23357191105524">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.007999200079993%" id="mcps1.3.3.3.2.2.5.1.2"><p id="EN-US_TOPIC_0049147856__p12884280105524">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.087991200879912%" id="mcps1.3.3.3.2.2.5.1.3"><p id="EN-US_TOPIC_0049147856__p36993754105524">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40.515948405159484%" id="mcps1.3.3.3.2.2.5.1.4"><p id="EN-US_TOPIC_0049147856__p43704084105524">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0049147856__row50369935105524"><td class="cellrowborder" valign="top" width="19.388061193880613%" headers="mcps1.3.3.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0049147856__p53432947105524">image_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.007999200079993%" headers="mcps1.3.3.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0049147856__p33101414105524">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20.087991200879912%" headers="mcps1.3.3.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0049147856__p63968915105524">String</p>
</td>
<td class="cellrowborder" valign="top" width="40.515948405159484%" headers="mcps1.3.3.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0049147856__p14099616105524">Specifies the image ID.</p>
<p id="EN-US_TOPIC_0049147856__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_0049147856__section1218229105524"><h4 class="sectiontitle">Request</h4><ul id="EN-US_TOPIC_0049147856__ul31567739105524"><li id="EN-US_TOPIC_0049147856__li15674200105524">Request parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0049147856__table6850073105524" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0049147856__row3268825105524"><th align="left" class="cellrowborder" valign="top" width="26.26%" id="mcps1.3.4.2.1.1.1.5.1.1"><p id="EN-US_TOPIC_0049147856__p63448301105524">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.43%" id="mcps1.3.4.2.1.1.1.5.1.2"><p id="EN-US_TOPIC_0049147856__p39038757105524">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.97%" id="mcps1.3.4.2.1.1.1.5.1.3"><p id="EN-US_TOPIC_0049147856__p8022762105524">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="34.339999999999996%" id="mcps1.3.4.2.1.1.1.5.1.4"><p id="EN-US_TOPIC_0049147856__p45863971105524">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0049147856__row23994169105524"><td class="cellrowborder" valign="top" width="26.26%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0049147856__p64479507105524">name</p>
</td>
<td class="cellrowborder" valign="top" width="19.43%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0049147856__p55457561105524">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.97%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0049147856__p62877493105524">String</p>
</td>
<td class="cellrowborder" valign="top" width="34.339999999999996%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0049147856__p34441981163338">Specifies the image name. For detailed description, see <a href="en-us_topic_0020091562.html#EN-US_TOPIC_0020091562__section61598810155254">Image Attributes</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0049147856__row2338354105524"><td class="cellrowborder" valign="top" width="26.26%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0049147856__p55189008105524">description</p>
</td>
<td class="cellrowborder" valign="top" width="19.43%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0049147856__p41124638105524">No</p>
</td>
<td class="cellrowborder" valign="top" width="19.97%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0049147856__p42761348105524">String</p>
</td>
<td class="cellrowborder" valign="top" width="34.339999999999996%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0049147856__p30451415163338">Provides supplementary information about the image. For detailed description, see <a href="en-us_topic_0020091562.html#EN-US_TOPIC_0020091562__section61598810155254">Image Attributes</a>. The value contains a maximum of 1024 characters and consists of only letters and digits. Carriage returns and angle brackets (&lt; &gt;) are not allowed. This parameter is left blank by default.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0049147856__row34510150105524"><td class="cellrowborder" valign="top" width="26.26%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0049147856__p43858769105524">cmk_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.43%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0049147856__p62899376105524">No</p>
</td>
<td class="cellrowborder" valign="top" width="19.97%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0049147856__p61684684105524">String</p>
</td>
<td class="cellrowborder" valign="top" width="34.339999999999996%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0049147856__p30403468105524">Specifies the encryption key. This parameter is left blank by default.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0049147856__row25391820153217"><td class="cellrowborder" valign="top" width="26.26%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0049147856__p1930422213328">enterprise_project_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.43%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0049147856__p143046221323">No</p>
</td>
<td class="cellrowborder" valign="top" width="19.97%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0049147856__p9304202215329">String</p>
</td>
<td class="cellrowborder" valign="top" width="34.339999999999996%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0049147856__p10305182217584">Specifies the enterprise project that the image belongs to.</p>
<ul id="EN-US_TOPIC_0049147856__ul444316189359"><li id="EN-US_TOPIC_0049147856__en-us_topic_0133188204_li06911382318">If the value is <strong id="EN-US_TOPIC_0049147856__en-us_topic_0133188204_b842352706111949">0</strong> or left blank, the image belongs to the default enterprise project.</li><li id="EN-US_TOPIC_0049147856__en-us_topic_0133188204_li186911342317">If the value is a UUID, the image belongs to the enterprise project corresponding to the UUID.<p id="EN-US_TOPIC_0049147856__en-us_topic_0133188204_p13705743174014"><a name="EN-US_TOPIC_0049147856__en-us_topic_0133188204_li186911342317"></a><a name="en-us_topic_0133188204_li186911342317"></a>For more information about enterprise projects and how to obtain enterprise project IDs, see <em id="EN-US_TOPIC_0049147856__en-us_topic_0133188204_i119223321415">Enterprise Management User Guide</em>.</p>
</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0049147856__section382020291976"><h4 class="sectiontitle">Example Request</h4><p id="EN-US_TOPIC_0049147856__p8143082919">Replicating an image (name: ims_encrypted_copy3) within a region</p>
<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0049147856__screen14253317814"><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/465076de-dc36-4aec-80f5-ef9d8009428f/copy</span>
<span class="p">{</span>
<span class="w"> </span><span class="s">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;ims_encrypted_copy3&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;description&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;test copy&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;cmk_id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;bd66288c-9081-460a-8227-4cbd0c814cb4&quot;</span>
<span class="p">}</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0049147856__section32485736105524"><h4 class="sectiontitle">Response</h4><ul id="EN-US_TOPIC_0049147856__ul14098923105524"><li id="EN-US_TOPIC_0049147856__li59781451105524">Response parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0049147856__table1162152105524" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0049147856__row45730117105524"><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_0049147856__p13151974105524">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_0049147856__p55216927105524">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_0049147856__p43386118105524">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0049147856__row24614698105524"><td class="cellrowborder" valign="top" width="30.486951304869514%" headers="mcps1.3.6.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0049147856__p47633522105524">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_0049147856__p64671376105524">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_0049147856__p3890102105524">Specifies the asynchronous job ID.</p>
<p id="EN-US_TOPIC_0049147856__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_0049147856__li17312162105524">Example response<pre class="codeblock" id="EN-US_TOPIC_0049147856__codeblock6641838292551">STATUS CODE 200</pre>
<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0049147856__screen21591734105524"><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">&quot;job_id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;edc89b490d7d4392898e19b2deb34797&quot;</span>
<span class="p">}</span>
</pre></div></td></tr></table></div>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0049147856__section40084941"><h4 class="sectiontitle">Returned Values</h4><ul id="EN-US_TOPIC_0049147856__ul4445458"><li id="EN-US_TOPIC_0049147856__li40009126">Normal<p id="EN-US_TOPIC_0049147856__p24537816"><a name="EN-US_TOPIC_0049147856__li40009126"></a><a name="li40009126"></a>200</p>
</li><li id="EN-US_TOPIC_0049147856__li19513753">Abnormal
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0049147856__table1069408417333" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0049147856__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_0049147856__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_0049147856__p2947196917333">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0049147856__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_0049147856__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_0049147856__p784206117333">Request error. For details, see <a href="en-us_topic_0022473689.html">Error Codes</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0049147856__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_0049147856__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_0049147856__p6560116717333">Authentication failed.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0049147856__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_0049147856__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_0049147856__p2546341217333">You do not have the rights to perform the operation.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0049147856__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_0049147856__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_0049147856__p28960832192252">The requested resource was not found.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0049147856__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_0049147856__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_0049147856__p1497458717333">Internal service error.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0049147856__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_0049147856__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_0049147856__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_0049147855.html">Image Replication</a></div>
</div>
</div>