doc-exports/docs/waf/api-ref/waf_02_0027.html
Li, Qiao 914011d51b waf_api_1109
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Li, Qiao <qiaoli@huawei.com>
Co-committed-by: Li, Qiao <qiaoli@huawei.com>
2022-11-16 15:31:27 +00:00

149 lines
12 KiB
HTML

<a name="waf_02_0027"></a><a name="waf_02_0027"></a>
<h1 class="topictitle1">Connecting a Domain Name to WAF</h1>
<div id="body8428523"><div class="section" id="waf_02_0027__section61598046"><h4 class="sectiontitle">Function Description</h4><p class="msonormal" id="waf_02_0027__p11621782">This API is used to connect a domain name to WAF.</p>
</div>
<div class="section" id="waf_02_0027__section17511502"><h4 class="sectiontitle">URI</h4><ul id="waf_02_0027__ul1840298"><li id="waf_02_0027__li16562682">URI format<p id="waf_02_0027__p14846413"><a name="waf_02_0027__li16562682"></a><a name="li16562682"></a>PUT /v1/{project_id}/waf/instance/{instance_id}/access_status</p>
</li><li id="waf_02_0027__li66508861">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0027__table61708842" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path parameters</caption><thead align="left"><tr id="waf_02_0027__row52390583"><th align="left" class="cellrowborder" valign="top" width="25.507449255074494%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="waf_02_0027__p15778808"><strong id="waf_02_0027__b1217402317425">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.348265173482652%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="waf_02_0027__p3015103"><strong id="waf_02_0027__b1275217241423">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.348265173482652%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="waf_02_0027__p42896753"><strong id="waf_02_0027__b6846173104219">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.796020397960206%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="waf_02_0027__p52084984"><strong id="waf_02_0027__b16721123210425">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0027__row58134204"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0027__p11250084">projecte_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0027__p38841625">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0027__p59163906">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0027__p27547080">Specifies the project ID.</p>
</td>
</tr>
<tr id="waf_02_0027__row46597129"><td class="cellrowborder" valign="top" width="25.507449255074494%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="waf_02_0027__p16271076">instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="waf_02_0027__p42888784">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17.348265173482652%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="waf_02_0027__p51439476">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="waf_02_0027__p5848057">Specifies the instance ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="waf_02_0027__section23385790"><h4 class="sectiontitle">Request</h4><div class="p" id="waf_02_0027__p5177930183720">Request parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0027__table49945669" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="waf_02_0027__row22862784"><th align="left" class="cellrowborder" valign="top" width="19.388061193880613%" id="mcps1.3.3.2.1.2.5.1.1"><p id="waf_02_0027__p39946191"><strong id="waf_02_0027__b12289154717429">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.288571142885711%" id="mcps1.3.3.2.1.2.5.1.2"><p id="waf_02_0027__p14416027"><strong id="waf_02_0027__b77018480428">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.288571142885711%" id="mcps1.3.3.2.1.2.5.1.3"><p id="waf_02_0027__p26847499"><strong id="waf_02_0027__b3884910426">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="52.03479652034796%" id="mcps1.3.3.2.1.2.5.1.4"><p id="waf_02_0027__p27163783"><strong id="waf_02_0027__b285216493426">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0027__row52782840"><td class="cellrowborder" valign="top" width="19.388061193880613%" headers="mcps1.3.3.2.1.2.5.1.1 "><p id="waf_02_0027__p47551686">access_status</p>
</td>
<td class="cellrowborder" valign="top" width="14.288571142885711%" headers="mcps1.3.3.2.1.2.5.1.2 "><p id="waf_02_0027__p26481368">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.288571142885711%" headers="mcps1.3.3.2.1.2.5.1.3 "><p id="waf_02_0027__p64616087">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="52.03479652034796%" headers="mcps1.3.3.2.1.2.5.1.4 "><p id="waf_02_0027__p865434175514">Specifies whether a domain name is connected to WAF.</p>
<p id="waf_02_0027__p18206134020151"><strong id="waf_02_0027__b11808213272">1</strong>: The domain name is connected to WAF.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="waf_02_0027__section9145519"><h4 class="sectiontitle">Response</h4><p id="waf_02_0027__p1148464483715">Response parameters</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0027__table15683171611354" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameter description</caption><thead align="left"><tr id="waf_02_0027__row1068411611352"><th align="left" class="cellrowborder" valign="top" width="19.44%" id="mcps1.3.4.3.2.5.1.1"><p id="waf_02_0027__p5684101653518"><strong id="waf_02_0027__b1221154202710">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.660000000000004%" id="mcps1.3.4.3.2.5.1.2"><p id="waf_02_0027__p156844167359"><strong id="waf_02_0027__b142253312">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.350000000000001%" id="mcps1.3.4.3.2.5.1.3"><p id="waf_02_0027__p9684316123513"><strong id="waf_02_0027__b677203796">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="51.550000000000004%" id="mcps1.3.4.3.2.5.1.4"><p id="waf_02_0027__p8684116183517"><strong id="waf_02_0027__b804148098">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0027__row1684101615357"><td class="cellrowborder" valign="top" width="19.44%" headers="mcps1.3.4.3.2.5.1.1 "><p id="waf_02_0027__p268417167352">access_status</p>
</td>
<td class="cellrowborder" valign="top" width="14.660000000000004%" headers="mcps1.3.4.3.2.5.1.2 "><p id="waf_02_0027__p146841416193519">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.350000000000001%" headers="mcps1.3.4.3.2.5.1.3 "><p id="waf_02_0027__p116842016173519">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="51.550000000000004%" headers="mcps1.3.4.3.2.5.1.4 "><p id="waf_02_0027__p012517913529">Specifies whether a domain name is connected to WAF.</p>
<ul id="waf_02_0027__ul1712616919526"><li id="waf_02_0027__li17126189145217"><strong id="waf_02_0027__b48391127181116">1</strong>: The domain name is connected to WAF.</li><li id="waf_02_0027__li8128194523"><strong id="waf_02_0027__b96294872718">0</strong>: The domain name is not connected to WAF.</li></ul>
</td>
</tr>
<tr id="waf_02_0027__row668461614351"><td class="cellrowborder" valign="top" width="19.44%" headers="mcps1.3.4.3.2.5.1.1 "><p id="waf_02_0027__p3684171616351">protect_status</p>
</td>
<td class="cellrowborder" valign="top" width="14.660000000000004%" headers="mcps1.3.4.3.2.5.1.2 "><p id="waf_02_0027__p17684016113517">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.350000000000001%" headers="mcps1.3.4.3.2.5.1.3 "><p id="waf_02_0027__p6684316103513">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="51.550000000000004%" headers="mcps1.3.4.3.2.5.1.4 "><p id="waf_02_0027__p158432573520">Specifies the WAF mode of a domain name.</p>
<ul id="waf_02_0027__ul484375711526"><li id="waf_02_0027__li9845657165213"><strong id="waf_02_0027__b1477211479513">1</strong>: enabled.</li><li id="waf_02_0027__li168452574529"><strong id="waf_02_0027__b3129155116209">0</strong>: disabled.</li><li id="waf_02_0027__li137818374400"><strong id="waf_02_0027__b1868532511120">-1</strong>: bypassed. That is, a client sends a request to the server without passing through WAF.</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="waf_02_0027__section3802184912372"><h4 class="sectiontitle">Examples</h4><p id="waf_02_0027__p1941661054114"><strong id="waf_02_0027__b191079486426">access_status</strong> with a value of <strong id="waf_02_0027__b2010794817426">1</strong> is used as an example.</p>
<ul id="waf_02_0027__ul1181024916370"><li class="msonormal" id="waf_02_0027__li681054913720">Request example<pre class="screen" id="waf_02_0027__screen0810949163717">{
"access_status": 1
}</pre>
</li></ul>
<ul id="waf_02_0027__ul13811114913372"><li id="waf_02_0027__li6811184913379">Response examples<p class="msonormal" id="waf_02_0027__p281014963718"><a name="waf_02_0027__li6811184913379"></a><a name="li6811184913379"></a>The following shows the response if the domain name is connected to WAF:</p>
<pre class="screen" id="waf_02_0027__screen0810144993717">{
"access_status": 1,
"protect_status": 1
}</pre>
<p class="msonormal" id="waf_02_0027__p4810134914372">The following shows the response if connection fails:</p>
<pre class="screen" id="waf_02_0027__screen5811549173713">{
"access_status": 0,
"protect_status": 0
}</pre>
</li></ul>
</div>
<div class="section" id="waf_02_0027__section15200810"><h4 class="sectiontitle">Status Code</h4><div class="p" id="waf_02_0027__waf_02_0012_a652d4922b7df48fca0a65bc1a38ea5f2"><a href="#waf_02_0027__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0">Table 4</a> describes the normal status code returned by the API.
<div class="tablenoborder"><a name="waf_02_0027__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0"></a><a name="waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0"></a><table cellpadding="4" cellspacing="0" summary="" id="waf_02_0027__waf_02_0012_t82c3440f3efb42a38b9d4dc4011a33d0" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Status code</caption><thead align="left"><tr id="waf_02_0027__waf_02_0012_r3d6e2f205c444705bdbb9daaac74e575"><th align="left" class="cellrowborder" valign="top" width="22%" id="mcps1.3.6.2.2.2.4.1.1"><p id="waf_02_0027__waf_02_0012_af3c4073076f24eca88d94e3fa1effdc6">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.41%" id="mcps1.3.6.2.2.2.4.1.2"><p id="waf_02_0027__waf_02_0012_en-us_topic_0144911667_p4531342288">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="58.589999999999996%" id="mcps1.3.6.2.2.2.4.1.3"><p id="waf_02_0027__waf_02_0012_ada185614bba24140995b8123b3e9faa8">Meaning</p>
</th>
</tr>
</thead>
<tbody><tr id="waf_02_0027__waf_02_0012_rc7b2adc390904a1ba79e303017797786"><td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.6.2.2.2.4.1.1 "><p id="waf_02_0027__waf_02_0012_a93f3895d44bb4226934cc626ac50e37b">200</p>
</td>
<td class="cellrowborder" valign="top" width="19.41%" headers="mcps1.3.6.2.2.2.4.1.2 "><p id="waf_02_0027__waf_02_0012_en-us_topic_0144911667_p7538425819">OK</p>
</td>
<td class="cellrowborder" valign="top" width="58.589999999999996%" headers="mcps1.3.6.2.2.2.4.1.3 "><p id="waf_02_0027__waf_02_0012_en-us_topic_0144911667_p369874114414">The request has succeeded.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="waf_02_0027__waf_02_0012_en-us_topic_0144911667_p482819399522">For details about error status codes, see <a href="waf_02_0085.html">Status Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="waf_02_0025.html">Protection Status and Domain Setup</a></div>
</div>
</div>