----- "Eoghan Glynn" <eoghan.glynn(a)gmail.com> wrote:
Hi Geert,
Interesting idea.
So for the sake of comparison, what we currently model as:
POST /hosts/123/install
Content-Type: application/xml
<action>
<root_password>geronimo</root_password>
</action>
you're suggesting we change to:
POST /hosts/123/actions
Content-Type: application/xml
<action>
<command>approve</command>
<root_password>geronimo</root_password>
</action>
I'm just starting to follow, but I was going to ask about action URIs myself. It
would seem that the POST should go to the
object (resource) itself, and the method call and parameters would be described in the
POST body.
I'd suggest something like this:
POST /hosts/123
Content-Type: application/xml
<action method="approve">
<param name="root_password">geronimo</param>
<!--... -->
</action>
There are models for this in XML-RPC already (Yes, that's XML RPC, but it's still
applicable, I think).
It seems to me that object methods don't deserve a resource all their own. There
should be a way to query the list of available actions on a resource (with their
parameters and an indication of which are required or defaulted)
GET /hosts/123/actions
<actions>
<action method="">
<param name="" required="true|false" [default=""]
/>
...
</action>
...
</actions>
POST /hosts/123
...
<action method="">
<param name="">value</param>
...
</action>
An action is something you want the resource to do. The list of actions is something you
want to ask for from the resource.
- Mark