Bug 1199011 - [RFE] support async requests for CoCo commands in rest-api
Summary: [RFE] support async requests for CoCo commands in rest-api
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: ---
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Juan Hernández
QA Contact: Pavel Stehlik
URL:
Whiteboard:
: 1315874 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-05 10:15 UTC by Daniel Erez
Modified: 2019-04-28 13:48 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-17 13:41:52 UTC
oVirt Team: Infra
Embargoed:
oourfali: ovirt-future?
ylavi: planning_ack?
ylavi: devel_ack?
ylavi: testing_ack?


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.