An open API service indexing awesome lists of open source software.

https://github.com/msimonin/restletapplication

Archetype source for a RESTlet application sample
https://github.com/msimonin/restletapplication

Last synced: 3 months ago
JSON representation

Archetype source for a RESTlet application sample

Awesome Lists containing this project

README

        

RESTlet Sample Application
==========================

This is an archetype with an application skeleton to demonstrate the use of the [RESTlet framework](http://restlet.org).
It exposes a simple Restful API compatible with [Restfully](https://github.com/crohr/restfully).

Versions :

For specific versions, checkout the corresponding tag.
* 0.0.1 : "Hello world" application
* current :The application present a "grid like" resource. A grid is composed of clusters of machines.

# Running from the sources

Clone the repository

```
git clone https://github.com/msimonin/RestletApplication
cd RestletApplication
```
compile it

```
./compile.sh
```

Go to the target directory and launch :

```
java -jar uber[...] ../configs/application.cfg ../configs/log4j.xml
```

Test it :

* root resources : ```curl localhost:4001/1.0```
* clusters resources: ```curl localhost:4001/1.0/clusters```
* add cluster with a ```POST``` request, remove one with a ```DELETE``` ...

or use Restfully :
```
>> pp root
#
=> nil
>> pp root.clusters
#
#>
=> nil
>> pp root.clusters[:cluster1]
#"cluster1">
=> nil
>> pp root.clusters[:cluster1].delete
#
=> nil
>> pp root.clusters.submit("test")
#"test"
"message"=>nil>
=> nil
>> pp root.clusters
#
#>
=> nil

```

# Getting the archetype

Alternatively, if you want to integrates this to your work you can download the archetype skeleton.
```
mvn archetype:generate -DarchetypeCatalog=http://snooze.inria.fr/maven
```

## Compiling

Move to the root directory, you should see :

```
.
├── compile.sh
├── configs
├── LICENSE
├── pom.xml
├── README.md
├── src
└── target
```

and run

```
mvn package
```