-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
1619 lines (1376 loc) · 28.5 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
Indicates exactly one field must be supplied and this field must not be `null`.
"""
directive @oneOf on INPUT_OBJECT
type Permission {
resource: Resource!
actions: [String!]!
}
type ApiKey {
id: ID!
name: String!
description: String
roles: [Role!]!
createdAt: DateTime!
permissions: [Permission!]!
}
type ApiKeyWithSecret {
id: ID!
key: String!
name: String!
description: String
roles: [Role!]!
createdAt: DateTime!
permissions: [Permission!]!
}
input CreateApiKeyInput {
name: String!
description: String
roles: [Role!]
permissions: [AddPermissionInput!]
""" This will replace the existing key if one already exists with the same name, otherwise returns the existing key
"""
overwrite: Boolean
}
input AddPermissionInput {
resource: Resource!
actions: [String!]!
}
input AddRoleForUserInput {
userId: ID!
role: Role!
}
input AddRoleForApiKeyInput {
apiKeyId: ID!
role: Role!
}
input RemoveRoleFromApiKeyInput {
apiKeyId: ID!
role: Role!
}
type Mutation {
createApiKey(input: CreateApiKeyInput!): ApiKeyWithSecret!
addPermission(input: AddPermissionInput!): Boolean!
addRoleForUser(input: AddRoleForUserInput!): Boolean!
addRoleForApiKey(input: AddRoleForApiKeyInput!): Boolean!
removeRoleFromApiKey(input: RemoveRoleFromApiKeyInput!): Boolean!
"""Start array"""
startArray: Array
"""Stop array"""
stopArray: Array
"""Add new disk to array"""
addDiskToArray(input: arrayDiskInput): Array
"""
Remove existing disk from array. NOTE: The array must be stopped before running this otherwise it'll throw an error.
"""
removeDiskFromArray(input: arrayDiskInput): Array
mountArrayDisk(id: ID!): Disk
unmountArrayDisk(id: ID!): Disk
clearArrayDiskStatistics(id: ID!): JSON
"""Start parity check"""
startParityCheck(correct: Boolean): JSON
"""Pause parity check"""
pauseParityCheck: JSON
"""Resume parity check"""
resumeParityCheck: JSON
"""Cancel parity check"""
cancelParityCheck: JSON
login(username: String!, password: String!): String
shutdown: String
reboot: String
connectSignIn(input: ConnectSignInInput!): Boolean!
connectSignOut: Boolean!
enableDynamicRemoteAccess(input: EnableDynamicRemoteAccessInput!): Boolean!
setAdditionalAllowedOrigins(input: AllowedOriginInput!): [String!]!
setupRemoteAccess(input: SetupRemoteAccessInput!): Boolean!
createNotification(input: NotificationData!): Notification!
deleteNotification(id: String!, type: NotificationType!): NotificationOverview!
"""Deletes all archived notifications on server."""
deleteArchivedNotifications: NotificationOverview!
"""Marks a notification as archived."""
archiveNotification(id: String!): Notification!
"""Marks a notification as unread."""
unreadNotification(id: String!): Notification!
archiveNotifications(ids: [String!]): NotificationOverview!
unarchiveNotifications(ids: [String!]): NotificationOverview!
archiveAll(importance: Importance): NotificationOverview!
unarchiveAll(importance: Importance): NotificationOverview!
"""Reads each notification to recompute & update the overview."""
recalculateOverview: NotificationOverview!
"""Add a new user"""
addUser(input: addUserInput!): User
"""Delete a user"""
deleteUser(input: deleteUserInput!): User
}
type Query {
apiKeys: [ApiKey!]!
apiKey(id: ID!): ApiKey
"""
An Unraid array consisting of 1 or 2 Parity disks and a number of Data disks.
"""
array: Array!
parityHistory: [ParityCheck]
online: Boolean
info: Info
cloud: Cloud
config: Config!
remoteAccess: RemoteAccess!
extraAllowedOrigins: [String!]!
connect: Connect!
"""Single disk"""
disk(id: ID!): Disk
"""Mulitiple disks"""
disks: [Disk]!
display: Display
"""All Docker containers"""
dockerContainers(all: Boolean): [DockerContainer!]!
docker: Docker!
"""Docker network"""
dockerNetwork(id: ID!): DockerNetwork!
"""All Docker networks"""
dockerNetworks(all: Boolean): [DockerNetwork]!
flash: Flash
network: Network
notifications: Notifications!
owner: Owner
registration: Registration
server: Server
servers: [Server!]!
services: [Service!]!
"""Network Shares"""
shares: [Share]
unassignedDevices: [UnassignedDevice]
"""Current user account"""
me: Me
"""User account"""
user(id: ID!): User
"""User accounts"""
users(input: usersInput): [User!]!
vars: Vars
"""Virtual machines"""
vms: Vms
}
"""Available resources for permissions"""
enum Resource {
api_key
array
cloud
config
connect
connect__remote_access
customizations
dashboard
disk
display
docker
flash
info
logs
me
network
notifications
online
os
owner
permission
registration
servers
services
share
vars
vms
welcome
}
"""Available roles for API keys and users"""
enum Role {
admin
connect
guest
}
type Subscription {
array: Array!
parityHistory: ParityCheck!
ping: String!
info: Info!
online: Boolean!
config: Config!
display: Display
dockerContainer(id: ID!): DockerContainer!
dockerContainers: [DockerContainer]
dockerNetwork(id: ID!): DockerNetwork!
dockerNetworks: [DockerNetwork]!
flash: Flash!
notificationAdded: Notification!
notificationsOverview: NotificationOverview!
owner: Owner!
registration: Registration!
server: Server
service(name: String!): [Service!]
share(id: ID!): Share!
shares: [Share!]
unassignedDevices: [UnassignedDevice!]
me: Me
user(id: ID!): User!
users: [User]!
vars: Vars!
vms: Vms
}
input arrayDiskInput {
"""Disk ID"""
id: ID!
"""The slot for the disk"""
slot: Int
}
type Array implements Node {
id: ID!
"""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!
"""Current boot disk"""
boot: ArrayDisk
"""Parity disks in the current array"""
parities: [ArrayDisk!]!
"""Data disks in the current array"""
disks: [ArrayDisk!]!
"""Caches in the current array"""
caches: [ArrayDisk!]!
}
enum ArrayState {
"""Array is running"""
STARTED
"""Array has stopped"""
STOPPED
"""Array has new disks"""
NEW_ARRAY
"""A disk is being reconstructed"""
RECON_DISK
"""A disk is disabled in the array"""
DISABLE_DISK
"""Array is disabled"""
SWAP_DSBL
"""Too many changes to array at the same time"""
INVALID_EXPANSION
"""Parity isn't the biggest, can't start array"""
PARITY_NOT_BIGGEST
"""Array has too many missing data disks"""
TOO_MANY_MISSING_DISKS
"""Array has new disks they're too small"""
NEW_DISK_TOO_SMALL
"""Array has no data disks"""
NO_DATA_DISKS
}
enum ArrayDiskStatus {
""" no disk present, no disk configured """
DISK_NP
""" enabled, disk present, correct, valid """
DISK_OK
""" enabled, but missing """
DISK_NP_MISSING
""" enabled, disk present, but not valid """
DISK_INVALID
""" enablled, disk present, but not correct disk """
DISK_WRONG
""" disabled, old disk still present """
DISK_DSBL
""" disabled, no disk present """
DISK_NP_DSBL
""" disabled, new disk present """
DISK_DSBL_NEW
""" new disk """
DISK_NEW
}
enum ArrayPendingState {
"""Array is starting"""
starting
"""Array is stopping"""
stopping
"""Array has no data disks"""
no_data_disks
"""Array has too many missing data disks"""
too_many_missing_disks
}
type ArrayCapacity {
kilobytes: Capacity!
disks: Capacity!
}
type Capacity {
free: String!
used: String!
total: String!
}
type ArrayDisk {
""" Disk indentifier, only set for present disks on the system """
id: ID!
""" Array slot number. Parity1 is always 0 and Parity2 is always 29. Array slots will be 1 - 28. Cache slots are 30 - 53. Flash is 54.
"""
idx: Int!
name: String
device: String
""" (KB) Disk Size total """
size: Long!
status: ArrayDiskStatus
""" Is the disk a HDD or SSD. """
rotational: Boolean
""" Disk temp - will be NaN if array is not started or DISK_NP """
temp: Int
"""
Count of I/O read requests sent to the device I/O drivers. These statistics may be cleared at any time.
"""
numReads: Long!
"""
Count of I/O writes requests sent to the device I/O drivers. These statistics may be cleared at any time.
"""
numWrites: Long!
"""
Number of unrecoverable errors reported by the device I/O drivers. Missing data due to unrecoverable array read errors is filled in on-the-fly using parity reconstruct (and we attempt to write this data back to the sector(s) which failed). Any unrecoverable write error results in disabling the disk.
"""
numErrors: Long!
""" (KB) Total Size of the FS (Not present on Parity type drive) """
fsSize: Long
""" (KB) Free Size on the FS (Not present on Parity type drive)"""
fsFree: Long
""" (KB) Used Size on the FS (Not present on Parity type drive)"""
fsUsed: Long
exportable: Boolean
""" Type of Disk - used to differentiate Cache / Flash / Array / Parity """
type: ArrayDiskType!
""" (%) Disk space left to warn """
warning: Int
""" (%) Disk space left for critical """
critical: Int
""" File system type for the disk """
fsType: String
""" User comment on disk """
comment: String
""" File format (ex MBR: 4KiB-aligned) """
format: String
""" ata | nvme | usb | (others)"""
transport: String
}
enum ArrayDiskType {
"""Data disk"""
Data
"""Parity disk"""
Parity
"""Flash disk"""
Flash
"""Cache disk"""
Cache
}
enum ArrayDiskFsColor {
"""Disk is OK and running"""
green_on
"""Disk is OK and not running"""
green_off
yellow_on
yellow_off
red_on
red_off
}
type ParityCheck {
date: String!
duration: Int!
speed: String!
status: String!
errors: String!
}
"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""
scalar JSON
"""The `Long` scalar type represents 52-bit integers"""
scalar Long
"""
A field whose value is a generic Universally Unique Identifier: https://en.wikipedia.org/wiki/Universally_unique_identifier.
"""
scalar UUID
"""
A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.
"""
scalar DateTime
"""
A field whose value is a valid TCP port within the range of 0 to 65535: https://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_ports
"""
scalar Port
"""
A field whose value conforms to the standard URL format as specified in RFC3986: https://www.ietf.org/rfc/rfc3986.txt.
"""
scalar URL
type Welcome {
message: String!
}
interface Node {
id: ID!
}
type ApiKeyResponse {
valid: Boolean!
error: String
}
enum MinigraphStatus {
PRE_INIT
CONNECTING
CONNECTED
PING_FAILURE
ERROR_RETRYING
}
type MinigraphqlResponse {
status: MinigraphStatus!
timeout: Int
error: String
}
type CloudResponse {
status: String!
ip: String
error: String
}
type RelayResponse {
status: String!
timeout: String
error: String
}
type Cloud {
error: String
apiKey: ApiKeyResponse!
relay: RelayResponse
minigraphql: MinigraphqlResponse!
cloud: CloudResponse!
allowedOrigins: [String!]!
}
enum ConfigErrorState {
UNKNOWN_ERROR
INVALID
NO_KEY_SERVER
WITHDRAWN
}
type Config implements Node {
id: ID!
valid: Boolean
error: ConfigErrorState
}
input ConnectUserInfoInput {
preferred_username: String!
email: String!
avatar: String
}
input ConnectSignInInput {
apiKey: String!
idToken: String
userInfo: ConnectUserInfoInput
accessToken: String
refreshToken: String
}
input AllowedOriginInput {
origins: [String!]!
}
enum WAN_ACCESS_TYPE {
DYNAMIC
ALWAYS
DISABLED
}
enum WAN_FORWARD_TYPE {
UPNP
STATIC
}
type RemoteAccess {
accessType: WAN_ACCESS_TYPE!
forwardType: WAN_FORWARD_TYPE
port: Port
}
input SetupRemoteAccessInput {
accessType: WAN_ACCESS_TYPE!
forwardType: WAN_FORWARD_TYPE
port: Port
}
input EnableDynamicRemoteAccessInput {
url: AccessUrlInput!
enabled: Boolean!
}
enum DynamicRemoteAccessType {
STATIC
UPNP
DISABLED
}
type DynamicRemoteAccessStatus {
enabledType: DynamicRemoteAccessType!
runningType: DynamicRemoteAccessType!
error: String
}
type Connect implements Node {
id: ID!
dynamicRemoteAccess: DynamicRemoteAccessStatus!
}
type Disk {
device: String!
type: String!
name: String!
vendor: String!
size: Long!
bytesPerSector: Long!
totalCylinders: Long!
totalHeads: Long!
totalSectors: Long!
totalTracks: Long!
tracksPerCylinder: Long!
sectorsPerTrack: Long!
firmwareRevision: String!
serialNum: String!
interfaceType: DiskInterfaceType!
smartStatus: DiskSmartStatus!
temperature: Long!
partitions: [DiskPartition!]
}
type DiskPartition {
name: String!
fsType: DiskFsType!
size: Long!
}
enum DiskFsType {
xfs
btrfs
vfat
zfs
}
enum DiskInterfaceType {
SAS
SATA
USB
PCIe
UNKNOWN
}
enum DiskSmartStatus {
OK
UNKNOWN
}
type Display {
id: ID!
case: Case
date: String
number: String
scale: Boolean
tabs: Boolean
users: String
resize: Boolean
wwn: Boolean
total: Boolean
usage: Boolean
banner: String
dashapps: String
theme: Theme
text: Boolean
unit: Temperature
warning: Int
critical: Int
hot: Int
max: Int
locale: String
}
type Case {
icon: String
url: String
error: String
base64: String
}
enum ContainerPortType {
TCP
UDP
}
type ContainerPort {
ip: String
privatePort: Int
publicPort: Int
type: ContainerPortType
}
enum ContainerState {
RUNNING
EXITED
}
type ContainerHostConfig {
networkMode: String!
}
type ContainerMount {
type: String!
name: String!
source: String!
destination: String!
driver: String!
mode: String!
rw: Boolean!
propagation: String!
}
type DockerContainer {
id: ID!
names: [String!]
image: String!
imageId: String!
command: String!
created: Int!
ports: [ContainerPort!]!
""" (B) Total size of all the files in the container """
sizeRootFs: Long
labels: JSON
state: ContainerState!
status: String!
hostConfig: ContainerHostConfig
networkSettings: JSON
mounts: [JSON]
autoStart: Boolean!
}
type Docker implements Node {
id: ID!
containers: [DockerContainer!]
networks: [DockerNetwork!]
}
type DockerNetwork {
name: String
id: ID
created: String
scope: String
driver: String
enableIPv6: Boolean!
ipam: JSON
internal: Boolean!
attachable: Boolean!
ingress: Boolean!
configFrom: JSON
configOnly: Boolean!
containers: JSON
options: JSON
labels: JSON
}
type Flash {
guid: String
vendor: String
product: String
}
type Info implements Node {
"""Count of docker containers"""
apps: InfoApps
baseboard: Baseboard
cpu: InfoCpu
devices: Devices
display: Display
id: ID!
"""Machine ID"""
machineId: ID
memory: InfoMemory
os: Os
system: System
time: DateTime!
versions: Versions
}
type InfoApps {
"""How many docker containers are installed"""
installed: Int
"""How many docker containers are running"""
started: Int
}
type Baseboard {
manufacturer: String!
model: String
version: String
serial: String
assetTag: String
}
type InfoCpu {
manufacturer: String!
brand: String!
vendor: String!
family: String!
model: String!
stepping: Int!
revision: String!
voltage: String
speed: Float!
speedmin: Float!
speedmax: Float!
threads: Int!
cores: Int!
processors: Long!
socket: String!
cache: JSON!
flags: [String!]
}
type Devices {
gpu: [Gpu]
network: [Network]
pci: [Pci]
usb: [Usb]
}
type Gpu {
id: ID!
type: String!
typeid: String!
vendorname: String!
productid: String!
blacklisted: Boolean!
class: String!
}
type Network implements Node {
iface: String
ifaceName: String
ipv4: String
ipv6: String
mac: String
internal: String
operstate: String
type: String
duplex: String
mtu: String
speed: String
carrierChanges: String
id: ID!
accessUrls: [AccessUrl!]
}
type Pci {
id: ID!
type: String
typeid: String
vendorname: String
vendorid: String
productname: String
productid: String
blacklisted: String
class: String
}
type Usb {
id: ID!
name: String
}
enum Temperature {
C
F
}
enum Theme {
white
}
type InfoMemory {
max: Long!
total: Long!
free: Long!
used: Long!
active: Long!
available: Long!
buffcache: Long!
swaptotal: Long!
swapused: Long!
swapfree: Long!
layout: [MemoryLayout!]
}
type MemoryLayout {
size: Long!
bank: String
type: MemoryType
clockSpeed: Long
formFactor: MemoryFormFactor
manufacturer: String
partNum: String
serialNum: String
voltageConfigured: Long
voltageMin: Long
voltageMax: Long
}
enum MemoryType {
DDR2
DDR3
DDR4
}
enum MemoryFormFactor {
DIMM
}
type Os {
platform: String
distro: String
release: String
codename: String
kernel: String
arch: String
hostname: String
codepage: String
logofile: String
serial: String
build: String
uptime: DateTime
}
type System {
manufacturer: String
model: String
version: String
serial: String
uuid: String
sku: String
}
type Versions {
kernel: String
openssl: String
systemOpenssl: String
systemOpensslLib: String
node: String
v8: String
npm: String
yarn: String
pm2: String
gulp: String
grunt: String
git: String
tsc: String
mysql: String
redis: String
mongodb: String
apache: String
nginx: String
php: String
docker: String
postfix: String
postgresql: String
perl: String
python: String
gcc: String
unraid: String
}