Skip to content
Snippets Groups Projects

manager: fully featured HTTP API

Merged Vaclav Sraier requested to merge manager-better-api into manager
All threads resolved!

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


Edited by Aleš Mrázek

Merge request reports

Pipeline #103790 passed

Pipeline: Knot Resolver

#103791

    Pipeline: Knot Resolver

    #103792

      Pipeline passed for 16ea2c8f on manager-better-api

      Approval is optional

      Merged by Aleš MrázekAleš Mrázek 2 years ago (Aug 30, 2022 12:42pm UTC)

      Merge details

      • Changes merged into manager with ef24b152.
      • Deleted the source branch.

      Pipeline #103794 passed

      Pipeline: Knot Resolver

      #103795

        Pipeline: Knot Resolver

        #103796

          Pipeline passed for ef24b152 on manager

          Activity

          Filter activity
          • Approvals
          • Assignees & reviewers
          • Comments (from bots)
          • Comments (from users)
          • Commits & branches
          • Edits
          • Labels
          • Lock status
          • Mentions
          • Merge request status
          • Tracking
          Please register or sign in to reply
          Loading