Skip to content

Commit a077aae

Browse files
committed
Implement Paul's feedback
1 parent 8d86215 commit a077aae

File tree

1 file changed

+88
-59
lines changed

1 file changed

+88
-59
lines changed

tag-rule/nitagrule.yml

Lines changed: 88 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ definitions:
7373
7474
type: object
7575
properties:
76-
deleteAlarmInstances:
76+
deleteRules:
7777
$ref: '#/definitions/Operation'
78-
readAlarmInstances:
78+
readRules:
7979
$ref: '#/definitions/Operation'
80-
writeAlarmInstances:
80+
writeRules:
8181
$ref: '#/definitions/Operation'
8282
Condition:
8383
title: Condition
@@ -114,7 +114,7 @@ definitions:
114114
severityLevel:
115115
description: An integer in the range [1,4] which specifies the severity level of a condition.
116116
Higher numeric values correspond to higher severity levels.
117-
type: number
117+
type: integer
118118
minimum: 1
119119
maximum: 4
120120
example: 2
@@ -133,45 +133,11 @@ definitions:
133133
type: string
134134
enum: [DOUBLE, INT, STRING, BOOLEAN, U_INT64, DATE_TIME]
135135
example: DOUBLE
136-
SearchPath:
137-
title: Search Path
138-
description: A string describing which tag(s) a rule applies to. This can take the form of either
139-
a single tag's path, or a string containing wildcard characters which can match multiple tags.
140-
type: string
141-
example: '*.System.Health.DiskUsePercentage'
142136
Conditions:
143137
description: Array containing one or more conditions which control when a rule creates or clears alarms.
144138
type: array
145139
items:
146140
$ref: '#/definitions/Condition'
147-
Disabled:
148-
description: A value indicating whether or not a rule is disabled.
149-
type: boolean
150-
example: false
151-
default: false
152-
DisplayName:
153-
description: Display string for a rule's name.
154-
type: string
155-
example: Low Disk Space Rule
156-
Description:
157-
description: Display string for a rule's description.
158-
type: string
159-
example: Preconfigured rule for monitoring managed systems' disk space
160-
AlarmInstanceDisplayNameTemplate:
161-
description: Template string which will be used to set the *displayName* field on alarms created
162-
by a rule. Values surrounded by angle brackets will be substituted with values from the tag's property
163-
dictionary. For example, if an *alarmInstanceDisplayNameTemplate* contained the string "Excessive vibration
164-
on turbine <turbine_number>", and the rule was evaluated against a tag whose property dictionary
165-
contained the key "turbine_number" with value "5", then the rule would request that an alarm with
166-
display name "Excessive vibration on turbine 5" be created.
167-
example: Excessive vibration on turbine <turbine_number>
168-
type: string
169-
AlarmInstanceDescriptionTemplate:
170-
description: Template string which will be used to set the *description* field on alarms created by a rule.
171-
Values surrounded by angle brackets will be substituted with values from the tag's property dictionary.
172-
See the description of AlarmInstanceDisplayNameTemplate for more information.
173-
example: Disk space on <system> is low. Disk usage was <value>% when this alarm was triggered.
174-
type: string
175141
Keywords:
176142
description: Words or phrases associated with a rule. Rules can be taggedwith keywords to make it easier
177143
to find them with queries.
@@ -195,21 +161,42 @@ definitions:
195161
the rule type itself.
196162
properties:
197163
searchPath:
198-
$ref: '#/definitions/SearchPath'
164+
description: A string describing which tag(s) a rule applies to. This can take the form of either
165+
a single tag's path, or a string containing wildcard characters which can match multiple tags.
166+
type: string
167+
example: '*.System.Health.DiskUsePercentage'
199168
tagDataType:
200169
$ref: '#/definitions/TagDataType'
201170
conditions:
202171
$ref: '#/definitions/Conditions'
203172
disabled:
204-
$ref: '#/definitions/Disabled'
173+
description: A value indicating whether or not a rule is disabled.
174+
type: boolean
175+
example: false
176+
default: false
205177
displayName:
206-
$ref: '#/definitions/DisplayName'
178+
description: Display string for a rule's name.
179+
type: string
180+
example: Low Disk Space Rule
207181
description:
208-
$ref: '#/definitions/Description'
182+
description: Display string for a rule's description.
183+
type: string
184+
example: Preconfigured rule for monitoring managed systems' disk space
209185
alarmInstanceDisplayNameTemplate:
210-
$ref: '#/definitions/AlarmInstanceDisplayNameTemplate'
186+
description: Template string which will be used to set the *displayName* field on alarms created
187+
by a rule. Values surrounded by angle brackets will be substituted with values from the tag's property
188+
dictionary. For example, if an *alarmInstanceDisplayNameTemplate* contained the string "Excessive vibration
189+
on turbine <turbine_number>", and the rule was evaluated against a tag whose property dictionary
190+
contained the key "turbine_number" with value "5", then the rule would request that an alarm with
191+
display name "Excessive vibration on turbine 5" be created.
192+
example: Excessive vibration on turbine <turbine_number>
193+
type: string
211194
alarmInstanceDescriptionTemplate:
212-
$ref: '#/definitions/AlarmInstanceDescriptionTemplate'
195+
description: Template string which will be used to set the *description* field on alarms created by a rule.
196+
Values surrounded by angle brackets will be substituted with values from the tag's property dictionary.
197+
See the description of AlarmInstanceDisplayNameTemplate for more information.
198+
example: Disk space on <system> is low. Disk usage was <value>% when this alarm was triggered.
199+
type: string
213200
keywords:
214201
$ref: '#/definitions/Keywords'
215202
properties:
@@ -266,6 +253,7 @@ paths:
266253
version:
267254
description: Implementation version of the web service
268255
type: string
256+
example: 18.0
269257
/{version}:
270258
parameters:
271259
- in: path
@@ -311,21 +299,42 @@ paths:
311299
- conditions
312300
properties:
313301
searchPath:
314-
$ref: '#/definitions/SearchPath'
302+
description: A string describing which tag(s) a rule applies to. This can take the form of either
303+
a single tag's path, or a string containing wildcard characters which can match multiple tags.
304+
type: string
305+
example: '*.System.Health.DiskUsePercentage'
315306
tagDataType:
316307
$ref: '#/definitions/TagDataType'
317308
conditions:
318309
$ref: '#/definitions/Conditions'
319310
disabled:
320-
$ref: '#/definitions/Disabled'
311+
description: A value indicating whether or not a rule is disabled.
312+
type: boolean
313+
example: false
314+
default: false
321315
displayName:
322-
$ref: '#/definitions/DisplayName'
316+
description: Display string for a rule's name.
317+
type: string
318+
example: Low Disk Space Rule
323319
description:
324-
$ref: '#/definitions/Description'
320+
description: Display string for a rule's description.
321+
type: string
322+
example: Preconfigured rule for monitoring managed systems' disk space
325323
alarmInstanceDisplayNameTemplate:
326-
$ref: '#/definitions/AlarmInstanceDisplayNameTemplate'
324+
description: Template string which will be used to set the *displayName* field on alarms created
325+
by a rule. Values surrounded by angle brackets will be substituted with values from the tag's property
326+
dictionary. For example, if an *alarmInstanceDisplayNameTemplate* contained the string "Excessive vibration
327+
on turbine <turbine_number>", and the rule was evaluated against a tag whose property dictionary
328+
contained the key "turbine_number" with value "5", then the rule would request that an alarm with
329+
display name "Excessive vibration on turbine 5" be created.
330+
example: Excessive vibration on turbine <turbine_number>
331+
type: string
327332
alarmInstanceDescriptionTemplate:
328-
$ref: '#/definitions/AlarmInstanceDescriptionTemplate'
333+
description: Template string which will be used to set the *description* field on alarms created by a rule.
334+
Values surrounded by angle brackets will be substituted with values from the tag's property dictionary.
335+
See the description of AlarmInstanceDisplayNameTemplate for more information.
336+
example: Disk space on <system> is low. Disk usage was <value>% when this alarm was triggered.
337+
type: string
329338
keywords:
330339
$ref: '#/definitions/Keywords'
331340
properties:
@@ -344,7 +353,7 @@ paths:
344353
401:
345354
description: Unauthorized
346355
schema:
347-
$ref: '#/definitions/Error'
356+
$ref: '#/responses/Unauthorized'
348357
default:
349358
$ref: '#/responses/Error'
350359
/v1/rules/{id}:
@@ -368,7 +377,7 @@ paths:
368377
401:
369378
description: Unauthorized
370379
schema:
371-
$ref: '#/definitions/Error'
380+
$ref: '#/responses/Unauthorized'
372381
default:
373382
$ref: '#/responses/Error'
374383
delete:
@@ -383,7 +392,7 @@ paths:
383392
401:
384393
description: Unauthorized
385394
schema:
386-
$ref: '#/definitions/Error'
395+
$ref: '#/responses/Unauthorized'
387396
default:
388397
$ref: '#/responses/Error'
389398
patch:
@@ -392,6 +401,8 @@ paths:
392401
description: Modifies a rule. All fields specified will have their values replaced with the given values.
393402
operationId: ModifyRule
394403
x-ni-operation: writeRules
404+
consumes:
405+
- application/merge-patch+json
395406
parameters:
396407
- in: body
397408
name: Request body
@@ -404,7 +415,7 @@ paths:
404415
401:
405416
description: Unauthorized
406417
schema:
407-
$ref: '#/definitions/Error'
418+
$ref: '#/responses/Unauthorized'
408419
default:
409420
$ref: '#/responses/Error'
410421
/v1/delete-rules:
@@ -419,6 +430,10 @@ paths:
419430
name: Request body
420431
required: true
421432
schema:
433+
title: DeleteRequestBody
434+
type: object
435+
required:
436+
- ids
422437
properties:
423438
ids:
424439
description: The IDs of the rules which should be deleted.
@@ -432,7 +447,7 @@ paths:
432447
401:
433448
description: Unauthorized
434449
schema:
435-
$ref: '#/definitions/Error'
450+
$ref: '#/responses/Unauthorized'
436451
default:
437452
$ref: '#/responses/Error'
438453
/v1/toggle-rules:
@@ -447,6 +462,11 @@ paths:
447462
name: Request body
448463
required: true
449464
schema:
465+
title: ToggleRequestBody
466+
type: object
467+
required:
468+
- ids
469+
- disabled
450470
properties:
451471
ids:
452472
description: The IDs of the rules which should be toggled.
@@ -455,11 +475,16 @@ paths:
455475
type: string
456476
example: [5c40ec55e0d6441168b4c543, 5c40ec55e0d6441168b4c543]
457477
disabled:
458-
$ref: '#/definitions/Disabled'
478+
description: A value indicating whether or not a rule is disabled.
479+
type: boolean
480+
example: false
481+
default: false
459482
responses:
460483
200:
461484
description: OK
462485
schema:
486+
title: ToggleResponse
487+
type: object
463488
properties:
464489
toggled:
465490
description: The IDs of the rules which were toggled.
@@ -476,7 +501,7 @@ paths:
476501
401:
477502
description: Unauthorized
478503
schema:
479-
$ref: '#/definitions/Error'
504+
$ref: '#/responses/Unauthorized'
480505
default:
481506
$ref: '#/responses/Error'
482507
/v1/query-rules:
@@ -491,6 +516,8 @@ paths:
491516
name: Request body
492517
required: true
493518
schema:
519+
title: QueryRequestBody
520+
type: object
494521
properties:
495522
displayName:
496523
description: Display name query. Returns rules whose *displayName* fields contain the query
@@ -505,7 +532,7 @@ paths:
505532
tagPath:
506533
description: Tag path query. If the query string contains wildcard characters, the service
507534
will return rules whose *searchPaths* either intersect with, or are matched by, the query
508-
string. For example, if the query string is CRIO1 .System.Health.*, then the service would
535+
string. For example, if the query string is CRIO1.System.Health.*, then the service would
509536
return rules with search paths of CRIO1.System.Health.Foo and
510537
*.System.Health.DiskUsePercentage. The former is matched by the query string, and the latter
511538
intersects with the query string, as there exists a string which could be matched by both
@@ -546,6 +573,8 @@ paths:
546573
200:
547574
description: OK
548575
schema:
576+
title: QueryResponse
577+
type: object
549578
properties:
550579
rules:
551580
description: The rules matched by the filter criteria in the request body.
@@ -559,6 +588,6 @@ paths:
559588
401:
560589
description: Unauthorized
561590
schema:
562-
$ref: '#/definitions/Error'
591+
$ref: '#/responses/Unauthorized'
563592
default:
564593
$ref: '#/responses/Error'

0 commit comments

Comments
 (0)