Bug 1199011

Summary: [RFE] support async requests for CoCo commands in rest-api
Product: [oVirt] ovirt-engine Reporter: Daniel Erez <derez>
Component: RestAPIAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED WONTFIX QA Contact: Pavel Stehlik <pstehlik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: ---CC: bugs, eshenitz, lsurette, masayag, nicolas, oourfali, rbalakri, srevivo, ykaul
Target Milestone: ---Keywords: FutureFeature, Reopened
Target Release: ---Flags: oourfali: ovirt-future?
ylavi: planning_ack?
ylavi: devel_ack?
ylavi: testing_ack?
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-17 13:41:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daniel Erez 2015-03-05 10:15:00 UTC
Description of problem:
Currently, the rest-api support asynchronous requests only for actions that invoke commands containing vdsm tasks. The support should be extended for commands based on the CoCo infrastructure. I.e. when invoking such command asynchronously, a '202 Accepted' status should be returned to the user. To support polling, a new PollingType could be added along with the relevant logic to fetch tasks statuses.


Version-Release number of selected component (if applicable):
3.6

Additional info:
AbstractBackendActionableResource -> doAction() method determines whether the request is async according to 'getHasAsyncTasks' flag.

Comment 1 Red Hat Bugzilla Rules Engine 2015-10-19 10:59:31 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 2 Moti Asayag 2016-01-20 20:18:07 UTC
(In reply to Daniel Erez from comment #0)
> Description of problem:
> Currently, the rest-api support asynchronous requests only for actions that
> invoke commands containing vdsm tasks. The support should be extended for
> commands based on the CoCo infrastructure. I.e. when invoking such command
> asynchronously, a '202 Accepted' status should be returned to the user. To
> support polling, a new PollingType could be added along with the relevant
> logic to fetch tasks statuses.
> 

I'd rather not adding another polling type for the sake of commands with callbacks. We should use the Job polling type instead:

If an action/command in the system should be monitored, it should create itself a job to be polled by and implement the job lifecycle as part of the command flow. The infrastructure could take care of not terminating commands with callback, only as part of the commands endAction(), which suppose to be the last step of the command.

> 
> Version-Release number of selected component (if applicable):
> 3.6
> 
> Additional info:
> AbstractBackendActionableResource -> doAction() method determines whether
> the request is async according to 'getHasAsyncTasks' flag.

Comment 3 Juan Hernández 2016-03-09 10:22:41 UTC
*** Bug 1315874 has been marked as a duplicate of this bug. ***

Comment 4 Yaniv Kaul 2017-06-07 18:15:44 UTC
Oved - please triage for 4.2/4.3 or close.

Comment 5 Eyal Shenitzky 2017-09-17 12:57:25 UTC
I also encountered the need for async support using CoCo when refactoring ExportVmCommand and ImportVmCommand to use CoCo.

I would suggest not to expose the commands and callbacks in the REST-API, but instead to consider the callback status when REST-API decides if a request is async or not (instead of relying on the direct tasks list)

Comment 6 Oved Ourfali 2017-09-17 13:41:52 UTC
This RFE is for rest api async requests.
What you're asking is something else.
Please open an RFE specifying what you need.