Cron

Cron entity
NAMETYPEDESCRIPTION

id

int

Unique ID for the cron.

author_id

int

ID of the user who created the cron job.

user_id

int

ID of the user who owns the cron job.

namespace_id

int

nullable

ID of the namespace the cron job belongs to if any.

name

string

The name of the cron job.

schedule

enum

The schedule of the cron job, will be one of:

  • daily
  • weekly
  • monthly

manifest

string

The build manifest the cron job submits on its interval.

next_run

timestamp

The RFC3339 formatted string at which the cron job will next run.

manifest

string

The build manifest the cron job submits on its interval.

next_run

timestamp

The RFC3339 formatted string at which the cron job will next run.

manifest

string

The build manifest the cron job submits on its interval.

next_run

timestamp

The RFC3339 formatted string at which the cron job will next run.

manifest

string

The build manifest the cron job submits on its interval.

next_run

timestamp

The RFC3339 formatted string at which the cron job will next run.

created_at

timestamp

The RFC3339 formatted string at which the cron job was created.

url

string

The API URL to the cron entity itself.

author

object

The user who authored the cron job.

user

object

The user the cron job belongs to.

namespace

object

The namespace the cron job belongs to, if any.

ENTITIES
ENDPOINTS

List crons

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

Parameters
NAMETYPEDESCRIPTION

search

string

Get the cron jobs with names like the given value.

Returns

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

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

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

Create cron

This will create a cron job for the currently authenticated user. This requires the cron:write permission.

Parameters
NAMETYPEREQUIREDDESCRIPTION

name

string

Yes

The name of the cron job.

schedule

enum

No

The cron job's schedule, will be one of:

  • daily
  • weekly
  • monthly

this will default to daily, if not otherwise specified.

manifest

string

Yes

The manifest to use for the cron job.

Returns

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

POST /cron
$ curl -X POST \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	-d '{"name": "Daily", "manifest": "driver:\n  image: centos/7\n  type: qemu"}' \
	https://api.djinn-ci.com/cron

Get cron

This will get the cron job by the given :id. This requires the cron:read permission.

Returns

This will return the cron job.

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

Get cron builds

This will get the builds on the given cron job. The following parameters can be given as query parameters to the URL. This requires the cron: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/cron/:id/builds?page=1>; rel="prev",
      <https://api.djinn-ci.com/cron/:id/builds?page=3>; rel="next"

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

Update cron

This will update the given cron job. This requies the cron:write permission.

Note: If no parameters are sent in the request body, then nothing happens to the cron job.

Parameters
NAMETYPEREQUIREDDESCRIPTION

name

string

Yes

The name of the cron job.

schedule

enum

No

The cron job's schedule, will be one of:

  • daily
  • weekly
  • monthly

this will default to daily, if not otherwise specified.

manifest

string

Yes

The manifest to use for the cron job.

Returns

This will return the updated cron job.

PATCH /cron/:id
$ curl -X POST \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	-d '{"name": "Daily build"}' \
	https://api.djinn-ci.com/cron/1

Delete cron

This will delete the cron job by the given :id. This requires the cron:delete permission.

Returns

This returns no content in the response body.

DELETE /cron/:id
$ curl -X DELETE \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/cron/1