Querying the Status of the IPS Feature

Function

This API is used to query the status of the IPS feature.

URI

GET /v1/{project_id}/ips/switch

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.

Table 2 Query Parameters

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).

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

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.

Content-Type

Yes

String

Content type. It can only be set to application/json.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

data

IpsSwitchResponseDTO object

Returned value for querying the IPS switch.

Table 5 IpsSwitchResponseDTO

Parameter

Type

Description

id

String

IPS switch ID. The value is the ID of the protected object at the Internet border, which can be obtained by calling the API for querying a firewall instance. In the return value, find the ID in data.records.protect_objects.object_id (The period [.] is used to separate different levels of objects).

basic_defense_status

Integer

Basic defense status: 0 (disabled), 1 (enabled).

virtual_patches_status

Integer

Virtual patch status: 0 (disabled), 1 (enabled).

Example Requests

Query the patch status of the current user based on the user ID 14181c1245cf4fd786824efe1e2b9388 and load the virtual patch status on the intrusion prevention page.

https://{Endpoint}/v1/14181c1245cf4fd786824efe1e2b9388/ips/switch?fw_instance_id=546af3f8-88e9-47f2-a205-2346d7090925&enterprise_project_id=default&object_id=cfebd347-b655-4b84-b938-3c54317599b2

Example Responses

Status code: 200

Return value for querying the IPS switch.

{
  "data" : {
    "basic_defense_status" : 1,
    "id" : "cefe80aa-83e4-4308-99aa-f9b6c816de00",
    "virtual_patches_status" : 0
  }
}

Status Codes

Status Code

Description

200

Return value for querying the IPS switch.

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.