-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathlib.rs
More file actions
37 lines (34 loc) · 1.28 KB
/
lib.rs
File metadata and controls
37 lines (34 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// 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 Bootstrap Agent Lockstep API
progenitor::generate_api!(
spec = "../../openapi/bootstrap-agent-lockstep.json",
interface = Positional,
inner_type = slog::Logger,
pre_hook = (|log: &slog::Logger, request: &reqwest::Request| {
slog::debug!(log, "client request";
"method" => %request.method(),
"uri" => %request.url(),
"body" => ?&request.body(),
);
}),
post_hook = (|log: &slog::Logger, result: &Result<_, _>| {
slog::debug!(log, "client response"; "result" => ?result);
}),
derives = [schemars::JsonSchema],
crates = {
"omicron-uuid-kinds" = "*",
"oxnet" = "0.1.0",
},
replace = {
AllowedSourceIps = omicron_common::api::external::AllowedSourceIps,
Baseboard = sled_hardware_types::Baseboard,
ImportExportPolicy = omicron_common::api::external::ImportExportPolicy,
},
);
impl omicron_common::api::external::ClientError for types::Error {
fn message(&self) -> String {
self.message.clone()
}
}