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

Hongbin Lu hongbin.lu at huawei.com
Fri Dec 16 20:50:00 UTC 2016

Hi API working group,

I am from the Zun team and I wanted to consult with you about the API design. Our team was discussing what is the best API design for exposing different container operations [1]. There are two proposed options:

1. Expose multiple URLs for individual container operation. For example:
* POST /containers/<ID>/start:            Start a container
* POST /containers/<ID>/stop:            Stop a container
* POST /containers/<ID>/reboot:        Reboot a container
* POST /containers/<ID>/pause:        Pause a container

2. Expose a single URL for all operations. For example:
* POST /containers/<ID>/action
{'start': {...}}
* POST /containers/<ID>/action
{'stop': {...}}
* POST /containers/<ID>/action
{'reboot': {...}}
* POST /containers/<ID>/action
{'pause': {...}}

After a quick search, it looks option #1 was chosen by Ironic, and option #2 was chosen by Nova, Cinder, Senlin, etc. Some services use a mix of these two styles. I would like to know if there is a guidance from API working group in this regards. Does API working group flavor one style over the other? Thanks in advance.

Best regards,

[1] https://etherpad.openstack.org/p/zun-core-api
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20161216/e991fb87/attachment.html>

More information about the OpenStack-dev mailing list