forked from docs/doc-exports
Reviewed-by: Hajba, László Antal <laszlo-antal.hajba@t-systems.com> Co-authored-by: Qin Ying, Fan <fanqinying@huawei.com> Co-committed-by: Qin Ying, Fan <fanqinying@huawei.com>
67 lines
5.5 KiB
HTML
67 lines
5.5 KiB
HTML
<a name="eip_apieg_0003"></a><a name="eip_apieg_0003"></a>
|
|
|
|
<h1 class="topictitle1">Unbinding an EIP from an <span id="text1627173411577">ECS</span></h1>
|
|
<div id="body1598357202801"><div class="section" id="eip_apieg_0003__section679692012810"><h4 class="sectiontitle">Scenarios</h4><p id="eip_apieg_0003__p29029204289">This section describes how to unbind an EIP from an <span id="eip_apieg_0003__text1077717625811">ECS</span> by calling APIs.</p>
|
|
</div>
|
|
<div class="section" id="eip_apieg_0003__section979752010288"><h4 class="sectiontitle">Prerequisites</h4><ul id="eip_apieg_0003__ul490212032811"><li id="eip_apieg_0003__li139021204281">You have created an ECS. For details, see section "Purchasing an ECS with Customized Configurations" in the <em id="eip_apieg_0003__i1934512136346">Elastic Cloud Server User Guide</em>.</li><li id="eip_apieg_0003__li1290292017282">If you use a token for authentication, you must obtain the token and add <strong id="eip_apieg_0003__b7658193773">X-Auth-Token</strong> to the request header when making an API call. <div class="note" id="eip_apieg_0003__note11614213151716"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="eip_apieg_0003__eip_apieg_0001_p530413530166">The token obtained from IAM is valid for only 24 hours. If you want to use a token for authentication, you can cache it to avoid frequent calling.</p>
|
|
</div></div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="eip_apieg_0003__section108026205288"><h4 class="sectiontitle">Procedure</h4><ol id="eip_apieg_0003__ol771523911329"><li id="eip_apieg_0003__li6715133993217">Query EIP details.<ol type="a" id="eip_apieg_0003__ol19903520122817"><li id="eip_apieg_0003__li1290322032818">Send <strong id="eip_apieg_0003__b6435719182">GET /v1/</strong><em id="eip_apieg_0003__i24431619986">project_id</em><strong id="eip_apieg_0003__b54451319785">/publicips/</strong><em id="eip_apieg_0003__i7447919386">publicip_id</em>. Parameter <strong id="eip_apieg_0003__b84491419382">project_id</strong> indicates the project ID.</li><li id="eip_apieg_0003__li20903162020282">Add <strong id="eip_apieg_0003__b18441448886">X-Auth-Token</strong> to the request header.</li><li id="eip_apieg_0003__li109031920122818">Check the response message.<ul id="eip_apieg_0003__ul190332072811"><li id="eip_apieg_0003__li159033207284">The request is successful if the following response is displayed.<pre class="screen" id="eip_apieg_0003__screen107421823103314">{
|
|
"publicip": {
|
|
"id": "f6318bef-6508-4ea5-a48f-6152b6b1a8fb",
|
|
"status": "ACTIVE",
|
|
"type": "5_bgp",
|
|
"port_id": "a135e9b8-1630-40d2-a6c5-eb534a61efbe",
|
|
"public_ip_address": "10.xx.xx.162",
|
|
"private_ip_address": "192.168.1.131",
|
|
"port_id": "a135e9b8-1630-40d2-a6c5-eb534a61efbe",
|
|
"tenant_id": "26ae5181a416420998eb2093aaed84d9",
|
|
"create_time": "2019-03-27 01:33:18",
|
|
"bandwidth_id": "02da78da-4fb0-4880-b512-f516cdeb8ef3",
|
|
"bandwidth_name": "test",
|
|
"<u id="eip_apieg_0003__u9743121814359">b</u>andwidth_share_type": "PER",
|
|
"bandwidth_size": 1,
|
|
"enterprise_project_id": "0",
|
|
"profile": {},
|
|
"ip_version": 4
|
|
}
|
|
}</pre>
|
|
</li><li id="eip_apieg_0003__li725211773312">For details about the error codes when the request is abnormal, see <a href="ErrorCode.html">Error Codes</a>.</li></ul>
|
|
</li></ol>
|
|
</li><li id="eip_apieg_0003__li12903520142818">Unbind the EIP from the <span id="eip_apieg_0003__text1996213915508">ECS</span> NIC.<ol type="a" id="eip_apieg_0003__ol139039208280"><li id="eip_apieg_0003__li1290392022819">Send <strong id="eip_apieg_0003__b1991911141114">PUT /v1/</strong><em id="eip_apieg_0003__i14173118114">project_id</em><strong id="eip_apieg_0003__b111931151119">/publicips/</strong><em id="eip_apieg_0003__i142141111110">publicip_id</em>. Parameter <strong id="eip_apieg_0003__b11232011131116">project_id</strong> indicates the project ID.</li><li id="eip_apieg_0003__li149031320172811">Add <strong id="eip_apieg_0003__b777095010115">X-Auth-Token</strong> to the request header.</li><li id="eip_apieg_0003__li1390318205285">Specify the following parameters in the request body:<pre class="screen" id="eip_apieg_0003__screen101543420339">{
|
|
"publicip": {
|
|
"port_id": ""
|
|
}
|
|
}</pre>
|
|
</li></ol>
|
|
<ol type="a" id="eip_apieg_0003__ol17903172042812"><li id="eip_apieg_0003__li1790332014285">Check the response message.<ul id="eip_apieg_0003__ul890342022813"><li id="eip_apieg_0003__li1690362012284">The request is successful if the following response is displayed.<pre class="screen" id="eip_apieg_0003__screen4589195213319">{
|
|
"publicip": {
|
|
"id": "f6318bef-6508-4ea5-a48f-6152b6b1a8fb",
|
|
"status": "DOWN",
|
|
"type": "5_bgp",
|
|
"public_ip_address": "10.xx.xx.162",
|
|
"bandwidth_id": "02da78da-4fb0-4880-b512-f516cdeb8ef3",
|
|
"bandwidth_name": "test",
|
|
"<u id="eip_apieg_0003__u97412814119">b</u>andwidth_share_type": "PER",
|
|
"bandwidth_size": 1,
|
|
"tenant_id": "26ae5181a416420998eb2093aaed84d9",
|
|
"create_time": "2019-03-27 01:33:18",
|
|
"enterprise_project_id": "0",
|
|
"profile": {}
|
|
"ip_version": 4
|
|
}
|
|
}</pre>
|
|
</li></ul>
|
|
</li></ol>
|
|
<ul id="eip_apieg_0003__ul3903420142817"><li id="eip_apieg_0003__li19903192017288">For details about the error codes when the request is abnormal, see <a href="ErrorCode.html">Error Codes</a>.</li></ul>
|
|
</li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="eip_apieg_0000.html">Application Examples</a></div>
|
|
</div>
|
|
</div>
|
|
|