deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "marios@redhat.com" <mandr...@redhat.com>
Subject Re: CIMI: CIMISelect filter added
Date Thu, 08 Dec 2011 15:09:47 GMT
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

marios

On 08/12/11 14:19, mfojtik@redhat.com wrote:
> Hi,
> 
> This patch add new parameter for all :index operations in CIMI.
> CIMISelect is described as optional Collection paramter in 4.1.6.1.
> 
> 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,
etc..)
> 
> 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
> 


Mime
View raw message