ensure array mutations return array, add arrayPendingState and clearDiskStatistics

Signed-off-by: Alexis Tyler <xo@wvvw.me>
This commit is contained in:
Alexis Tyler
2019-07-15 14:35:34 +09:30
parent 9f0f0f32bf
commit a0470c16e1
2 changed files with 16 additions and 2 deletions
+14 -2
View File
@@ -4,9 +4,9 @@ type Query {
type Mutation {
"""Start array"""
startArray: JSON @func(module: "array/update-array", data: { state: "start" })
startArray: Array @func(module: "array/update-array", data: { state: "start" })
"""Stop array"""
stopArray: JSON @func(module: "array/update-array", data: { state: "stop" })
stopArray: Array @func(module: "array/update-array", data: { state: "stop" })
"""Add new disk to array"""
addDiskToArray(input: arrayDiskInput): Array @func(module: "array/add-disk")
@@ -20,6 +20,11 @@ input arrayDiskInput {
}
type Array {
"""Array state before this query/mutation"""
previousState: ArrayState
"""Array state after this query/mutation"""
pendingState: ArrayPendingState
"""Current array state"""
state: ArrayState!
"""Current array capacity"""
capacity: ArrayCapacity!
@@ -34,6 +39,13 @@ enum ArrayState {
stopped
}
enum ArrayPendingState {
"""Array is starting"""
starting
"""Array is stopping"""
stopping
}
type ArrayCapacity {
bytes: Capacity
disks: Capacity
@@ -8,6 +8,8 @@ type Query {
type Mutation {
mountDisk(id: String!): Disk
unmountDisk(id: String!): Disk
clearDiskStatistics(id: String!): JSON
}
type Disk {