aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin/api.rs
diff options
context:
space:
mode:
authorAlex Auvolat <lx@deuxfleurs.fr>2025-02-05 15:36:47 +0100
committerAlex Auvolat <lx@deuxfleurs.fr>2025-02-05 15:36:47 +0100
commitf914db057a85e0fa70f319ee3af85998a551af96 (patch)
treed5a805dbc0615544d3fe1b1b538fbf2a3642a74a /src/api/admin/api.rs
parent406b6da1634a38c1b8176ff468d964e42ce5ce5d (diff)
downloadgarage-f914db057a85e0fa70f319ee3af85998a551af96.tar.gz
garage-f914db057a85e0fa70f319ee3af85998a551af96.zip
cli_v2: implement LaunchRepairOperation and remove old stuff
Diffstat (limited to 'src/api/admin/api.rs')
-rw-r--r--src/api/admin/api.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/api/admin/api.rs b/src/api/admin/api.rs
index 4caae02c..48c9ee0b 100644
--- a/src/api/admin/api.rs
+++ b/src/api/admin/api.rs
@@ -81,6 +81,7 @@ admin_endpoints![
CreateMetadataSnapshot,
GetNodeStatistics,
GetClusterStatistics,
+ LaunchRepairOperation,
// Worker operations
ListWorkers,
@@ -99,6 +100,7 @@ local_admin_endpoints![
// Node operations
CreateMetadataSnapshot,
GetNodeStatistics,
+ LaunchRepairOperation,
// Background workers
ListWorkers,
GetWorkerInfo,
@@ -663,6 +665,38 @@ pub struct GetClusterStatisticsResponse {
pub freeform: String,
}
+// ---- LaunchRepairOperation ----
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct LocalLaunchRepairOperationRequest {
+ pub repair_type: RepairType,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub enum RepairType {
+ Tables,
+ Blocks,
+ Versions,
+ MultipartUploads,
+ BlockRefs,
+ BlockRc,
+ Rebalance,
+ Scrub(ScrubCommand),
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub enum ScrubCommand {
+ Start,
+ Pause,
+ Resume,
+ Cancel,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct LocalLaunchRepairOperationResponse;
+
// **********************************************
// Worker operations
// **********************************************