Nice work!
Just some random thoughts that occurred on reading through the docco, while
they're fresh in my mind ...
For the "POST /vms" triggering VM creation, an alternative pattern would be
to return the complete representation of the newly created VM in the
response entity-body. Obviously this would only really make sense if there's
some extra information to convey, over and above what the client already
knows ... I dunno, the initial memory usage or something. The point being to
save on an immediate dereference of the Location header provided in the
response. It would also be a convenient place to encode the links to the
"action" URIs (to reboot, suspend, migrate, whatever) .
Which segues nicely to the use of the Link header in the response to the
top-level GET, which is kinda cool as it avoids marshalling up an
entity-body. But it might be slightly inconsistent to use the Link header in
some cases, but then to revert to inline <link> elements elsewhere in the
API (e.g. in the per-VMs links within a collection of VMs returned from a
search).
I think you're right to use 204 for the DELETE response code, as long as
there's no entity-body. Now there might I guess be a case in the future
where some sort of status would be returned, maybe an indication as to which
alternative VM any migrated processes ended up on. In that case, the status
should revert to 200 OK.
BTW I don't think the {BASE} in the Request-URIs is really needed, as the
relative URI form is more common AFAIK (with the {BASE} kinda hidden in the
Host header).
Cheers,
Eoghan
On 7 April 2010 18:33, Mark McLoughlin <markmc(a)redhat.com> wrote:
Hi,
I've made a first attempt at documenting the REST API here:
https://fedorahosted.org/rhevm-api/wiki/ApiReference
https://fedorahosted.org/rhevm-api/wiki/VirtualMachinesCollection
Basically, I just wanted to get a feel for how sane the semantics sound
when described in prose. It seems like a fine start to me?
Geert will notice that I borrowed liberally from his API reference
style :-)
Thanks,
Mark.
_______________________________________________
rhevm-api mailing list
rhevm-api(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/rhevm-api