incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Various fixes in REST (status codes, etc)
Date Tue, 07 Dec 2010 14:05:27 GMT

This patch includes a lot of REST-specific fixes to be more 'RESTish' ;-)

Some notes:

* Start action on stopped instance (EC2 especially)
  This will lead to immediate Internal Server Error right now when this 
  instance is not EBS.
  So rather than returning ISE, return 304 (Not Modified) and redirect
  back to that instance (eg. instance status was not modified by this call)

* DELETE calls
  Now we redirecting client to deleted resource, which from my point of
  view has no sense ;-)
  So instead of pointing client to deleted resource, reply with '410'
  status code (Gone), and tell client that this resource was deleted
  and it's 'marked' as deleted.

* CREATE calls
  I fixed (hopefully) all create calls where code '200' was returned and
  replaced this HTTP code with '201' (Created).

* Instance actions
  Instead of returning '200' (OK), return '202' which means 'Accepted'.
  Obviously, actions are not performed 'immediately' so it means client
  can get wrong result and think that Instance is 'STOPPED' for example
  where it's not (it's PENDING or SHUTTING_DOWN).
  Code '202' is more like 'job queued' or 'task accepted'.

* Use PUT when pushing something to resource
  For now this applies only for registering instance to created
  LoadBalancer object. So instead of using 'POST' method for that,
  use 'PUT' because we 'literally' 'putting' a new object to this

This patch also includes fix for typo in 'load balancer' view.

Let me know, what do you think about this.

  -- Michal

View raw message