5.13.1 Previous execution history acquisition
- Description
-
Gets history information that shows when the response actions corresponding to either the specified IM management node or suggestion IDs were previously executed.
- Execution permissions
-
-
JP1_Console_Admin
-
JP1_Console_Operator
-
JP1_Console_User
-
- API version
-
v1
- Format
-
- Request line
POST /application/component/apivVersion/nodes/suggestions/history httpVersion
- Request message body
{ "sid": tree-SID-of-IM-management-node, "suggestionIds": list-of-suggestion-IDs }
- Response message body
{ "histories":[ { "suggestionId": suggestion-ID, "label": display-name-of-suggestion, "jp1UserName": name-of-JP1-user-executing-response-action, "startTime": date-and-time-when-response-action-started, "endTime": date-and-time-when-response-action-ended, "status" : response-action-execution-status }, ... ] }
- Parameters
-
- sid
-
Specify the tree SID of the IM management node. This parameter cannot be omitted.
- suggestionIds
-
Specify a list of suggestion IDs. You can specify a list of 1 to 1,000 suggestion IDs. If you specify an empty list, the error message KAJY22019-E is output, and the acquisition of the history of the previously executed response actions stops.
When this parameter is omitted, the history of previously executed response actions is acquired for only those suggestion definitions mapped to the specified IM management node that the logged-in user is qualified to view.
When the specified suggestion IDs correspond to either those suggestions definitions that are not mapped to the tree SID of the specified IM management node or those which the logged-in user is not allowed to view, the error message KAJY22021-E is output, and the acquisition of the history of the previously executed response actions stops.
- Status codes
-
The following table describes the status codes that may be returned as a response to the request:
Status code
Message
Description
200
None
Successfully acquired the previous execution history.
400
KAJY22019-E
The request of the REST API is invalid.
The possible causes are: invalid format of the tree SID of the IM management node, invalid suggestion IDs, invalid number of lists of suggestion IDs, etc.
KAJY22022-E
The request of the REST API is invalid.
There are duplicate suggestion IDs.
KAJY22011-E
Either the specified tree SID does not exist or the logged-in user does not have the permission to view the specified IM management node.
KAJY22021-E
The specified suggestion IDs correspond to either those suggestions that are not mapped to the specified IM management node or those which the logged-in user is not allowed to view.
403
KAJY01000-E
The logged-in user does not have the permission to execute the REST API.
When the status code is 200, the following information is returned in the response body:
No.
Member name
Data type
Description
1
histories
object[]
Returns the history of previously executed response actions as an array.
When there are no suggestion definitions that are mapped to the tree SID of the specified IM management node, or when the logged-in user is allowed to view none of the suggestion definitions mapped to the tree SID of the specified IM management node, an empty array is returned.
2
suggestionId
string
Sets the suggestion ID.
3
label
string
Sets the display name of the suggestion.
4
jp1UserName
string
The name of the JP1 user executing the response action. This member is not returned when there is no previous execution history.
5
startTime
string
Returns the date and time when the response action was executed, as UTC time in ISO 8601 format. This member is not returned when there is no previous execution history.
6
endTime
string
Returns the date and time when the execution of the response action was completed, as UTC time in ISO 8601 format. When the response action is currently being executed or has failed, an empty string is returned. This member is not returned when there is no previous execution history.
7
status
int
The execution status of the response action. One of the following values is returned:
-
0: Currently being executed
-
1: Successfully executed
-
2: Failed
This member is not returned when there is no previous execution history.
-
- Examples
-
The following example shows how to use this API:
- Request:
POST http://hostname:20703/im/api/v1/nodes/suggestions/history { "sid":"_ROOT_AllSystems/_HOST_HOSTA/_CATEGORY_managementApplications/_OBJECT_JP1IMMGR" }
- Response:
{ "histories":[ { "suggestionId":"exec_jim_log", "label":"Execution of JP1/IM data collection tool", "jp1UserName":"jp1admin", "startTime":"2020-03-01T00:00:00Z", "endTime":"", "status" :0 }, { "suggestionId":"reg_ticket", "label":"Registration of ticket to Redmine", "jp1UserName":"jp1admin", "startTime":"2020-03-01T00:00:00Z", "endTime":"2020-03-01T00:00:10Z", "status" :1 } ] }