Hi,

I squeezed previous patchset to 2 patches to keep this thread clean.
New patches adds new features likes assigning instance to IP for EC2
and small improvement to /api/instances/new (now when you don't set
'image_id' parameter instead of choosing first image (tomcat) you
can choose image you want to launch from select box)

But the most interesting feature is a new Rabbit method called
'disable_if_not' ;-) (gimme better name...) and it's suppose is
to disable entire collection operation if given method is
not present in driver.

Well it will not be 'literally' disabled. Operation still remains
in collection. Inovation is, that when you request for HEAD on
collection (HEAD /api/ip_addresses) all HTTP methods from 
operations which are disabled will be not present in 'Allow' header.
This could be easely picked up by client.

Mispelled 'destroy_ip_addresss' and 'create_ip_addresss' are just
for demostration suppose. To try this patches, you need to install
a 'Poster' extension to Firefox (or use Curl) and request for:

HEAD "/api/ip_addresses"

Response header should include "Allow: HEAD, GET" instead of
"Allow: HEAD, POST, DELETE, GET".

So as you can see, DELETE and POST methods are not here and therefore
collection operations assigned to them are not supported.

Please let me know if this approach is correct.
If so, I'll update client library to support HEAD request.

 -- Michal


Reply via email to