From 528a1d8cb48ec0f5b656604207a439b5fadc72bc Mon Sep 17 00:00:00 2001 From: Alexis Tyler Date: Fri, 12 Jul 2019 12:40:21 +0930 Subject: [PATCH] add array parity types and array disk types Signed-off-by: Alexis Tyler --- app/graphql/schema/types/array/array.graphql | 57 ++++++++++++++++--- app/graphql/schema/types/array/parity.graphql | 18 ++++++ 2 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 app/graphql/schema/types/array/parity.graphql diff --git a/app/graphql/schema/types/array/array.graphql b/app/graphql/schema/types/array/array.graphql index 065d0691c..e8b70e014 100644 --- a/app/graphql/schema/types/array/array.graphql +++ b/app/graphql/schema/types/array/array.graphql @@ -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 } \ No newline at end of file diff --git a/app/graphql/schema/types/array/parity.graphql b/app/graphql/schema/types/array/parity.graphql new file mode 100644 index 000000000..4ea762b31 --- /dev/null +++ b/app/graphql/schema/types/array/parity.graphql @@ -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! +} \ No newline at end of file