diff --git a/cli/src/aggregators.rs b/cli/src/aggregators.rs index 47660ccb..73f667f1 100644 --- a/cli/src/aggregators.rs +++ b/cli/src/aggregators.rs @@ -60,6 +60,12 @@ pub enum AggregatorAction { /// new bearer token for this aggregator bearer_token: String, }, + + /// Update the aggregator's configuration + UpdateConfig { + /// uuid for this aggregator + aggregator_id: Uuid, + }, } impl AggregatorAction { @@ -130,6 +136,12 @@ impl AggregatorAction { .rotate_aggregator_bearer_token(aggregator_id, &bearer_token) .await?, ), + + Self::UpdateConfig { aggregator_id } => output.display( + client + .update_aggregator_configuration(aggregator_id) + .await?, + ), } Ok(()) } diff --git a/client/src/lib.rs b/client/src/lib.rs index 1937619c..f3afa588 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -230,6 +230,14 @@ impl DivviupClient { .await } + pub async fn update_aggregator_configuration( + &self, + aggregator_id: Uuid, + ) -> ClientResult { + self.patch(&format!("api/aggregators/{aggregator_id}"), &json!({})) + .await + } + pub async fn delete_aggregator(&self, aggregator_id: Uuid) -> ClientResult { self.delete(&format!("api/aggregators/{aggregator_id}")) .await