Variables

Variable entity
NAMETYPEDESCRIPTION

id

int

Unique ID for the variable.

author_id

int

ID of the user who authored the variable.

user_id

int

ID of the user who owns the variable.

namespace_id

int

nullable

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

variable

string

The name of the variable.

value

string

The value of the variable.

masked

bool

Where the variable has been masked.

created_at

timestamp

The RFC3339 formatted string at which the variable was created.

url

string

The API URL for the variable entity itself.

author

object

nullable

The user who authored the variable.

user

object

nullable

The user who owns the variable.

namespace

object

nullable

The namespace who owns the variable.

ENTITIES

List variables

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

Parameters
NAMETYPEDESCRIPTION

search

string

Get the variables with names like the given value.

Returns

This will return a list of variable. The list will be paginated to 25 variables per page, and will be ordered lexically. If the crons were paginated, then the pagination information will be in the response header Link.

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

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

Create variable

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

Parameters
NAMETYPEREQUIREDDESCRIPTION

namespace

string

No

The namespace to store the variable in.

key

string

Yes

The name of the variable.

value

string

Yes

The value of the variable.

mask

bool

No

Whether the variable should be masked. Masked variable values must be at least 6 characters in length.

Returns

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

POST /variables
$ curl -X POST \
	-H "Content-Type: application/json" \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	-d '{"key": "PGADDR", "value": "host=localhost port=5432"}' \
	https://api.djinn-ci.com/variables

Get variable

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

Returns

This will return the variable.

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

Delete variable

This will delete the variable by the given :id. This requires the variable:delete permission.

Returns

This returns no content in the response body.

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