Skip to main content

Module consumers

Module consumers 

Source
Expand description

Admin API endpoints for consumer CRUD. Mutations rewrite the in-memory gateway config and trigger SharedState::reload, which rebuilds and atomically swaps the consumer store (no graph recompile is strictly needed, but reload keeps the semantics uniform with routes/policies).

FunctionsΒ§

create_consumer πŸ”’
POST /api/consumers β€” creates a new consumer from the JSON body, then rebuilds the consumer store. Returns 201 Created on success.
delete_consumer πŸ”’
DELETE /api/consumers/{name} β€” removes the named consumer and rebuilds the store. Returns {"status": "deleted"}.
get_consumer πŸ”’
GET /api/consumers/{name} β€” returns the named consumer as JSON.
list_consumers πŸ”’
GET /api/consumers β€” returns all declared consumers as a JSON array.
router
Builds the router for the /api/consumers endpoints.
upsert_consumer πŸ”’
PUT /api/consumers/{name} β€” creates or replaces the named consumer (the path name overrides any name in the body), matching the policies endpoint’s upsert semantics. Returns {"status": "updated"}.