Skip to content

Commit ecbd43f

Browse files
committed
Implemented feedback from Vlad
Signed-off-by: Cristian Hotea <[email protected]>
1 parent 5cdd4f6 commit ecbd43f

File tree

1 file changed

+125
-6
lines changed

1 file changed

+125
-6
lines changed

systems-management/nisysmgmt.yml

Lines changed: 125 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ definitions:
796796
$ref: '#/definitions/ReportType'
797797
filter:
798798
type: string
799-
example: grains.data.os==NILinuxRT
799+
example: grains.data.os==""NILinuxRT""
800800
description: Specifies the filter criteria for systems.
801801
required: [ids, type]
802802

@@ -1322,8 +1322,119 @@ definitions:
13221322
example: 100
13231323
filter:
13241324
type: string
1325-
example: connected.data.state==CONNECTED
1326-
description: The criteria used to filter resources.
1325+
example: connected.data.state==""CONNECTED""
1326+
description: >-
1327+
The filter criteria for jobs or systems. Consists of a string of queries composed using AND/OR operators.
1328+
String values and date strings need to be enclosed in double quotes.
1329+
Parenthesis can be used around filters to better define the order of operations.
1330+
1331+
Filter syntax: '[property name][operator][operand] and [property name][operator][operand]'
1332+
1333+
1334+
Operators:
1335+
1336+
- Equals operator '='. Example: 'x = y'
1337+
1338+
- Not equal operator '!='. Example: 'x != y'
1339+
1340+
- Greater than operator '>'. Example: 'x > y'
1341+
1342+
- Greater than or equal operator '>='. Example: 'x >= y'
1343+
1344+
- Less than operator '<'. Example: 'x < y'
1345+
1346+
- Less than or equal operator '<='. Example: 'x <= y'
1347+
1348+
- Logical AND operator 'and' or '&&'. Example: 'x and y'
1349+
1350+
- Logical OR operator 'or' or '||'. Example: 'x or y'
1351+
1352+
- Contains operator '.Contains()', used to check if a list contains an element. Example: 'x.Contains(y)'
1353+
1354+
- Not Contains operator '!.Contains()', used to check if a list does not contain an element. Example: '!x.Contains(y)'
1355+
1356+
1357+
Valid job properties that can be used in the filter:
1358+
1359+
- jid : String representing the ID of the job.
1360+
1361+
- id : String representing the ID of the system.
1362+
1363+
- createdTimestamp: ISO-8601 formatted timestamp string specifying the date when the job was created.
1364+
1365+
- lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the job was updated.
1366+
1367+
- dispatchedTimestamp: ISO-8601 formatted timestamp string specifying the date when the job was actually sent to the system.
1368+
1369+
- state: String representing the state of the job.
1370+
1371+
- metadata: Object containg the the metadata of job. Example: metadata.queued
1372+
1373+
- config.user: String representing the user who created the job.
1374+
1375+
- config.tgt: List of strings representing the targeted systems. Example: config.tgt.Contains(""id"")
1376+
1377+
- config.fun: List of strings representing the functions to be executed within the job. Example: config.fun.Contains(""nisysmgmt.set_blackout"")
1378+
1379+
- 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"")
1380+
1381+
- result.return: An array of objects representing return values for each executed function. Example:
1382+
result.return[0].Contains(""Success"")
1383+
1384+
- result.retcode: An array of integers representing code values for each executed function. Example: result.retcode
1385+
1386+
- result.success: An array of booleans representing success values for each executed function. Example:
1387+
result.success.Contains(false)
1388+
1389+
Valid system properties that can be used in the filter:
1390+
1391+
- id : String representing the ID of the system.
1392+
1393+
- createdTimestamp: ISO-8601 formatted timestamp string specifying the date when the system was registered.
1394+
1395+
- lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system was updated.
1396+
1397+
- alias: String representing the alias of the system.
1398+
1399+
- activation.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system activation was updated.
1400+
1401+
- activation.data.activated: Boolean representing whether the system is activated or not.
1402+
1403+
- activation.data.licenseName: String representing the name of the license.
1404+
1405+
- activation.data.licenseVersion: String representing the license version.
1406+
1407+
- connected.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system connection was updated.
1408+
1409+
- connected.data.state: String representing the state of the system.
1410+
1411+
- grains.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system grains were updated.
1412+
1413+
- grains.data: Dictionary of string to object representing general information about the system. Example: grains.data.os == ""Windows""
1414+
1415+
- packages.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system installed packages were updated.
1416+
1417+
- packages.data: Dictionary representing software packages installed on the system. Example: packages.data.ni-package-manager-upgrader.version: String representing the installed version of ni-package-manager-upgrader package.
1418+
1419+
- feeds.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system configured feeds were updated.
1420+
1421+
- feeds.data: Dictionary representing the feeds configured on the system.
1422+
1423+
- sysapi.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system sysapi data was updated.
1424+
1425+
- sysapi.data: Dictionary representing system API information of a system.
1426+
1427+
- groups.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system groups data was updated.
1428+
1429+
- groups.data: Array of strings representing the IDs of the groups the system is assigned to. Example: groups.data.Contains(""id"")
1430+
1431+
- keywords.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system keywords were updated.
1432+
1433+
- keywords.data: Array of strings representing the keywords of the system. Example: keywords.data.Contains(""test"")
1434+
1435+
- properties.lastUpdatedTimestamp: ISO-8601 formatted timestamp string specifying the last date the system properties were updated.
1436+
1437+
- properties.data: Dictionary of string to string representing metadata information about a system. Example: properties.data.owner == ""admin""
13271438
projection:
13281439
type: string
13291440
example: 'new(id,grains,lastUpdatedTimestamp)'
@@ -1406,7 +1517,7 @@ paths:
14061517
x-ni-operation: createOrCancelJobs
14071518
tags: [jobs]
14081519
summary: Create a job
1409-
description: Create a job.
1520+
description: Create a job and returns the newly created job including the job ID.
14101521
parameters:
14111522
- in: body
14121523
name: CreateJobRequest
@@ -1619,6 +1730,10 @@ paths:
16191730
type: array
16201731
items:
16211732
$ref: '#/definitions/SystemInfo'
1733+
401:
1734+
$ref: '#/responses/Unauthorized'
1735+
default:
1736+
$ref: '#/responses/Error'
16221737
/v1/get-systems-summary:
16231738
get:
16241739
operationId: GetSystemsSummary
@@ -1800,6 +1915,8 @@ paths:
18001915
$ref: '#/responses/BadRequest'
18011916
401:
18021917
$ref: '#/responses/Unauthorized'
1918+
404:
1919+
$ref: '#/responses/NotFound'
18031920
default:
18041921
$ref: '#/responses/Error'
18051922
/v1/remove-groups:
@@ -2024,6 +2141,8 @@ paths:
20242141
$ref: '#/responses/BadRequest'
20252142
401:
20262143
$ref: '#/responses/Unauthorized'
2144+
404:
2145+
$ref: '#/responses/NotFound'
20272146
default:
20282147
$ref: '#/responses/Error'
20292148
/v1/query-jobs:
@@ -2042,7 +2161,7 @@ paths:
20422161
x-example:
20432162
skip: 100
20442163
take: 100
2045-
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'
2164+
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""'
20462165
projection: 'new(jid,id,lastUpdatedTimestamp,state,result)'
20472166
orderBy: 'lastUpdatedTimestamp descending'
20482167
schema:
@@ -2074,7 +2193,7 @@ paths:
20742193
x-example:
20752194
skip: 10
20762195
take: 10
2077-
filter: 'connected.data.state == CONNECTED && grains.data.os == Windows'
2196+
filter: 'connected.data.state == ""CONNECTED"" && grains.data.os == ""Windows""'
20782197
projection: 'new(id,lastUpdatedTimestamp,connected,packages)'
20792198
orderBy: 'connected.data.state'
20802199
schema:

0 commit comments

Comments
 (0)