Skip to content

Commit 7138cf2

Browse files
author
Rares POP
committed
Fix SystemManagement swagger
- fix examples - fix grains/feeds/packages, as dicts - fix sysapi/groups and lists Signed-off-by: Rares POP <[email protected]>
1 parent 93fad7b commit 7138cf2

File tree

1 file changed

+56
-28
lines changed

1 file changed

+56
-28
lines changed

systems-management/nisysmgmt.yml

Lines changed: 56 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,25 @@ definitions:
587587
example: 19.0
588588
required: [activated]
589589

590-
ManagedSystemDataProperty:
590+
ManagedSystemDataPropertyList:
591+
description: Property of a system composed by the last updated timestamp and a list with the actual data.
592+
type: object
593+
properties:
594+
lastUpdatedTimestamp:
595+
description: Last updated timestamp.
596+
type: string
597+
format: iso-date-time
598+
example: '2019-02-11T13:32:06.030958Z'
599+
data:
600+
description: The actual data.
601+
type: array
602+
items:
603+
type: object
604+
example:
605+
- Lab1
606+
required: [lastUpdatedTimestamp, data]
607+
608+
ManagedSystemDataPropertyMap:
591609
description: Property of a system composed by the last updated timestamp and a dictionary with the actual data.
592610
type: object
593611
properties:
@@ -599,6 +617,8 @@ definitions:
599617
data:
600618
description: The actual data.
601619
type: object
620+
additionalProperties:
621+
type: object
602622
example:
603623
key: value
604624
required: [lastUpdatedTimestamp, data]
@@ -656,7 +676,7 @@ definitions:
656676
required: [lastUpdatedTimestamp, data]
657677
grains:
658678
description: General information about the system.
659-
$ref: '#/definitions/ManagedSystemDataProperty'
679+
$ref: '#/definitions/ManagedSystemDataPropertyMap'
660680
example:
661681
lastUpdatedTimestamp: '2019-02-19T11:42:25.078Z'
662682
data:
@@ -672,7 +692,7 @@ definitions:
672692
osrelease: 7
673693
packages:
674694
description: Software packages installed on the system.
675-
$ref: '#/definitions/ManagedSystemDataProperty'
695+
$ref: '#/definitions/ManagedSystemDataPropertyMap'
676696
example:
677697
lastUpdatedTimestamp: '2019-02-19T11:42:25.078Z'
678698
data:
@@ -696,7 +716,7 @@ definitions:
696716
version: 19.5.0.28-0+d28
697717
feeds:
698718
description: Feeds configured on the system.
699-
$ref: '#/definitions/ManagedSystemDataProperty'
719+
$ref: '#/definitions/ManagedSystemDataPropertyMap'
700720
example:
701721
lastUpdatedTimestamp: '2019-02-19T11:42:25.078Z'
702722
data:
@@ -712,7 +732,7 @@ definitions:
712732
uri: http://download.ni.com/support/nipkg/products/ni-package-manager/eulas
713733
sysapi:
714734
description: System API information.
715-
$ref: '#/definitions/ManagedSystemDataProperty'
735+
$ref: '#/definitions/ManagedSystemDataPropertyList'
716736
example:
717737
lastUpdatedTimestamp: '2019-02-19T11:42:25.078Z'
718738
data:
@@ -734,11 +754,21 @@ definitions:
734754
value: false
735755
groups:
736756
description: Specifies the groups to which the system is assigned.
737-
$ref: '#/definitions/ManagedSystemDataProperty'
738-
example:
739-
lastUpdatedTimestamp: '2019-02-19T11:42:25.078Z'
757+
type: object
758+
properties:
759+
lastUpdatedTimestamp:
760+
description: Last updated timestamp.
761+
type: string
762+
format: iso-date-time
763+
example: '2019-02-19T11:42:25.078Z'
740764
data:
741-
- 121b471c-d7d4-4996-a38f-27f7e58be070
765+
description: A list of strings defining metadata information about a system.
766+
type: array
767+
items:
768+
type: string
769+
example:
770+
- Lab1
771+
required: [lastUpdatedTimestamp, data]
742772
keywords:
743773
description: Keywords metadata information about a system.
744774
type: object
@@ -796,7 +826,7 @@ definitions:
796826
$ref: '#/definitions/ReportType'
797827
filter:
798828
type: string
799-
example: grains.data.os==""NILinuxRT""
829+
example: grains.data.os=="NILinuxRT"
800830
description: Specifies the filter criteria for systems.
801831
required: [ids, type]
802832

