add addDiskToArray, removeDiskFromArray, mountDisk and unmountDisk and updated @unraid\core

Signed-off-by: Alexis Tyler <xo@wvvw.me>
This commit is contained in:
Alexis Tyler
2019-07-12 16:41:31 +09:30
parent 4b6884685d
commit 7d90e011ef
3 changed files with 34 additions and 17 deletions

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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"