apisix commands

16 commands, each with a one-line explanation. Click a command to copy it, or its title for details.

Commands 16 shown

  • curl -s http://apisix:9180/apisix/admin/routes -H 'X-API-KEY: <key>' | jq '.list[].value | {id:.id, uri:.uri, upstream:.upstream.nodes}'

    List all APISIX routes with URI and upstream

    network

  • curl -s http://apisix:9180/apisix/admin/routes/<id> -H 'X-API-KEY: <key>' | jq .

    Inspect a single APISIX route configuration

    network

  • curl -s http://apisix:9180/apisix/admin/upstreams -H 'X-API-KEY: <key>' | jq '.list[].value | {id:.id, nodes:.nodes}'

    All APISIX upstream definitions with nodes

    network

  • curl -s http://apisix:9180/apisix/admin/plugins/list -H 'X-API-KEY: <key>' | jq .

    All available APISIX plugins

  • curl -X PUT http://apisix:9180/apisix/admin/configs/reload -H 'X-API-KEY: <key>'

    Hot-reload APISIX configuration from etcd

    config

  • curl -s http://apisix:9080/apisix/status | jq .

    APISIX process health via control plane API

    monitoring

  • kubectl get pods -n ingress-apisix

    Check APISIX pods are running in Kubernetes

    api-gateway · k8s

  • curl http://apisix-admin:9180/apisix/admin/routes -H "X-API-KEY: $ADMIN_KEY"

    List all configured APISIX routes

    api-gateway · admin · api

  • curl -X PUT http://apisix-admin:9180/apisix/admin/routes/1 -H "X-API-KEY: $ADMIN_KEY" -d '{"uri":"/api/*","upstream":{"nodes":{"backend:8080":1},"type":"roundrobin"}}'

    Create a simple route with roundrobin upstream

    api-gateway · route · create

  • curl -X PATCH http://apisix-admin:9180/apisix/admin/routes/1 -H "X-API-KEY: $ADMIN_KEY" -d '{"plugins":{"limit-req":{"rate":100,"burst":50,"key":"remote_addr"}}}'

    Add rate-limiting plugin to an existing route

    api-gateway · plugin · rate-limit

  • curl http://apisix-admin:9180/apisix/admin/upstreams -H "X-API-KEY: $ADMIN_KEY"

    List all configured APISIX upstreams

    api-gateway · upstream

  • curl -X PUT http://apisix-admin:9180/apisix/admin/consumers/myuser -H "X-API-KEY: $ADMIN_KEY" -d '{"plugins":{"key-auth":{"key":"user-api-key"}}}'

    Create an APISIX consumer with key authentication

    api-gateway · consumer · auth

  • # Add jwt-auth to plugins in route or consumer config

    Enable JWT authentication on a route via plugin config

    api-gateway · jwt · auth

  • curl http://apisix-admin:9180/apisix/admin/plugins/list -H "X-API-KEY: $ADMIN_KEY"

    List all available APISIX plugins

    api-gateway · plugins

  • apisix reload

    Hot-reload APISIX configuration without downtime

    api-gateway · reload · config

  • curl -X PATCH http://apisix-admin:9180/apisix/admin/routes/1 \ -H "X-API-KEY: $ADMIN_KEY" \ -d '{"plugins":{"jwt-auth":{"header":"Authorization","query":"jwt"}}}'

    Add jwt-auth plugin to an existing route via Admin API

    api-gateway · jwt · auth