Open Context Protocol is live! 🚀 Read the launch post
listFirewallGroupRules

listFirewallGroupRules

List Firewall Rules

Details

  • Method: GET
  • Path: /firewalls/{firewall-group-id}/rules
  • Operation ID: list-firewall-group-rules

Parameters

{
  "per_page": {
    "description": "Number of items requested per page. Default is 100 and Max is 500.",
    "required": false,
    "location": "query",
    "type": "integer"
  },
  "cursor": {
    "description": "Cursor for paging. See [Meta and Pagination](#section/Introduction/Meta-and-Pagination).",
    "required": false,
    "location": "query",
    "type": "string"
  }
}

Response Schema

{
  "type": "object",
  "properties": {
    "firewall_rules": {
      "type": "array",
      "items": {
        "title": "firewall-rule",
        "type": "object",
        "x-tags": [
          "firewall"
        ],
        "description": "Firewall rule information.",
        "x-examples": {
          "firewall rule": {
            "id": 1,
            "type": "v4",
            "ip_type": "v4",
            "action": "accept",
            "protocol": "tcp",
            "port": "80",
            "subnet": "192.0.2.123",
            "subnet_size": 24,
            "source": "",
            "notes": "Example Firewall Rule"
          }
        },
        "properties": {
          "id": {
            "type": "integer",
            "description": "A unique ID for the Firewall Rule."
          },
          "type": {
            "type": "string",
            "description": "This field is deprecated. Use `ip_type` instead.\n\nThe type of IP rule.\n\n* v4\n* v6",
            "deprecated": true
          },
          "ip_type": {
            "type": "string",
            "description": "The type of IP rule.\n\n* v4\n* v6"
          },
          "action": {
            "type": "string",
            "description": "Action to take when this rule is met.\n\n* accept"
          },
          "protocol": {
            "type": "string",
            "description": "The protocol for this rule.\n\n* ICMP\n* TCP\n* UDP\n* GRE\n"
          },
          "port": {
            "type": "string",
            "description": "Port or port range for this rule."
          },
          "subnet": {
            "type": "string",
            "description": "IP address representing a subnet. The IP address format must match with the \"ip_type\" parameter value."
          },
          "subnet_size": {
            "type": "integer",
            "description": "The number of bits for the netmask in CIDR notation. Example: 24"
          },
          "source": {
            "type": "string",
            "description": "If the source string is given a value of \"cloudflare\" subnet and subnet_size will both be ignored.\nPossible values:\n\n|   | Value | Description |\n| - | ------ | ------------- |\n|   | \"\" | Use the value from `subnet` and `subnet_size`. |\n|   | cloudflare | Allow all of Cloudflare's IP space through the firewall |"
          },
          "notes": {
            "type": "string",
            "description": "User-supplied notes for this rule."
          }
        }
      }
    },
    "meta": {
      "title": "meta",
      "type": "object",
      "x-examples": {
        "meta response": {
          "meta": {
            "total": 31,
            "links": {
              "next": "WxYzExampleNext",
              "prev": ""
            }
          }
        }
      },
      "description": "The meta information object. See [Meta and Pagination](#section/Introduction/Meta-and-Pagination) for more information.",
      "properties": {
        "total": {
          "type": "integer",
          "description": "Total objects available in the list. This value may be greater than the number of objects returned if `per_page` is set."
        },
        "links": {
          "type": "object",
          "description": "Cursor values for pagination.",
          "properties": {
            "next": {
              "type": "string",
              "description": "Cursor value for the next page."
            },
            "prev": {
              "type": "string",
              "description": "Cursor value for the previous page."
            }
          }
        }
      }
    }
  }
}

Usage

from ocp_agent import OCPAgent

agent = OCPAgent()
await agent.register_api('vultr')

# Call this tool
result = await agent.call_tool('listFirewallGroupRules', {
    # Add required parameters here
})