Crash REST API

23 views
Skip to first unread message

William Antônio Siqueira

unread,
Apr 25, 2012, 8:53:51 PM4/25/12
to crash...@googlegroups.com
Hello,

great project, I was reading about it. I started to learn crash because of the JCR features, now I'm seeing it's much more than JCR.

I'm trying to create a way to access crash trough HTTP, something like a REST API. I would like to hear your suggestions:

- Do you think a simple HTTP call and send a commando would be enough? (crash/execute?command={command} or crash/execute/{command})
- We can create a more complete "REST like architecture", for example, using commands as resources and much more features.

The access to the API would use basic authentication.

Julien Viet

unread,
Apr 26, 2012, 1:55:32 AM4/26/12
to crash...@googlegroups.com

On Apr 26, 2012, at 2:53 AM, William Antônio Siqueira wrote:

> Hello,
>
> great project, I was reading about it. I started to learn crash because of the JCR features, now I'm seeing it's much more than JCR.

yes that's how CRaSH can give and obtain love.

>
> I'm trying to create a way to access crash trough HTTP, something like a REST API. I would like to hear your suggestions:
>
> - Do you think a simple HTTP call and send a commando would be enough? (crash/execute?command={command} or crash/execute/{command})
> - We can create a more complete "REST like architecture", for example, using commands as resources and much more features.
>

I think that "/crash/execute/{command}" is better to use but it may not be correct from rest point of view.

For dual commands like "git add" we could have "/crash/execute/git/add"

Then the problem is about argument and option passing. The main difference between those is that options have a name and arguments don't have a name.

Options can easily be associated with query parameters, arguments would perhaps need a special query parameter name ?

I am not a rest expert and I know that normally in the path we should have the "resource" notion. I don't know if a command can conceptually considered as a resource.

> The access to the API would use basic authentication.

Yes it's a good start

One last point, as it is a fairly simple rest mapping, can you do it without a framework (i.e jaxrs) and use a plain servlet instead ? I am trying to get very few jar dependencies for CRaSH.
Reply all
Reply to author
Forward
0 new messages