admin api, cliv2: implement garage layout show using api functions

This commit is contained in:
Alex Auvolat
2025-03-06 17:56:22 +01:00
parent 913e6da41b
commit 004866caac
5 changed files with 198 additions and 194 deletions
+76 -32
View File
@@ -1899,6 +1899,7 @@
"required": [
"version",
"roles",
"partitionSize",
"parameters",
"stagedRoleChanges"
],
@@ -1906,10 +1907,15 @@
"parameters": {
"$ref": "#/components/schemas/LayoutParameters"
},
"partitionSize": {
"type": "integer",
"format": "int64",
"minimum": 0
},
"roles": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NodeRoleResp"
"$ref": "#/components/schemas/LayoutNodeRole"
}
},
"stagedParameters": {
@@ -2059,6 +2065,44 @@
}
}
},
"LayoutNodeRole": {
"type": "object",
"required": [
"id",
"zone",
"tags"
],
"properties": {
"capacity": {
"type": [
"integer",
"null"
],
"format": "int64",
"minimum": 0
},
"id": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"usableCapacity": {
"type": [
"integer",
"null"
],
"format": "int64",
"minimum": 0
},
"zone": {
"type": "string"
}
}
},
"LayoutParameters": {
"type": "object",
"required": [
@@ -2853,6 +2897,36 @@
}
}
},
"NodeAssignedRole": {
"type": "object",
"required": [
"id",
"zone",
"tags"
],
"properties": {
"capacity": {
"type": [
"integer",
"null"
],
"format": "int64",
"minimum": 0
},
"id": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"zone": {
"type": "string"
}
}
},
"NodeResp": {
"type": "object",
"required": [
@@ -2916,7 +2990,7 @@
"type": "null"
},
{
"$ref": "#/components/schemas/NodeRoleResp"
"$ref": "#/components/schemas/NodeAssignedRole"
}
]
}
@@ -2986,36 +3060,6 @@
}
]
},
"NodeRoleResp": {
"type": "object",
"required": [
"id",
"zone",
"tags"
],
"properties": {
"capacity": {
"type": [
"integer",
"null"
],
"format": "int64",
"minimum": 0
},
"id": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"zone": {
"type": "string"
}
}
},
"PreviewClusterLayoutChangesResponse": {
"oneOf": [
{