Updating Rule Actions in Batches
Function
This API is used to update rule actions in batches.
URI
PUT /v1/{project_id}/acl-rule/action
| 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 |
|---|---|---|---|
| object_id | Yes | String | Definition: Protected object ID, which is used to distinguish between Internet border protection and VPC border protection after a CFW is created. You can obtain the ID by calling the API for querying firewall instances. Find the value in data.records.protect_objects.object_id (The period [.] is used to separate different levels of objects). Constraints: If type is set to 0, object_id indicates the protected object ID of the Internet border. If type is set to 1, object_id indicates the protected object ID of the VPC border. The value of type can be obtained from data.records.protect_objects.type (The period [.] is used to separate different levels of objects). Range: 32-bit UUID Default Value: N/A |
| action | Yes | String | Definition: Action Constraints: N/A Range: enable: permit; disable: deny Default Value: N/A |
| rule_ids | Yes | Array of strings | Definition: 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). Constraints: N/A Range: N/A Default Value: N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| data | Array of strings | Definition: IDs of ACL rules to be updated in batches. The value is the rule IDs transferred from the request body. Range: N/A |
Example Requests
Update the statuses of rules 4e12d889-c1d3-491b-8470-3d1b3dadc1fd and f798a6a8-c4c5-42b4-838c-c922c9908cb4 of firewall 546af3f8-88e9-47f2-a205-2346d7090925 in project 14181c1245cf4fd786824efe1e2b9388 to enabled.
https://{Endpoint}/v1/14181c1245cf4fd786824efe1e2b9388/acl-rule/action?fw_instance_id=546af3f8-88e9-47f2-a205-2346d7090925&enterprise_project_id=default
{
"action" : "enable",
"rule_ids" : [ "4e12d889-c1d3-491b-8470-3d1b3dadc1fd", "f798a6a8-c4c5-42b4-838c-c922c9908cb4" ],
"object_id" : "ae42418e-f077-41a0-9d3b-5b2f5ad9102b"
} Example Responses
Status code: 200
OK
{
"data" : [ "4e12d889-c1d3-491b-8470-3d1b3dadc1fd", "f798a6a8-c4c5-42b4-838c-c922c9908cb4" ]
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
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