Pangolin icon

Pangolin

Interact with the Pangolin API

Actions142

Resource → Apply a rule to a resource.

AI-generated

Summary

Apply a specific rule to a resource by sending a PUT request with the rule details in the body.

Inputs

  • Resource ID (required) — The identifier of the resource to which the rule will be applied.
  • Body (required) — A JSON object defining the rule to apply, including properties such as action, match, value, priority, and enabled status.
  • Options — Optional settings such as 'Raw Response' to return full response data instead of splitting arrays into individual items.

Output shape

The operation returns the full response data from the API call, which could be a single object or array depending on the API response.

If 'Raw Response' option is set to true, the entire response is returned in one item; otherwise, if the response is an array, it is split into individual items.

Examples

Example 1: Apply a firewall rule to allow traffic from a CIDR range on a resource.

Set the Resource ID, and provide a JSON body with the rule details such as action='ACCEPT', match='CIDR', value='192.168.0.0/24', priority=0, and enabled=true.

Discussion