Files
cloud-firewall/api-ref/source/api/ips_management/changing_the_protection_mode.rst

9.6 KiB

original_name

ChangeIpsProtectMode.html

Changing the Protection Mode

Function

This API is used to change the protection mode.

URI

POST /v1/{project_id}/ips/protect

Table 1 Path Parameters
Parameter Mandatory Type Description
project_id Yes String Project ID, which can be obtained by calling an API or from the console. For details, see Obtaining a Project ID <cfw_02_0015>.
Table 2 Query Parameters
Parameter Mandatory Type Description
enterprise_project_id No String Enterprise project ID, which is the ID of a project planned based on organizations. You can obtain the enterprise project ID by referring to Obtaining an Enterprise Project ID <cfw_02_0027>. If the enterprise project function is not enabled, the value is 0.
fw_instance_id No String Firewall ID, which can be obtained by referring to Obtaining a Firewall ID <cfw_02_0028>.

Request Parameters

Table 3 Request header parameters
Parameter Mandatory Type Description
X-Auth-Token Yes String User token. You can obtain the token by referring to Obtaining a User Token <cfw_02_0029>.
Table 4 Request body parameters
Parameter Mandatory Type Description
object_id Yes String 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 API for querying a firewall instance <listfirewalldetail>. Note that the value 0 indicates the ID of a protected object on the Internet border, and the value 1 indicates the ID of a protected object on the VPC border.
mode Yes Integer IPS protection mode: 0 (observation mode), 1 (strict mode), 2 (medium mode), or 3 (loose mode).

Response Parameters

Status code: 200

Table 5 Response body parameters
Parameter Type Description
data data <changeipsprotectmode__response_data> object Response body.
Table 6 data
Parameter Type Description
id String ID information.

Status code: 400

Table 7 Response body parameters
Parameter Type Description
error_code String Error code.
error_msg String Error description.

Example Requests

Set the protection mode to Interception mode - strict for the protected object whose ID is cfebd347-b655-4b84-b938-3c54317599b2 in the project 9d80d070b6d44942af73c9c3d38e0429.

https://{Endpoint}/v1/9d80d070b6d44942af73c9c3d38e0429/ips/protect

{
  "object_id" : "cfebd347-b655-4b84-b938-3c54317599b2",
  "mode" : 1
}

Example Responses

Status code: 200

Request body for modifying the IPS protection mode.

{
  "data" : {
    "id" : "cfebd347-b655-4b84-b938-3c54317599b2"
  }
}

Status code: 400

Bad Request

{
  "error_code" : "CFW.0020016",
  "error_msg" : "Incorrect instance status."
}

Status Codes

Status Code Description
200 Request body for modifying the IPS protection mode.
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
500 Internal Server Error

Error Codes

See Error Codes <errorcode>.