[ 
https://issues.apache.org/jira/browse/GRIFFIN-240?focusedWorklogId=223063&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-223063
 ]

ASF GitHub Bot logged work on GRIFFIN-240:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Apr/19 16:04
            Start Date: 04/Apr/19 16:04
    Worklog Time Spent: 10m 
      Work Description: chemikadze commented on pull request #494: GRIFFIN-240 
trigger returns triggerkey
URL: https://github.com/apache/griffin/pull/494#discussion_r272251722
 
 

 ##########
 File path: service/src/main/java/org/apache/griffin/core/job/JobController.java
 ##########
 @@ -120,8 +124,13 @@ public JobHealth getHealthInfo() {
     }
 
     @RequestMapping(value = "/jobs/trigger/{id}", method = RequestMethod.POST)
-    @ResponseStatus(HttpStatus.NO_CONTENT)
-    public void triggerJob(@PathVariable("id") Long id) throws 
SchedulerException {
-        jobService.triggerJobById(id);
+    @ResponseStatus(HttpStatus.OK)
+    public Map<String, Object> triggerJob(@PathVariable("id") Long id, 
@RequestBody(required = false) String request) throws SchedulerException {
+        return Collections.singletonMap("triggerKey", 
jobService.triggerJobById(id));
+    }
+
+    @RequestMapping(value = "jobs/trigger/{triggerKey:.+}", method = 
RequestMethod.GET)
 
 Review comment:
   it would be semantically more correct to have it as different "collection", 
because ids are completely different
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 223063)
    Time Spent: 4h 10m  (was: 4h)

> [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
>          Issue Type: Improvement
>            Reporter: Aleksandr Borgatin
>            Priority: Major
>          Time Spent: 4h 10m
>  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)

Reply via email to