2.7.3 Editing a task
Function
Edits the notes and TODO for the specified task.
Execution permissions
Admin role, Develop role, Modify role, Submit role
API version
v1
Request format
PUT http://host:port/Automation/version/objects/Tasks/id
The request schema has the same format as the response body for the API function Acquisition of service information. The following table describes the object that can be specified as Task (member).
Function |
Resource name |
Number |
Description |
---|---|---|---|
Task |
Task |
1 |
Task resource that has the specified ID |
The following table describes the properties that must be specified for this object.
Resource name |
Member name |
Number |
---|---|---|
Task |
notes |
1 |
toDo |
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. |
403 |
Forbidden |
The user does not have permission to edit tasks. |
404 |
Not found |
The user does not have permission to acquire tasks, or the task 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 function edits the notes and TODO for the task whose instanceID is 3042.
Request header: PUT /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 Content-Type: application/json Content-Length: 666 Accept-Language: ja Response header: HTTP/1.1 200 OK Date: Fri, 31 Jul 2015 03:37:03 GMT Server: Cosminexus HTTP Server Access-Control-Expose-Headers: WWW-Authenticate WWW-Authenticate: HSSO 91351d8e544375a67473e7c7494d1aa7c67b24_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" : "completed", "startTime" : "2015-07-31T11:30:00.000+09:00", "completionTime" : "2015-07-31T11:30:33.000+09:00", "scheduledStartTime" : "2015-07-31T11:30:00.000+09:00", "submitter" : "System", "submitTime" : "2015-07-31T11:00:06.000+09:00", "modifyTime" : "2015-07-31T12:37:03.000+09:00", "serviceState" : "release", "scheduleType" : "schedule", "description" : "", "serviceName" : "Execute Remote Command", "tags" : "Windows,Linux,Execute Script", "serviceGroupName" : "DefaultServiceGroup", "toDo" : true, "notes" : "Notes Test", "serviceTemplateID" : 560, "scheduleID" : 3020, "serviceGroupID" : 3, "serviceID" : 2004, "supportedActionType" : "forciblyStop,retry" }* Connection #0 to host 10.196.184.182 left intact