Swagger Command examples
Swagger POST /command example
Submit a command to execute.
Perform the following steps to execute the API:
- Expand the Command section.
- Click POST /command.
- Click Try it Out.
- Select the media type from the drop-down menu. This controls the header accept type in the curl command. Possible values are application/json and application/xml.
- Specify the request body in the following format, where
commandName
is the name of a command listed in thecommandName
tables in https://server-name/ws/powerscui/command,elementId
is the fully-qualified name of the system on which to execute the command, andarguments
are the command-specific arguments that are listed in the table.
For example, for the refreshStaus command that does not accept any arguments:{ "orders": [ { "commandName" : "command", "elementId" : "system name", "arguments" : command arguments }, : : ] }
{ "orders": [ { "commandName" : "refreshStatus", "elementId" : "system-name.com" }, : : ] }
- Click Execute.Swagger UI submits the request and shows the curl command that was submitted. If successful, the Responses section shows the response with an HTTP status code of 200 OK.
Response body { "KBM_TYPE": "commandHandlerResponse", "results": [ { "KBM_TYPE": "result", "elementId": "system-name.com", "commandName": "refreshStatus", "resultKey": "OK", "result": "4" } ] }
Swagger POST /command/results example
Submit the results command to execute.
Perform the following steps to execute the API.
- Expand the Command section.
- Click POST /command/results.
- Click Try it Out.
- Select the media type from the drop-down menu. This controls the header accept type in the curl command. Possible values are application/json and application/xml.
- Determine the result status that you want. The result status is displayed in the response to a
POST /command API call. For
example:
Response body { "KBM_TYPE": "commandHandlerResponse", "results": [ { "KBM_TYPE": "result", "elementId": "system-name.com", "commandName": "refreshStatus", "resultKey": "OK", "result": "4" <-- } ] }
- Supply the request body in the following format:
{ "keys": [ "4" ] }
- Click Execute.Swagger UI submits the request and shows the curl command that was submitted. If successful, the Responses section shows the response with an HTTP status code of 200 OK.
Response body { "KBM_TYPE": "commandResultsHandlerResponse", "results": { "4": { "uid": "6681249854347280387", "commandName": "refreshStatus", "bestName": "system-name.com", "resultKey": "OK", "result": "" } } }
Swagger POST /timelineEvents example
Get the list of events by event type.
Perform the following steps to execute the API.
- Expand the Command section.
- Click POST /timelineEvents.
- Click Try it Out.
- Select the media type from the drop-down menu. This controls the header accept type in the curl command. Possible values are application/json and application/xml.
- Enter a UID or hostname in the text box and click Add item. Click Add item again to specify additional systems.
- Enter the name of an existing group in the groupName text box.
- Optionally, click includeHidden and set it to true to include hidden events. A hidden event is not otherwise included in the number of events.
- Specify a from-date in the fromDate field in the format MM/DD/YYYY. You can modify the dates to increase or decrease the time range.
- Specify a to-date in the toDate field in the format MM/DD/YYYY. You can modify the dates to increase or decrease the time range.
- Select the event types to receive in the eventTypes field. You can control the events that are displayed in the report. The event types include RTC, Auditd, TE, Compliance, and UpToDate.
- Click Execute.
Swagger UI submits the request and shows the curl command that was submitted. If successful, the Responses section shows the response with an HTTP status code of 200 OK.
Swagger GET /ruleFailures example
Get a list of the failed compliance rules.
Perform the following steps to execute the API. This procedure first executes the
checkCompliance command to check the compliance level for rule failures.
- Expand the Command section.
- Click POST /command.
- Click Try it Out.
- Select the media type from the drop-down menu. This controls the header accept type in the curl command. Possible values are application/json and application/xml.
- Specify the request body in the following format, where
checkCompliance
checks the compliance level as described in thecommandName
tables in https://server-name/ws/powerscui/command, andelementId
is the fully-qualified name of the system on which to execute the command.{ "orders": [ { "commandName": "checkCompliance", "elementId": "system name" } ] }
- Click Execute.
Swagger UI submits the request and shows the curl command that was submitted. If successful, the Responses section shows the response with an HTTP status code of 200 OK.
- Click GET /ruleFailures.
- Click Try it Out.
- Enter a UID or hostname in the text box. Click Add item to specify additional systems.
- Enter the name of an existing group in the groupName text box.
- Leave the Operation control set to null to get any failed rules for the last checked profile. Choose compatibility to get any failed rules for the last simulated profile check you performed in the PowerSC graphical user interface (GUI).
- Select the media type from the drop-down menu. This controls the header accept type in the curl command. Possible values are application/json and application/xml.
- Click Execute.Swagger UI submits the request and shows the curl command that was submitted. If successful, the Responses section shows the response with an HTTP status code of 200 OK.
Response body { "KBM_TYPE": "root", "tuples": [ { "KBM_TYPE": "tuple", "uid": "6692429250491842561", "bestName": "system name", "operation": "check", "logEntryTimestamp": 1595605256000, "complianceLevel": "CISv1", "ruleName": "cisv1_telnet_0DA0C685", "ruleDescription": "Implements CIS Recommendations AIX6.1-1.3.24 and AIX7.1-3.3.24 (Level 1): Disable telnet in /etc/inetd.conf: Comments the entry for telnet daemon in /etc/inetd.conf and kills all instances of telnetd.", "argumentsPassed": "/etc/security/pscexpert/bin/cominetdconf telnet tcp d cisv1_telnet", "ruleStatus": false, "reasonForFailure": " Service telnet using protocol tcp should be disabled, however it is now enabled.\n" }, : :