From 7d90e011efe5144b21947e0beeb613249790ccbc Mon Sep 17 00:00:00 2001 From: Alexis Tyler Date: Fri, 12 Jul 2019 16:41:31 +0930 Subject: [PATCH] add addDiskToArray, removeDiskFromArray, mountDisk and unmountDisk and updated @unraid\core Signed-off-by: Alexis Tyler --- app/graphql/schema/types/array/array.graphql | 16 ++++++++-- app/graphql/schema/types/disks/disk.graphql | 33 +++++++++++--------- yarn.lock | 2 +- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/app/graphql/schema/types/array/array.graphql b/app/graphql/schema/types/array/array.graphql index 2c9adb003..59a7060ca 100644 --- a/app/graphql/schema/types/array/array.graphql +++ b/app/graphql/schema/types/array/array.graphql @@ -7,18 +7,30 @@ type Mutation { startArray: JSON @func(module: "array/update-array", data: { state: "start" }) """Stop array""" stopArray: JSON @func(module: "array/update-array", data: { state: "stop" }) + + """Add new disk to array""" + addDiskToArray(input: arrayDiskInput): Array @func(module: "array/add-disk") + """Remove existing disk from array. NOTE: The array must be stopped before running this otherwise it'll throw an error.""" + removeDiskFromArray(input: arrayDiskInput): Array @func(module: "array/add-disk") +} + +input arrayDiskInput { + id: String! + slot: Int | String } type Array { state: ArrayState! + """Current array capacity""" capacity: ArrayCapacity! + """Disks in the current array""" disks: [Disk] } enum ArrayState { - """Array is started""" + """Array is running""" started - """Array is stopped""" + """Array has stopped""" stopped } diff --git a/app/graphql/schema/types/disks/disk.graphql b/app/graphql/schema/types/disks/disk.graphql index 044b9d986..f73196ce8 100644 --- a/app/graphql/schema/types/disks/disk.graphql +++ b/app/graphql/schema/types/disks/disk.graphql @@ -1,11 +1,13 @@ type Query { + """Single disk""" disk(id: String!): Disk @func(module: "disks/id/get-disk") + """Mulitiple disks""" disks: [Disk]! @func(module: "get-disks") } type Mutation { - mountDisk: Disk - unmountDisk: Disk + mountDisk(id: String!): Disk + unmountDisk(id: String!): Disk } type Disk { @@ -23,19 +25,19 @@ type Disk { numErrors: Int! type: DiskType! color: String! - fsStatus: DiskFsStatus! - luksState: String! - comment: String! + fsStatus: String + luksState: String + comment: String exportable: Boolean! fsType: DiskFsType! fsColor: DiskFsColor! fsSize: Int! fsFree: Int! - spindownDelay: String! - spinupGroup: String! - deviceSb: String! - idSb: String! - sizeSb: Int! + spindownDelay: String + spinupGroup: String + deviceSb: String + idSb: String + sizeSb: Int } enum DiskStatus { @@ -44,10 +46,8 @@ enum DiskStatus { enum DiskType { Data -} - -enum DiskFsStatus { - Mounted + Parity + Flash } enum DiskFsType { @@ -56,4 +56,9 @@ enum DiskFsType { enum DiskFsColor { green_on + green_off + yellow_on + yellow_off + red_on + red_off } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 28e9d67a4..1b253a8cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -205,7 +205,7 @@ "@unraid/core@ssh://git@github.com:unraid/core.git": version "1.0.0" - resolved "ssh://git@github.com:unraid/core.git#2a4e86642fe7054df8b7a9bfdb494cc9b35b9ec2" + resolved "ssh://git@github.com:unraid/core.git#069303147c71d18ad608e5be3a565d83385b72ca" dependencies: better-stack-traces "^1.1.0" bolus "https://github.com/omgimalexis/bolus"