storage.graphql 1.57 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# ===============================================
# STORAGE
# ===============================================

extend type Query {
  storage: StorageQuery
}

extend type Mutation {
  storage: StorageMutation
}

# -----------------------------------------------
# QUERIES
# -----------------------------------------------

type StorageQuery {
18
  targets: [StorageTarget] @auth(requires: ["manage:system"])
Nick's avatar
Nick committed
19
  status: [StorageStatus] @auth(requires: ["manage:system"])
20 21 22 23 24 25 26 27
}

# -----------------------------------------------
# MUTATIONS
# -----------------------------------------------

type StorageMutation {
  updateTargets(
Nick's avatar
Nick committed
28
    targets: [StorageTargetInput]!
Nicolas Giard's avatar
Nicolas Giard committed
29
  ): DefaultResponse @auth(requires: ["manage:system"])
30 31 32 33 34

  executeAction(
    targetKey: String!
    handler: String!
  ): DefaultResponse @auth(requires: ["manage:system"])
35 36 37 38 39 40 41
}

# -----------------------------------------------
# TYPES
# -----------------------------------------------

type StorageTarget {
42
  isAvailable: Boolean!
43 44 45
  isEnabled: Boolean!
  key: String!
  title: String!
46 47 48
  description: String
  logo: String
  website: String
49
  supportedModes: [String]
50
  mode: String
Nick's avatar
Nick committed
51 52 53
  hasSchedule: Boolean!
  syncInterval: String
  syncIntervalDefault: String
54
  config: [KeyValuePair]
55
  actions: [StorageTargetAction]
56 57 58 59 60 61
}

input StorageTargetInput {
  isEnabled: Boolean!
  key: String!
  mode: String!
Nick's avatar
Nick committed
62
  syncInterval: String
63 64
  config: [KeyValuePairInput]
}
Nick's avatar
Nick committed
65 66 67 68 69

type StorageStatus {
  key: String!
  title: String!
  status: String!
Nick's avatar
Nick committed
70 71
  message: String!
  lastAttempt: String!
Nick's avatar
Nick committed
72
}
73 74 75 76 77 78

type StorageTargetAction {
  handler: String!
  label: String!
  hint: String!
}