forked from docs/doc-exports
Reviewed-by: Gladkov, Maksim <mgladkov@noreply.gitea.eco.tsi-dev.otc-service.com> Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com> Co-authored-by: weihongmin1 <weihongmin1@huawei.com> Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
142 lines
12 KiB
HTML
142 lines
12 KiB
HTML
<a name="en-us_topic_0171146929"></a><a name="en-us_topic_0171146929"></a>
|
|
|
|
<h1 class="topictitle1">Adding Resources</h1>
|
|
<div id="body1550112675023"><div class="section" id="en-us_topic_0171146929__section49195514612"><h4 class="sectiontitle">Function</h4><p id="en-us_topic_0171146929__p1638013440562">This API is used to add resources to a target enterprise project.</p>
|
|
</div>
|
|
<div class="section" id="en-us_topic_0171146929__section18168551365"><h4 class="sectiontitle">URI</h4><p id="en-us_topic_0171146929__p114871246052">POST /v1.0/enterprise-projects/{enterprise_project_id}/resources-migrate</p>
|
|
<div class="p" id="en-us_topic_0171146929__p58771146152317">
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0171146929__table11144755465" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter in the URI</caption><thead align="left"><tr id="en-us_topic_0171146929__row978613561065"><th align="left" class="cellrowborder" valign="top" width="22.189999999999998%" id="mcps1.3.2.3.1.2.5.1.1"><p id="en-us_topic_0171146929__p67861556963">Name</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20.84%" id="mcps1.3.2.3.1.2.5.1.2"><p id="en-us_topic_0171146929__p1278655617619">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25.94%" id="mcps1.3.2.3.1.2.5.1.3"><p id="en-us_topic_0171146929__p167866561561">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="31.03%" id="mcps1.3.2.3.1.2.5.1.4"><p id="en-us_topic_0171146929__p20786125616618">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="en-us_topic_0171146929__row57860566611"><td class="cellrowborder" valign="top" width="22.189999999999998%" headers="mcps1.3.2.3.1.2.5.1.1 "><p id="en-us_topic_0171146929__p127865561665">enterprise_project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.84%" headers="mcps1.3.2.3.1.2.5.1.2 "><p id="en-us_topic_0171146929__p3786156568">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25.94%" headers="mcps1.3.2.3.1.2.5.1.3 "><p id="en-us_topic_0171146929__p17868561565">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="31.03%" headers="mcps1.3.2.3.1.2.5.1.4 "><p id="en-us_topic_0171146929__p3786256661">Specifies the ID of the target enterprise project.</p>
|
|
<p id="en-us_topic_0171146929__p855322553112">You can obtain the ID by using API <a href="en-us_topic_0121230880.html">Querying the Enterprise Project List</a>.</p>
|
|
<p id="en-us_topic_0171146929__p1656025915615">If the value of <strong id="en-us_topic_0171146929__b13618182665211">enterprise_project_id</strong> is <strong id="en-us_topic_0171146929__b1151617306521">0</strong>, resources are migrated to enterprise project <strong id="en-us_topic_0171146929__b14413121012587">default</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="en-us_topic_0171146929__section1318812551669"><h4 class="sectiontitle">Request</h4><ul id="en-us_topic_0171146929__ul1578845613612"><li id="en-us_topic_0171146929__li17788556668">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0171146929__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameters in the request header</caption><thead align="left"><tr id="en-us_topic_0171146929__row727512137523"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="en-us_topic_0171146929__p027611312525">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="en-us_topic_0171146929__p1276161313529">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="en-us_topic_0171146929__p227613131524">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="en-us_topic_0171146929__p16276161375220">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="en-us_topic_0171146929__row927511319523"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="en-us_topic_0171146929__p5276191313524">X-Auth-Token</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="en-us_topic_0171146929__p1927710138522">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="en-us_topic_0171146929__p52771913115217">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="en-us_topic_0171146929__p327741315527">Specifies the user token. EPS is a global service. When calling the IAM API to obtain a user token, set <strong id="en-us_topic_0171146929__b5791711193718">scope</strong> to <strong id="en-us_topic_0171146929__b1179111123716">domain</strong>. The value of <strong id="en-us_topic_0171146929__b9388171316372">X-Subject-Token</strong> in the response header is the user token.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="en-us_topic_0171146929__row9275101314522"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="en-us_topic_0171146929__p163831551165418">Content-Type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="en-us_topic_0171146929__p938318511546">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="en-us_topic_0171146929__p8362219105513">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="en-us_topic_0171146929__p203831251205414">Default value: <strong id="en-us_topic_0171146929__b27010175338">application/json; charset=UTF-8</strong></p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0171146929__table420971011103" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameters in the request body</caption><thead align="left"><tr id="en-us_topic_0171146929__row4210151081019"><th align="left" class="cellrowborder" valign="top" width="19.869999999999997%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="en-us_topic_0171146929__p87885561165">Name</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.75%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="en-us_topic_0171146929__p778818562611">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.75%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="en-us_topic_0171146929__p97881556763">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="54.63%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="en-us_topic_0171146929__p1478813561662">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="en-us_topic_0171146929__row102108103106"><td class="cellrowborder" valign="top" width="19.869999999999997%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="en-us_topic_0171146929__p15917111012117">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.75%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="en-us_topic_0171146929__p191741017115">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.75%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="en-us_topic_0171146929__p1591791016112">string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.63%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="en-us_topic_0171146929__p348415223112">Specifies the project ID. This parameter is mandatory when <strong id="en-us_topic_0171146929__b2856744104511">resource_type</strong> is set to a region-level resource.</p>
|
|
<p id="en-us_topic_0171146929__p12917141091116">You can obtain the project ID from <a href="em_03_0909.html">Obtaining a Project ID</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="en-us_topic_0171146929__row10210111014104"><td class="cellrowborder" valign="top" width="19.869999999999997%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="en-us_topic_0171146929__p1291718106118">resource_type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.75%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="en-us_topic_0171146929__p129175108114">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.75%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="en-us_topic_0171146929__p139171810201110">string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.63%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="en-us_topic_0171146929__p679225619610">Specifies the resource type.</p>
|
|
<p id="en-us_topic_0171146929__p16677124818499">To query resource types, call the <a href="ListProviders.html">Querying Supported Services</a> API.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="en-us_topic_0171146929__row2210131091014"><td class="cellrowborder" valign="top" width="19.869999999999997%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="en-us_topic_0171146929__p6119155011614">resource_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.75%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="en-us_topic_0171146929__p3119195061611">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.75%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="en-us_topic_0171146929__p101191050131613">string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.63%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="en-us_topic_0171146929__p10640459171714">Specifies the ID of the resource to be added. The ID is provided by the cloud service of the resource. For example, if you want to add an ECS resource, query the resource type on the ECS console or by calling the ECS API.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="en-us_topic_0171146929__row126279218178"><td class="cellrowborder" valign="top" width="19.869999999999997%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="en-us_topic_0171146929__p45877821716">associated</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.75%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="en-us_topic_0171146929__p1258710821717">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.75%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="en-us_topic_0171146929__p1258715819174">boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="54.63%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="en-us_topic_0171146929__p1269615529331">Specifies whether associated resources are added too.</p>
|
|
<p id="en-us_topic_0171146929__p19587208161714">The default value is <strong id="en-us_topic_0171146929__b16431151411613">false</strong>. Currently, only ECS associated EVS disks and EIPs can be added.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="en-us_topic_0171146929__li5320201013189">Example request<pre class="codeblock" id="en-us_topic_0171146929__codeblock199222217229">POST https://{EPS endpoint}/v1.0/enterprise-projects/{enterprise_project_id}/resources-migrate</pre>
|
|
<pre class="screen" id="en-us_topic_0171146929__screen8439174172013">{
|
|
"project_id": "0f02faab61ab497997867b2c9ef193a2",
|
|
"associated": false,
|
|
"resource_type": "eip",
|
|
"resource_id": "e220166e-a6b1-4bb4-9abf-950b367212e8"
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="en-us_topic_0171146929__section5932974"><h4 class="sectiontitle">Response</h4><p id="en-us_topic_0171146929__p165182016166"><strong id="en-us_topic_0171146929__b1351515287379">Status code: 204</strong></p>
|
|
<p class="msonormal" id="en-us_topic_0171146929__p33416961">None</p>
|
|
</div>
|
|
<div class="section" id="en-us_topic_0171146929__section4531164315292"><h4 class="sectiontitle">Status Codes</h4><p id="en-us_topic_0171146929__p145228330242">For details, see <a href="en-us_topic_0171146972.html">Status Code</a>.</p>
|
|
</div>
|
|
<div class="section" id="en-us_topic_0171146929__section0396144719295"><h4 class="sectiontitle">Error Codes</h4><p id="en-us_topic_0171146929__p177044331253">For details, see <a href="en-us_topic_0121230887.html">Error Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0133321992.html">Enterprise Project Management</a></div>
|
|
</div>
|
|
</div>
|
|
|