forked from oxidecomputer/omicron
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clickhouse cluster reconfigurator execution (oxidecomputer#6762)
Create a clickhouse-admin-client and use it in reconfigurator execution for clickhouse keepers and servers. Note that since the policy is disabled, there won't be a `Some(clickhouse_cluster_config)` in the blueprint and the execution will be skipped.
- Loading branch information
1 parent
62c7672
commit ba21231
Showing
9 changed files
with
586 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "clickhouse-admin-client" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
chrono.workspace = true | ||
clickhouse-admin-types.workspace = true | ||
clickhouse-admin-api.workspace = true | ||
omicron-uuid-kinds.workspace = true | ||
progenitor.workspace = true | ||
reqwest = { workspace = true, features = [ "json", "rustls-tls", "stream" ] } | ||
schemars.workspace = true | ||
serde.workspace = true | ||
slog.workspace = true | ||
omicron-workspace-hack.workspace = true | ||
|
||
[lints] | ||
workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// 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 a clickhouse-admin server running in | ||
//! an omicron zone. | ||
progenitor::generate_api!( | ||
spec = "../../openapi/clickhouse-admin.json", | ||
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], | ||
replace = { | ||
TypedUuidForOmicronZoneKind = omicron_uuid_kinds::OmicronZoneUuid, | ||
KeeperConfigurableSettings = clickhouse_admin_api::KeeperConfigurableSettings, | ||
ServerConfigurableSettings = clickhouse_admin_api::ServerConfigurableSettings, | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.