Obtaining the Number of Rule Hits
Function
This API is used to obtain the number of rule hits.
URI
POST /v1/{project_id}/acl-rule/count
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition: Project ID, which is used to specify the project that an asset belongs to. You can query the assets of a project by project ID. You can obtain the project ID from the API or console. For details, see Obtaining a Project ID. Constraints: N/A Range: 32-bit UUID Default Value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| enterprise_project_id | No | String | Definition: Enterprise project ID. If you plan enterprise projects based on your organization's plan, each enterprise project will have such an ID. After this parameter is configured, you can filter assets by enterprise project. Constraints: N/A Range: N/A Default Value: 0 |
| fw_instance_id | No | String | Definition: Firewall ID. It is a unique ID generated after a firewall instance is created. You can obtain the firewall ID by referring to Obtaining a Firewall ID. Constraints: N/A Range: 32-bit UUID Default Value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition: User token, which carries user identity information. After the token is configured, you can use it for API authentication. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header). Constraints: N/A Range: N/A Default Value: N/A. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| rule_ids | Yes | Array of strings | List of rule IDs. You can obtain the rule IDs by calling the API for querying protection rules. Find the value in data.records.rule_id (The period [.] is used to separate different levels of objects). |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| data | RuleHitCountRecords object | Definition: Response to the request for obtaining the number of rule hits. |
| Parameter | Type | Description |
|---|---|---|
| limit | Integer | Definition: Number of records displayed on each page. Range: 1-1024 |
| offset | Integer | Definition: Offset: The start position of the returned records. The value must be a number. Range: The value must be greater than or equal to 0. The default value is 0. |
| total | Integer | Definition: Obtain the total number of rule hits. Range: N/A |
| records | Array of RuleHitCountObject objects | Definition: List of rule hits. Constraints: N/A |
Example Requests
Query the hits of ACL rule 59ff6bd9-0a76-41ec-9650-380086069965 whose project ID is 0b2179bbe180d3762fb0c01a2d5725c7.
https://{Endpoint}/v1/0b2179bbe180d3762fb0c01a2d5725c7/acl-rule/count
{
"rule_ids" : [ "59ff6bd9-0a76-41ec-9650-380086069965" ]
} Example Responses
Status code: 200
OK
{
"data" : {
"limit" : 1,
"offset" : 1,
"records" : [ {
"rule_hit_count" : 0,
"rule_id" : "59ff6bd9-0a76-41ec-9650-380086069965"
} ],
"total" : 1
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 401 | Unauthorized: Request error. |
| 403 | Forbidden: Access forbidden. |
| 404 | Not Found: Web page not found. |
| 500 | Internal Server Error |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot