[openstack-dev] [api][zun] Effective URL for resource actions

Ed Leafe ed at leafe.com
Tue Dec 20 15:25:52 UTC 2016

On Dec 19, 2016, at 9:34 PM, Qiming Teng <tengqim at linux.vnet.ibm.com> wrote:
> Then we should stop identifying actions based on URL. :)
> The following URL for representing a 'pause' action is really ugly:
>   /containers/<ID>/pause
> First of all, 'pause' is a verb. I cannot persuade myself that doing a
> POST to a verb is a ReST call. And I cannot do a 'GET', 'DELETE' not
> due to I'm not an admin ... rather, it is because I cannot explain what
> it means by 'deleting a pause'.  

Like the rest of the options, this is not ideal, but it is worth consideration:

POST /containers/ID?action=pause

with a body that is either empty or contains some other non-related information.

You don't have the problem of a single URL for multiple actions, and while it's not 100% RESTish, it's not illegal either. 

-- Ed Leafe

More information about the OpenStack-dev mailing list