Skip to content

Commit

Permalink
Metadata HTTP API
Browse files Browse the repository at this point in the history
Summary:
An interface that exposes Metadata via a REST API.
Is mainly used for testing and not enabled by default

Only enabled with `metadata-api` build flag

Usage:
The API is served by the admin port under `/metadata/<key>`
GET, and HEAD operations always populates the `X-Version` header
if a value is found.

PUT and DELETE operations both require a `X-Precondition` header.
If the precondition is not met, the operation fails with (412 Precondition Failed)

PUT operation requires a header `X-Version` which sets the version
of the new value
  • Loading branch information
muhamadazmy committed Jan 16, 2025
1 parent 19fc6f7 commit d8b44df
Show file tree
Hide file tree
Showing 7 changed files with 310 additions and 18 deletions.
30 changes: 12 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/admin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ options_schema = ["restate-service-client/options_schema"]
memory-loglet = ["restate-bifrost/memory-loglet"]
replicated-loglet = ["restate-bifrost/replicated-loglet"]
serve-web-ui = ["restate-web-ui", "mime_guess"]
metadata-api = []

[dependencies]
workspace-hack = { version = "0.1", path = "../../workspace-hack" }
Expand Down
2 changes: 2 additions & 0 deletions crates/admin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

pub mod cluster_controller;
mod error;
#[cfg(feature = "metadata-api")]
mod metadata_api;
mod rest_api;
mod schema_registry;
pub mod service;
Expand Down
Loading

0 comments on commit d8b44df

Please sign in to comment.