Swagger Command examples

Swagger POST /command example

Submit a command to execute.

Perform the following steps to execute the API:
  1. Expand the Command section.
  2. Click POST /command.
  3. Click Try it Out.
  4. 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.
  5. Specify the request body in the following format, where commandName is the name of a command listed in the commandName tables in https://server-name/ws/powerscui/command, elementId is the fully-qualified name of the system on which to execute the command, and arguments are the command-specific arguments that are listed in the table.
    {
      "orders": [
        {
       "commandName" : "command",
       "elementId" : "system name",
       "arguments" : command arguments
        },
        :
        :
      ]
    }
    
    For example, for the refreshStaus command that does not accept any arguments:
    {
      "orders": [
        {
       "commandName" : "refreshStatus",
       "elementId" : "system-name.com"
        },
        :
        :
      ]
    }
    
  6. 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.
  1. Expand the Command section.
  2. Click POST /command/results.
  3. Click Try it Out.
  4. 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.
  5. 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" <-- 
        }
      ]
    }
  6. Supply the request body in the following format:
    {
      "keys": [
        "4"
      ]
    }
  7. 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.
  1. Expand the Command section.
  2. Click POST /timelineEvents.
  3. Click Try it Out.
  4. 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.
  5. Enter a UID or hostname in the text box and click Add item. Click Add item again to specify additional systems.
  6. Enter the name of an existing group in the groupName text box.
  7. Optionally, click includeHidden and set it to true to include hidden events. A hidden event is not otherwise included in the number of events.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  1. Expand the Command section.
  2. Click POST /command.
  3. Click Try it Out.
  4. 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.
  5. Specify the request body in the following format, where checkCompliance checks the compliance level as described in the commandName tables in https://server-name/ws/powerscui/command, and elementId is the fully-qualified name of the system on which to execute the command.
    {
      "orders": [
       
        {
          "commandName": "checkCompliance",
          "elementId": "system name"   
        }        
        ]
    }
    
  6. 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.

  7. Click GET /ruleFailures.
  8. Click Try it Out.
  9. Enter a UID or hostname in the text box. Click Add item to specify additional systems.
  10. Enter the name of an existing group in the groupName text box.
  11. 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).
  12. 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.
  13. 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"
        },
     :
     :