doc-exports/docs/dns/api-ref/dns_api_63003.html
Qin Ying, Fan cf1007c84e DNS API 20240223 version
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>
2024-05-16 13:48:49 +00:00

153 lines
12 KiB
HTML

<a name="dns_api_63003"></a><a name="dns_api_63003"></a>
<h1 class="topictitle1">Associating a Private Zone with a VPC</h1>
<div id="body1492852258393"><div class="section" id="dns_api_63003__section3569153217343"><h4 class="sectiontitle">Function</h4><p id="dns_api_63003__p2420228517348">Associate a private zone with a VPC.</p>
</div>
<div class="section" id="dns_api_63003__section6163262617350"><h4 class="sectiontitle">URI</h4><p id="dns_api_63003__p5527305017659">POST /v2/zones/{zone_id}/associaterouter</p>
<div class="p" id="dns_api_63003__p2625118592">For details, see <a href="#dns_api_63003__table14024165">Table 1</a>.
<div class="tablenoborder"><a name="dns_api_63003__table14024165"></a><a name="table14024165"></a><table cellpadding="4" cellspacing="0" summary="" id="dns_api_63003__table14024165" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter in the URI</caption><thead align="left"><tr id="dns_api_63003__row26592044"><th align="left" class="cellrowborder" valign="top" width="18.84188418841884%" id="mcps1.3.2.3.2.2.5.1.1"><p id="dns_api_63003__p6471942"><strong id="dns_api_63003__b162774213314533_1">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.03190319031903%" id="mcps1.3.2.3.2.2.5.1.2"><p id="dns_api_63003__p54465313"><strong id="dns_api_63003__b593421527191713_1">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.711471147114713%" id="mcps1.3.2.3.2.2.5.1.3"><p id="dns_api_63003__p49614245"><strong id="dns_api_63003__b84235270619112_1">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="47.41474147414741%" id="mcps1.3.2.3.2.2.5.1.4"><p id="dns_api_63003__p59330872"><strong id="dns_api_63003__b842352706112423_1">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dns_api_63003__row41071365"><td class="cellrowborder" valign="top" width="18.84188418841884%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="dns_api_63003__p38446258">zone_id</p>
</td>
<td class="cellrowborder" valign="top" width="19.03190319031903%" headers="mcps1.3.2.3.2.2.5.1.2 "><p id="dns_api_63003__p27139175">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.711471147114713%" headers="mcps1.3.2.3.2.2.5.1.3 "><p id="dns_api_63003__p50789581">String</p>
</td>
<td class="cellrowborder" valign="top" width="47.41474147414741%" headers="mcps1.3.2.3.2.2.5.1.4 "><p id="dns_api_63003__p20315403">Zone ID</p>
<p id="dns_api_63003__p1669018482183">You can obtain the value by calling the API in <a href="dns_api_63006.html">Querying Private Zones</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="dns_api_63003__section4207148117353"><h4 class="sectiontitle">Request</h4><ul id="dns_api_63003__ul5122522817716"><li id="dns_api_63003__li5604781117716">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dns_api_63003__table3720408817742" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameters in the request</caption><thead align="left"><tr id="dns_api_63003__row6225671717742"><th align="left" class="cellrowborder" valign="top" width="19.040000000000003%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="dns_api_63003__p5153686617742"><strong id="dns_api_63003__b162774213314533_3">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.35%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="dns_api_63003__p473035017742"><strong id="dns_api_63003__b593421527191713_3">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.65%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="dns_api_63003__p386753717742"><strong id="dns_api_63003__b84235270619112_3">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="47.96%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="dns_api_63003__p5956810717742"><strong id="dns_api_63003__b842352706112423_3">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dns_api_63003__row1329410717742"><td class="cellrowborder" valign="top" width="19.040000000000003%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="dns_api_63003__p2681781817157">router</p>
</td>
<td class="cellrowborder" valign="top" width="19.35%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="dns_api_63003__p6603174617742">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="13.65%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="dns_api_63003__p9188475171518">Object</p>
</td>
<td class="cellrowborder" valign="top" width="47.96%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="dns_api_63003__p10335706111018">Router information (VPC associated with the zone)</p>
<p id="dns_api_63003__p36712148171536">For details, see <a href="#dns_api_63003__table4448008117179">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="dns_api_63003__table4448008117179"></a><a name="table4448008117179"></a><table cellpadding="4" cellspacing="0" summary="" id="dns_api_63003__table4448008117179" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Description of the <strong id="dns_api_63003__b1252474841615">router</strong> field</caption><thead align="left"><tr id="dns_api_63003__row6132935617179"><th align="left" class="cellrowborder" valign="top" width="16.27%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="dns_api_63003__p36588677171719"><strong id="dns_api_63003__b117811514164">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="13.96%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="dns_api_63003__p06011644121012"><strong id="dns_api_63003__b2023680971">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.94%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="dns_api_63003__p9906869171719"><strong id="dns_api_63003__b1944655460">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="56.830000000000005%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="dns_api_63003__p64258954171719"><strong id="dns_api_63003__b842352706112423_7">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dns_api_63003__row266872817179"><td class="cellrowborder" valign="top" width="16.27%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="dns_api_63003__p25118582171719">router_id</p>
</td>
<td class="cellrowborder" valign="top" width="13.96%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="dns_api_63003__p11602144151017">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.94%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="dns_api_63003__p50755907171719">String</p>
</td>
<td class="cellrowborder" valign="top" width="56.830000000000005%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="dns_api_63003__p17587794171719">ID of the associated VPC</p>
</td>
</tr>
<tr id="dns_api_63003__row6657832817179"><td class="cellrowborder" valign="top" width="16.27%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="dns_api_63003__p3709384171719">router_region</p>
</td>
<td class="cellrowborder" valign="top" width="13.96%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="dns_api_63003__p8602134413102">No</p>
</td>
<td class="cellrowborder" valign="top" width="12.94%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="dns_api_63003__p43861924171719">String</p>
</td>
<td class="cellrowborder" valign="top" width="56.830000000000005%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="dns_api_63003__p63154928171719">Region of the VPC</p>
<p id="dns_api_63003__p38645142171939">If it is left blank, the region of the project in the token takes effect by default.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="dns_api_63003__li3969179817718">Example request<div class="p" id="dns_api_63003__p1380013852614"><a name="dns_api_63003__li3969179817718"></a><a name="li3969179817718"></a>Associate the zone whose ID is ff8080825b8fc86c015b94bc6f8712c3 with a VPC:<pre class="codeblock" id="dns_api_63003__codeblock14428428142614">POST https://{DNS_Endpoint}/v2/zones/ff8080825b8fc86c015b94bc6f8712c3/associaterouter</pre>
</div>
<div class="p" id="dns_api_63003__p0429728142614"><pre class="screen" id="dns_api_63003__screen204291828132616">{
"router": {
"router_id": "f0791650-db8c-4a20-8a44-a06c6e24b15b",
"router_region": "xx"
}
}</pre>
</div>
</li></ul>
</div>
<div class="section" id="dns_api_63003__section2142173017358"><h4 class="sectiontitle">Response</h4><ul id="dns_api_63003__ul24043226171010"><li id="dns_api_63003__li61921720171010">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dns_api_63003__table4512106017551" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Parameters in the response</caption><thead align="left"><tr id="dns_api_63003__row2225931917551"><th align="left" class="cellrowborder" valign="top" width="21.63%" id="mcps1.3.4.2.1.1.2.4.1.1"><p id="dns_api_63003__p5817443517551"><strong id="dns_api_63003__b162774213314533_7">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.38%" id="mcps1.3.4.2.1.1.2.4.1.2"><p id="dns_api_63003__p3436442517551"><strong id="dns_api_63003__b84235270619112_7">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="61.99%" id="mcps1.3.4.2.1.1.2.4.1.3"><p id="dns_api_63003__p3205505917551"><strong id="dns_api_63003__b2036755510">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="dns_api_63003__row4632297717551"><td class="cellrowborder" valign="top" width="21.63%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="dns_api_63003__p6117366017551">router_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.38%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="dns_api_63003__p4937778317551">String</p>
</td>
<td class="cellrowborder" valign="top" width="61.99%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="dns_api_63003__p4017744717551">Router ID (VPC ID)</p>
</td>
</tr>
<tr id="dns_api_63003__row2605270417551"><td class="cellrowborder" valign="top" width="21.63%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="dns_api_63003__p2989427417551">router_region</p>
</td>
<td class="cellrowborder" valign="top" width="16.38%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="dns_api_63003__p4423327117551">String</p>
</td>
<td class="cellrowborder" valign="top" width="61.99%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="dns_api_63003__p2612521117551">Region of the VPC</p>
</td>
</tr>
<tr id="dns_api_63003__row16652885175519"><td class="cellrowborder" valign="top" width="21.63%" headers="mcps1.3.4.2.1.1.2.4.1.1 "><p id="dns_api_63003__p38120631175524">status</p>
</td>
<td class="cellrowborder" valign="top" width="16.38%" headers="mcps1.3.4.2.1.1.2.4.1.2 "><p id="dns_api_63003__p57184665175519">String</p>
</td>
<td class="cellrowborder" valign="top" width="61.99%" headers="mcps1.3.4.2.1.1.2.4.1.3 "><p id="dns_api_63003__p1635999216648">Resource status</p>
<p id="dns_api_63003__p656495918714">For details, see <a href="dns_api_80005.html#dns_api_80005__section33673592114748">Resource Status</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="dns_api_63003__li7863653171013">Example response<pre class="screen" id="dns_api_63003__screen6413204020223">{
"status": "PENDING_CREATE",
"router_id": "f0791650-db8c-4a20-8a44-a06c6e24b15b",
"router_region": "xx"
}
</pre>
</li></ul>
</div>
<div class="section" id="dns_api_63003__section9249181042119"><h4 class="sectiontitle">Returned Value</h4><p id="dns_api_63003__dns_api_61001_p711102924515">If a 2xx status code is returned, for example, 200, 202, or 204, the request is successful.</p>
<p id="dns_api_63003__dns_api_61001_p18506102624518">For details, see <a href="dns_api_80002.html">Status Code</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dns_api_63000.html">Private Zone Management</a></div>
</div>
</div>