admin api: implement PreviewClusterLayoutChanges

This commit is contained in:
Alex Auvolat
2025-03-06 17:26:28 +01:00
parent e4881e62f1
commit 913e6da41b
5 changed files with 116 additions and 0 deletions
+16
View File
@@ -117,6 +117,21 @@ Contrary to the CLI that may update only a subset of the fields capacity, zone a
)]
fn UpdateClusterLayout() -> () {}
#[utoipa::path(post,
path = "/v2/PreviewClusterLayoutChanges",
tag = "Cluster layout",
description = "
Computes a new layout taking into account the staged parameters, and returns it with detailed statistics. The new layout is not applied in the cluster.
*Note: do not try to parse the `message` field of the response, it is given as an array of string specifically because its format is not stable.*
",
responses(
(status = 200, description = "Information about the new layout", body = PreviewClusterLayoutChangesResponse),
(status = 500, description = "Internal server error")
),
)]
fn PreviewClusterLayoutChanges() -> () {}
#[utoipa::path(post,
path = "/v2/ApplyClusterLayout",
tag = "Cluster layout",
@@ -686,6 +701,7 @@ impl Modify for SecurityAddon {
// Layout operations
GetClusterLayout,
UpdateClusterLayout,
PreviewClusterLayoutChanges,
ApplyClusterLayout,
RevertClusterLayout,
// Key operations