Inertia Daemon API Reference (0.5.2)

Download OpenAPI specification:Download

This is the reference documentation for the Inertia daemon's REST API.

About Inertia

For a more general usage guide, check out the Inertia Usage Guide. A CLI reference is also available.

If you find any issues, please feel free to open an issue!

Request Authentication

Inertia issues JWTs for request authentication. Using the CLI, a persistent key is generated - for general use, you should create a user and log in to receive a user-specific JWT.

bearer_auth

JWT issued by Inertia

Security scheme type: HTTP
HTTP Authorization Scheme bearer
Bearer format "JWT"

Deployment

Start up project

Build and deploy your project

Authorizations:
Request Body schema: application/json
stream
boolean

Whether or not to stream log output

project
string
build_type
string
build_file_path
string
git_options
object
webhook_secret
string

Responses

201

Project deployment successfully started

4XX,5XX

Something went wrong - refer to the error code and message for more details

post /up
https://$DAEMON_ADDR:$DAEMON_PORT/up

Request samples

application/json
Copy
Expand all Collapse all
{
  • "stream": true,
  • "project": "string",
  • "build_type": "string",
  • "build_file_path": "string",
  • "git_options":
    {
    },
  • "webhook_secret": "string"
}

Response samples

text/plain
Copy
No deployment detected
Setting up project...
Cloning branch dev from git@github.com:example/example.git...

Shut down project

Shuts down project containers

Authorizations:

Responses

200

Success!

4XX,5XX

Something went wrong - refer to the error code and message for more details

post /down
https://$DAEMON_ADDR:$DAEMON_PORT/down

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data": { }
}

Remove project

Reset daemon and remove project from deployment

Authorizations:

Responses

200

Success!

4XX,5XX

Something went wrong - refer to the error code and message for more details

post /reset
https://$DAEMON_ADDR:$DAEMON_PORT/reset

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data": { }
}

Update environment variables

Set environment variables

Authorizations:
Request Body schema: application/json
name
required
string
value
required
string
encrypt
boolean
remove
boolean

Responses

202

Success!

4XX,5XX

Something went wrong - refer to the error code and message for more details

post /env
https://$DAEMON_ADDR:$DAEMON_PORT/env

Request samples

application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "value": "string",
  • "encrypt": true,
  • "remove": true
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data": { }
}

Retrieve environment variables

Retrieve configured environment variables

Authorizations:

Responses

200

Success!

4XX,5XX

Something went wrong - refer to the error code and message for more details

get /env
https://$DAEMON_ADDR:$DAEMON_PORT/env

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data":
    {
    }
}

Webhooks

Accepts incoming payloads from Git hosts (GitHub, GitLab, and Bitbucket)

Responses

202

Success!

4XX,5XX

Something went wrong - refer to the error code and message for more details

post /webhook
https://$DAEMON_ADDR:$DAEMON_PORT/webhook

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data": { }
}

Deployment status check

Check the status of your Inertia deployment

Authorizations:

Responses

200

Success!

4XX,5XX

Something went wrong - refer to the error code and message for more details

get /status
https://$DAEMON_ADDR:$DAEMON_PORT/status

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data":
    {
    }
}

View deployment logs

View logs of the Inertia daemon or project containers

Authorizations:
query Parameters
container
string
Example: "/docker-compose"

Name of container to fetch logs for - leave blank for Inertia daemon logs

stream
boolean
Example: true

Whether or not to upgrade connection to a websocket

entries
integer
Example: 500

Number of lines of logs to fetch (default 500)

Responses

200

Log contents retrieved

4XX,5XX

Something went wrong - refer to the error code and message for more details

get /logs
https://$DAEMON_ADDR:$DAEMON_PORT/logs

Response samples

text/plain
Copy
No deployment detected
Setting up project...
Cloning branch dev from git@github.com:example/example.git...

Monitoring

Daemon healthcheck

Returns OK if daemon is online and ready

Responses

200

Daemon is online

get /
https://$DAEMON_ADDR:$DAEMON_PORT/

Response samples

text/plain
Copy
Hello world!

Deployment status check

Check the status of your Inertia deployment

Authorizations:

Responses

200

Success!

4XX,5XX

