Skip to content

Commit f83ddfa

Browse files
author
Rares POP
authored
Merge pull request #59 from rares-pop/dev/iepopr/fix-sysmgmt-swagger-examples-and-make-grains-dictionaries
Fix SystemManagement swagger
2 parents 11dda94 + b2f3ed5 commit f83ddfa

File tree

1 file changed

+67
-31
lines changed

1 file changed

+67
-31
lines changed

systems-management/nisysmgmt.yml

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

590-
ManagedSystemDataProperty:
590+
ManagedSystemSysApiData:
591+
description: Contains the SysAPI information.
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 lists of SysAPI property-bags.
601+
type: array
602+
items:
603+
description: >
604+
A property-bag tend to look like
605+
{
606+
resource_uri = <str>,
607+
[
608+
{
609+
type = <str>,
610+
tag = <int64>,
611+
value = <str>
612+
}
613+
]
614+
}
615+
type: object
616+
required: [lastUpdatedTimestamp, data]
617+
618+
ManagedSystemDataPropertyMap:
591619
description: Property of a system composed by the last updated timestamp and a dictionary with the actual data.
592620
type: object
593621
properties:
@@ -597,8 +625,10 @@ definitions:
597625
format: iso-date-time
598626
example: '2019-02-11T13:32:06.030958Z'
599627
data:
600-
description: The actual data.
628+
description: This map is used for grains/packages/feeds. All these are heterogeneous (integers, booleans, lists, dictionaries, ...) collections containing open-ended properties and flags.
601629
type: object
630+
additionalProperties:
631+
type: object
602632
example:
603633
key: value
604634
required: [lastUpdatedTimestamp, data]
@@ -656,7 +686,7 @@ definitions:
656686
required: [lastUpdatedTimestamp, data]
657687
grains:
658688
description: General information about the system.
659-
$ref: '#/definitions/ManagedSystemDataProperty'
689+
$ref: '#/definitions/ManagedSystemDataPropertyMap'
660690
example:
661691
lastUpdatedTimestamp: '2019-02-19T11:42:25.078Z'
662692
data:
@@ -672,7 +702,7 @@ definitions:
672702
osrelease: 7
673703
packages:
674704
description: Software packages installed on the system.
675-
$ref: '#/definitions/ManagedSystemDataProperty'
705+
$ref: '#/definitions/ManagedSystemDataPropertyMap'
676706
example:
677707
lastUpdatedTimestamp: '2019-02-19T11:42:25.078Z'
678708
data:
@@ -696,7 +726,7 @@ definitions:
696726
version: 19.5.0.28-0+d28
697727
feeds:
698728
description: Feeds configured on the system.
699-
$ref: '#/definitions/ManagedSystemDataProperty'
729+
$ref: '#/definitions/ManagedSystemDataPropertyMap'
700730
example:
701731
lastUpdatedTimestamp: '2019-02-19T11:42:25.078Z'
702732
data:
@@ -712,7 +742,7 @@ definitions:
712742
uri: http://download.ni.com/support/nipkg/products/ni-package-manager/eulas
713743
sysapi:
714744
description: System API information.
715-
$ref: '#/definitions/ManagedSystemDataProperty'
745+
$ref: '#/definitions/ManagedSystemSysApiData'
716746
example:
717747
lastUpdatedTimestamp: '2019-02-19T11:42:25.078Z'
718748
data:
@@ -734,11 +764,20 @@ definitions:
734764
value: false
735765
groups:
736766
description: Specifies the groups to which the system is assigned.
737-
$ref: '#/definitions/ManagedSystemDataProperty'
738-
example:
739-
lastUpdatedTimestamp: '2019-02-19T11:42:25.078Z'
767+
type: object
768+
properties:
769+
lastUpdatedTimestamp:
770+
description: Last updated timestamp.
771+
type: string
772+
format: iso-date-time
773+
example: '2019-02-19T11:42:25.078Z'
740774
data:
741-
- 121b471c-d7d4-4996-a38f-27f7e58be070
775+
description: A list of strings defining metadata information about a system.
776+
type: array
777+
items:
778+
type: string
779+
example: Lab1
780+
required: [lastUpdatedTimestamp, data]
742781
keywords:
743782
description: Keywords metadata information about a system.
744783
type: object
@@ -753,8 +792,7 @@ definitions:
753792
type: array
754793
items:
755794
type: string
756-
example:
757-
- testVM
795+
example: testVM
758796
required: [lastUpdatedTimestamp, data]
759797
properties:
760798
description: Properties metadata information about a system.
@@ -796,7 +834,7 @@ definitions:
796834
$ref: '#/definitions/ReportType'
797835
filter:
798836
type: string
799-
example: grains.data.os==""NILinuxRT""
837+
example: grains.data.os=="NILinuxRT"
800838
description: Specifies the filter criteria for systems.
801839
required: [ids, type]
802840

