Hitachi

JP1 Version 11 JP1/Automatic Operation Command and API Reference 


2.7.21 Acquisition of task logs

Function

Acquires the logs for the specified task.

Execution permissions

Admin role, Develop role, Modify role, Submit role

API version

v1

Request format

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

Among all tasks for which the user who executed the API function has permissions, this API function acquires the logs for the task that has the specified taskID. By specifying query parameters, you can filter the tasks for which you want to acquire the list.

This API acquires the logs for the task that has the specified taskID, in the size specified for readSize or smaller, starting from the point specified for the offset. If reverse is specified, the API acquires the logs in the size specified for readSize to the opposite direction from the offset. Specify query parameters in the format below.

Note that logs are acquired line by line. If the log size reaches the specified size, the line being acquired will be discarded.

?query-parameter=value[&query-parameter=value...] 
Table 2‒71: List of query parameters that can be specified for API Acquisition of task logs

Query parameter

Filter condition

taskID

Equal to the specified value

readSize

Equal to the specified value (however, if the log size reaches readSize at the middle of a task log, task logs before the task log are acquired.)

offset

Equal to the specified value

reverse#

Acquires task logs, starting from the point specified for offset , in the opposite direction.

#

Do not specify any values for reverse.

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

Example

The following shows an example setting to acquire 1,000-byte task log data for the task whose taskID is 512, starting from 3,000th byte in the opposite direction.

?taskID=512&offset=3000&readSize=1000&reverse

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

Created

Processing has been successfully completed.

400

Bad Request

The argument is invalid.

401

Unauthorized

The user does not have login permission.

404

Not found

The permission is invalid, or the resource does not exist.

412

Precondition failed

The server is not running.

500

Server-side error

A server processing error occurred.

Response schema

The following shows the structure of the response body for a request.

