API Overview

The Jetpath API provides full control over load balancing, routing, and DDoS protection.

Interactive API on SwaggerHub →

Base URL: http://localhost:8080/v1

Instances

Create Instance

POST /v1/instances

{
  "interface": "eth0",
  "modes": ["load_balancing", "routing", "defend"]
}

Get Instance

GET /v1/instances/{id}

Services

Create Service

POST /v1/services?instance_id=inst-1

{
  "name": "web",
  "protocol": "tcp",
  "service_type": "http",
  "listeners": [{"vip": "10.0.0.100", "port": 80}],
  "lb_policy": {"type": "round_robin"},
  "destinations": [
    {"id": "web-1", "ip": "10.0.1.10", "port": 80, "weight": 1},
    {"id": "web-2", "ip": "10.0.1.11", "port": 80, "weight": 1}
  ],
  "http": {
    "host_policy": ["example.com"],
    "host_match": "exact"
  }
}

List Services

GET /v1/services?instance_id=inst-1

Routes

Create Route

POST /v1/routes?instance_id=inst-1

{
  "name": "api-route",
  "priority": 100,
  "match": {
    "host": "api.example.com",
    "host_match": "exact"
  },
  "action": {
    "service_id": "svc-api"
  }
}

DDoS Protection

Add to Drop List

POST /v1/drop-list?instance_id=inst-1

# Block single IP
{"ip": "198.51.100.5", "reason": "DDoS source"}

# Block IP range
{"ip_range": {"start": "198.51.100.0", "end": "198.51.100.255"}, "reason": "abuse"}

Configure Rate Limiting

PUT /v1/ddos/rate-limit?instance_id=inst-1

{
  "enabled": true,
  "pps": 10000,
  "burst": 20000
}

Enable SYN Protection

PUT /v1/ddos/syn-protection?instance_id=inst-1

{"enabled": true}

Metrics

GET /v1/metrics?instance_id=inst-1

Response:
{
  "counters": {
    "packets_blocked": 15420,
    "packets_allowed": 1542890,
    "syn_challenges": 3200
  }
}

Health & Status

GET /v1/health

Response:
{"status": "ok"}

GET /v1/status

Response:
{
  "bpf_enabled": true,
  "instances": ["inst-1"],
  "version": "1.0.0"
}