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
Merge request reports
Activity
added manager label
assigned to @vsraier
added 1 commit
- 62e1344a - manager: config API: new query capability inspired by Caddy's HTTP API
added 1 commit
- 0f1a1169 - manager: config API: new query capability inspired by Caddy's HTTP API
added 1 commit
- 0126ead8 - kresctl: basic implementation using the new HTTP API
added 1 commit
- a0b2b6c2 - kresctl: argument parsing infrastracture and init of tab completion
added 1 commit
- 070fdfdb - packaging tests: kresctl changing number of workers
added 1 commit
- bba9e6a6 - packaging tests: kresctl changing number of workers
added 1 commit
- 8bb6d6cc - packaging tests: kresctl changing number of workers
added 1 commit
- 115d594f - packaging tests: kresctl changing number of workers
added 1 commit
- 0d57687a - manager dependencies: accept just about any pyyaml (problems with kresctl...
added 1 commit
- a6b83592 - manager dependencies: accept just about any pyyaml (problems with kresctl...
added 1 commit
- 63cdbd4d - manager dependencies: accept just about any pyyaml (problems with kresctl...
unassigned @vsraier
- Resolved by Aleš Mrázek
I think the HTTP API is pretty much done. I have however started to work on basic
kresctl
utility to test it and that is not fully finished. At least the tests are failing for variety of weird technical reasons.@amrazek Feel free to take over this MR. I think if you disable the
workers.sh
packaging test, then it's ready to merge. Reasoning being, that the API seems to be working, it's just not completely related part of the code that's failing. Kresctl can have its own MR. Sorry I didn't finish this MR before my vacation. Debugging CI is so incredibly slow
added 21 commits
-
63cdbd4d...38c75545 - 15 commits from branch
manager
- 5d38ad72 - manager: config API: new query capability inspired by Caddy's HTTP API
- 18d0d688 - http api improvements and tests
- fcf6ae51 - kresctl: basic implementation using the new HTTP API
- 644f09df - kresctl: argument parsing infrastracture and init of tab completion
- 5d5fc9e9 - packaging tests: kresctl changing number of workers
- e4b6b76c - manager dependencies: accept just about any pyyaml (problems with kresctl...
Toggle commit list-
63cdbd4d...38c75545 - 15 commits from branch
added 1 commit
- 78e26bfb - doc/gettingstarted-config.rst: initial info about API
added 1 commit
- 8a554698 - doc/gettingstarted-config.rst: json schema added, API payload
assigned to @amrazek
mentioned in commit ef24b152