{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/linode/json-schema/linode-firewall-request-schema.json",
  "title": "FirewallRequest",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/linode-networking-api-openapi.yml#/components/schemas/FirewallRequest",
  "type": "object",
  "required": [
    "label",
    "rules"
  ],
  "properties": {
    "label": {
      "type": "string",
      "minLength": 3,
      "maxLength": 32,
      "description": "The label for the firewall."
    },
    "rules": {
      "type": "object",
      "properties": {
        "inbound": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FirewallRule"
          }
        },
        "inbound_policy": {
          "type": "string",
          "enum": [
            "ACCEPT",
            "DROP"
          ]
        },
        "outbound": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FirewallRule"
          }
        },
        "outbound_policy": {
          "type": "string",
          "enum": [
            "ACCEPT",
            "DROP"
          ]
        }
      },
      "description": "The firewall rules."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tags for the firewall."
    }
  },
  "$defs": {
    "FirewallRule": {
      "type": "object",
      "properties": {
        "ports": {
          "type": "string",
          "description": "The ports this rule applies to, such as 22 or 443-445."
        },
        "protocol": {
          "type": "string",
          "enum": [
            "TCP",
            "UDP",
            "ICMP",
            "IPENCAP"
          ],
          "description": "The network protocol."
        },
        "addresses": {
          "type": "object",
          "properties": {
            "ipv4": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "IPv4 addresses or CIDRs."
            },
            "ipv6": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "IPv6 addresses or CIDRs."
            }
          },
          "description": "The addresses this rule applies to."
        },
        "action": {
          "type": "string",
          "enum": [
            "ACCEPT",
            "DROP"
          ],
          "description": "The action for matching traffic."
        },
        "label": {
          "type": "string",
          "description": "The label for this rule."
        },
        "description": {
          "type": "string",
          "description": "A description for this rule."
        }
      }
    }
  }
}