On 09/20/2010 07:24 PM, Mark McLoughlin wrote:
On Mon, 2010-09-20 at 19:17 +0200, Geert Jansen wrote:
>>> Elaborating on ii, this would also introduce a protocol to query linked
>>> objects, e.g. "GET /clusters/xxx/hosts" and "GET
>>> /datacenters/xxx/clusters". I'd go just one level deep. If you want
to
>>> get all VMs in a datacenter, that's two queries.
>>
>> Yeah, I think it probably makes sense to add these eventually, but they
>> are just short-cuts for the API user - the information *is* already
>> modelled by the API
>>
>> I guess it's an extension of:
>>
>>
https://fedorahosted.org/rhevm-api/ticket/12
>>
>> What has stopped us from doing this before now is that a) it's an
>> optimization and b) there's the potential for dramatically increasing
>> the number of collections and complicating the API
>
> OK. For b), would you be able to use the same collection with a
> different URL mapping and a bound parameter? I don't know RESTEasy and
> so i don't know if it has a URL mapper that allows this.
Hmm, I'm not sure I follow
By API complexity in (b) I mean having e.g. a "networks" collection in 5
different place in the API, each one with different semantics
OK, i thought you meant complexity on the implementation side of the API.
I agree it's a useful short-cut for API users, but before we add
a
short-cut in one place we should go over the implications of adding a
similar short-cut for every other similar association in the API.
Agreed.
Regards,
Geert