add array parity types and array disk types

Signed-off-by: Alexis Tyler <xo@wvvw.me>
This commit is contained in:
Alexis Tyler
2019-07-12 12:40:21 +09:30
parent af877d7fd3
commit 528a1d8cb4
2 changed files with 67 additions and 8 deletions

View File

@@ -7,17 +7,12 @@ type Mutation {
startArray: JSON @func(module: "array/update-array", data: { state: "start" })
"""Stop array"""
stopArray: JSON @func(module: "array/update-array", data: { state: "stop" })
"""Start parity check"""
startPartityCheck: JSON @func(module: "array/update-parity", data: { state: "start" })
"""Cancel parity check"""
cancelPartityCheck: JSON @func(module: "array/update-parity", data: { state: "cancel" })
}
type Array {
state: ArrayState!
capacity: ArrayCapacity!
drives: [Drive]
disks: [Disk]
}
enum ArrayState {
@@ -38,6 +33,52 @@ type Capacity {
total: Long
}
type Drive {
x: String
type Disk {
idx: String!
name: String!
device: String!
id: String!
size: Int!
status: DiskStatus!
rotational: Boolean!
format: String!
temp: Int!
numReads: Int!
numWrites: Int!
numErrors: Int!
type: DiskType!
color: String!
fsStatus: DiskFsStatus!
luksState: String!
comment: String!
exportable: Boolean!
fsType: DiskFsType!
fsColor: DiskFsColor!
fsSize: Int!
fsFree: Int!
spindownDelay: String!
spinupGroup: String!
deviceSb: String!
idSb: String!
sizeSb: Int!
}
enum DiskStatus {
DISK_OK
}
enum DiskType {
Data
}
enum DiskFsStatus {
Mounted
}
enum DiskFsType {
xfs
}
enum DiskFsColor {
green_on
}

View File

@@ -0,0 +1,18 @@
type Query {
parityHistory: [ParityCheck] @func(module: "get-parity-history")
}
type Mutation {
"""Start parity check"""
startPartityCheck: JSON @func(module: "array/update-parity", data: { state: "start" })
"""Cancel parity check"""
cancelPartityCheck: JSON @func(module: "array/update-parity", data: { state: "cancel" })
}
type ParityCheck {
date: String!
duration: Int!
speed: String!
status: String!
errors: String!
}