incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: Various fixes in REST (status codes, etc)
Date Thu, 09 Dec 2010 09:28:01 GMT
On 07/12/10 16:09 +0100, Michal Fojtik wrote:
>On 07/12/10 15:08 +0100, Ladislav Martincik wrote:
>>Nice one. Like it very much. :)
>
>Thanks,
>
>BTW. this will need for sure some client update, just forgot to check
>when I sent this patch. I'll sent another patch with client fixes, after
>some discussion about this stuff.

OK, I was wrong, our Ruby client is so inteligent that it can deal with
this changes without any modifications. (rake spec without errors)

   -- Michal

>
>  -- Michal
>
>>
>>-- Ladislav
>>
>>On Dec 7, 2010, at 3:05 PM, mfojtik@redhat.com wrote:
>>
>>>Hi,
>>>
>>>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
>>> resource.
>>>
>>>This patch also includes fix for typo in 'load balancer' view.
>>>
>>>Let me know, what do you think about this.
>>>
>>> -- Michal
>>>
>>
>
>-- 
>--------------------------------------------------------
>Michal Fojtik, mfojtik@redhat.com
>Deltacloud API: http://deltacloud.org
>--------------------------------------------------------

-- 
--------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com
Deltacloud API: http://deltacloud.org
--------------------------------------------------------

Mime
View raw message