diff --git a/Cargo.lock b/Cargo.lock index a20dd8acce..61670509bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3419,6 +3419,20 @@ dependencies = [ "syn", ] +[[package]] +name = "oxide-client" +version = "0.1.0" +dependencies = [ + "chrono", + "futures", + "progenitor", + "regress", + "reqwest", + "serde", + "serde_json", + "uuid", +] + [[package]] name = "oximeter" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 90a46f0bdb..36de59228c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,7 @@ members = [ "sled-agent", "sled-agent-client", "sp-sim", + "oxide-client", "oximeter/oximeter", "oximeter/collector", "oximeter/db", @@ -50,6 +51,7 @@ default-members = [ "sled-agent", "sled-agent-client", "sp-sim", + "oxide-client", "oximeter/oximeter", "oximeter/collector", "oximeter/db", diff --git a/oxide-client/Cargo.toml b/oxide-client/Cargo.toml new file mode 100644 index 0000000000..ecb4c59af7 --- /dev/null +++ b/oxide-client/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "oxide-client" +version = "0.1.0" +edition = "2021" +license = "MPL-2.0" + +[dependencies] +futures = "0.3.21" +progenitor = { git = "https://github.com/oxidecomputer/progenitor" } +regress = "0.4.1" +serde_json = "1.0.82" + +[dependencies.chrono] +version = "0.4" +features = [ "serde" ] + +[dependencies.reqwest] +version = "0.11" +default-features = false +features = ["rustls-tls", "stream"] + +[dependencies.serde] +version = "1.0" +features = [ "derive" ] + +[dependencies.uuid] +version = "1.1.0" +features = [ "serde", "v4" ] diff --git a/oxide-client/src/lib.rs b/oxide-client/src/lib.rs new file mode 100644 index 0000000000..7a6237759c --- /dev/null +++ b/oxide-client/src/lib.rs @@ -0,0 +1,11 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +//! Interface for making API requests to the Oxide control plane. + +progenitor::generate_api!( + spec = "../openapi/nexus.json", + interface = Builder, + tags = Separate, +);