[Hawkular-dev] REST ideas

Viliam Rockai vrockai at redhat.com
Wed Feb 11 09:45:20 EST 2015


On Wed, 2015-02-11 at 14:43 +0100, Heiko W.Rupp wrote:
> > Am 11.02.2015 um 14:23 schrieb Viliam Rockai <vrockai at redhat.com>:
> > 
> > Hi,
> > 
> > I'm looking at hawkular-inventory and I've got several comments (liveoak
> > legacy) which could apply on other rest endpoints, too:
> > 
> > 1. I think it would be easier to use/get if we make it more
> > hierarchical. That means; instead of using two distinct URLs (resources
> > vs. resource) for lists (/hawkular/inventory/rest-test/resources/) and
> > entities (/hawkular/inventory/rest-test/resource/x1422733176502), we use
> > only one (/hawkular/inventory/rest-test/resources/x1422733176502).
> 
> This is a good question/suggestion. I tried to follow the pattern of <foo>S 
> for list + creation
> and <foo>/x for identifying individual objects - sort of like in natural language.


Yeah, I thought this is the reason. My way of looking at it is as if it
were folders. So "resources" is the name of the folder, I can create new
item there with POST, I can list the "directory" with GET on the
directory itself, or list the contents of items by GETing some
particular item and so on...

> 
> 
> 
> > 2. Sometimes, in the docs, attribute called "name" is used, and referred
> > to, as an "id". Would it be possible and make sense to choose just one
> > notation and use it in the representation? 
> 
> Yes. I think we may need some more overall cleanup as soon as we know
> more about some terms and semantics we want to use.
> > 
> > 3. Usage of methods: When you want to create a metric, you use the PUT
> > method. What about unifying methods in some commonly used manner. Like
> > post for create, put for edit?
> 
> I guess you are right here. I used put instead of post for the metrics, as they are
> sort of dependent objects. 
> 
> 
> 
>   Heiko
> 
> 
> _______________________________________________
> hawkular-dev mailing list
> hawkular-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hawkular-dev




More information about the hawkular-dev mailing list