On 05/17/2010 07:53 PM, David Lutterkort wrote:
> On Mon, 2010-05-17 at 15:30 +0200, Michal Fojtik wrote:
>> I'm not sure if this extra checking have sense for some fields and if
>> throwing
>> exception when instance doesn't have assigned image isn't better approach.
>> Or just add something like:
>>
>> %image
>> - unless @instance.image_id
>> %error{:code => '404'}
>> "Instance without image / Image not found"
>>
>> Also this patch will need change to client (check if element exists).
>
> I am not sure - from the server's point of view, it's easiest to just
> omit anything that's not set (as Chris' patch did). Of course, from the
> client's point of view, that causes extra work, since there's now a
> chance that any attribute might be missing.
>
> I agree that we need to be a little more discriminating in what parts of
> the instance details are optional, and which ones aren't. Chris: which
> attributes in particular were missing for your changes ?
If I understand the question correctly, you are asking which attributes
of the Instance object might be missing for certain driver responses. If
I did understand that properly, then the answer is that almost all of the
attributes are optional, except for the id, the href, the state, and the
instance_actions. This can happen both on instance lookup failure (in the
EC2 case), as well as the rackspace driver, which doesn't give you any
information whatsoever in response to an action.
Does that answer your question?
--
Chris Lalancette
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel