[rest-practices] Links for actions

Itamar Heim iheim at redhat.com
Wed May 12 17:40:58 UTC 2010


> From: Mark McLoughlin [mailto:markmc at redhat.com]
...
> On Wed, 2010-05-12 at 06:56 -0400, Itamar Heim wrote:
> > > From: Mark McLoughlin [mailto:markmc at redhat.com]
>
> > >          <vm id="500" href="/vms/500">
> > >            <name>vm500</name>
> > >            <status>DOWN</status>
> > >          </vm>
> > >        </vms>
> > [IH] how would the client pass the request or a partial entity
> (parameter
> > wise)?
>
> you mean something this?
>
>   https://fedorahosted.org/rhevm-api/wiki/StorageDomainsCollection
>
>   POST /storagedomains/{id}/initialize HTTP/1.1
>   Content-type: application/xml
>   Content-length: {length}
>
>   <action>
>     <host id="..."/>
>   </action>
>
> i.e. the client doesn't have to pass an complete representation of the
> host
[IH] I meant when client wants to get back a list of all storage domains, 
but only wants their ID and Name, and not all their statistics for example.
>
> > > > isn't this mixing introspection with data?
> > >
> > > Yes, that's a key part of REST's "hypermedia as the engine of
> > > application state" principle
> > [IH] that's quite an overhead of data when it is not needed.
>
> You gave a good example of why its needed - it lets the client know up
> front which operations are applicable for a given resource, without the
> client having to make extra requests to query it
[IH] I gave an example of when I may want it, but there are still plenty of 
use cases where all objects may have same operations on them and I wouldn't 
want this overhead.




More information about the rest-practices mailing list