@@ -1119,10 +1157,9 @@ definitions:
11191157
description: The name of the package.
11201158
example: "ni-securityupdate-kb67l8lcqw-killbits"
11211159
plugin:
1122-
type: integer
1123-
format: int32
1160+
type: string
11241161
description: Agent that will be used to install the package.
1125-
example: 2
1162+
example: "wininst"
11261163
predepends:
11271164
type: array
11281165
description: An array containing information about other packages this package predepends.
@@ -1131,10 +1168,9 @@ definitions:
11311168
type: string
11321169
example: "ni-teststand-2017-tools (>= 17.0.0)"
11331170
priority:
1134-
type: integer
1135-
format: int32
1171+
type: string
11361172
description: The priority of the package.
1137-
example: 4
1173+
example: "standard"
11381174
provides:
11391175
type: array
11401176
description: An array containing information about other packages this package provides.
@@ -1189,7 +1225,7 @@ definitions:
11891225
description: An array containing tags for the package.
11901226
items:
11911227
type: string
1192-
description: Tag for the package.
1228+
description: The tag for the package.
11931229
example: ".NET"
11941230
userVisible:
11951231
type: boolean
@@ -1325,7 +1361,7 @@ definitions:
13251361
example: 100
13261362
filter:
13271363
type: string
1328-
example: connected.data.state==""CONNECTED""
1364+
example: connected.data.state=="CONNECTED"
13291365
description: >-
13301366
The filter criteria for jobs or systems. Consists of a string of queries composed using AND/OR operators.
13311367
String values and date strings need to be enclosed in double quotes.
@@ -1375,14 +1411,14 @@ definitions:
13751411
13761412
- config.user: String representing the user who created the job.
13771413
1378-
- config.tgt: List of strings representing the targeted systems. Example: config.tgt.Contains(""id"")
1414+
- config.tgt: List of strings representing the targeted systems. Example: config.tgt.Contains("id")
13791415
1380-
- config.fun: List of strings representing the functions to be executed within the job. Example: config.fun.Contains(""nisysmgmt.set_blackout"")
1416+
- config.fun: List of strings representing the functions to be executed within the job. Example: config.fun.Contains("nisysmgmt.set_blackout")
13811417
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"")
1418+
- 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")
13831419
13841420
- result.return: An array of objects representing return values for each executed function. Example:
1385-
result.return[0].Contains(""Success"")
1421+
result.return[0].Contains("Success")
13861422
13871423
- result.retcode: An array of integers representing code values for each executed function. Example: result.retcode
13881424
@@ -1413,7 +1449,7 @@ definitions:
14131449
14141450
- grains.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system grains were updated.
14151451
1416-
- grains.data: Dictionary of string to object representing general information about the system. Example: grains.data.os == ""Windows""
1452+
- grains.data: Dictionary of string to object representing general information about the system. Example: grains.data.os == "Windows"
14171453
14181454
- packages.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system installed packages were updated.
14191455
@@ -1429,15 +1465,15 @@ definitions:
14291465
14301466
- groups.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system groups data was updated.
14311467
1432-
- groups.data: Array of strings representing the IDs of the groups the system is assigned to. Example: groups.data.Contains(""id"")
1468+
- groups.data: Array of strings representing the IDs of the groups the system is assigned to. Example: groups.data.Contains("id")
14331469
14341470
- keywords.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system keywords were updated.
14351471
1436-
- keywords.data: Array of strings representing the keywords of the system. Example: keywords.data.Contains(""test"")
1472+
- keywords.data: Array of strings representing the keywords of the system. Example: keywords.data.Contains("test")
14371473
14381474
- properties.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system properties were updated.
14391475
1440-
- properties.data: Dictionary of string to string representing metadata information about a system. Example: properties.data.owner == ""admin""
1476+
- properties.data: Dictionary of string to string representing metadata information about a system. Example: properties.data.owner == "admin"
14411477
projection:
14421478
type: string
14431479
example: 'new(id,grains,lastUpdatedTimestamp)'
@@ -2168,7 +2204,7 @@ paths:
21682204
x-example:
21692205
skip: 100
21702206
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""'
2207+
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"'
21722208
projection: 'new(jid,id,lastUpdatedTimestamp,state,result)'
21732209
orderBy: 'lastUpdatedTimestamp descending'
21742210
schema:
@@ -2200,7 +2236,7 @@ paths:
22002236
x-example:
22012237
skip: 10
22022238
take: 10
2203-
filter: 'connected.data.state == ""CONNECTED"" && grains.data.os == ""Windows""'
2239+
filter: 'connected.data.state == "CONNECTED" && grains.data.os == "Windows"'
22042240
projection: 'new(id,lastUpdatedTimestamp,connected,packages)'
22052241
orderBy: 'connected.data.state'
22062242
schema:

0 commit comments

Comments
 (0)