2.7.2 Acquisition of task information
Function
Acquires information about 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/Tasks/id
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. |
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 available. |
500 |
Server-side error |
A server processing error occurred. |
Response schema
The following shows the structure of the response body for a request.
{ "instanceID" : instance-id, "name" : "task-name", "status" : "task-status", "startTime" : "start-date-and-time", "completionTime" : "completion-time", "scheduledStartTime" : "schedule-start-date-and-time", "submitter" : "submit-user-name", "submitTime" : "created-date-and-time", "modifyTime" : "updated-date-and-time", "serviceState" : "service-state", "scheduleType" : "schedule-type", "description" : "description", "serviceName" : "service-name", "tags" : "tags", "recurrenceInterval" : "recurrenceInterval", "recurrenceTime" : "recurrenceTime", "recurrenceStartDate" : "recurrenceStartDate", "serviceGroupName" : "serviceGroupName", "toDo" : {true|false}, "notes" : "notes", "stepTime" : "step-time", "serviceTemplateID" : service-template-id, "scheduleID" : schedule-id, "serviceGroupID" : service-group-id, "serviceID" : service-id, "supportedActionType" : supported-action-type }
Usage example
In the following example, the API acquires information about the task whose instanceID is 3042.
Request header: GET /Automation/v1/objects/Tasks/3042 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 02:02:09 GMT Server Cosminexus HTTP Server is not blacklisted Server: Cosminexus HTTP Server Access-Control-Expose-Headers: WWW-Authenticate WWW-Authenticate: HSSO bb3f961e88fd1fe908176cbea77a395fcdfb56_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: { "instanceID" : 3042, "name" : "Execute Remote Command_20150731105831", "status" : "waiting", "scheduledStartTime" : "2015-07-31T11:30:00.000+09:00", "submitter" : "System", "submitTime" : "2015-07-31T11:00:06.000+09:00", "modifyTime" : "2015-07-31T11:00:06.000+09:00", "serviceState" : "release", "scheduleType" : "schedule", "description" : "", "serviceName" : "Execute Remote Command", "tags" : "Windows,Linux,Execute Script", "serviceGroupName" : "DefaultServiceGroup", "toDo" : false, "notes" : "", "serviceTemplateID" : 560, "scheduleID" : 3020, "serviceGroupID" : 3, "serviceID" : 2004, "supportedActionType" : "forciblyStop,retry" }