
Comment below On 2/23/2012 6:29 AM, Ralf Nyren wrote:
On Wed, 22 Feb 2012 15:16:28 +0000, "Feldhaus, Florian" <florian.feldhaus@gwdg.de> wrote:
I'm currently reviewing the rendering of entities. I was wondering, if we could use "Collection" for rendering single entities as well. On the other hand, we might as well drop the Collection completely and just use an array of entity renderings. I would prefer using the term entities, as the rendering is then similar to the rendering of the categories (with "kinds" and "mixing"). What do you think? I used the word "collection" just to avoid confusion. OCCI Core says that a bunch of entities of a certain type (say Compute) automatically form a
collection. This however was not entirely obvious at first glance so I wanted to make it clear that OCCI indeed have collections.
I do not understand the reason for having the same representation for collections as for single resource responses.
What is wrong with:
GET /resource-ID { resource }
GET /collection/ { collection: [ resource1, resource2, ... ], size: 1004, // total number of items in the collection, not in the response start: 0, }
E.g. how do you get just the size of a collection? Like this: GET /collectionX/?count=0 ... { collection: [], size: 1004, start: 0, }
There is nothing technically "wrong" with it, it just sucks as a client to figure out if you have an array or resource. CDMI had the same issue and decided for the array of one element....
e.g. instead of using { "collection": [ { "kind: { … }, "mixing": { … }, "actions": { … }, "attributes": { … } }, { "kind: { … }, "mixing": { … }, "actions": { … }, "attributes": { … } } ] } I still vote for this yes.
or just: [ { "kind: { … }, "mixing": { … }, "actions": { … }, "attributes": { … } }, { "kind: { … }, "mixing": { … }, "actions": { … }, "attributes": { … } } ] This we cannot have. It is a security issue to return a JSON arary at the top level. There is an old thread on occi-wg on that as well.
regards, Ralf _______________________________________________ occi-wg mailing list occi-wg@ogf.org https://www.ogf.org/mailman/listinfo/occi-wg