The Rose server for StreamLab supports a simple API.
Supported options include:
|/_help||Get||HTML – help for the rose api|
||Get||JSON project definition (The rose file, not the slab file, so excludes all dashboards)|
||Get||JSON array of project elements for the user|
||Get||SQL - entire project script for the user|
||Get||SQL – script to start project pumps|
||Get||SQL – script to stop project pumps|
||Get||SQL – script to drop project|
||Get||JSON – the project slab file Must run /_project_export first|
||Get||JSON containing the _download URL Must be run before /_download|
||Get||Returns a shell script with embedded dashboards: •Pipe this into bash to get them separated•Dashboards need to have been actually materialized in StreamLab (by viewing them)•Dashboards need to have been saved•The StreamLab project must have been saved after the dashboard is saved|
||Get||Deletes the slab file that is created on the rose server by /_project_export|
||Get||Renames the project; does NOT change the project schema. Returns ‘false’ (meaning success) or an error message|
|Entrypoint||Type||Post document contains|
||Post||JSON project to be uploaded|
||Del||Delete the project|
To get the project SQL from a project called t which is saved on localhost:
curl -o t.sql http://localhost:5585/_project_script/user/t
To get the dashboards for a project called buses:
curl http://localhost:5585/_project_dashboards/user/buses | bash
Note: You can use Wget as an alternative to curl
These APIs can easily be packaged into a script to save SQL, JSON and SLAB files into a suitable location (including into source control)
You do not need to login to the StreamLab server command line, or to have any specific software installed.
You can also automate these scripts.
Provides options for loading project components into a remote StreamLab or s-Server instance (so it is easy for example to build that into a docker or vagrant startup)
The Rose server has to be up and running for these components to be extracted. To use these with source control, you will either need to export them all from the development environment into source control or:
The dashboard export assumes that the caller is running in a Linux environment. If you are running Windows users, you may be able to use a Cygwin or Linux shell.
When you export dashboards, they have auto-generated names. For example, within StreamLab the dashboard may be given a generated URL such as:
When extracted using /_project_dashboards the name is flattened to:
If you want meaningful names to appear in the s-Dashboard menu, you will need to add some kind of file rename mechanism to your extract script.
Dashboard information also includes no reference to the StreamLab project name or pipeline name or the type of dashboard included. That is, the dashboard does not indicate whether it is a “quickie” dashboard generated from a step in a pipeline (the grey icon available in each step) or a dashboard defined as a step in a pipeline (the pink eye icon). In the first case, the existence of the dashboard is indicated by turning the light grey eye icon dark grey. In the second case the icon is turned pale pink when the dashboard is generated, and then a darker pink once the dashboard has been saved.