Various components of ralph suite expose a REST-ful API that can be used
both for querying the database and populating it with data. The API utilises
tastypie to handle your requests.
plist format can be used for data serialization and deserialization.
Current version of the API: v0.9. The API specification is unstable now.
To authenticate yourself you need to provide your ApiKey in a header:
Authorization: ApiKey your_username:your_api_key
In order to obtain the api_key:
- Click your username in the lower right corner of the application.
- Choose “My API key” from the menu.
There are two ways of setting the format of output:
- By setting the
Acceptheader to the correct MIME-type:
- By adding a
formatparameter with the desired format name
NOTE: In order to use
plist format you need to install biplist package
which is currently not installed by default in ralph distribution.
You can use any of the above formats for input. The
should be set as above.
The following methods can be used in the API. Consult the API reference of specific module for more precise explanations.
|Method||On a collection||On a single resource|
|GET||Get full list of resources||Get resource details|
|POST||Add a new resource||Unused|
|PUT||Replace the whole collection (!)||Edit the resource (you need to provide all data)|
|PATCH||Unused||Edit the resource (you only need to provide changed data)|
|DELETE||Remove the whole collection (!)||Remove the resource|
When using the POST method you should expect to receive HTTP status 201 response. This response will contain
Locationheader with the URL of the created resource. The response body would be empty.
The related resource will be specified in one of two ways:
- The URL of the related resource
- As the details
You may use any of these in input.
API references for modules: