Pangolin icon

Pangolin

Interact with the Pangolin API

Actions142

Rule → Update a rule applied to a resource.

AI-generated

Summary

Update a specific rule applied to a resource by sending a POST request with the rule details to the resource and rule IDs specified.

Inputs

  • Resource ID (required) — The unique ID of the resource to which the rule is applied.
  • Rule ID (required) — The unique ID of the rule to update.
  • Body (required) — A JSON object containing the properties of the rule to update. This should match the rule schema, including properties such as action, match, value, priority, and enabled status.
  • Options — Additional options for the operation, such as 'Raw Response' to control whether the full response or split items are returned.

Output shape

a single JSON object representing the updated rule or the full raw response if requested

The output will be the updated rule data as a JSON object; if the 'Raw Response' option is set to true, the entire raw response from the API is returned instead. Errors will throw unless 'Continue On Fail' is enabled, in which case error details appear in the output.

Examples

Example 1: Updating an access rule on a resource to accept traffic from a specific CIDR range with priority 0 and enabling it.

Set 'Resource ID' to the resource's ID, 'Rule ID' to the rule's ID, and provide a JSON body specifying the updated rule details (e.g., action: ACCEPT, match: CIDR, value: '192.168.1.0/24', priority: 0, enabled: true).

Discussion