deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <>
Subject Re: CIMI: CIMISelect filter added
Date Thu, 08 Dec 2011 15:26:17 GMT

On Dec 8, 2011, at 4:09 PM, wrote:

> ACK - very nice - just 1 thought: looking at CIMISelect - not sure it
> applies only to *_Collection - so for example you want to GET Machine
> but only see the name and volumes attributes:
> GET /cimi/machines/my_machine?CIMISelect=name&CIMISelect=volumes


I put it into base model so it should be also available for other
entities. I haven't yet implemented all features for CIMISelect but we
can extend it later.

  -- Michal

> marios
> On 08/12/11 14:19, wrote:
>> Hi,
>> This patch add new parameter for all :index operations in CIMI.
>> CIMISelect is described as optional Collection paramter in
>> Currently you can do:
>> curl -H 'Accept: application/xml' --user 'mockuser:mockpassword' 'http://localhost:3001/cimi/machines?CIMISelect=name'
>> The output will be limited to just 'name' element.
>> curl -H 'Accept: application/xml' --user 'mockuser:mockpassword' 'http://localhost:3001/cimi/machines?CIMISelect=machines'
>> Only machines array will be displayed in MachineCollection
>> curl -H 'Accept: application/xml' --user 'mockuser:mockpassword' 'http://localhost:3001/cimi/machines?CIMISelect=machines[1]'
>> Only first machine in array will be displayed in MachineCollection
>> curl -H 'Accept: application/xml' --user 'mockuser:mockpassword' 'http://localhost:3001/cimi/machines?CIMISelect=machines[1-10]'
>> Only first ten machines will be displayed (similar to Ruby Range, usefull for pagination,
>> I found some inconsistencies between JSON and XML. All filter names currently
>> work onyl with JSON names (machine_configurations, etc..) so the XML tag names
>> are ignored (machineConfiguration). There is no notion if in XML you should use
>> the xml tag name in filter name or not.
>> There is also secondary parameter 'CIMIExpand' that will expand the Entity in
>> Collection. 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 this Array, so
>> then the CIMIExpand parameter should be used properly (Collection entity will
>> contain a full entity with all properties).
>> Cheers,
>>  Michal

Michal Fojtik,
Deltacloud API:

View raw message