{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cesnet/json-schema/cesnet-rtbhrule-schema.json",
  "title": "RTBHRule",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cesnet-rules-api-openapi.yml#/components/schemas/RTBHRule",
  "allOf": [
    {
      "$ref": "#/$defs/RTBHRuleInput"
    },
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "rstate_id": {
          "type": "integer"
        },
        "user_id": {
          "type": "integer"
        },
        "org_id": {
          "type": "integer"
        }
      }
    }
  ],
  "$defs": {
    "RTBHRuleInput": {
      "type": "object",
      "required": [
        "expires",
        "community"
      ],
      "properties": {
        "ipv4": {
          "type": "string",
          "description": "IPv4 address"
        },
        "ipv4_mask": {
          "type": "integer",
          "description": "IPv4 network mask"
        },
        "ipv6": {
          "type": "string",
          "description": "IPv6 address"
        },
        "ipv6_mask": {
          "type": "integer",
          "description": "IPv6 network mask"
        },
        "community": {
          "type": "integer",
          "description": "Community ID"
        },
        "expires": {
          "type": "string",
          "format": "date-time",
          "description": "Rule expiration time"
        },
        "comment": {
          "type": "string",
          "description": "Rule comment"
        }
      }
    }
  }
}