[Engine-devel] REST-API: Problem with additional DELETE action at collection level

Shubhendu Tripathi shtripat at redhat.com
Fri Nov 8 05:59:59 UTC 2013


Hi All,

There is a DELETE action defined at collection level for Gluster Bricks 
with signature -

/@DELETE
public////Response//remove//(//GlusterBricks//bricks//);/

Recently we had needed a commit action to remove migrated bricks.
After multiple rounds of discussion on introducing a commit action to 
remove migrated bricks we introduced a DELETE action [1] which accepts a 
boolean parameter isForce.
If the parameter is set to /true/, forced deletion of bricks happens 
without any data migration.
And if the parameter is not set or set to /false,/ the deletion is meant 
for a brick on which migration has already taken place.

To achieve the above functionality we introduced another DELETE action 
with new signature as below and also marked the first action as deprecated -

/@DELETE
public////Response//remove//(//Action//action//);/

The problem arises now as the new api works fine for all possible 
scenarios with below input structure -
/
//<action>//
//    <force>true/false</force>//
//    <bricks>//
//        <brick>//
//            <name>//brick1-name</name>//
//    <name>brick2-name</name>//
//        </brick>//
//    </bricks>//
//</action>/

BUT after these change backward compatibility is broken and the old api 
does not work.
If we try invoking old DELETE with bricks as input parameter as below, 
it still invokes the new api and gives an error saying "Invalid parameter".
/
//<bricks>
     <brick id="brick1-id"/>
//    <brick id="brick2-id"/>
</bricks>/

Kindly suggest a solution around the same.

*PS:* Both the actions are defined at collection level 
(//api/clusters/<cluster-id>/glustervolumes/<volume-id>/bricks/)

[1]: http://gerrit.ovirt.org/#/c/21043/

Thanks and Regards,
Shubhendu


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/engine-devel/attachments/20131108/67c0e63b/attachment.html>


More information about the Engine-devel mailing list