To start this web service, install Maven and execute the following command
mvn package
A war will be created. Deploy it to an application server.
Once the web service is started, it can be reached at
http://localhost:8080/rackspace/service/vehicle
The following REST endpoints are available upon deployment:
HTTP Verb | URL | Description | Status Codes |
---|---|---|---|
GET |
http://localhost:8080/rackspace/service/vehicle |
Obtains a list of all existing vehicles |
|
GET |
http://localhost:8080/rackspace/service/vehicle/{id} |
Obtains the vehicle corresponding to the supplied vehicle ID |
|
POST |
http://localhost:8080/rackspace/service/vehicle |
Creates a new vehicle based on the payload contained in the request body |
|
PUT |
http://localhost:8080/rackspace/service/vehicle/{id} |
Updated an existing vehicle with the data contained in the request body |
|
DELETE |
http://localhost:8080/rackspace/service/vehicle/{id} |
Deletes an existing vehicle that corresponds to the supplied vehicle ID |
|
Use the following JSON structure when making a POST or PUT call:
{ "type": "truck", "description": "This is a big truck!", "costInCents": 9148937489723 }
{ "type": "train", "description": "This is a bullet train!!", "costInCents": 3812391283098219380 }