api
HTTP API
Sparky HTTP API allows execute Sparky jobs remotely over HTTP
Trigger Sparky job
POST /build/project/$projectReturns $key - unique build identification ( aka Sparky Job ID )
Trigger job with parameters
POST /build-with-tags/project/$project @jsonFor example:
Request data - request.json:
{
"description" : "test build",
"tags" : "message=hello,from=Sparky"
}Request via curl:
curl -k -H "Content-Type: application/json" \
--data "@request.json" \
https://127.0.0.1:4000/build-with-tags/project/hello-worldWill trigger a job hello-world, with named parameters message and from.
Parameters are handled within Sparky scenario as:
my $message = tags()<message>;
my $from = tags()<from>;Job status
Get job status - status of the last executed build:
GET /status/$project/$keyReturns $status:
0- build is running-1- build failed1- build finished successfully-2- unknown state ( build does not exist or is placed in a queue )
Badges
Get job badge - image with status of the last executed build
GET /badge/$projectJob report
Get build report in raw text format
GET /report/raw/$project/$key