Swagger Command examples

Submit a command to execute.

Swagger POST /command example

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 GET /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.

start of change

Swagger POST /blackboard example

Hide, unhide, or delete events for the specified time period.

Perform the following steps to execute the API.
  1. Expand the Command section.
  2. Click POST /blackboard example.
  3. Click Try it Out.
  4. Enter a UID or hostname in the text box and click Add string item. Click Add string item again to specify additional systems.
  5. Enter the name of an existing group in the groupName text box and click Add string item. Click Add string item again to specify additional groups.
  6. Click Hide and set it to true to hide the events. Or, click Delete and set it to true to delete the events. You cannot specify both.
  7. 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.
  8. 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.
  9. Specify an event ID to affect only that event. You can use Swagger GET /blackboard example to get the current event IDs.
  10. 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.

end of change
start of change

Swagger GET /blackboard example

Get the list of events.

Perform the following steps to execute the API.
  1. Expand the Command section.
  2. Click GET /blackboard example.
  3. Click Try it Out.
  4. Enter a UID or hostname in the text box and click Add string item. Click Add string item again to specify additional systems.
  5. Enter the name of an existing group in the groupName text box and click Add string item. Click Add string item again to specify additional groups.
  6. Click varmap and set it to true if you want to get the details associated with the event.
  7. Click includeHidden if you want to include hidden events.
  8. For AUDITD_CONTENT_CHANGED events only, click identityVarValue to provide additional granularity for a specific AUDITD_CONTENT_CHANGED event. For example, if the PowerSC GUI displays /test/test1.txt in the details for an Auditd: Content Changed event, specify /test/test1.txt in the identityVarValue field.
  9. Click categoryId and specify an event category to get only events of a specific category. To get the possible category values from your existing events, perform the following steps:
    1. Do not specify categoryId.
    2. Execute GET /blackboard example.
    3. Obtain the category values from the response.
  10. Click limit to set the maximum number of events to return.
  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.

end of change

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"
        },
     :
     :