Hitachi

JP1 Version 12 JP1/Automatic Operation Command and API Reference 


2.8.2 Deletion of history records (with conditions specified)

Function

Deletes history records according to the conditions specified by query parameters.

Execution permissions

Admin role, Develop role, Modify role

API version

v1

Request format

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

By specifying query parameters, you can filter the history records to be deleted. Specify query parameters in the following format:

?query-parameter=value[&query-parameter=value...] 
Table 2‒73: List of query parameters that can be specified for the API function Deletion of history records (with conditions specified)

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

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

204

No Content

Processing has been successfully completed. Or, the task history to be deleted did not exist.

400

Bad Request

A query parameter is invalid.

401

Unauthorized

The user does not have login permission.

403

Forbidden

The user does not have permission to delete history records.

412

Precondition failed

The server is not running.

500

Server-side error

A server processing error occurred.

Usage example

In the following example, the API function deletes the history records for which serviceGroupID is 1451 and the period is between July 31 and August 31 in 2015.

Request header:

DELETE /Automation/v1/objects/TaskHistories?serviceGroupID=1451&start=2015-07-31T11:30:00.000+09:00&end=2015-08-31T11:30:00.000+09:00 HTTP/1.1
Host: 192.168.146.132:22015
User-Agent: curl/7.36.0
Accept: application/json
Authorization: Basic c3lzdGVtOm1hbmFnZXI=
Accept-Language: ja

Response header:

HTTP/1.1 204 No Content
Date: Fri, 07 Aug 2015 11:17:40 GMT
Server: Cosminexus HTTP Server
Access-Control-Expose-Headers: WWW-Authenticate
WWW-Authenticate: HSSO e949c7e079a0bc9a137cd1bf3515c72685a506a_Vlo8Y30JBWoKHUYTEXAMXx5iHgQ=_V0810
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, HEAD, OPTIONS
Access-Control-Allow-Credentials: true
Cache-Control: no-cache
Content-Length: 0
Content-Type: application/json