doc-exports/docs/rds/api-ref/rds_05_0009.html
Wang , Deng Ke 21e968a153 rds api 2.0.38sp24 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com>
Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
2023-01-12 13:50:31 +00:00

112 lines
12 KiB
HTML

<a name="rds_05_0009"></a><a name="rds_05_0009"></a>
<h1 class="topictitle1">Binding and Unbinding an EIP</h1>
<div id="body32001227"><div class="section" id="rds_05_0009__en-us_topic_0226369680_section4850156117316"><h4 class="sectiontitle">Function</h4><p id="rds_05_0009__en-us_topic_0226369680_p2204125173815">This API is used to bind an EIP to a DB instance for public access or unbind an EIP from the DB instance as required.</p>
<ul id="rds_05_0009__en-us_topic_0226369680_ul19289147182712"><li id="rds_05_0009__en-us_topic_0226369680_en-us_topic_0110967248_li836513175363">Before calling an API, you need to understand the API in <a href="rds_03_0001.html">Authentication</a>.</li><li id="rds_05_0009__en-us_topic_0226369680_en-us_topic_0110967248_li1991981933613">Before calling this API, obtain the required <a href="https://docs.otc.t-systems.com/en-us/endpoint/index.html" target="_blank" rel="noopener noreferrer">region and endpoint</a>.</li></ul>
</div>
<div class="section" id="rds_05_0009__en-us_topic_0226369680_section9207631102915"><h4 class="sectiontitle">Constraints</h4><p id="rds_05_0009__en-us_topic_0226369680_p231193123811">An EIP cannot be bound to or unbound from a DB instance that is being created, modified, restored, or rebooted.</p>
</div>
<div class="section" id="rds_05_0009__en-us_topic_0226369680_section28961517113719"><h4 class="sectiontitle">URI</h4><ul id="rds_05_0009__en-us_topic_0226369680_ul53354139141429"><li id="rds_05_0009__en-us_topic_0226369680_li1270098217262">URI format<p id="rds_05_0009__en-us_topic_0226369680_p30251930154721"><a name="rds_05_0009__en-us_topic_0226369680_li1270098217262"></a><a name="en-us_topic_0226369680_li1270098217262"></a>PUT https://{<em id="rds_05_0009__en-us_topic_0226369680_i2475051121512">Endpoint</em>}/v3/{<em id="rds_05_0009__en-us_topic_0226369680_i5492195683913">project_id</em>}/instances/{<em id="rds_05_0009__en-us_topic_0226369680_i51344221435">instance_id</em>}/public-ip</p>
</li></ul>
<ul id="rds_05_0009__en-us_topic_0226369680_ul49831254144655"><li id="rds_05_0009__en-us_topic_0226369680_li15430535">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_05_0009__en-us_topic_0226369680_table4657088" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="rds_05_0009__en-us_topic_0226369680_row60083059"><th align="left" class="cellrowborder" valign="top" width="20.93%" id="mcps1.3.3.3.1.1.2.4.1.1"><p id="rds_05_0009__en-us_topic_0226369680_p34889605"><strong id="rds_05_0009__en-us_topic_0226369680_b84235270691445">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.6%" id="mcps1.3.3.3.1.1.2.4.1.2"><p id="rds_05_0009__en-us_topic_0226369680_p7485743"><strong id="rds_05_0009__en-us_topic_0226369680_b438414101113">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="62.470000000000006%" id="mcps1.3.3.3.1.1.2.4.1.3"><p id="rds_05_0009__en-us_topic_0226369680_p2365466"><strong id="rds_05_0009__en-us_topic_0226369680_b11652342111114">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="rds_05_0009__en-us_topic_0226369680_row57385070"><td class="cellrowborder" valign="top" width="20.93%" headers="mcps1.3.3.3.1.1.2.4.1.1 "><p id="rds_05_0009__en-us_topic_0226369680_p17679057">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.6%" headers="mcps1.3.3.3.1.1.2.4.1.2 "><p id="rds_05_0009__en-us_topic_0226369680_p22717550">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="62.470000000000006%" headers="mcps1.3.3.3.1.1.2.4.1.3 "><p id="rds_05_0009__en-us_topic_0226369680_p28182251">Specifies the project ID of a tenant in a region.</p>
<p id="rds_05_0009__en-us_topic_0226369680_p14611855135510">For details about how to obtain the project ID, see <a href="rds_03_0002.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="rds_05_0009__en-us_topic_0226369680_row2864326155157"><td class="cellrowborder" valign="top" width="20.93%" headers="mcps1.3.3.3.1.1.2.4.1.1 "><p id="rds_05_0009__en-us_topic_0226369680_p41557789155220">instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.6%" headers="mcps1.3.3.3.1.1.2.4.1.2 "><p id="rds_05_0009__en-us_topic_0226369680_p10737742155220">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="62.470000000000006%" headers="mcps1.3.3.3.1.1.2.4.1.3 "><p id="rds_05_0009__en-us_topic_0226369680_p64450739155220">Specifies the DB instance ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="rds_05_0009__en-us_topic_0226369680_section3074340117316"><h4 class="sectiontitle">Request</h4><ul id="rds_05_0009__en-us_topic_0226369680_ul5099287616954"><li id="rds_05_0009__en-us_topic_0226369680_li5628270116954">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_05_0009__en-us_topic_0226369680_table11236435" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="rds_05_0009__en-us_topic_0226369680_row61525259"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.1.1.2.5.1.1"><p id="rds_05_0009__en-us_topic_0226369680_p17490046"><strong id="rds_05_0009__en-us_topic_0226369680_b3548749181211">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.1.1.2.5.1.2"><p id="rds_05_0009__en-us_topic_0226369680_p7407659"><strong id="rds_05_0009__en-us_topic_0226369680_b3220950101219">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.1.1.2.5.1.3"><p id="rds_05_0009__en-us_topic_0226369680_p63149496"><strong id="rds_05_0009__en-us_topic_0226369680_b2421351181211">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.1.1.2.5.1.4"><p id="rds_05_0009__en-us_topic_0226369680_p14835533"><strong id="rds_05_0009__en-us_topic_0226369680_b186821452171219">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="rds_05_0009__en-us_topic_0226369680_row60827539"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.1 "><p id="rds_05_0009__en-us_topic_0226369680_p1673976224">public_ip</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.2 "><p id="rds_05_0009__en-us_topic_0226369680_p60181840">No</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.3 "><p id="rds_05_0009__en-us_topic_0226369680_p42890904">String</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.4 "><div class="notice" id="rds_05_0009__en-us_topic_0226369680_note11283101711450"><span class="noticetitle"> NOTICE: </span><div class="noticebody"><p id="rds_05_0009__en-us_topic_0226369680_p22831817154515">When <span class="parmname" id="rds_05_0009__en-us_topic_0226369680_parmname060063018451"><b>is_bind</b></span> is <span class="parmvalue" id="rds_05_0009__en-us_topic_0226369680_parmvalue469673312457"><b>true</b></span>, <span class="parmname" id="rds_05_0009__en-us_topic_0226369680_parmname113447119468"><b>public_ip</b></span> is mandatory.</p>
</div></div>
<p id="rds_05_0009__en-us_topic_0226369680_p34251836102211">Specifies the EIP to be bound. The value must be in the standard IP address format.</p>
</td>
</tr>
<tr id="rds_05_0009__en-us_topic_0226369680_row64061440122213"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.1 "><p id="rds_05_0009__en-us_topic_0226369680_p10406154032219">public_ip_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.2 "><p id="rds_05_0009__en-us_topic_0226369680_p17406840172218">No</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.3 "><p id="rds_05_0009__en-us_topic_0226369680_p1040611403223">String</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.4 "><div class="notice" id="rds_05_0009__en-us_topic_0226369680_note17664712144613"><span class="noticetitle"> NOTICE: </span><div class="noticebody"><p id="rds_05_0009__en-us_topic_0226369680_p36649124464">When <span class="parmname" id="rds_05_0009__en-us_topic_0226369680_parmname118611514101511"><b>is_bind</b></span> is <span class="parmvalue" id="rds_05_0009__en-us_topic_0226369680_parmvalue18611014151514"><b>true</b></span>, <span class="parmname" id="rds_05_0009__en-us_topic_0226369680_parmname77843264462"><b>public_ip_id</b></span> is mandatory.</p>
</div></div>
<p id="rds_05_0009__en-us_topic_0226369680_p8406164016225">Specifies the EIP ID. The value must be in the standard UUID format.</p>
</td>
</tr>
<tr id="rds_05_0009__en-us_topic_0226369680_row1877012092316"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.1 "><p id="rds_05_0009__en-us_topic_0226369680_p14770170192311">is_bind</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.2 "><p id="rds_05_0009__en-us_topic_0226369680_p877017072312">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.3 "><p id="rds_05_0009__en-us_topic_0226369680_p1177019042312">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.4 "><ul id="rds_05_0009__en-us_topic_0226369680_ul973361411474"><li id="rds_05_0009__en-us_topic_0226369680_li9733714164712"><strong id="rds_05_0009__en-us_topic_0226369680_b175381711619">true</strong>: Bind an EIP.</li><li id="rds_05_0009__en-us_topic_0226369680_li3356141710478"><strong id="rds_05_0009__en-us_topic_0226369680_b1498171971616">false</strong>: Unbind an EIP.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="rds_05_0009__ul1493310286309"><li id="rds_05_0009__li4411135064210">Example<p id="rds_05_0009__p1529015792713"><a name="rds_05_0009__li4411135064210"></a><a name="li4411135064210"></a>PUT https://rds.eu-de.otc.t-systems.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/public-ip</p>
</li></ul>
<ul id="rds_05_0009__en-us_topic_0226369680_ul18318676175816"><li id="rds_05_0009__en-us_topic_0226369680_li30650356175816">Request example<pre class="codeblock" id="rds_05_0009__en-us_topic_0226369680_codeblock26701898174649">{
"public_ip":"10.145.51.214",
"public_ip_id":"8403e9cd-a7fa-4288-8b15-c7ceac1etest",
"is_bind":true
}</pre>
</li></ul>
</div>
<div class="section" id="rds_05_0009__en-us_topic_0226369680_section28521534113742"><h4 class="sectiontitle">Response</h4><ul id="rds_05_0009__en-us_topic_0226369680_ul396612717394"><li id="rds_05_0009__en-us_topic_0226369680_li49661427193912">Normal response<p id="rds_05_0009__en-us_topic_0226369680_p824011811104"><a name="rds_05_0009__en-us_topic_0226369680_li49661427193912"></a><a name="en-us_topic_0226369680_li49661427193912"></a>None</p>
</li><li id="rds_05_0009__en-us_topic_0226369680_li8200143916396">Abnormal response<p id="rds_05_0009__en-us_topic_0226369680_p29415884"><a name="rds_05_0009__en-us_topic_0226369680_li8200143916396"></a><a name="en-us_topic_0226369680_li8200143916396"></a>For details, see <a href="en-us_topic_0032488197.html">Abnormal Request Results</a>.</p>
</li></ul>
</div>
<div class="section" id="rds_05_0009__section4778540915440"><h4 class="sectiontitle">Status Code</h4><ul id="rds_05_0009__en-us_topic_0032347778_ul7858132212142"><li id="rds_05_0009__en-us_topic_0032347778_li58581622171411">Normal<p id="rds_05_0009__en-us_topic_0032347778_p1040982941020"><a name="rds_05_0009__en-us_topic_0032347778_li58581622171411"></a><a name="en-us_topic_0032347778_li58581622171411"></a>200</p>
</li><li id="rds_05_0009__en-us_topic_0032347778_li11583183218149">Abnormal<p id="rds_05_0009__en-us_topic_0032347778_p0723374409"><a name="rds_05_0009__en-us_topic_0032347778_li11583183218149"></a><a name="en-us_topic_0032347778_li11583183218149"></a>For details, see <a href="en-us_topic_0032488240.html">Status Codes</a>.</p>
</li></ul>
</div>
<div class="section" id="rds_05_0009__section1183074220016"><h4 class="sectiontitle">Error Code</h4><p id="rds_05_0009__en-us_topic_0032347778_p19357163913406">For details, see <a href="en-us_topic_0032488241.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0056887470.html">DB Instance Management</a></div>
</div>
</div>