Files
doc-exports/docs/cfw/api-ref/ChangeIpsProtectMode.html
qiaoli 9776db0ee8 First version of the CFW API
Reviewed-by: Gladkov, Maksim <mgladkov@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: qiaoli <qiaoli@huawei.com>
Co-committed-by: qiaoli <qiaoli@huawei.com>
2025-01-21 07:59:01 +00:00

267 lines
19 KiB
HTML

<a name="ChangeIpsProtectMode"></a><a name="ChangeIpsProtectMode"></a>
<h1 class="topictitle1">Changing the Protection Mode</h1>
<div id="body1708331107508"><div class="section" id="ChangeIpsProtectMode__section1032935512325"><h4 class="sectiontitle">Function</h4><p id="ChangeIpsProtectMode__p83291555133213">This API is used to change the protection mode.</p>
</div>
<div class="section" id="ChangeIpsProtectMode__section20329115516321"><h4 class="sectiontitle">URI</h4><p id="ChangeIpsProtectMode__p1329145593220">POST /v1/{project_id}/ips/protect</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ChangeIpsProtectMode__table193303551323" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="ChangeIpsProtectMode__row1832919552322"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="ChangeIpsProtectMode__p233017554321">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="ChangeIpsProtectMode__p1133055512321">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="ChangeIpsProtectMode__p1330155518328">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="ChangeIpsProtectMode__p11330155143212">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ChangeIpsProtectMode__row13301655183210"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="ChangeIpsProtectMode__p7330125519322">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="ChangeIpsProtectMode__p9330135518329">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="ChangeIpsProtectMode__p103305555329">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="ChangeIpsProtectMode__p533114555327">Project ID, which can be obtained by calling an API or from the console. For details, see <a href="cfw_02_0015.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ChangeIpsProtectMode__table113311355113216" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Query Parameters</caption><thead align="left"><tr id="ChangeIpsProtectMode__row143311855143218"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.1"><p id="ChangeIpsProtectMode__p1933125543216">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.2"><p id="ChangeIpsProtectMode__p4331555123214">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.5.1.3"><p id="ChangeIpsProtectMode__p23311355173218">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.4.2.5.1.4"><p id="ChangeIpsProtectMode__p153311555203216">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ChangeIpsProtectMode__row633135533215"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="ChangeIpsProtectMode__p4331755153218">enterprise_project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="ChangeIpsProtectMode__p43325558326">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="ChangeIpsProtectMode__p6332185514325">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="ChangeIpsProtectMode__p1233275515328">Enterprise project ID, which is the ID of a project planned based on organizations. You can obtain the enterprise project ID by referring to <a href="cfw_02_0027.html">Obtaining an Enterprise Project ID</a>. If the enterprise project function is not enabled, the value is <strong id="ChangeIpsProtectMode__b19332115563218">0</strong>.</p>
</td>
</tr>
<tr id="ChangeIpsProtectMode__row113311155113215"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.1 "><p id="ChangeIpsProtectMode__p033219551326">fw_instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.2 "><p id="ChangeIpsProtectMode__p733211556320">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.5.1.3 "><p id="ChangeIpsProtectMode__p7332165519323">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.4.2.5.1.4 "><p id="ChangeIpsProtectMode__p1933265563211">Firewall ID, which can be obtained by referring to <a href="cfw_02_0028.html">Obtaining a Firewall ID</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ChangeIpsProtectMode__section6332355203215"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ChangeIpsProtectMode__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request header parameters</caption><thead align="left"><tr id="ChangeIpsProtectMode__row333265512329"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="ChangeIpsProtectMode__p533375523214">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="ChangeIpsProtectMode__p83330557321">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="ChangeIpsProtectMode__p1133314559323">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="ChangeIpsProtectMode__p1533315593218">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ChangeIpsProtectMode__row19332155573218"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="ChangeIpsProtectMode__p333385518326">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="ChangeIpsProtectMode__p1233345514323">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="ChangeIpsProtectMode__p1533312554322">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="ChangeIpsProtectMode__p733395518325">User token. You can obtain the token by referring to <a href="cfw_02_0029.html">Obtaining a User Token</a>.</p>
</td>
</tr>
<tr id="ChangeIpsProtectMode__row1190372014331"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="ChangeIpsProtectMode__p16987185572214">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="ChangeIpsProtectMode__p1453216872313">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="ChangeIpsProtectMode__p598785514223">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="ChangeIpsProtectMode__p1821149193417">Content type. It can only be set to application/json.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ChangeIpsProtectMode__request_IpsProtectDTO" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Request body parameters</caption><thead align="left"><tr id="ChangeIpsProtectMode__row5334255203213"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="ChangeIpsProtectMode__p53341555193220">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="ChangeIpsProtectMode__p4334175519327">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="ChangeIpsProtectMode__p033418554326">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="ChangeIpsProtectMode__p1133475519326">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ChangeIpsProtectMode__row1334175593219"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="ChangeIpsProtectMode__p1233414559326">object_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="ChangeIpsProtectMode__p19334155512325">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="ChangeIpsProtectMode__p1333555516329">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="ChangeIpsProtectMode__p533535519321">Protected object ID, which is used to distinguish Internet border protection from VPC border protection after a CFW instance is created. You can obtain the ID by calling the <a href="ListFirewallDetail.html">API for querying a firewall instance</a>. Note that the value <strong id="ChangeIpsProtectMode__b17335175503211">0</strong> indicates the ID of a protected object on the Internet border, and the value <strong id="ChangeIpsProtectMode__b11335155173214">1</strong> indicates the ID of a protected object on the VPC border.</p>
</td>
</tr>
<tr id="ChangeIpsProtectMode__row17334125519326"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="ChangeIpsProtectMode__p13352055163219">mode</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="ChangeIpsProtectMode__p1433555512329">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="ChangeIpsProtectMode__p1333565519328">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="ChangeIpsProtectMode__p9335105543213">IPS protection mode: <strong id="ChangeIpsProtectMode__b10335255153213">0</strong> (observation mode), <strong id="ChangeIpsProtectMode__b17335655153216">1</strong> (strict mode), 2 (medium mode), or 3 (loose mode).</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ChangeIpsProtectMode__section7335155593215"><h4 class="sectiontitle">Response Parameters</h4><p id="ChangeIpsProtectMode__p533565515320"><strong id="ChangeIpsProtectMode__b16335165510329">Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ChangeIpsProtectMode__response_CommonResponseDTO" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response body parameters</caption><thead align="left"><tr id="ChangeIpsProtectMode__row1033515510327"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.1"><p id="ChangeIpsProtectMode__p333625593215">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.2"><p id="ChangeIpsProtectMode__p2336755183215">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.3.2.4.1.3"><p id="ChangeIpsProtectMode__p933665511320">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ChangeIpsProtectMode__row203353556325"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ChangeIpsProtectMode__p9336195553216">data</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ChangeIpsProtectMode__p933618558324"><a href="#ChangeIpsProtectMode__response_data">data</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="ChangeIpsProtectMode__p633611553329">Response body.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="ChangeIpsProtectMode__response_data"></a><a name="response_data"></a><table cellpadding="4" cellspacing="0" summary="" id="ChangeIpsProtectMode__response_data" frame="border" border="1" rules="all"><caption><b>Table 6 </b>data</caption><thead align="left"><tr id="ChangeIpsProtectMode__row15336155163219"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.4.1.1"><p id="ChangeIpsProtectMode__p93378559324">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.4.1.2"><p id="ChangeIpsProtectMode__p16337115510323">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.4.2.4.1.3"><p id="ChangeIpsProtectMode__p5337145518324">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ChangeIpsProtectMode__row133635553220"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="ChangeIpsProtectMode__p15337135533218">id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="ChangeIpsProtectMode__p1933745520327">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="ChangeIpsProtectMode__p8337175583220">ID information.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="ChangeIpsProtectMode__p19337655113212"><strong id="ChangeIpsProtectMode__b1133710553322">Status code: 400</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ChangeIpsProtectMode__response_ErrorRsp" frame="border" border="1" rules="all"><caption><b>Table 7 </b>Response body parameters</caption><thead align="left"><tr id="ChangeIpsProtectMode__row143371755193219"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.6.2.4.1.1"><p id="ChangeIpsProtectMode__p193381255153211">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.6.2.4.1.2"><p id="ChangeIpsProtectMode__p7338355183212">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.6.2.4.1.3"><p id="ChangeIpsProtectMode__p733885517320">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ChangeIpsProtectMode__row63372055163219"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.6.2.4.1.1 "><p id="ChangeIpsProtectMode__p63381455183214">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.6.2.4.1.2 "><p id="ChangeIpsProtectMode__p1833875518320">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.6.2.4.1.3 "><p id="ChangeIpsProtectMode__p9338165573218">Error code.</p>
</td>
</tr>
<tr id="ChangeIpsProtectMode__row433755503213"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.6.2.4.1.1 "><p id="ChangeIpsProtectMode__p163381455133218">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.6.2.4.1.2 "><p id="ChangeIpsProtectMode__p1338135510321">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.6.2.4.1.3 "><p id="ChangeIpsProtectMode__p4339185517326">Error description.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ChangeIpsProtectMode__section43391155183218"><h4 class="sectiontitle">Example Requests</h4><p id="ChangeIpsProtectMode__p1333945514323">Set the protection mode to <strong id="ChangeIpsProtectMode__b03398556327">Interception mode - strict</strong> for the protected object whose ID is cfebd347-b655-4b84-b938-3c54317599b2 in the project 9d80d070b6d44942af73c9c3d38e0429.</p>
<pre class="screen" id="ChangeIpsProtectMode__screen633985516325">https://{Endpoint}/v1/9d80d070b6d44942af73c9c3d38e0429/ips/protect
{
"object_id" : "cfebd347-b655-4b84-b938-3c54317599b2",
"mode" : 1
}</pre>
</div>
<div class="section" id="ChangeIpsProtectMode__section83395551328"><h4 class="sectiontitle">Example Responses</h4><p id="ChangeIpsProtectMode__p73391555163217"><strong id="ChangeIpsProtectMode__b12339155510328">Status code: 200</strong></p>
<p id="ChangeIpsProtectMode__p633955517325">Request body for modifying the IPS protection mode.</p>
<pre class="screen" id="ChangeIpsProtectMode__screen173409552329">{
"data" : {
"id" : "cfebd347-b655-4b84-b938-3c54317599b2"
}
}</pre>
<p id="ChangeIpsProtectMode__p17340255143217"><strong id="ChangeIpsProtectMode__b43401555133218">Status code: 400</strong></p>
<p id="ChangeIpsProtectMode__p1734075516327">Bad Request</p>
<pre class="screen" id="ChangeIpsProtectMode__screen11340105515328">{
"error_code" : "CFW.0020016",
"error_msg" : "Incorrect instance status."
}</pre>
</div>
<div class="section" id="ChangeIpsProtectMode__section15457105573218"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ChangeIpsProtectMode__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="ChangeIpsProtectMode__row634955583217"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="ChangeIpsProtectMode__p7458105519326">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="ChangeIpsProtectMode__p445812553322">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ChangeIpsProtectMode__row8349155153215"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ChangeIpsProtectMode__p104581559321">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ChangeIpsProtectMode__p54586559324">Request body for modifying the IPS protection mode.</p>
</td>
</tr>
<tr id="ChangeIpsProtectMode__row7349135517326"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ChangeIpsProtectMode__p16458165516322">400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ChangeIpsProtectMode__p1445865583210">Bad Request</p>
</td>
</tr>
<tr id="ChangeIpsProtectMode__row163491155153211"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ChangeIpsProtectMode__p11458155523213">401</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ChangeIpsProtectMode__p945825519329">Unauthorized</p>
</td>
</tr>
<tr id="ChangeIpsProtectMode__row634955513210"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ChangeIpsProtectMode__p7458205513320">403</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ChangeIpsProtectMode__p445875583215">Forbidden</p>
</td>
</tr>
<tr id="ChangeIpsProtectMode__row12349125517322"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ChangeIpsProtectMode__p1045865503210">404</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ChangeIpsProtectMode__p7458555193219">Not Found</p>
</td>
</tr>
<tr id="ChangeIpsProtectMode__row53491755113210"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="ChangeIpsProtectMode__p1145845517326">500</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="ChangeIpsProtectMode__p1045805518322">Internal Server Error</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ChangeIpsProtectMode__section14588556322"><h4 class="sectiontitle">Error Codes</h4><p id="ChangeIpsProtectMode__p17458175563217">See <a href="ErrorCode.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="topic_300000007.html">IPS management</a></div>
</div>
</div>