[occi-wg] JSON Rendering

Ralf Nyren ralf at nyren.net
Thu Feb 23 08:29:02 EST 2012


On Wed, 22 Feb 2012 15:16:28 +0000, "Feldhaus, Florian"
<florian.feldhaus at 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,
}

> 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


More information about the occi-wg mailing list