@@ -1119,10 +1149,9 @@ definitions:
11191149
description: The name of the package.
11201150
example: "ni-securityupdate-kb67l8lcqw-killbits"
11211151
plugin:
1122-
type: integer
1123-
format: int32
1152+
type: string
11241153
description: Agent that will be used to install the package.
1125-
example: 2
1154+
example: "wininst"
11261155
predepends:
11271156
type: array
11281157
description: An array containing information about other packages this package predepends.
@@ -1131,10 +1160,9 @@ definitions:
11311160
type: string
11321161
example: "ni-teststand-2017-tools (>= 17.0.0)"
11331162
priority:
1134-
type: integer
1135-
format: int32
1163+
type: string
11361164
description: The priority of the package.
1137-
example: 4
1165+
example: "standard"
11381166
provides:
11391167
type: array
11401168
description: An array containing information about other packages this package provides.
@@ -1189,7 +1217,7 @@ definitions:
11891217
description: An array containing tags for the package.
11901218
items:
11911219
type: string
1192-
description: Tag for the package.
1220+
description: The tag for the package.
11931221
example: ".NET"
11941222
userVisible:
11951223
type: boolean
@@ -1325,7 +1353,7 @@ definitions:
13251353
example: 100
13261354
filter:
13271355
type: string
1328-
example: connected.data.state==""CONNECTED""
1356+
example: connected.data.state=="CONNECTED"
13291357
description: >-
13301358
The filter criteria for jobs or systems. Consists of a string of queries composed using AND/OR operators.
13311359
String values and date strings need to be enclosed in double quotes.
@@ -1375,14 +1403,14 @@ definitions:
13751403
13761404
- config.user: String representing the user who created the job.
13771405
1378-
- config.tgt: List of strings representing the targeted systems. Example: config.tgt.Contains(""id"")
1406+
- config.tgt: List of strings representing the targeted systems. Example: config.tgt.Contains("id")
13791407
1380-
- config.fun: List of strings representing the functions to be executed within the job. Example: config.fun.Contains(""nisysmgmt.set_blackout"")
1408+
- config.fun: List of strings representing the functions to be executed within the job. Example: config.fun.Contains("nisysmgmt.set_blackout")
13811409
1382-
- config.arg: An array of arrays of variable type elements that are arguments to the function specified by the "fun" property. Example: config.arg[0].Contains(""test"")
1410+
- config.arg: An array of arrays of variable type elements that are arguments to the function specified by the "fun" property. Example: config.arg[0].Contains("test")
13831411
13841412
- result.return: An array of objects representing return values for each executed function. Example:
1385-
result.return[0].Contains(""Success"")
1413+
result.return[0].Contains("Success")
13861414
13871415
- result.retcode: An array of integers representing code values for each executed function. Example: result.retcode
13881416
@@ -1413,7 +1441,7 @@ definitions:
14131441
14141442
- grains.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system grains were updated.
14151443
1416-
- grains.data: Dictionary of string to object representing general information about the system. Example: grains.data.os == ""Windows""
1444+
- grains.data: Dictionary of string to object representing general information about the system. Example: grains.data.os == "Windows"
14171445
14181446
- packages.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system installed packages were updated.
14191447
@@ -1429,15 +1457,15 @@ definitions:
14291457
14301458
- groups.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system groups data was updated.
14311459
1432-
- groups.data: Array of strings representing the IDs of the groups the system is assigned to. Example: groups.data.Contains(""id"")
1460+
- groups.data: Array of strings representing the IDs of the groups the system is assigned to. Example: groups.data.Contains("id")
14331461
14341462
- keywords.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system keywords were updated.
14351463
1436-
- keywords.data: Array of strings representing the keywords of the system. Example: keywords.data.Contains(""test"")
1464+
- keywords.data: Array of strings representing the keywords of the system. Example: keywords.data.Contains("test")
14371465
14381466
- properties.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system properties were updated.
14391467
1440-
- properties.data: Dictionary of string to string representing metadata information about a system. Example: properties.data.owner == ""admin""
1468+
- properties.data: Dictionary of string to string representing metadata information about a system. Example: properties.data.owner == "admin"
14411469
projection:
14421470
type: string
14431471
example: 'new(id,grains,lastUpdatedTimestamp)'
@@ -2168,7 +2196,7 @@ paths:
21682196
x-example:
21692197
skip: 100
21702198
take: 100
2171-
filter: 'id == ""VMware_Virtual_Platform--SN-VMware-56_4d_70_f1_81_06_04_3b-55_19_2a_87_f6_41_20_e5--MAC-00-0C-29-41-20-E5""'
2199+
filter: 'id == "VMware_Virtual_Platform--SN-VMware-56_4d_70_f1_81_06_04_3b-55_19_2a_87_f6_41_20_e5--MAC-00-0C-29-41-20-E5"'
21722200
projection: 'new(jid,id,lastUpdatedTimestamp,state,result)'
21732201
orderBy: 'lastUpdatedTimestamp descending'
21742202
schema:
@@ -2200,7 +2228,7 @@ paths:
22002228
x-example:
22012229
skip: 10
22022230
take: 10
2203-
filter: 'connected.data.state == ""CONNECTED"" && grains.data.os == ""Windows""'
2231+
filter: 'connected.data.state == "CONNECTED" && grains.data.os == "Windows"'
22042232
projection: 'new(id,lastUpdatedTimestamp,connected,packages)'
22052233
orderBy: 'connected.data.state'
22062234
schema:

0 commit comments

Comments
 (0)