apisix commands

16 commands, each with a one-line explanation. Click a command to copy it, or click its title to see 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 their URI and upstream nodes.

    network

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

    Show the full configuration of one APISIX route.

    network

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

    List all APISIX upstreams with their nodes.

    network

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

    List all available APISIX plugins.

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

    Reload APISIX configuration from etcd without a restart.

    config

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

    Show APISIX node status and connection stats from the /apisix/status endpoint.

    monitoring

  • kubectl get pods -n ingress-apisix

    Check that 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 as raw JSON.

    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 a 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 the limit-req 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 that logs in with an API key (key-auth).

    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

    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 the jwt-auth plugin to an existing route through the Admin API.

    api-gateway · jwt · auth