1"""
2The root query for implementing GraphQL mutations.
3"""
4type Mutation {
5
6  #
7  # Generic
8  #
9
10  "Create or overrwrite resource from given wrapped resource."
11  putWrapped(
12    "Raw is a JSON string representation of the resource"
13    raw: String!,
14    """
15    Upsert is a flag that determines whether to insert a resource, or on
16    the basis of the resource already existing, UPDATE that existing
17    resource instead.
18    """
19    upsert: Boolean = true,
20  ): PutWrappedPayload!
21
22  #
23  # Checks
24  #
25
26  "Creates a new check."
27  createCheck(input: CreateCheckInput!): CreateCheckPayload
28
29  "Updates given check."
30  updateCheck(input: UpdateCheckInput!): UpdateCheckPayload
31
32  "Updates given check."
33  executeCheck(input: ExecuteCheckInput!): ExecuteCheckPayload
34
35  "Removes given check."
36  deleteCheck(input: DeleteRecordInput!): DeleteRecordPayload
37
38  #
39  # Entities
40  #
41
42  "Removes a given entity."
43  deleteEntity(input: DeleteRecordInput!): DeleteRecordPayload
44
45  #
46  # Events
47  #
48
49  "Resolves an event."
50  resolveEvent(input: ResolveEventInput!): ResolveEventPayload
51
52  "Deletes an event."
53  deleteEvent(input: DeleteRecordInput!): DeleteRecordPayload
54
55  #
56  # Event Filters
57  #
58
59  "Removes given event filter."
60  deleteEventFilter(input: DeleteRecordInput!): DeleteRecordPayload
61
62  #
63  # Handlers
64  #
65
66  "Removes given handler."
67  deleteHandler(input: DeleteRecordInput!): DeleteRecordPayload
68
69  #
70  # Mutator
71  #
72
73  "Removes given mutator."
74  deleteMutator(input: DeleteRecordInput!): DeleteRecordPayload
75
76  #
77  # Silences
78  #
79
80  "Creates a silence."
81  createSilence(input: CreateSilenceInput!): CreateSilencePayload
82
83  "Removes given silence."
84  deleteSilence(input: DeleteRecordInput!): DeleteRecordPayload
85}
86
87#
88# Generic
89#
90
91type PutWrappedPayload {
92  "The newly created / updated resource"
93  node: Node
94
95  """
96  Includes any failed preconditions or unrecoverable errors that occurred while
97  executing the mutation.
98  """
99  errors: [Error!]!
100}
101
102"""
103Generic container for deleted record payload.
104"""
105type DeleteRecordPayload {
106  "A unique identifier for the client performing the mutation."
107  clientMutationId: String
108
109  "ID of the deleted resource"
110  deletedId: ID!
111}
112
113"""
114Generic input used when deleting records.
115"""
116input DeleteRecordInput {
117  "A unique identifier for the client performing the mutation."
118  clientMutationId: String
119
120  "Global ID of the check to update."
121  id: ID!
122}
123
124#
125# CreateCheckMutation
126#
127
128input CheckConfigInputs {
129
130  "command to run."
131  command: String
132
133  "interval is the time interval, in seconds, in which the check should be run."
134  interval: Int
135
136  """
137	lowFlapThreshold is the flap detection low threshold (% state change) for
138	the check. Sensu uses the same flap detection algorithm as Nagios.
139  """
140  lowFlapThreshold: Int
141
142  """
143	highFlapThreshold is the flap detection high threshold (% state change) for
144	the check. Sensu uses the same flap detection algorithm as Nagios.
145  """
146  highFlapThreshold: Int
147
148	"subscriptions refers to the list of subscribers for the check."
149  subscriptions: [String!]
150
151	"handlers are the event handler for the check (incidents and/or metrics)."
152  handlers: [String!]
153
154	"publish indicates if check requests are published for the check"
155  publish: Boolean
156
157	"Provide a list of valid assets that are required to execute the check."
158  assets: [String!]
159
160}
161
162input CreateCheckInput {
163  "A unique identifier for the client performing the mutation."
164  clientMutationId: String
165
166  "namespace the resulting resource will belong to."
167  namespace: String = "default"
168
169  "name of the resulting check."
170  name: String!
171
172  "properties of the check"
173  props: CheckConfigInputs!
174}
175
176type CreateCheckPayload {
177  "A unique identifier for the client performing the mutation."
178  clientMutationId: String
179
180  "The newly created check."
181  check: CheckConfig!
182}
183
184#
185# UpdateCheckMutation
186#
187
188input UpdateCheckInput {
189  "A unique identifier for the client performing the mutation."
190  clientMutationId: String
191
192  "Global ID of the check to update."
193  id: ID!
194
195  "properties of the check"
196  props: CheckConfigInputs!
197}
198
199type UpdateCheckPayload {
200  "A unique identifier for the client performing the mutation."
201  clientMutationId: String
202
203  "The updated check."
204  check: CheckConfig!
205}
206
207#
208# ExecuteCheckMutation
209#
210
211input ExecuteCheckInput {
212  "A unique identifier for the client performing the mutation."
213  clientMutationId: String
214
215  "Global ID of the check to update."
216  id: ID!
217
218  "Subscriptions is an optional list of subscriptions to target."
219  subscriptions: [String!] = []
220
221  "Reason is used to provide context to the adho request."
222  reason: String = ""
223}
224
225type ExecuteCheckPayload {
226  "A unique identifier for the client performing the mutation."
227  clientMutationId: String
228
229  """
230  Includes any failed preconditions or unrecoverable errors that occurred while
231  executing the mutation.
232  """
233  errors: [Error!]!
234}
235
236#
237# ResolveEventMutation
238#
239
240input ResolveEventInput {
241  "A unique identifier for the client performing the mutation."
242  clientMutationId: String
243
244  "Global ID of the event to resolve."
245  id: ID!
246
247  "The source of the resolve request"
248  source: String = "GraphQL"
249}
250
251type ResolveEventPayload {
252  "A unique identifier for the client performing the mutation."
253  clientMutationId: String
254
255  "The event that was resolved."
256  event: Event!
257}
258
259#
260# CreateSilenceMutation
261#
262
263input CreateSilenceInput {
264  "A unique identifier for the client performing the mutation."
265  clientMutationId: String
266
267  "namespace the resulting resource will belong to."
268  namespace: String = "default"
269
270  "check associated with the silenced entry; optional."
271  check: String
272
273  "subscription associated with the silenced entry; optional."
274  subscription: String
275
276  "properties of the silence"
277  props: SilenceInputs!
278}
279
280input SilenceInputs {
281  "Reason is used to provide context to the entry"
282  reason: String
283
284  "Begin is a timestamp at which the silenced entry takes effect."
285  begin: DateTime
286
287  """
288  ExpireOnResolve defaults to false, clears the entry on resolution when set
289  to true
290  """
291  expireOnResolve: Boolean = true
292
293  "Expire is the number of seconds the entry will live"
294  expire: Int = -1
295}
296
297type CreateSilencePayload {
298  "A unique identifier for the client performing the mutation."
299  clientMutationId: String
300
301  "The newly created silence."
302  silence: Silenced!
303}
304