{
  "data" : [ {"member-of-the-resources-for-task-log-functionality(Tasklogs)" : 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 5,000,000-byte task log data for the task whose taskID is 2052, starting from the beginning (0th byte).

Request header:

GET /Automation/v1/objects/TaskLogs?taskID=10042&offset=0&readSize=5000000 HTTP/1.1
Host:192.168.146.132:22015
User-Agent:sample rest client/1.00.0
Accept:application/json
Accept-Language: en
Authorization: Basic c3lzdGVtOm1hbmFnZXI=

Response header:

HTTP/1.1 200 OK
Date: Mon, 26 Oct 2015 02:28:09 GMT
Server: Cosminexus HTTP Server
Cache-Control: no-cache
WWW-Authenticate: HSSO a36baaf736fd84afdc27aecf1559fcb8620792b_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
Transfer-Encoding: chunked
Content-Type: application/json

Response body:

{
  "data" : [ {
    "instanceID" : 10042,
    "text" : "**** Windows Server 2008 R2 6.1                                                    TZ=Asia/Seoul                    2015/10/26 11:22:00.450\r\n
     yyyy/mm/dd hh:mm:ss.sss                      pid      tid      message-id            message(LANG=en)\r\n
7156 2015/10/26 11:22:00.574     Automation       74170687 36EBDFE4 KNAE08001-I           Started executing plug-in (task name: Execute Remote Command_20151026112116, task ID: 10042, step ID: /remoteHostCommandExe, execution ID: @A111).\r\n
7280 2015/10/26 11:22:00.886     Automation       74170687 36EBDFE4 KNAE08129-I           The general command plug-in started (command: a).\r\n
7282 2015/10/26 11:22:00.886     Automation       74170687 36EBDFE4 KNAE08071-I           The setting to elevate to root privileges for SSH connections is now disabled.\r\n
7307 2015/10/26 11:22:10.652     Automation       74170687 36EBDFE4 KNAE08131-E      ER   The general command plug-in failed (command: a, plug-in return code: 77).\r\n
7311 2015/10/26 11:22:10.652     Automation       74170687 36EBDFE4 KNAE08002-I           Plug-in execution completed (task name: Execute Remote Command_20151026112116, task ID: 10042, step ID: /remoteHostCommandExe, execution ID: @A111, plug-in return code: 77).\r\n
7313 2015/10/26 11:22:10.652     Automation       74170687 36EBDFE4 KNAE08004-I           schema_version=1.1\r\n
7315 2015/10/26 11:22:10.652     Automation       74170687 36EBDFE4 KNAE08004-I           vendor=com.hitachi.software.dna\r\n
7317 2015/10/26 11:22:10.652     Automation       74170687 36EBDFE4 KNAE08004-I           name=ExecuteCommandPlugin\r\n
7319 2015/10/26 11:22:10.652     Automation       74170687 36EBDFE4 KNAE08004-I           version=01.52.01\r\n
7321 2015/10/26 11:22:10.652     Automation       74170687 36EBDFE4 KNAE08004-I           plugin_type=javaClass\r\n
7323 2015/10/26 11:22:10.652     Automation       74170687 36EBDFE4 KNAE08004-I           vendor_display_name=Hitachi, Ltd.\r\n
7325 2015/10/26 11:22:10.652     Automation       74170687 36EBDFE4 KNAE08004-I           display_name=General Command Plug-in\r\n
7327 2015/10/26 11:22:10.652     Automation       74170687 36EBDFE4 KNAE08004-I           short_description=This plug-in executes a command line on the destination host.\r\n
7329 2015/10/26 11:22:10.652     Automation       74170687 36EBDFE4 KNAE08004-I           tags=Basic,Hitachi\r\n
7331 2015/10/26 11:22:10.652     Automation       74170687 36EBDFE4 KNAE08004-I           enable_SSH_charset_detection=true\r\n
7333 2015/10/26 11:22:10.652     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/account, value=\r\n
7335 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/commandLine, value=?dna_common.remoteCommand?\r\n
7337 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/commandLineParameter, value=?dna_common.remoteCommandParameter?\r\n
7339 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/credentialType, value=destination\r\n
7341 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/destinationHost, value=?dna_common.targetHost?\r\n
7343 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/elevatePrivileges, value=false\r\n
7345 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/keyboardInteractiveAuthentication, value=\r\n
7347 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/password, value=********\r\n
7349 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/publicKeyAuthentication, value=\r\n
7351 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/stdoutPattern1, value=((?s).*)\r\n
7353 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/stdoutPattern2, value=\r\n
7355 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/stdoutPattern3, value=\r\n
7357 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/stdoutProperty1, value=common.stdoutProperty\r\n
7359 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/stdoutProperty2, value=\r\n
7361 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/stdoutProperty3, value=\r\n
7363 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=/remoteHostCommandExe/suPassword, value=********\r\n
7365 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=com.hitachi.software.dna.sys.jp1.password, value=********\r\n
7367 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=com.hitachi.software.dna.sys.jp1.username, value=jp1admin\r\n
7369 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=com.hitachi.software.dna.sys.mail.bcc, value=\r\n
7371 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=com.hitachi.software.dna.sys.mail.cc, value=\r\n
7373 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=com.hitachi.software.dna.sys.mail.from, value=********\r\n
7375 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=com.hitachi.software.dna.sys.mail.notify, value=false\r\n
7377 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=com.hitachi.software.dna.sys.mail.smtp.password, value=********\r\n
7379 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=com.hitachi.software.dna.sys.mail.smtp.port, value=25\r\n
7381 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=com.hitachi.software.dna.sys.mail.smtp.server, value=\r\n
7383 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=com.hitachi.software.dna.sys.mail.smtp.userid, value=\r\n
7385 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=com.hitachi.software.dna.sys.mail.to, value=\r\n
7387 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=com.hitachi.software.dna.sys.ssh.privatekey.passphrase, value=********\r\n
7389 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=com.hitachi.software.dna.sys.task.log.level, value=10\r\n
7391 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=common.remoteCommand, value=a\r\n
7393 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=common.remoteCommandParameter, value=\r\n
7395 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=common.stdoutProperty, value=\r\n
7397 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=common.targetHost, value=a\r\n
7399 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=foreach.max_value, value=3\r\n
7401 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=mail.plugin.retry.interval, value=10\r\n
7403 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=mail.plugin.retry.times, value=3\r\n
7405 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=plugin.private.builtin.baseUrl, value=http://WIN-FC6MCPD47CQ:22015/Automation/\r\n
7407 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=reserved.service.category, value=Execute Script,Linux,Windows\r\n
7409 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=reserved.service.name, value=Execute Remote Command\r\n
7411 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=reserved.service.resourceGroupName, value=Default Service Group\r\n
7413 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=reserved.service.serviceGroupName, value=Default Service Group\r\n
7415 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=reserved.step.path, value=/remoteHostCommandExe\r\n
7417 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=reserved.step.prevReturnCode, value=0\r\n
7419 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=reserved.task.description, value=\r\n
7421 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=reserved.task.dir, value=C:\\Program Files\\Hitachi\\JP1AO\\data\\task\\10042\r\n
7423 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=reserved.task.id, value=10042\r\n
7425 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=reserved.task.name, value=Execute Remote Command_20151026112116\r\n
7427 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=reserved.task.submitter, value=System\r\n
7429 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=reserved.task.tags, value=Execute Script,Linux,Windows\r\n
7431 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=reserved.task.url, value=http://WIN-FC6MCPD47CQ:22015/Automation/launcher/TaskDetails?task_id=10042\r\n
7433 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=account, value=\r\n
7435 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=commandLine, value=a\r\n
7437 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=commandLineParameter, value=\r\n
7439 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=credentialType, value=destination\r\n
7441 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=destinationHost, value=a\r\n
7443 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=elevatePrivileges, value=false\r\n
7445 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=keyboardInteractiveAuthentication, value=\r\n
7447 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=password, value=********\r\n
7449 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=publicKeyAuthentication, value=\r\n
7451 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=stdoutPattern1, value=((?s).*)\r\n
7453 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=stdoutPattern2, value=\r\n
7455 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=stdoutPattern3, value=\r\n
7457 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08004-I           property=suPassword, value=********\r\n
7459 2015/10/26 11:22:10.668     Automation       74170687 36EBDFE4 KNAE08009-I           No standard output exists.\r\n
7461 2015/10/26 11:22:10.746     Automation       74170687 36EBDFE4 KNAE08014-E      ER   Cannot resolve the specified host name (error details: a  [errno=11004, syscall=getaddrinfo]). The specified host name could not be resolved. Check your network and DNS configuration, and then re-execute the service.\r\n
7463 2015/10/26 11:22:10.746     Automation       74170687 36EBDFE4 KNAE08016-E      ER   An error occurred while executing the plug-in (task name: Execute Remote Command_20151026112116, task ID: 10042, step ID: /remoteHostCommandExe, execution ID: @A111, plug-in return code: 77). The possible causes are as follows\r\n
(1) An error occurred during plug-in execution.\r\n
(2) An operation was performed to forcibly stop the task.\r\n
(3) An operation was performed to stop the product.\r\n
In the dialog box or in Server[n].log, refer to the error message that was output before and after the error occurred, and take the appropriate action. If there is no evidence of an operation to forcibly stop a task or to stop the product, and if no error message was output before or after the error occurred, use the data collection tool to collect the necessary information, and then contact your system administrator.\r\n
",
    "totalSize" : 13065,
    "readSize" : 13065,
    "lineCount" : 88,
    "offset" : 0,
    "reverse" : false
  } ],
  "count" : 1
}