Get CPC Events Log

The Get CPC Events Log operation returns the console events log, filtered according to the query parameters, if specified. This operation is supported using the BCPii interface.

HTTP method and URI

GET /api/cpcs/{cpc-id}/operations/get-events-log

In this request, the URI variable {cpc-id} is the object ID of the target CPC object.

Query Parameters

Name Type Rqd/Opt Description
begin-time Timestamp Optional A timestamp used to filter log entries. Entries created earlier than this time are omitted from the results. This is specified as the number of milliseconds since the epoch and must be greater than or equal to 0. If not specified, then no such filtering is performed.
end-time Timestamp Optional A timestamp used to filter log entries. Entries created later than this time are omitted from the results. This is specified as the number of milliseconds since the epoch and must be greater than or equal to 0. If not specified, then no such filtering is performed.
event-id String Optional A regular expression used to limit returned entries to those that have a matching event ID. This query parameter can be used to limit the data returned to event IDs that are desired. If not specified, then no such filtering is performed.
max-entries Integer Optional An integer value greater than zero that indicates the maximum number of entries to be returned. If specified, this query parameter can only be specified once. Use of this query parameter allows for the data returned to be limited. Using the timestamp of the last entry returned as the begin-time on a subsequent invocation of this operation can get the next set of entries.
Note: For operations using the BCPii interface this query parameter is required and cannot be a value greater than 100.

Response body contents

On successful completion, the response body is a JSON array of JSON objects. For the web services interface the response is returned using HTTP chunked transfer encoding, while for the BCPii interface it is not. Each array element is a log-entry-info object containing information about a single log entry. The array elements are in order of increasing timestamp. See Table 1 for more information.

Description

This operation returns the Console's events log in increasing timestamp order, filtered according to the query parameters, if specified. Each log entry pertains to a specific event that occurred on or to a managed object or the console itself. The log entries can be limited by specifying explicit filtering criteria on the request. If the begin-time query parameter is specified, then any entries earlier than that time are omitted. If the end-time query parameter is specified, then any entries later than that time are omitted. If the event-id query parameter is specified, then any entries with an event ID that does not match are omitted. If the max-entries query parameter is specified, then the number of returned entries will not exceed this value.

For the web services interface the API user must have action/task permission to the View Console Events task; otherwise, status code 403 (Forbidden) is returned. For the BCPii interface the source partition must have receive BCPii security controls permissions for the CPC object; otherwise, status code 403 (Forbidden) is returned.

On successful execution, the response body contains an array of filtered log entries. If the security log is empty or there are no entries to be returned after filtering, then an empty array is provided. Each log entry contains the event ID, event name and event message. If there are data items included in the event message, they are available separately. The order and meaning of the substitution items for each event ID are documented in the console help system in the HMC Introduction topic Audit, Event, and Security Log Messages.

Authorization requirement

This operation has the following authorization requirements:

  • For the web services interface, action/task permission to the View Console Events task.
  • For the BCPii interface the source partition must have receive BCPii security controls permissions for the CPC object.

HTTP status and reason codes

On success, HTTP status code 200 (OK) is returned and the response body is provided as described Response body contents.

The following HTTP status codes are returned for the indicated errors, and the response body is a standard error response body providing the reason code indicated and associated error message.

HTTP error status code Reason code Description
400 (Bad Request) Various Errors were detected during common request validation. See Common request validation reason codes for a list of the possible reason codes.
403 (Forbidden) 0 The request used the BCPii interface and the source partition does not have receive BCPii security controls permission for the CPC object.
1 The API user does not have the required permission for this operation

Additional standard status and reason codes can be returned, as described in Invoking API operations.

Example HTTP interaction

Figure 1. Get CPC Events Log: Request
GET /api/cpcs/f7f2ded1-75dc-3826-9927-0ffa94e22806/operations/get-events-log 
x-api-session: 2t4ixcf8nplr7yersi8i9b953fgxvvqxl8c4r066ge9kcyzr4c
Figure 2. Get CPC Events Log: Response (Part 1)
200 OK
server: Hardware management console API web server / 2.0
transfer-encoding: chunked
cache-control: no-cache
date: Sat, 06 Mar 2021 19:19:44 GMT
content-type: application/json;charset=ISO-8859-1
[
   {
      "event-data-items": [
         {
            "data-item-number": 0, 
            "data-item-type": "string", 
            "data-item-value": "sysprog"
         }, 
         {
            "data-item-number": 1, 
            "data-item-type": "long", 
            "data-item-value": 0
         }, 
         {
            "data-item-number": 2, 
            "data-item-type": "long", 
            "data-item-value": 0
         }, 
         {
            "data-item-number": 3, 
            "data-item-type": "string", 
            "data-item-value": ""
         }, 
         {
            "data-item-number": 4, 
            "data-item-type": "string", 
            "data-item-value": "3"
         }, 
         {
            "data-item-number": 5, 
            "data-item-type": "string", 
            "data-item-value": "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"
         }
      ], 
      "event-details": [], 
      "event-id": "1408", 
      "event-message": "User sysprog has logged on from the console to session id 3.", 
      "event-name": "Logon", 
      "event-time": 1615060019180, 
      "user-uri": "/api/users/8efd81be-7c6a-11eb-ae1e-fa163e1cb540", 
      "userid": "SYSPROG"
   }, 
   {
      "event-data-items": [
         {
            "data-item-number": 0, 
            "data-item-type": "string", 
            "data-item-value": "\"View Console Tasks Performed\""
         }, 
         {
            "data-item-number": 1, 
            "data-item-type": "string", 
            "data-item-value": "5"
         }, 
         {
            "data-item-number": 2, 
            "data-item-type": "string", 
            "data-item-value": "sysprog"
        }, 
Figure 3. Get CPC Events Log: Response (Part 2)
 
         {
            "data-item-number": 3, 
            "data-item-type": "string", 
            "data-item-value": "3"
         }, 
         {
            "data-item-number": 4, 
            "data-item-type": "string", 
            "data-item-value": ""
         }
      ], 
      "event-details": [], 
      "event-id": "1989", 
      "event-message": "Task \"View Console Tasks Performed\" with identifier 5 started by user sysprog in session 3.", 
      "event-name": "TaskStart", 
      "event-time": 1615060035000, 
      "user-uri": "/api/users/8efd81be-7c6a-11eb-ae1e-fa163e1cb540", 
      "userid": "SYSPROG"
   }, 
   {
      "event-data-items": [
         {
            "data-item-number": 0, 
            "data-item-type": "string", 
            "data-item-value": "\"View Console Tasks Performed\""
         }, 
         {
            "data-item-number": 1, 
            "data-item-type": "string", 
            "data-item-value": "5"
         }, 
         {
            "data-item-number": 2, 
            "data-item-type": "string", 
            "data-item-value": "sysprog"
         }
      ], 
      "event-details": [], 
      "event-id": "1991", 
      "event-message": "Task \"View Console Tasks Performed\" with identifier 5 for user sysprog has ended.", 
      "event-name": "TaskEnd", 
      "event-time": 1615060038260, 
      "user-uri": "/api/users/8efd81be-7c6a-11eb-ae1e-fa163e1cb540", 
      "userid": "SYSPROG"
   }
]