Changing the IPS Feature Status¶
Function¶
This API is used to enable or disable the feature.
URI¶
POST /v1/{project_id}/ips/switch
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. |
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. 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. |
Request Parameters¶
Parameter | Mandatory | Type | Description |
---|---|---|---|
X-Auth-Token | Yes | String | User token. You can obtain the token by referring to Obtaining a User Token. |
Content-Type | Yes | String | Content type. It can only be set to application/json. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
object_id | Yes | String | Protected object ID, which is used to distinguish between Internet border protection and VPC border protection after a cloud firewall is created. You can obtain the ID by calling the API for querying firewall instances. In the return value, find the ID in data.records.protect_objects.object_id (The period [.] is used to separate different levels of objects). If the value of type is 0, the protected object ID belongs to the Internet border. If the value of type is 1, the protected object ID belongs to the VPC border. Here, a protected object ID whose type is 0 is used. You can obtain the value of type from data.records.protect_objects.type (The period [.] is used to separate different levels of objects). |
ips_type | Yes | Integer | Patch type. Its value can only be 2 (virtual patch). |
status | Yes | Integer | IPS feature status: 0 (disabled), 1 (enabled). |
Response Parameters¶
Status code: 200
Parameter | Type | Description |
---|---|---|
id | String | ID information. |
Example Requests¶
Enable or disable the basic patch and virtual patch of the engine on the user side. The following example shows how to enable the basic patch function for protected object 1530de8a-522d-4771-9067-9fa4e2f53b48 whose project ID is 14181c1245cf4fd786824efe1e2b9388.
https://{Endpoint}/v1/14181c1245cf4fd786824efe1e2b9388/ips/switch?fw_instance_id=546af3f8-88e9-47f2-a205-2346d7090925&enterprise_project_id=default
{
"ips_type" : 1,
"object_id" : "1530de8a-522d-4771-9067-9fa4e2f53b48",
"status" : 1
}
Example Responses¶
Status code: 200
Return value for changing the IPS feature status.
{
"data" : {
"id" : "1530de8a-522d-4771-9067-9fa4e2f53b48"
}
}
Status Codes¶
Status Code | Description |
---|---|
200 | Return value for changing the IPS feature status. |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
500 | Internal Server Error |
Error Codes¶
See Error Codes.