Builds

Build entity
NAMETYPEDESCRIPTION

id

int

Unique ID for the build.

user_id

int

ID of the user who submitted the build.

namespace_id

int nullable

ID of the namespace the build belongs to, if any.

number

int

Number of the build for the user who submitted it.

status

enum

The status of the build, will be one of:

  • queued
  • running
  • passed
  • passed_with_failures
  • failed
  • killed
  • timed_out

output

string nullable

The output of the build, if any.

tags

string[]

The list of tags on the build.

pinned

bool

Whether or not the build has been pinned.

created_at

timestamp

The RFC3339 formatted string at which the build was created.

started_at

timestamp nullable

The RFC3339 formatted string at which the build started.

finished_at

timestamp nullable

The RFC3339 formatted string at which the build finished.

url

string

The API URL to the build entity itself.

objects_url

string

The API URL to the build's objects.

variables_url

string

The API URL to the build's variables.

jobs_url

string

The API URL to the build's jobs.

artifacts_url

string

The API URL to the build's artifacts.

tags_url

string

The API URL to the build's tags.

user

object nullable

The user the build belongs to.

namespace

object nullable

The namespace of the build, if any.

trigger

object nullable

The trigger of the build, if any.

Trigger entity
NAMETYPEDESCRIPTION

type

enum

The type of trigger for the build, will be one of:

  • manual
  • push
  • pull
  • schedule

comment

string

The comment associated with the build.

data

object

A string:string object of the data about the trigger, such as whoe authored it, and any commit information associated with it, if it was a push or pull trigger.

Job entity
NAMETYPEDESCRIPTION

id

int

Unique ID for the job.

build_id

int

ID of the build the job belongs to.

stage

string

The name of the stage the job belongs to.

name

string

The name of the job.

commmands

string

The commands for the job.

status

enum

The status of the build, will be one of:

  • queued
  • running
  • passed
  • passed_with_failures
  • failed
  • killed
  • timed_out

output

string nullable

The output of the job, if any.

created_at

timestamp

The RFC3339 formatted string at which the job was created.

started_at

timestamp nullable

The RFC3339 formatted string at which the job started.

finished_at

timestamp nullable

The RFC3339 formatted string at which the job finished.

url

string

The API URL to the job object itself.

build

object

The build of the job.

Build object entity
NAMETYPEDESCRIPTION

id

int

Unique ID for the build object.

build_id

int

ID of the build

source

string

The original name of the object.

name

string

The name of the object it was placed as.

type

string nullable

The MIME type of the object.

md5

string nullable

The MD5 hash of the object.

sha256

string nullable

The SHA256 hash of the object.

Build variable entity
NAMETYPEDESCRIPTION

id

int

Unique ID for the variable.

build_id

int

ID of the build the variable belongs to.

key

string

The name of the variable.

value

string

The value of the variable.

masked

bool

Whether or not the variable was masked.

variable_url

string

The API URL to the original variable itself.

build

object

The build of the variable.

Artifact entity
NAMETYPEDESCRIPTION

id

int

Unique ID for the artifact.

build_id

int

ID of the build the artifact belongs to.

job_id

int

ID of the job the artifact belongs to.

source

string

The original name of the artifact from the build environment.

name

string

The name of the artifact it was collected as.

size

int

nullable

The size of the artifact. This will be null if it was not collected.

md5

string nullable

The MD5 hash of the artifact. This will be null if it was not collected.

sha256

string nullable

The SHA256 hash of the artifact. This will be null if it was not collected.

created_at

timestamp

The RFC3339 formatted time at which the artifact was created.

url

string

The API URL to the artifact object itself.

build

object

The build of the artifact.

Tag entity
NAMETYPEDESCRIPTION

id

int

Unique ID for the tag.

user_id

int

ID of the user who created the tag.

build_id

int

ID of the build the tag belongs to.

name

string

The name of the tag.

created_at

timestamp

The RFC3339 formatted string at which the tag was created.

url

string

The API URL to the tag object itself.

user

object

The user of the tag.

build

object

The build of the tag.

List builds

List the builds for the currently authenticated user. The following parameters can be given as query parameters to the URL. This requires the build:read permission.

Parameters
NAMETYPEREQUIREDDESCRIPTION

