Skip to content
kjetilly edited this page Jan 15, 2014 · 4 revisions

This page describes the HTTP API for a Tinia Server Job. This does not describe how to start or stop a job, see GUIDE SOON

All requests are prefixed with <baseurl>, which is either http://server/trell/job/<jobid>/sessionid/ on the trell server, or http://server:8080/ on the QT server

Getting the renderlist

<baseurl>/getRenderList.xml?key=<viewerkey>&timestamp=<last revision, first value=0>

Gets the xml-representation of the (diff, if timestamp> 0) renderlist.

Parameters

  • timestamp is used to handle updates to the renderlist, always supply the latest revision fetched (start is 0)

  • key should be the key for the viewer in the ExposedModel (usually just "viewer").

Getting a snapshot

<baseurl>/snapshot.png?key=<viewerkey>&timestamp=<currenttime>&width=<width in px>&height=<height in px>

This will return a png-encoded image with the specified width and height.

Parameters

  • key should be the key for the viewer in the ExposedModel (usually just "viewer").

  • timestamp is used to prevent caching (and must always be present). A smart value is the current timestamp, but any integer value will suffice.

Updating the ExposedModel on the server

<baseurl>/updateState.xml

This will accept the full XML-document of the current ExposedModel as POST data.

Getting the latest ExposedModel from the server

<baseurl>/getExposedModelUpdate.xml?revision=<latest revision>

Returns the latest (diff) for the ExposedModel.

Parameters

  • revision latest revision obtained, starting at 0.

Getting a snapshot AND updating image in one request

<baseurl>/snapshot.png?width=<width>&height=<height>&key=<viewer key>&timestamp=<timestamp>

This is a convenience function to reduce the number of HTTP requests. The ExposedModel update should be appended as POST data. The server will parse the XML data, and then generate the latest OpenGL image and return it. Alternate version of this is

<baseurl>/snapshot.txt?width=<width>&height=<height>&key=<viewer key>&timestamp=<timestamp>

which will return the image as base64-encoded png image (used by the JavaScript client).