From shtripat at redhat.com Fri Nov 8 01:37:37 2013 Content-Type: multipart/mixed; boundary="===============2669700212703000856==" MIME-Version: 1.0 From: Shubhendu Tripathi To: devel at ovirt.org Subject: [Engine-devel] REST-API: Problem with additional DELETE action at collection level Date: Fri, 08 Nov 2013 12:07:30 +0530 Message-ID: <527C86AA.7010904@redhat.com> In-Reply-To: 527C7DDF.2050308@redhat.com --===============2669700212703000856== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable This is a multi-part message in MIME format. --------------010703000301070404040104 Content-Type: text/plain; charset=3DISO-8859-1; format=3Dflowed Content-Transfer-Encoding: 7bit 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 - / //// // true/false// // // // // // //brick1-name// // brick2-name// // // // // /// 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". / // // / Kindly suggest a solution around the same. *PS:* Both the actions are defined at collection level = (//api/clusters//glustervolumes//bricks/) [1]: http://gerrit.ovirt.org/#/c/21043/ Thanks and Regards, Shubhendu --------------010703000301070404040104 Content-Type: text/html; charset=3DISO-8859-1 Content-Transfer-Encoding: 7bit Hi All,

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

@DELETE
public
Response remove= (GlusterBricks<= /span> 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
<= span class=3D"pun">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><= i>
           = <name>brick1-name</name>
&n= bsp;           <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=3D"brick1-id"/>
=    = ; <brick id=3D"brick2-id"/>=
</bricks>


Kindly suggest a solution around the same.

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

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

Thanks and Regards,
Shubhendu




--------------010703000301070404040104-- --===============2669700212703000856== Content-Type: multipart/alternative MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.bin" VGhpcyBpcyBhIG11bHRpLXBhcnQgbWVzc2FnZSBpbiBNSU1FIGZvcm1hdC4KLS0tLS0tLS0tLS0t LS0wMTA3MDMwMDAzMDEwNzA0MDQwNDAxMDQKQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFy c2V0PUlTTy04ODU5LTE7IGZvcm1hdD1mbG93ZWQKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzog N2JpdAoKSGkgQWxsLAoKVGhlcmUgaXMgYSBERUxFVEUgYWN0aW9uIGRlZmluZWQgYXQgY29sbGVj dGlvbiBsZXZlbCBmb3IgR2x1c3RlciBCcmlja3MgCndpdGggc2lnbmF0dXJlIC0KCi9AREVMRVRF CnB1YmxpYy8vLy9SZXNwb25zZS8vcmVtb3ZlLy8oLy9HbHVzdGVyQnJpY2tzLy9icmlja3MvLy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GFuPjwv c3Bhbj4gPGJyPgogICAgPC9kaXY+CiAgICA8YnI+CiAgPC9ib2R5Pgo8L2h0bWw+CgotLS0tLS0t LS0tLS0tLTAxMDcwMzAwMDMwMTA3MDQwNDA0MDEwNC0tCg== --===============2669700212703000856==-- From shtripat at redhat.com Fri Nov 8 01:58:30 2013 Content-Type: multipart/mixed; boundary="===============5312201394906762651==" MIME-Version: 1.0 From: Shubhendu Tripathi To: devel at ovirt.org Subject: [Engine-devel] REST-API: Problem with additional DELETE action at collection level Date: Fri, 08 Nov 2013 11:29:59 +0530 Message-ID: <527C7DDF.2050308@redhat.com> --===============5312201394906762651== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable This is a multi-part message in MIME format. --------------050509030900000404030401 Content-Type: text/plain; charset=3DISO-8859-1; format=3Dflowed Content-Transfer-Encoding: 7bit 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 - / //// // true/false// // // // // // //brick1-name// // brick2-name// // // // // /// 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". / // // / Kindly suggest a solution around the same. *PS:* Both the actions are defined at collection level = (//api/clusters//glustervolumes//bricks/) [1]: http://gerrit.ovirt.org/#/c/21043/ Thanks and Regards, Shubhendu --------------050509030900000404030401 Content-Type: text/html; charset=3DISO-8859-1 Content-Transfer-Encoding: 7bit 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<= /i> 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>=
            &= lt;name>brick1-name</name>
= &nbs= p;           <name>brick2-name</name>
        </brick><= /i>
    </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=3D"brick1-id"/>
    = <brick id=3D"brick2-id"/> </bricks>

Kindly suggest a solution around the same.

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

[1]: http://gerrit.o= virt.org/#/c/21043/

Thanks and Regards,
Shubhendu


--------------050509030900000404030401-- --===============5312201394906762651== Content-Type: multipart/alternative MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.bin" VGhpcyBpcyBhIG11bHRpLXBhcnQgbWVzc2FnZSBpbiBNSU1FIGZvcm1hdC4KLS0tLS0tLS0tLS0t LS0wNTA1MDkwMzA5MDAwMDA0MDQwMzA0MDEKQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFy c2V0PUlTTy04ODU5LTE7IGZvcm1hdD1mbG93ZWQKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzog N2JpdAoKSGkgQWxsLAoKVGhlcmUgaXMgYSBERUxFVEUgYWN0aW9uIGRlZmluZWQgYXQgY29sbGVj dGlvbiBsZXZlbCBmb3IgR2x1c3RlciBCcmlja3MgCndpdG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gog ICAgICAgIEJVVCBhZnRlciB0aGVzZSBjaGFuZ2UgYmFja3dhcmQgY29tcGF0aWJpbGl0eSBpcyBi cm9rZW4gYW5kIHRoZQogICAgICAgIG9sZCBhcGkgZG9lcyBub3Qgd29yay48YnI+CiAgICAgICAg SWYgd2UgdHJ5IGludm9raW5nIG9sZCBERUxFVEUgd2l0aCBicmlja3MgYXMgaW5wdXQgcGFyYW1l dGVyIGFzCiAgICAgICAgYmVsb3csIGl0IHN0aWxsIGludm9rZXMgdGhlIG5ldyBhcGkgYW5kIGdp dmVzIGFuIGVycm9yIHNheWluZyAiPGZvbnQKICAgICAgICAgIGNvbG9yPSIjZmYwMDAwIj5JbnZh bGlkIHBhcmFtZXRlcjwvZm9udD4iLjxicj4KICAgICAgICA8Zm9udCBjb2xvcj0iIzMzMzNmZiI+ PGk+PGJyPgogICAgICAgICAgPC9pPjwvZm9udD48L3NwYW4+PC9zcGFuPjxmb250IGNvbG9yPSIj MzMzM2ZmIj48aT48c3BhbgogICAgICAgICAgY2xhc3M9InB1biI+PHNwYW4gY2xhc3M9InB1biI+ PHNwYW4gY2xhc3M9InB1biI+PHNwYW4KICAgICAgICAgICAgICAgIGNsYXNzPSJwdW4iPiZsdDti cmlja3MmZ3Q7PGJyPgogICAgICAgICAgICAgICAgJm5ic3A7Jm5ic3A7Jm5ic3A7ICZsdDticmlj ayBpZD0iYnJpY2sxLWlkIi8mZ3Q7PGJyPgogICAgICAgICAgICAgIDwvc3Bhbj48L3NwYW4+PC9z cGFuPjwvc3Bhbj48L2k+PC9mb250PjxzcGFuIGNsYXNzPSJwdW4iPjxzcGFuCiAgICAgICAgY2xh c3M9InB1biI+PGZvbnQgY29sb3I9IiMzMzMzZmYiPjxpPjxzcGFuIGNsYXNzPSJwdW4iPjxzcGFu CiAgICAgICAgICAgICAgICBjbGFzcz0icHVuIj48c3BhbiBjbGFzcz0icHVuIj48c3BhbiBjbGFz cz0icHVuIj48c3BhbgogICAgICAgICAgICAgICAgICAgICAgY2xhc3M9InB1biI+PHNwYW4gY2xh c3M9InB1biI+Jm5ic3A7Jm5ic3A7Jm5ic3A7ICZsdDticmljawogICAgICAgICAgICAgICAgICAg ICAgICBpZD0iYnJpY2syLWlkIi8mZ3Q7PC9zcGFuPjwvc3Bhbj48L3NwYW4+PC9zcGFuPjxicj4K ICAgICAgICAgICAgICAgICZsdDsvYnJpY2tzJmd0Ozwvc3Bhbj48L3NwYW4+PC9pPjwvZm9udD48 YnI+CiAgICAgICAgPGJyPgogICAgICAgIEtpbmRseSBzdWdnZXN0IGEgc29sdXRpb24gYXJvdW5k IHRoZSBzYW1lLjxicj4KICAgICAgICA8YnI+CiAgICAgICAgPGI+UFM6PC9iPiBCb3RoIHRoZSBh Y3Rpb25zIGFyZSBkZWZpbmVkIGF0IGNvbGxlY3Rpb24gbGV2ZWwgKDxmb250CiAgICAgICAgICBj b2xvcj0iIzMzMzNmZiI+PGk+L2FwaS9jbHVzdGVycy8mbHQ7Y2x1c3Rlci1pZCZndDsvZ2x1c3Rl cnZvbHVtZXMvJmx0O3ZvbHVtZS1pZCZndDsvYnJpY2tzPC9pPjwvZm9udD4pPGJyPgogICAgICAg IDxicj4KICAgICAgICBbMV06IDxhIGhyZWY9Imh0dHA6Ly9nZXJyaXQub3ZpcnQub3JnLyMvYy8y MTA0My8iPmh0dHA6Ly9nZXJyaXQub3ZpcnQub3JnLyMvYy8yMTA0My88L2E+PGJyPgogICAgICAg IDxicj4KICAgICAgICBUaGFua3MgYW5kIFJlZ2FyZHMsPGJyPgogICAgICAgIFNodWJoZW5kdTxi cj4KICAgICAgICA8YnI+CiAgICAgICAgPGJyPgogICAgICA8L3NwYW4+PC9zcGFuPgogIDwvYm9k eT4KPC9odG1sPgoKLS0tLS0tLS0tLS0tLS0wNTA1MDkwMzA5MDAwMDA0MDQwMzA0MDEtLQo= --===============5312201394906762651==-- From masayag at redhat.com Sun Nov 10 12:36:10 2013 Content-Type: multipart/mixed; boundary="===============7464113626245701125==" MIME-Version: 1.0 From: Moti Asayag To: devel at ovirt.org Subject: Re: [Engine-devel] REST-API: Problem with additional DELETE action at collection level Date: Sun, 10 Nov 2013 12:36:08 -0500 Message-ID: <25153947.26941766.1384104968045.JavaMail.root@redhat.com> In-Reply-To: 527C86AA.7010904@redhat.com --===============7464113626245701125== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ----- Original Message ----- > From: "Shubhendu Tripathi" > To: "engine-devel" , "Michael Pasternak" , oliel(a)redhat.com > Sent: Friday, November 8, 2013 8:37:30 AM > Subject: [Engine-devel] REST-API: Problem with additional DELETE action a= t collection level > = > Hi All, > = > There is a DELETE action defined at collection level for Gluster Bricks w= ith > 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 rem= ove > 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 witho= ut > any data migration. > And if the parameter is not set or set to false, the deletion is meant fo= r a > brick on which migration has already taken place. > = > To achieve the above functionality we introduced another DELETE action wi= th > 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 scenari= os > with below input structure - > = > > true/false > > > brick1-name > brick2-name > > > > = > BUT after these change backward compatibility is broken and the old api d= oes > 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 ". > = Maybe I've missed it some where, but i wasn't able to find the new 'force' = parameter in the rsdl, and specifically not in optionalArguments list of: - name: /api/clusters/{cluster:id}/glustervolumes/{glustervolume:id}/bricks= |rel=3Ddelete and perhaps the correct approach will be to deprecate this signature and in= troduce a new one with the 'force' in the 'mandatoryArguments' section. > > > > > = > Kindly suggest a solution around the same. > = > PS: Both the actions are defined at collection level ( > /api/clusters//glustervolumes//bricks ) > = > [1]: http://gerrit.ovirt.org/#/c/21043/ > = > Thanks and Regards, > Shubhendu > = > = > = > = > = > _______________________________________________ > Engine-devel mailing list > Engine-devel(a)ovirt.org > http://lists.ovirt.org/mailman/listinfo/engine-devel >=20 --===============7464113626245701125==-- From shtripat at redhat.com Mon Nov 11 00:00:47 2013 Content-Type: multipart/mixed; boundary="===============6284567269269216454==" MIME-Version: 1.0 From: Shubhendu Tripathi To: devel at ovirt.org Subject: Re: [Engine-devel] REST-API: Problem with additional DELETE action at collection level Date: Mon, 11 Nov 2013 10:30:31 +0530 Message-ID: <5280646F.2050903@redhat.com> In-Reply-To: 25153947.26941766.1384104968045.JavaMail.root@redhat.com --===============6284567269269216454== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 11/10/2013 11:06 PM, Moti Asayag wrote: > > ----- Original Message ----- >> From: "Shubhendu Tripathi" >> To: "engine-devel" , "Michael Pasternak" , oliel(a)redhat.com >> Sent: Friday, November 8, 2013 8:37:30 AM >> Subject: [Engine-devel] REST-API: Problem with additional DELETE action = at collection level >> >> 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 re= move >> 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 with= out >> any data migration. >> And if the parameter is not set or set to false, the deletion is meant f= or a >> brick on which migration has already taken place. >> >> To achieve the above functionality we introduced another DELETE action w= ith >> 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 scenar= ios >> with below input structure - >> >> >> true/false >> >> >> brick1-name >> brick2-name >> >> >> >> >> 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 = ". >> > Maybe I've missed it some where, but i wasn't able to find the new 'force= ' parameter > in the rsdl, and specifically not in optionalArguments list of: > > - name: /api/clusters/{cluster:id}/glustervolumes/{glustervolume:id}/bric= ks|rel=3Ddelete > > and perhaps the correct approach will be to deprecate this signature and = introduce a new > one with the 'force' in the 'mandatoryArguments' section. Moti, I have introduced another methods remove of DELETE type which = takes Action as input. I pass list of bricks and force as parameter in the same Action. Also, I tried marking the old method deprecated and introduced the new = one BUT as mentioned above, after introduction of new DELETE with Action = parameter old one STOPS working. Is it OK to stop working for a method if its deprecated?? I don't feel = so. Please comment. > >> >> >> >> >> >> Kindly suggest a solution around the same. >> >> PS: Both the actions are defined at collection level ( >> /api/clusters//glustervolumes//bricks ) >> >> [1]: http://gerrit.ovirt.org/#/c/21043/ >> >> Thanks and Regards, >> Shubhendu >> >> >> >> >> >> _______________________________________________ >> Engine-devel mailing list >> Engine-devel(a)ovirt.org >> http://lists.ovirt.org/mailman/listinfo/engine-devel >> --===============6284567269269216454==-- From shtripat at redhat.com Mon Nov 11 05:00:42 2013 Content-Type: multipart/mixed; boundary="===============8312544508368346679==" MIME-Version: 1.0 From: Shubhendu Tripathi To: devel at ovirt.org Subject: Re: [Engine-devel] REST-API: Problem with additional DELETE action at collection level Date: Mon, 11 Nov 2013 15:30:34 +0530 Message-ID: <5280AAC2.6010805@redhat.com> In-Reply-To: 5280646F.2050903@redhat.com --===============8312544508368346679== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Self and Ori had a detailed discussion on the topic. Points discussed - 1. Ori mentioned that Michael and Ori did not mean to have a separate = DELETE action for the purpose of commit in previous discussions. 2. Ori tried to understand the intention behind the separate commit = command in gluster and suggested that ideally gluster should remember = that a migration of data is started on the set of bricks, and if there = is a delete fired on the same bricks it should perform a commit action = because commit is nothing but a delete action 3. Ori suggested that in an ideal situation APIs needed would be - start migrate - stop migrate - delete bricks - retain bricks 4. As suggested by Ori, the remove bricks action should internally = decide if there was a data migration, started on the set of bricks. If = so, it should effectively fire a commit for the set of bricks. And if = there was not occurrence of data migration it should behave like a = normal force remove action. Ori, please add your comments if I have missed out anything here. Sahina, request your comments on the same. Thanks and Regards, Shubhendu On 11/11/2013 10:30 AM, Shubhendu Tripathi wrote: > On 11/10/2013 11:06 PM, Moti Asayag wrote: >> >> ----- Original Message ----- >>> From: "Shubhendu Tripathi" >>> To: "engine-devel" , "Michael Pasternak" = >>> , oliel(a)redhat.com >>> Sent: Friday, November 8, 2013 8:37:30 AM >>> Subject: [Engine-devel] REST-API: Problem with additional DELETE = >>> action at collection level >>> >>> 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 - >>> >>> >>> true/false >>> >>> >>> brick1-name >>> brick2-name >>> >>> >>> >>> >>> 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 ". >>> >> Maybe I've missed it some where, but i wasn't able to find the new = >> 'force' parameter >> in the rsdl, and specifically not in optionalArguments list of: >> >> - name: = >> /api/clusters/{cluster:id}/glustervolumes/{glustervolume:id}/bricks|rel= =3Ddelete >> >> and perhaps the correct approach will be to deprecate this signature = >> and introduce a new >> one with the 'force' in the 'mandatoryArguments' section. > Moti, I have introduced another methods remove of DELETE type which = > takes Action as input. > I pass list of bricks and force as parameter in the same Action. > > Also, I tried marking the old method deprecated and introduced the new = > one BUT as mentioned above, after introduction of new DELETE with = > Action parameter old one STOPS working. > Is it OK to stop working for a method if its deprecated?? I don't feel = > so. Please comment. >> >>> >>> >>> >>> >>> >>> Kindly suggest a solution around the same. >>> >>> PS: Both the actions are defined at collection level ( >>> /api/clusters//glustervolumes//bricks ) >>> >>> [1]: http://gerrit.ovirt.org/#/c/21043/ >>> >>> Thanks and Regards, >>> Shubhendu >>> >>> >>> >>> >>> >>> _______________________________________________ >>> Engine-devel mailing list >>> Engine-devel(a)ovirt.org >>> http://lists.ovirt.org/mailman/listinfo/engine-devel >>> > > _______________________________________________ > Engine-devel mailing list > Engine-devel(a)ovirt.org > http://lists.ovirt.org/mailman/listinfo/engine-devel > > --===============8312544508368346679==-- From oliel at redhat.com Mon Nov 11 05:38:47 2013 Content-Type: multipart/mixed; boundary="===============2060601200768758339==" MIME-Version: 1.0 From: Ori Liel To: devel at ovirt.org Subject: Re: [Engine-devel] REST-API: Problem with additional DELETE action at collection level Date: Mon, 11 Nov 2013 05:38:46 -0500 Message-ID: <463738104.27509428.1384166326211.JavaMail.root@redhat.com> In-Reply-To: 5280AAC2.6010805@redhat.com --===============2060601200768758339== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable >----- Original Message ----- >From: "Shubhendu Tripathi" >To: oliel(a)redhat.com, "Michael Pasternak" , "Sahi= na Bose" >Cc: "Dusmant Pati" , "engine-devel" >Sent: Monday, November 11, 2013 12:00:34 PM >Subject: Re: [Engine-devel] REST-API: Problem with additional DELETE actio= n at collection level > >Self and Ori had a detailed discussion on the topic. > >Points discussed - > >1. Ori mentioned that Michael and Ori did not mean to have a separate = >DELETE action for the purpose of commit in previous discussions. That's right - no need for a new delete signature; existing signatures are = enough. >2. Ori tried to understand the intention behind the separate commit = >command in gluster and suggested that ideally gluster should remember = >that a migration of data is started on the set of bricks, and if there = >is a delete fired on the same bricks it should perform a commit action = >because commit is nothing but a delete action >3. Ori suggested that in an ideal situation APIs needed would be > - start migrate > - stop migrate > - delete bricks > - retain bricks >4. As suggested by Ori, the remove bricks action should internally = >decide if there was a data migration, started on the set of bricks. If = >so, it should effectively fire a commit for the set of bricks. And if = >there was not occurrence of data migration it should behave like a = >normal force remove action. > >Ori, please add your comments if I have missed out anything here. I agree with what you wrote, let me sort of say it again in my words: = I don't like requiring two consecutive commands from the API user, to perfo= rm migrate. = If the user only does 'migrate', and doesn't do the second step, we are in = a state of = corruption. But Shubhendu explained to me that there's no way around this; = the = administrator *must* take a look and decide; it is simply not possible to m= ake this decision in advance. So I accepted this heavy-heartedly. = Then we were left with the decision of how to model this two step operation= . I tried to = look at it from the point of view of the user; what would be the simplest w= ay to 'tell him the story?' - If you want to migrate a brick, run 'migrate' on it. = - If you want to stop migration of the brick, run 'stopMigrate' on it. = - If you want to resume the migration of the brick, simply run 'migrate' on= it again. = After migration is done: - if you want to remove the brick, DELETE it (regular delete). = - if you want to keep using the brick, run 'reactivate' on it. = And that's the whole story. = The advantages are: = * In simple English, not bound to Gluster terms, the administrator has to d= ecide whether to = get rid of the brick, remove it, when migration is done. So what would be m= ore natural than = to delete it? It makes sense, and there's no need for a new 'action'. On th= e Gluster side, = if user tried to delete a brick which is undergoing migration - simply don'= t allow it. This = is something you have to do anyway; a user might try to delete a brick whic= h is undergoing migration and you have to stop him from doing so. So 0 extra work here. = * Instead of stopMigrate meaning two different things in two different cont= exts, we now = have stopMigration mean exactly what its name suggests: it stops the migrat= ion, and 'reactive' = mean exactly what it suggests - mark this brick as active again, allow it t= o be used. = > >Sahina, request your comments on the same. > >Thanks and Regards, >Shubhendu On 11/11/2013 10:30 AM, Shubhendu Tripathi wrote: > On 11/10/2013 11:06 PM, Moti Asayag wrote: >> >> ----- Original Message ----- >>> From: "Shubhendu Tripathi" >>> To: "engine-devel" , "Michael Pasternak" = >>> , oliel(a)redhat.com >>> Sent: Friday, November 8, 2013 8:37:30 AM >>> Subject: [Engine-devel] REST-API: Problem with additional DELETE = >>> action at collection level >>> >>> 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 - >>> >>> >>> true/false >>> >>> >>> brick1-name >>> brick2-name >>> >>> >>> >>> >>> 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 ". >>> >> Maybe I've missed it some where, but i wasn't able to find the new = >> 'force' parameter >> in the rsdl, and specifically not in optionalArguments list of: >> >> - name: = >> /api/clusters/{cluster:id}/glustervolumes/{glustervolume:id}/bricks|rel= =3Ddelete >> >> and perhaps the correct approach will be to deprecate this signature = >> and introduce a new >> one with the 'force' in the 'mandatoryArguments' section. > Moti, I have introduced another methods remove of DELETE type which = > takes Action as input. > I pass list of bricks and force as parameter in the same Action. > > Also, I tried marking the old method deprecated and introduced the new = > one BUT as mentioned above, after introduction of new DELETE with = > Action parameter old one STOPS working. > Is it OK to stop working for a method if its deprecated?? I don't feel = > so. Please comment. >> >>> >>> >>> >>> >>> >>> Kindly suggest a solution around the same. >>> >>> PS: Both the actions are defined at collection level ( >>> /api/clusters//glustervolumes//bricks ) >>> >>> [1]: http://gerrit.ovirt.org/#/c/21043/ >>> >>> Thanks and Regards, >>> Shubhendu >>> >>> >>> >>> >>> >>> _______________________________________________ >>> Engine-devel mailing list >>> Engine-devel(a)ovirt.org >>> http://lists.ovirt.org/mailman/listinfo/engine-devel >>> > > _______________________________________________ > Engine-devel mailing list > Engine-devel(a)ovirt.org > http://lists.ovirt.org/mailman/listinfo/engine-devel > > --===============2060601200768758339==-- From shtripat at redhat.com Mon Nov 11 06:03:58 2013 Content-Type: multipart/mixed; boundary="===============1838073393278435514==" MIME-Version: 1.0 From: Shubhendu Tripathi To: devel at ovirt.org Subject: Re: [Engine-devel] REST-API: Problem with additional DELETE action at collection level Date: Mon, 11 Nov 2013 16:33:53 +0530 Message-ID: <5280B999.6000605@redhat.com> In-Reply-To: 463738104.27509428.1384166326211.JavaMail.root@redhat.com --===============1838073393278435514== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 11/11/2013 04:08 PM, Ori Liel wrote: >> ----- Original Message ----- >> From: "Shubhendu Tripathi" >> To: oliel(a)redhat.com, "Michael Pasternak" , "Sa= hina Bose" >> Cc: "Dusmant Pati" , "engine-devel" >> Sent: Monday, November 11, 2013 12:00:34 PM >> Subject: Re: [Engine-devel] REST-API: Problem with additional DELETE act= ion at collection level >> >> Self and Ori had a detailed discussion on the topic. >> >> Points discussed - >> >> 1. Ori mentioned that Michael and Ori did not mean to have a separate >> DELETE action for the purpose of commit in previous discussions. > That's right - no need for a new delete signature; existing signatures ar= e enough. > >> 2. Ori tried to understand the intention behind the separate commit >> command in gluster and suggested that ideally gluster should remember >> that a migration of data is started on the set of bricks, and if there >> is a delete fired on the same bricks it should perform a commit action >> because commit is nothing but a delete action >> 3. Ori suggested that in an ideal situation APIs needed would be >> - start migrate >> - stop migrate >> - delete bricks >> - retain bricks >> 4. As suggested by Ori, the remove bricks action should internally >> decide if there was a data migration, started on the set of bricks. If >> so, it should effectively fire a commit for the set of bricks. And if >> there was not occurrence of data migration it should behave like a >> normal force remove action. >> >> Ori, please add your comments if I have missed out anything here. > I agree with what you wrote, let me sort of say it again in my words: > > I don't like requiring two consecutive commands from the API user, to per= form migrate. > If the user only does 'migrate', and doesn't do the second step, we are i= n a state of > corruption. But Shubhendu explained to me that there's no way around this= ; the > administrator *must* take a look and decide; it is simply not possible to= make this > decision in advance. So I accepted this heavy-heartedly. > > Then we were left with the decision of how to model this two step operati= on. I tried to > look at it from the point of view of the user; what would be the simplest= way to 'tell him > the story?' > > - If you want to migrate a brick, run 'migrate' on it. > - If you want to stop migration of the brick, run 'stopMigrate' on it. > - If you want to resume the migration of the brick, simply run 'migrate' = on it again. > After migration is done: > - if you want to remove the brick, DELETE it (regular delete). > - if you want to keep using the brick, run 'reactivate' on it. > > And that's the whole story. > > The advantages are: > > * In simple English, not bound to Gluster terms, the administrator has to= decide whether to > get rid of the brick, remove it, when migration is done. So what would be= more natural than > to delete it? It makes sense, and there's no need for a new 'action'. On = the Gluster side, > if user tried to delete a brick which is undergoing migration - simply do= n't allow it. This > is something you have to do anyway; a user might try to delete a brick wh= ich is undergoing > migration and you have to stop him from doing so. So 0 extra work here. > > * Instead of stopMigrate meaning two different things in two different co= ntexts, we now > have stopMigration mean exactly what its name suggests: it stops the migr= ation, and 'reactive' > mean exactly what it suggests - mark this brick as active again, allow it= to be used. Thanks Ori for the detailed mail. So now the final set of APIs are - - migrate - stopmigrate - delete (existing delete to be enabled for commit) - reactivate Will go ahead with this and raise the patches accordingly. Thanks and Regards, Shubhendu >> Sahina, request your comments on the same. >> >> Thanks and Regards, >> Shubhendu > On 11/11/2013 10:30 AM, Shubhendu Tripathi wrote: >> On 11/10/2013 11:06 PM, Moti Asayag wrote: >>> ----- Original Message ----- >>>> From: "Shubhendu Tripathi" >>>> To: "engine-devel" , "Michael Pasternak" >>>> , oliel(a)redhat.com >>>> Sent: Friday, November 8, 2013 8:37:30 AM >>>> Subject: [Engine-devel] REST-API: Problem with additional DELETE >>>> action at collection level >>>> >>>> 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 - >>>> >>>> >>>> true/false >>>> >>>> >>>> brick1-name >>>> brick2-name >>>> >>>> >>>> >>>> >>>> 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 ". >>>> >>> Maybe I've missed it some where, but i wasn't able to find the new >>> 'force' parameter >>> in the rsdl, and specifically not in optionalArguments list of: >>> >>> - name: >>> /api/clusters/{cluster:id}/glustervolumes/{glustervolume:id}/bricks|rel= =3Ddelete >>> >>> and perhaps the correct approach will be to deprecate this signature >>> and introduce a new >>> one with the 'force' in the 'mandatoryArguments' section. >> Moti, I have introduced another methods remove of DELETE type which >> takes Action as input. >> I pass list of bricks and force as parameter in the same Action. >> >> Also, I tried marking the old method deprecated and introduced the new >> one BUT as mentioned above, after introduction of new DELETE with >> Action parameter old one STOPS working. >> Is it OK to stop working for a method if its deprecated?? I don't feel >> so. Please comment. >>>> >>>> >>>> >>>> >>>> >>>> Kindly suggest a solution around the same. >>>> >>>> PS: Both the actions are defined at collection level ( >>>> /api/clusters//glustervolumes//bricks ) >>>> >>>> [1]: http://gerrit.ovirt.org/#/c/21043/ >>>> >>>> Thanks and Regards, >>>> Shubhendu >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Engine-devel mailing list >>>> Engine-devel(a)ovirt.org >>>> http://lists.ovirt.org/mailman/listinfo/engine-devel >>>> >> _______________________________________________ >> Engine-devel mailing list >> Engine-devel(a)ovirt.org >> http://lists.ovirt.org/mailman/listinfo/engine-devel >> >> > > --===============1838073393278435514==-- From oliel at redhat.com Mon Nov 11 10:47:37 2013 Content-Type: multipart/mixed; boundary="===============5236471698372966406==" MIME-Version: 1.0 From: Ori Liel To: devel at ovirt.org Subject: Re: [Engine-devel] REST-API: Problem with additional DELETE action at collection level Date: Mon, 11 Nov 2013 10:47:36 -0500 Message-ID: <1378916650.28031202.1384184856755.JavaMail.root@redhat.com> In-Reply-To: 5280B999.6000605@redhat.com --===============5236471698372966406== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Guys, I apologize, but after considering it some more, I think there's a ba= sic problem in what I've suggested. = What I described would be great, if there would never be a need to delete a= brick during the process of its = migration, or in other words to force its deletion. But since we must have = such an option, in case migration goes wrong and we decide to get rid of the brick at all cost, then we must be ab= lechoose force=3Dtrue or force=3Dfalse. = We've already had this discussion, and the original conclusion was right: t= his does require another signature for = DELETE, one which receives an Action object and sets force=3Dtrue or force= =3Dfalse inside it - just like what Shubhendu = described that he tried to do in his email. Telling you, Shubhendu, that an= other signature is unnecessary was wrong, = took you a step back and waisted of your time. I hope you haven't spent muc= h effort implementing what we said yet, = as we reached an agreement relatively late in your working day... So my sin= cere apologies for that. I am well aware = that as it is a lot of time has been invested in agreeing on the correct AP= I. = I will now revisit your original question, Shubehendu, and soon reply to th= at, addressing the technical difficulty that you encountered. = Ori. = ----- Original Message ----- From: "Shubhendu Tripathi" To: "Ori Liel" Cc: "Michael Pasternak" , "Sahina Bose" , "Dusmant Pati" , "engine-devel" Sent: Monday, November 11, 2013 1:03:53 PM Subject: Re: [Engine-devel] REST-API: Problem with additional DELETE action= at collection level On 11/11/2013 04:08 PM, Ori Liel wrote: >> ----- Original Message ----- >> From: "Shubhendu Tripathi" >> To: oliel(a)redhat.com, "Michael Pasternak" , "Sa= hina Bose" >> Cc: "Dusmant Pati" , "engine-devel" >> Sent: Monday, November 11, 2013 12:00:34 PM >> Subject: Re: [Engine-devel] REST-API: Problem with additional DELETE act= ion at collection level >> >> Self and Ori had a detailed discussion on the topic. >> >> Points discussed - >> >> 1. Ori mentioned that Michael and Ori did not mean to have a separate >> DELETE action for the purpose of commit in previous discussions. > That's right - no need for a new delete signature; existing signatures ar= e enough. > >> 2. Ori tried to understand the intention behind the separate commit >> command in gluster and suggested that ideally gluster should remember >> that a migration of data is started on the set of bricks, and if there >> is a delete fired on the same bricks it should perform a commit action >> because commit is nothing but a delete action >> 3. Ori suggested that in an ideal situation APIs needed would be >> - start migrate >> - stop migrate >> - delete bricks >> - retain bricks >> 4. As suggested by Ori, the remove bricks action should internally >> decide if there was a data migration, started on the set of bricks. If >> so, it should effectively fire a commit for the set of bricks. And if >> there was not occurrence of data migration it should behave like a >> normal force remove action. >> >> Ori, please add your comments if I have missed out anything here. > I agree with what you wrote, let me sort of say it again in my words: > > I don't like requiring two consecutive commands from the API user, to per= form migrate. > If the user only does 'migrate', and doesn't do the second step, we are i= n a state of > corruption. But Shubhendu explained to me that there's no way around this= ; the > administrator *must* take a look and decide; it is simply not possible to= make this > decision in advance. So I accepted this heavy-heartedly. > > Then we were left with the decision of how to model this two step operati= on. I tried to > look at it from the point of view of the user; what would be the simplest= way to 'tell him > the story?' > > - If you want to migrate a brick, run 'migrate' on it. > - If you want to stop migration of the brick, run 'stopMigrate' on it. > - If you want to resume the migration of the brick, simply run 'migrate' = on it again. > After migration is done: > - if you want to remove the brick, DELETE it (regular delete). > - if you want to keep using the brick, run 'reactivate' on it. > > And that's the whole story. > > The advantages are: > > * In simple English, not bound to Gluster terms, the administrator has to= decide whether to > get rid of the brick, remove it, when migration is done. So what would be= more natural than > to delete it? It makes sense, and there's no need for a new 'action'. On = the Gluster side, > if user tried to delete a brick which is undergoing migration - simply do= n't allow it. This > is something you have to do anyway; a user might try to delete a brick wh= ich is undergoing > migration and you have to stop him from doing so. So 0 extra work here. > > * Instead of stopMigrate meaning two different things in two different co= ntexts, we now > have stopMigration mean exactly what its name suggests: it stops the migr= ation, and 'reactive' > mean exactly what it suggests - mark this brick as active again, allow it= to be used. Thanks Ori for the detailed mail. So now the final set of APIs are - - migrate - stopmigrate - delete (existing delete to be enabled for commit) - reactivate Will go ahead with this and raise the patches accordingly. Thanks and Regards, Shubhendu >> Sahina, request your comments on the same. >> >> Thanks and Regards, >> Shubhendu > On 11/11/2013 10:30 AM, Shubhendu Tripathi wrote: >> On 11/10/2013 11:06 PM, Moti Asayag wrote: >>> ----- Original Message ----- >>>> From: "Shubhendu Tripathi" >>>> To: "engine-devel" , "Michael Pasternak" >>>> , oliel(a)redhat.com >>>> Sent: Friday, November 8, 2013 8:37:30 AM >>>> Subject: [Engine-devel] REST-API: Problem with additional DELETE >>>> action at collection level >>>> >>>> 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 - >>>> >>>> >>>> true/false >>>> >>>> >>>> brick1-name >>>> brick2-name >>>> >>>> >>>> >>>> >>>> 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 ". >>>> >>> Maybe I've missed it some where, but i wasn't able to find the new >>> 'force' parameter >>> in the rsdl, and specifically not in optionalArguments list of: >>> >>> - name: >>> /api/clusters/{cluster:id}/glustervolumes/{glustervolume:id}/bricks|rel= =3Ddelete >>> >>> and perhaps the correct approach will be to deprecate this signature >>> and introduce a new >>> one with the 'force' in the 'mandatoryArguments' section. >> Moti, I have introduced another methods remove of DELETE type which >> takes Action as input. >> I pass list of bricks and force as parameter in the same Action. >> >> Also, I tried marking the old method deprecated and introduced the new >> one BUT as mentioned above, after introduction of new DELETE with >> Action parameter old one STOPS working. >> Is it OK to stop working for a method if its deprecated?? I don't feel >> so. Please comment. >>>> >>>> >>>> >>>> >>>> >>>> Kindly suggest a solution around the same. >>>> >>>> PS: Both the actions are defined at collection level ( >>>> /api/clusters//glustervolumes//bricks ) >>>> >>>> [1]: http://gerrit.ovirt.org/#/c/21043/ >>>> >>>> Thanks and Regards, >>>> Shubhendu >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Engine-devel mailing list >>>> Engine-devel(a)ovirt.org >>>> http://lists.ovirt.org/mailman/listinfo/engine-devel >>>> >> _______________________________________________ >> Engine-devel mailing list >> Engine-devel(a)ovirt.org >> http://lists.ovirt.org/mailman/listinfo/engine-devel >> >> > > --===============5236471698372966406==-- From oliel at redhat.com Mon Nov 11 11:20:47 2013 Content-Type: multipart/mixed; boundary="===============0376091484638336410==" MIME-Version: 1.0 From: Ori Liel To: devel at ovirt.org Subject: Re: [Engine-devel] REST-API: Problem with additional DELETE action at collection level Date: Mon, 11 Nov 2013 11:20:46 -0500 Message-ID: <2101667553.28083459.1384186846646.JavaMail.root@redhat.com> In-Reply-To: 527C7DDF.2050308@redhat.com --===============0376091484638336410== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Shubhendu, = The problem you're describing stems from the fact that BackendGlusterBricks= Resource already has an implementation of 'remove' which recieves an object= (GlusterBricks). This creates ambiguity that RestEasy can't resolve: it ha= s no way of deciding whether to deserialize the XML data into an 'Action' o= bject or into a 'GlusterBricks' object. Within the current limitation of Re= stEasy, this problem is unsolvable. = To overcome this, we can take a different approach: pass 'force' as a URL m= atrix parameter. In order to see how this is achieved technically, I refer = you to BackendResource.isAsync() method. 'async' is a URL matrix parameter,= and this simple method shows how it's fetched from the URL. Implementing s= omething similar for force should be easy. = On our side, I will deprecate all current uses of 'force' in the API and mo= ve them all to be URL matrix parameters, so that we'll be aligned with you. Michael will be here tomorrow, and on Wednesday I'll also be available agai= n, to help and/or review. = Thanks, = Ori. = ----- Original Message ----- From: "Shubhendu Tripathi" To: "engine-devel" , "Michael Pasternak" , oliel(a)redhat.com Cc: "Dusmant Pati" Sent: Friday, November 8, 2013 7:59:59 AM Subject: REST-API: Problem with additional DELETE action at collection level 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 - / //// // true/false// // // // // // //brick1-name// // brick2-name// // // // // /// 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". / // // / Kindly suggest a solution around the same. *PS:* Both the actions are defined at collection level = (//api/clusters//glustervolumes//bricks/) [1]: http://gerrit.ovirt.org/#/c/21043/ Thanks and Regards, Shubhendu --===============0376091484638336410==--