SUSE Studio API
From openSUSE
Navigation: Start FAQ Tour Howto API Bugs Support Download How to edit this wiki
Contents |
Important
The following information is incomplete! The full documentation can be found in SUSE Studio.
RESTful API
SUSE Studio features a RESTful API over HTTP which can be used to clone appliances, upload files, trigger and monitor builds and more.
Authentication
In order to use the API you have to create an API key which will be used as the password for HTTP Basic Authentication. This can be done on this page.
Using the API with curl
All API functions can be used with curl. The following examples should give you an idea on how this is to be used.
Get the list of template sets
The available templates are grouped in template sets. The following command gets the list of template sets from Studio:
curl -u <user>:<api_key> "http://susestudio.com/api/v1/user/template_sets" (example)
Usually you will pick one of the templates in the 'default' template set, which lists the default SUSE templates, and clone an appliance from it.
List your appliances
All appliances:
curl -u <user>:<api_key> "http://susestudio.com/api/v1/user/appliances" (example)
A specific appliance:
curl -u <user>:<api_key> "http://susestudio.com/api/v1/user/appliances/<id>" (example)
Clone an appliance
To create a new appliance pick a template from the template set and use its id with the following command (name and arch are optional parameters):
curl -u <user>:<api_key> -XPOST "http://susestudio.com/api/v1/user/appliances?clone_from=14774&name=My%20Server&arch=x86_64"
Manage overlay files
List the files of an appliance:
curl -u <user>:<api_key> "http://susestudio.com/api/v1/user/files?appliance_id=<id>" (example)
Upload a file:
curl -u <user>:<api_key> -XPOST -F "file=@/path/to/your/file" "http://susestudio.com/api/v1/user/files?appliance_id=<id>" (example)
Optionally, you can specify the filename, path, owner, group or permissions, here.
Build your appliance
Trigger a build of an appliance:
curl -u <user>:<api_key> -XPOST "http://susestudio.com/api/v1/user/running_builds?appliance_id=<id>"
Monitor build progress:
curl -u <user>:<api_key> "http://susestudio.com/api/v1/user/running_builds?appliance_id=<id>" (example)

