[
https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=215411&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215411
]
ASF GitHub Bot logged work on GRIFFIN-240:
------------------------------------------
Author: ASF GitHub Bot
Created on: 19/Mar/19 12:23
Start Date: 19/Mar/19 12:23
Worklog Time Spent: 10m
Work Description: aborgatin commented on pull request #489: GRIFFIN-240
Return JobInstanceBean in response to a call Trigger job by id
URL: https://github.com/apache/griffin/pull/489#discussion_r266855423
##########
File path: griffin-doc/service/api-guide.md
##########
@@ -549,7 +549,21 @@ curl -k -H "Content-Type: application/json" -H "Accept:
application/json" \
`POST /api/v1/jobs/trigger/{job_id}`
#### API Example
```
-curl -k -X POST http://127.0.0.1:8080/api/v1/jobs/trigger/51
+curl -k -X POST http://127.0.0.1:8080/api/v1/jobs/trigger/51 \
+-d '{
+ "timeout": "1000"
Review comment:
This timeout is the maximum time in milliseconds that we are waiting for the
creation of a JobInstanceBean.
The time between schedule job with "execute right now" trigger and the
actual execution the job may be differ (from several milliseconds to tens of
seconds).
Sometimes, for example, in requests from the UI, waiting for a
JobInstanceBean to be created is not required, because response will be
ignored.
But in other cases it can be very important. For example, we can run job
using this API from ETL. After that using JobInstance ID from response, we can
check the measurement result.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 215411)
Time Spent: 1.5h (was: 1h 20m)
> [Service] Return JobInstance in response to a call Trigger job by id
> ---------------------------------------------------------------------
>
> Key: GRIFFIN-240
> URL: https://issues.apache.org/jira/browse/GRIFFIN-240
> Project: Griffin (Incubating)
> Issue Type: Improvement
> Reporter: Aleksandr Borgatin
> Priority: Major
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> The proposal is following: in response of method "/jobs/trigger/\{id}" to
> return JobInstance
> {code:java}
> @RequestMapping(value = "/jobs/trigger/{id}", method = RequestMethod.POST)
> @ResponseStatus(HttpStatus.OK)
> public JobInstanceBean triggerJob(@PathVariable("id") Long id) throws
> SchedulerException
> { return jobService.triggerJobById(id); }{code}
> Now this method looks like this
> {code:java}
> @RequestMapping(value = "/jobs/trigger/{id}", method = RequestMethod.POST)
> @ResponseStatus(HttpStatus.NO_CONTENT)
> public void triggerJob(@PathVariable("id") Long id) throws
> SchedulerException {
> jobService.triggerJobById(id);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)