deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: CIMI: CIMISelect filter added
Date Tue, 13 Dec 2011 15:53:41 GMT

On Dec 12, 2011, at 5:07 PM, Tong Li wrote:

> Earlier I sent an email mentioned that no search or filter was specified in
> the spec. Which was true in earlier specs. Doug pointed out that in the
> newer CIMI spec section 4.1.1.6 actually does support it. Here is what the
> spec will do to address that.
> 
> 	/machines?CIMISelect=*,machines[href.name=mine]

Right, I found this in CIMI 0.0.50 I think. To implement this kind of filters
we need update our models and add more descriptive relations between entities
in Collections. (Check /me and lutter earlier discussion). So far my patch adds
just basic filtering capabilities.

  -- Michal

> 
> Notice the bracket at the end of an attribute name, The above described
> mechanism was added somewhere between 0.0.50 and 0.0.55b.
> 
> Thanks.
> 
> Tong Li
> Emerging Technologies & Standards
> Building 501/B205
> litong01@us.ibm.com
> 
> David Lutterkort <lutter@redhat.com> wrote on 12/09/2011 07:56:53 PM:
> 
>> From: David Lutterkort <lutter@redhat.com>
>> To: dev@deltacloud.apache.org
>> Date: 12/09/2011 07:57 PM
>> Subject: Re: CIMI: CIMISelect filter added
>> 
>> On Thu, 2011-12-08 at 13:19 +0100, mfojtik@redhat.com wrote:
>>> Practically it will display a full Machine entity instead of
>>> reference. Currently the Collection models are defined to hold
>> only references.
>>> I was thinking about adding something like:
>>> 
>>> array :machines do
>>>  scalar :href
>>>  inherit :machine
>>> end
>>> 
>>> The 'inherit' method will 'copy' schema from Machine model to
> thisArray, so
>>> then the CIMIExpand parameter should be used properly (Collection
>> entity will
>>> contain a full entity with all properties).
>> 
>> I haven't thought through this in code, but my gut feeling says we need
>> to tie the href and the object that it references together more tightly,
>> i.e. I think we'd need something like
>> 
>>        array :machines do
>>          reference :machine, :attribute => :href
>>        end
>> 
>> where :href is the default for :attribute. At that point, we should
>> probably copy Rails even farther and say
>> 
>>        has_many :machines, :attribute => :href, :class => Machine
>> 
>> where :attribute and :class default to :href and Machine
>> (singularization of the association name)
>> 
>> One of the advantages of tying things together like that is that it
>> gives us a lot of flexibility if the association itself should gain
>> attributes in a future draft, e.g. so that the collection of volumes
>> attached to a machine gets its own URL.
>> 
>> And we probably want a has_one, too.
>> 
>> David
>> 
>> 
>> 
> 

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


Mime
View raw message