tag

string

No

Get the builds with the given tag name.

search

string

No

Get the builds with tags like the given value.

status

enum

No

Get the builds with the given status, will be one of:

  • queued
  • running
  • passed
  • passed_with_failures
  • failed
  • killed
  • timed_out

Returns

This will return a list of builds. The list will be paginated to 25 builds per page, and will be ordered by the most recently submitted builds first. If the builds were paginated, then the pagination information will be in the response header Link.

Link: <https://api.djinn-ci.com/builds?page=1>; rel="prev",
      <https://api.djinn-ci.com/builds?page=3>; rel="next"

GET /builds
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/builds

Create build

This will submit a new build to the server for the currently authenticated user. This requires the build:write permission.

Parameters
NAMETYPEREQUIREDDESCRIPTION

manifest

string

Yes

The YAML formatted build manifest.

comment

string

No

The build's comment.

tags

string[]

No

A list of tags to attach to the build.

Returns

Returns the created build. It returns an error if any of the parameters are invalid, or if an internal error occurs.

POST /builds
$ curl -X POST \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	-d '{"manifest":"namespace: djinn\ndriver:\n  image: centos/7\n  type: qemu\nenv:\n- LOCALE=en_GB.UTF-8\nobjects:\n- data => data\nstages:\n- clean\njobs:\n- stage: clean\n  commands:\n  - tr -d '0-9' data > data.cleaned\n  artifacts:\n  - data.cleaned => data.cleaned"}' \
	https://api.djinn-ci.com/builds

Get build

This will get the build by the given :user, with the given :number. This requires the build:read permission.

Returns

This will return the build.

GET /b/:user/:number
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/b/me/3

Get build objects

This will get the objects on the given build. This requires the build:read permission.

Returns

This will return list of build objects.

GET /b/:user/:number/objects
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/b/me/3/objects

Get build variables

This will get the variables on the given build. This requires the build:read permission.

Returns

This will return a list of variables.

GET /b/:user/:number/variables
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/b/me/3/variables

Get build jobs

This will get the jobs on the given build. This requires the build:read permission.

Returns

This will return a list of job.

GET /b/:user/:number/jobs
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/b/me/3/jobs

Get build job

This will get the job by the given :name, on the given build. This requires the build:read permission.

Returns

This will return the job.

GET /b/:user/:number/jobs
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/b/me/3/jobs

Get build artifacts

This will get the artifacts on the given build. This requires the build:read permission.

Returns

This will return a list of artifacts.

GET /b/:user/:number/artifacts
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/b/me/3/artifacts

Get build artifact

This will get the artifact by the given :name, on the given build. This requires the build:read permission.

Returns

This will return artifact.

GET /b/:user/:number/artifacts/:name
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/b/me/3/artifact/data.cleaned

Get build tags

This will get the tags on the given build. This requires the build:read permission.

Returns

This will return a list of tags.

GET /b/:user/:number/tags
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/b/me/3/tags

Create build tag

This will add a tag to the given build. This requires the build:write permission.

Parameters
NAMETYPEREQUIREDDESCRIPTION

--

string[]

Yes

An array of strings submitted as the request body.

Returns

Returns a list of created tags. It returns an error if an internal error occurs.

POST /b/:user/:number/tags
$ curl -X POST \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	-d '["tag1", "tag2", "tag3"]' \
	https://api.djinn-ci.com/b/me/3/tags

Delete build tag

This will remove the tag by the given :name, from the given build. This requires the build:delete permission.

Returns

This returns no content in the response body.

POST /b/:user/:number/tags/:name
$ curl -X DELETE \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/b/me/3/tags/tag2

Pin build

This will pin the given build. This requires the build:write permission.

Returns

This returns the build.

PATCH /b/:user/:number/pin
$ curl -X PATCH \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/b/me/3/pin

Unpin build

This will unpin the given build. This requires the build:write permission.

Returns

This returns the build.

PATCH /b/:user/:number/unpin
$ curl -X PATCH \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/b/me/3/unpin

Kill build

This will kill a build that is running. This requires the build:delete permission.

Returns

This returns no content in the response body.

DELETE /b/:user/:number
$ curl -X DELETE \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/b/me/3