Ori Liel has posted comments on this change.

Change subject: restapi: Modified gluster volume rebalance action
......................................................................


Patch Set 9:

Asynchronous actions in the API return an 'Action' object, with a list of links 
to Engine tasks inside it. IIUC you want to do something similar with a link to 
the a Job, e.g: 

<action>
    <link href="/api/jobs/fdfc627c-d875-11e0-90f0-83df133b58cc"/>
    <gluster_volume>
         .
         .
         .
    </gluster_volume>
</action>

For this you need to:
1) Add "private ArrayList<Guid> jobIdList" to VdcReturnValueBase
2) Make StartRebalanceGlusterVolumeCommand set the job-id in this list
3) In BackendGlusterVolumeResource-->rebalance() manually create a link to a 
job entity, using the ID from the engine response (in the future we should have 
infrastructure for this). 

* Notice that by following the link to the Job (i.e retrieving the job), the 
user would have access to this job's tasks. For this reason I think that 
returning the job is better than returning a list of tasks. 

* One more comment about this patch: API actions are synchronous by default, 
but this specific action - correct me if I'm wrong - should always be 
asynchronous. Therefore I think that if the user does not explicitly assign a 
value to 'async' flag,  BackendGlusterVolumeResource-->rebalance() should it to 
'true' for him (action.setAsync(true)). This way, the flow activated in the API 
will be of asynchronous actions. However, if the user *explicitly* supplied

<action>
    <async>false</async>
    .
    .
    .
</action> 

Then the rebalance action should be done synchronously.

-- 
To view, visit http://gerrit.ovirt.org/18208
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia9fd560cc1b6a0db9cc28647bc311cb9f1b9e3b3
Gerrit-PatchSet: 9
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shubhendu Tripathi <[email protected]>
Gerrit-Reviewer: Kanagaraj M <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ori Liel <[email protected]>
Gerrit-Reviewer: Sahina Bose <[email protected]>
Gerrit-Reviewer: Shubhendu Tripathi <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to