Something went wrong - refer to the error code and message for more details

get /status
https://$DAEMON_ADDR:$DAEMON_PORT/status

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data":
    {
    }
}

View deployment logs

View logs of the Inertia daemon or project containers

Authorizations:
query Parameters
container
string
Example: "/docker-compose"

Name of container to fetch logs for - leave blank for Inertia daemon logs

stream
boolean
Example: true

Whether or not to upgrade connection to a websocket

entries
integer
Example: 500

Number of lines of logs to fetch (default 500)

Responses

200

Log contents retrieved

4XX,5XX

Something went wrong - refer to the error code and message for more details

get /logs
https://$DAEMON_ADDR:$DAEMON_PORT/logs

Response samples

text/plain
Copy
No deployment detected
Setting up project...
Cloning branch dev from git@github.com:example/example.git...

Authentication

Validate JWT

Validate your JWT

Authorizations:

Responses

200

Success!

4XX,5XX

Something went wrong - refer to the error code and message for more details

get /user/validate
https://$DAEMON_ADDR:$DAEMON_PORT/user/validate

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data": { }
}

Log in as user

Authenticate as a user to Inertia daemon

Authorizations:
Request Body schema: application/json
username
string
password
string
totp
string

Responses

200

Success!

4XX,5XX

Something went wrong - refer to the error code and message for more details

post /user/login
https://$DAEMON_ADDR:$DAEMON_PORT/user/login

Request samples

application/json
Copy
Expand all Collapse all
{
  • "username": "string",
  • "password": "string",
  • "totp": "string"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data":
    {
    }
}

List users

List all currently registered users on the Inertia daemon

Authorizations:
bearer_auth (admin:true)

Responses

200

Success!

4XX,5XX

Something went wrong - refer to the error code and message for more details

get /user/list
https://$DAEMON_ADDR:$DAEMON_PORT/user/list

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data":
    {
    }
}

Add user

Register a new user in the Inertia daemon

Authorizations:
bearer_auth (admin:true)
Request Body schema: application/json
username
required
string
password
required
string
admin
boolean

Responses

201

Success!

4XX,5XX

Something went wrong - refer to the error code and message for more details

post /user/add
https://$DAEMON_ADDR:$DAEMON_PORT/user/add

Request samples

application/json
Copy
Expand all Collapse all
{
  • "username": "string",
  • "password": "string",
  • "admin": true
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data": { }
}

Remove user

Unregister a user from the Inertia daemon

Authorizations:
bearer_auth (admin:true)
Request Body schema: application/json
username
required
string

Responses

200

Success!

4XX,5XX

Something went wrong - refer to the error code and message for more details

post /user/remove
https://$DAEMON_ADDR:$DAEMON_PORT/user/remove

Request samples

application/json
Copy
Expand all Collapse all
{
  • "username": "string"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data": { }
}

Reset all users

Remove all users from the Inertia daemon

Authorizations:
bearer_auth (admin:true)

Responses

200

Success!

4XX,5XX

Something went wrong - refer to the error code and message for more details

post /user/reset
https://$DAEMON_ADDR:$DAEMON_PORT/user/reset

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data": { }
}

Enable 2FA for user

Enables TOTP-based 2FA for the given user

Authorizations:
bearer_auth (admin:true)
Request Body schema: application/json
username
required
string
password
required
string

Responses

200

2FA successfully enabled for user

4XX,5XX

Something went wrong - refer to the error code and message for more details

post /user/totp/enable
https://$DAEMON_ADDR:$DAEMON_PORT/user/totp/enable

Request samples

application/json
Copy
Expand all Collapse all
{
  • "username": "string",
  • "password": "string"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data":
    {
    }
}

Disable 2FA for user

Disable TOTP-based 2FA for the given user

Authorizations:
bearer_auth (admin:true)

Responses

200

Success!

4XX,5XX

Something went wrong - refer to the error code and message for more details

post /user/totp/disable
https://$DAEMON_ADDR:$DAEMON_PORT/user/totp/disable

Response samples

application/json
Copy
Expand all Collapse all
{
  • "code": 0,
  • "message": "(example) successfully did something!",
  • "request_id": "example/2Mch7LMzhj-000023",
  • "data": { }
}