dev@glassfish.java.net

Re: spec for REST api for v3?

From: Jason Lee <jason_at_steeplesoft.com>
Date: Fri, 1 Feb 2008 09:54:03 -0600

On 2/1/08, vince kraemer <Vince.Kraemer_at_sun.com> wrote:
>
> Jakub Podlesak wrote:
> > On Thu, Jan 31, 2008 at 07:25:01PM -0800, Peter Williams wrote:
> >
> >> Is there a document detailing the inputs & outputs for V3's REST api?
> >>
> >> I found the one here:
> >> http://wiki.glassfish.java.net/Wiki.jsp?page=V3AdminCommands
> >>
> >
> > the above described api doesn't look very RESTfully.
> > It uses verbs to specify methods in URIs. It is probably
> > fine as long as it is not called REST api.
> >
> > ~Jakub
> >
>
> I am not sure I understand your comment. Can you provide a specific
> example of what you mean and a suggested improvement that would resolve
> the issue?
>

I'm not REST expert, but think what he means is that the verb is in the URL,
rather than in the headers. That is, getting a list of applications should
probably look something like this:

http://localhost:8080/__asadmin/applications

Submitted to the server as a GET request. To see a specific application,
one would GET http://localhost:8080/__asadmin/applications/MyFancyJsfApp

To deploy, PUT http://localhost:8080/__asadmin/applications/MyFancyJsfApp
To undeploy, perhaps one would DELETE
http://localhost:8080/__asadmin/applications/MyFancyJsfApp

Etc. The verb is defined by the type of HTTP request, where the data to be
retrieved or acted upon would be specified in the URL.

That might not be accurate, but that's the way I took the assessment.

-- 
Jason Lee, SCJP
Software Architect -- Objectstream, Inc.
Mojarra and Mojarra Scales Dev Team
https://mojarra.dev.java.net
https://scales.dev.java.net
http://blogs.steeplesoft.com