manager: fully featured HTTP API
Implement a config query capability based on Caddy's config API
Operations:
-
GET /config[/path]
- returns current config with an etag -
POST /config[/path]
- upsert (try update, if does not exists, insert), appends to array -
PUT /config[/path]
- insert (fails if object already exists) -
PATCH /config[/path]
- update (fails if object does not exist) -
DELETE /config[/path]
- delete an existing object
All requests support HTTP Header If-Match
with an etag. If the etag is wrong, the request fails.
Path
/list/0
/dict/key
and can be mixed such as /config-root/dict/list/0/something/some-other-list/5/important-value
Concurrency
With etags and if-match
headers, it is possible to implement a system which is updated concurrently by multiple tools at once. I don't think we need to provide complex transactional support, this should be sufficient for most use-cases
- fixes #733 (closed)
- closes #701 (closed) as unneeded
Edited by Aleš Mrázek