Hitachi

JP1 Version 12 JP1/Automatic Operation Command and API Reference 


2.8.1 Acquisition of a list of history records

Function

Acquires a list of history records.

Execution permissions

Admin role, Develop role, Modify role, Submit role

API version

v1

Request format

GET http://host:port/Automation/version/objects/TaskHistories

This API function acquires a list of all history records for which the user who executed the API function has permissions. By specifying query parameters, you can filter the history records for which you want to acquire the list. Specify query parameters in the following format:

?query-parameter=value[&query-parameter=value...] 
Table 2‒72: List of query parameters that can be specified for the API function Acquisition of a list of history records

Query parameter

Filter condition

start

Whether startTime is equal to or later than the specified value

end

Whether completionTime is equal to or earlier than the specified value

serviceGroupID

Equal to the specified value

tags

Whether all values are contained. You can specify multiple values by separating them with a comma (,).

q

For the following schema, a full-text search is performed to determine whether the specified value is contained:

  • name

  • submitter

  • serviceName

  • tags

  • description

  • notes

If you specify multiple values by separating them with a half-width space character, a full-text search is performed to determine whether all of the specified values are contained. This query parameter is not case sensitive.

For details about other query parameters that can be specified, see 2.2.9 Query parameter.

Status code

The following table describes the various status codes that can be returned as the response to a request.

Status code

Message

Description

200

OK

Processing has been successfully completed.

400

Bad Request

A query parameter is invalid.

401

Unauthorized

The user does not have login permission.

412

Precondition failed

The server is not available.

500

Server-side error

A server processing error occurred.

Response schema

Data that matches the conditions specified by query parameters in a request is returned in the response body. The following shows the schema of the response body.

{
  "data" : [ {"member-of-the-resources-for-history-functionality(TaskHistories)" : value ... }, ... ],
  "count" : number-of-data-items-that-match-the-conditions-specified-by-query-parameters(0-to-n)
}

Usage example

In the following example, the API function acquires a list of all history records.

Request header:

GET /Automation/v1/objects/TaskHistories HTTP/1.1
Authorization: Basic c3lzdGVtOm1hbmFnZXI=
User-Agent: curl/7.36.0
Host: 10.196.184.182:22015
Accept: application/json
Accept-Language: ja

Response header:

HTTP/1.1 200 OK
Date: Fri, 31 Jul 2015 06:22:25 GMT
Server: Cosminexus HTTP Server
Access-Control-Expose-Headers: WWW-Authenticate
WWW-Authenticate: HSSO 24f87c98d12f4f434cf398edcbe582939cee4d6_Vlo8Y30JdDBUB3ljJSVPaRtjBSA=_V0810
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, HEAD, OPTIONS
Access-Control-Allow-Credentials: true
Cache-Control: no-cache
Transfer-Encoding: chunked
Content-Type: application/json

Response body:

{
  "data" : [ {
    "instanceID" : 4006,
    "name" : "Execute Remote Command_20150731105831",
    "submitter" : "System",
    "serviceName" : "Execute Remote Command",
    "tags" : "Windows,Linux,Execute Script",
    "scheduleType" : "schedule",
    "scheduledStartTime" : "2015-07-31T11:30:00.000+09:00",
    "startTime" : "2015-07-31T11:30:00.000+09:00",
    "completionTime" : "2015-07-31T11:30:33.000+09:00",
    "archiveTime" : "2015-07-31T15:22:21.000+09:00",
    "taskID" : 3042,
    "submitTime" : "2015-07-31T11:00:06.000+09:00",
    "status" : "completed",
    "description" : "",
    "serviceState" : "release",
    "toDo" : true,
    "notes" : "Notes Test",
    "serviceGroupName" : "DefaultServiceGroup",
    "serviceGroupID" : 3
  } ],
  "count" : 1
}