> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Get Rule

- Component: `appmixer.imperva.waf.GetRule`
- Kind: Action
- Version: 1.0.3
- Visibility: Public
- Connector: [appmixer.imperva 1.2.3](https://connectors.appmixer.com/connector/appmixer.imperva/1.2.3.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.imperva/1.2.3/component/appmixer.imperva.waf.GetRule>

Get a rule by ID.

## Properties

_No properties defined._

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Site ID (`siteId`) | text | - |
| Rule ID (`ruleId`) | text | - |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Site ID (`siteId`) | number | - |
| Rule ID (`rule_id`) | number | - |
| Name (`name`) | string | - |
| Action (`action`) | string | - |
| Filter (`filter`) | string | - |
| Response Code (`response_code`) | number | - |
| Add Missing (`add_missing`) | boolean | - |
| Rewrite Existing (`rewrite_existing`) | boolean | - |
| From (`from`) | string | - |
| To (`to`) | string | - |
| Rewrite Name (`rewrite_name`) | string | - |
| Data Center ID (`dc_id`) | number | - |
| Port Forwarding Context (`port_forwarding_context`) | string | - |
| Port Forwarding Value (`port_forwarding_value`) | string | - |
| Rate Context (`rate_context`) | string | - |
| Rate Interval (`rate_interval`) | number | - |
| Error Type (`error_type`) | string | - |
| Error Response Format (`error_response_format`) | string | - |
| Error Response Data (`error_response_data`) | string | - |
| Multiple Deletions (`multiple_deletions`) | boolean | - |
| Override WAF Rule (`overrideWafRule`) | string | - |
| Override WAF Action (`overrideWafAction`) | string | - |
| Enabled (`enabled`) | boolean | - |
| Block Duration Details (`blockDurationDetails`) | object | - |
| Send Notifications (`sendNotifications`) | boolean | - |

## Full metadata (component.json)

```json
{
  "version": "1.0.3",
  "name": "appmixer.imperva.waf.GetRule",
  "author": "Appmixer <info@appmixer.com>",
  "description": "Get a rule by ID.",
  "private": false,
  "auth": {
    "service": "appmixer:imperva"
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "siteId": {
            "type": "string"
          },
          "ruleId": {
            "type": "string"
          }
        },
        "required": [
          "siteId",
          "ruleId"
        ]
      },
      "inspector": {
        "inputs": {
          "siteId": {
            "type": "text",
            "index": 0,
            "label": "Site ID",
            "source": {
              "url": "/component/appmixer/imperva/waf/ListSites?outPort=out",
              "data": {
                "messages": {
                  "in/isSource": true
                },
                "transform": "./ListSites#toSelectArray"
              }
            }
          },
          "ruleId": {
            "type": "text",
            "index": 1,
            "label": "Rule ID"
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "options": [
        {
          "label": "Site ID",
          "value": "siteId",
          "schema": {
            "type": "number",
            "example": 12345678
          }
        },
        {
          "label": "Rule ID",
          "value": "rule_id",
          "schema": {
            "type": "number",
            "example": 94521
          }
        },
        {
          "label": "Name",
          "value": "name",
          "schema": {
            "type": "string",
            "example": "Block malicious IPs"
          }
        },
        {
          "label": "Action",
          "value": "action",
          "schema": {
            "type": "string",
            "example": "RULE_ACTION_BLOCK"
          }
        },
        {
          "label": "Filter",
          "value": "filter",
          "schema": {
            "type": "string",
            "example": "ClientIP == 192.0.2.10"
          }
        },
        {
          "label": "Response Code",
          "value": "response_code",
          "schema": {
            "type": "number",
            "example": 302
          }
        },
        {
          "label": "Add Missing",
          "value": "add_missing",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "Rewrite Existing",
          "value": "rewrite_existing",
          "schema": {
            "type": "boolean",
            "example": true
          }
        },
        {
          "label": "From",
          "value": "from",
          "schema": {
            "type": "string",
            "example": "/old-path"
          }
        },
        {
          "label": "To",
          "value": "to",
          "schema": {
            "type": "string",
            "example": "/new-path"
          }
        },
        {
          "label": "Rewrite Name",
          "value": "rewrite_name",
          "schema": {
            "type": "string",
            "example": "X-Custom-Header"
          }
        },
        {
          "label": "Data Center ID",
          "value": "dc_id",
          "schema": {
            "type": "number",
            "example": 1234
          }
        },
        {
          "label": "Port Forwarding Context",
          "value": "port_forwarding_context",
          "schema": {
            "type": "string",
            "example": "Use Port Value"
          }
        },
        {
          "label": "Port Forwarding Value",
          "value": "port_forwarding_value",
          "schema": {
            "type": "string",
            "example": "8080"
          }
        },
        {
          "label": "Rate Context",
          "value": "rate_context",
          "schema": {
            "type": "string",
            "example": "IP"
          }
        },
        {
          "label": "Rate Interval",
          "value": "rate_interval",
          "schema": {
            "type": "number",
            "example": 60
          }
        },
        {
          "label": "Error Type",
          "value": "error_type",
          "schema": {
            "type": "string",
            "example": "error.type.all"
          }
        },
        {
          "label": "Error Response Format",
          "value": "error_response_format",
          "schema": {
            "type": "string",
            "example": "json"
          }
        },
        {
          "label": "Error Response Data",
          "value": "error_response_data",
          "schema": {
            "type": "string",
            "example": "{\"error\": \"Access denied\"}"
          }
        },
        {
          "label": "Multiple Deletions",
          "value": "multiple_deletions",
          "schema": {
            "type": "boolean",
            "example": false
          }
        },
        {
          "label": "Override WAF Rule",
          "value": "overrideWafRule",
          "schema": {
            "type": "string",
            "example": "SQL Injection"
          }
        },
        {
          "label": "Override WAF Action",
          "value": "overrideWafAction",
          "schema": {
            "type": "string",
            "example": "Alert Only"
          }
        },
        {
          "label": "Enabled",
          "value": "enabled",
          "schema": {
            "type": "boolean",
            "example": true
          }
        },
        {
          "label": "Block Duration Details",
          "value": "blockDurationDetails",
          "schema": {
            "type": "object",
            "properties": {
              "blockDurationPeriodType": {
                "type": "string",
                "title": "Block Duration Details.Block Duration Period Type"
              },
              "blockFixedDurationValue": {
                "type": "number",
                "title": "Block Duration Details.Block Fixed Duration Value"
              },
              "blockRandomizedDurationMinValue": {
                "type": "number",
                "title": "Block Duration Details.Block Randomized Duration Min Value"
              },
              "blockRandomizedDurationMaxValue": {
                "type": "number",
                "title": "Block Duration Details.Block Randomized Duration Max Value"
              }
            },
            "example": {
              "blockDurationPeriodType": "fixed",
              "blockFixedDurationValue": 60,
              "blockRandomizedDurationMinValue": 10,
              "blockRandomizedDurationMaxValue": 60
            }
          }
        },
        {
          "label": "Send Notifications",
          "value": "sendNotifications",
          "schema": {
            "type": "boolean",
            "example": false
          }
        }
      ]
    }
  ],
  "properties": {},
  "label": "Get Rule",
  "icon": "(data URI omitted)"
}
```
