Servers

List servers

List all your servers.

GET /api/servers

Example request :

curl "https://cloud.boxydev.com/api/servers" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Example response :

{
    "data": [
        {
            "id": 1,
            "name": "fiofio",
            "region": "lon1",
            "size": "s-1vcpu-1gb",
            "status": "provisioned",
            "ip_address": "127.0.0.1",
            "private_ip_address": "10.0.0.1",
            "port": 22,
            "os": "ubuntu:20.04",
            "type": "server",
            "web_server_type": "nginx",
            "php_version": "8.1",
            "database_type": "mysql:8.0",
            "server_provider_id": 1,
            "created_at": "2022-09-10T06:00:56.000000Z",
            "tags": ["cloud"]
        }
    ],
    "links": {
        "first": "https://cloud.boxydev.com/api/servers?page=1",
        "last": "https://cloud.boxydev.com/api/servers?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://cloud.boxydev.com/api/servers",
        "per_page": 20,
        "to": 1,
        "total": 1
    }
}

Get server

Show a server.

GET /api/server/{id}

Example request :

curl "https://cloud.boxydev.com/api/server/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Example response :

{
    "id": 1,
    "name": "fiofio",
    "region": "lon1",
    "size": "s-1vcpu-1gb",
    "status": "provisioned",
    "ip_address": "127.0.0.1",
    "private_ip_address": "10.0.0.1",
    "port": 22,
    "os": "ubuntu:20.04",
    "type": "server",
    "web_server_type": "nginx",
    "php_version": "8.1",
    "database_type": "mysql:8.0",
    "server_provider_id": 1,
    "created_at": "2022-09-10T06:00:56.000000Z",
    "tags": ["cloud"]
}

Create server

Create a server.

POST /api/server

You can get server provider list with regions and sizes here. You can manage all your server providers on your account.

You can get all server provider VPCs here.

Parameters :

Parameter Description
name The server name.
type Server type to create: server, balancer, cache, database, web or worker.
server_provider_id Server provider ID. If empty, server will be custom.
region Region name when server provider ID is provided.
size Size when server provider ID is provided.
os OS version. Can be ubuntu:20.04 or ubuntu:22.04.
web_server_type Web server to use: nginx.
php_version PHP version to use: 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 or 8.2.
database_type Database to user: mysql:8.0, mariadb:10.6 or pgsql:14.
vpc_id VPC ID you want to use (Optional).
vpc_name VPC name you want to create (Optional).

A server can take about 10 minutes to provision. When server is ready, status is provisioned. You can ping the endpoint every 2 minutes to check status.

Example request :

curl "https://cloud.boxydev.com/api/server" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "name": "fiofio",
        "type": "server",
        "server_provider_id": 1,
        "region": "lon1",
        "size": "s-1vcpu-1gb",
        "os": "ubuntu:20.04",
        "web_server_type": "nginx",
        "php_version": "8.1",
        "database_type": "mysql:8.0"
    }'

Example response :

{
    "server": {
        "id": 1,
        "name": "fiofio",
        "region": "lon1",
        "size": "s-1vcpu-1gb",
        "status": "provisioned",
        "ip_address": "127.0.0.1",
        "private_ip_address": "10.0.0.1",
        "port": 22,
        "os": "ubuntu:20.04",
        "type": "server",
        "web_server_type": "nginx",
        "php_version": "8.1",
        "database_type": "mysql:8.0",
        "server_provider_id": 1,
        "created_at": "2022-09-10T06:00:56.000000Z",
        "tags": ["cloud"]
    },
    "sudo_password": "IvSVZou66CBCBRAC",
    "database_password": "ZNnq8vyOwZQCxgiy",
    "install_command": null
}

Create custom server

Create a custom server without provider.

POST /api/server

Parameters :

Parameter Description
name The server name.
type Server type to create: server, balancer, cache, database, web or worker.
ip_address The server IP address.
private_ip_address The server private IP address (Optional).
port The server port (Optional).
os OS version. Can be ubuntu:20.04 or ubuntu:22.04.
web_server_type Web server to use: nginx.
php_version PHP version to use: 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1 or 8.2.
database_type Database to user: mysql:8.0, mariadb:10.6 or pgsql:14.

Example request :

curl "https://cloud.boxydev.com/api/server" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "name": "fiofio",
        "type": "server",
        "ip_address": "127.0.0.1",
        "os": "ubuntu:20.04",
        "web_server_type": "nginx",
        "php_version": "8.1",
        "database_type": "mysql:8.0"
    }'

Example response :

{
    "server": {
        "id": 1,
        "name": "fiofio",
        "region": "lon1",
        "size": "s-1vcpu-1gb",
        "status": "provisioned",
        "ip_address": "127.0.0.1",
        "private_ip_address": null,
        "port": 22,
        "os": "ubuntu:20.04",
        "type": "server",
        "web_server_type": "nginx",
        "php_version": "8.1",
        "database_type": "mysql:8.0",
        "server_provider_id": null,
        "created_at": "2022-09-10T06:00:56.000000Z",
        "tags": []
    },
    "sudo_password": "IvSVZou66CBCBRAC",
    "database_password": "ZNnq8vyOwZQCxgiy",
    "install_command": "mkdir -p /root/.ssh && touch /root/.ssh/authorized_keys && echo \"ssh-rsa ... [email protected]\" >> /root/.ssh/authorized_keys"
}

You need to run install_command on your server as root. After, you can provision your server.

POST /api/server/{id}/provision

Example request :

curl -X POST "https://cloud.boxydev.com/api/server/1/provision" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Example response :

{
    "id": 1,
    "name": "fiofio",
    "region": "lon1",
    "size": "s-1vcpu-1gb",
    "status": "queued",
    "ip_address": "127.0.0.1",
    "private_ip_address": null,
    "port": 22,
    "os": "ubuntu:20.04",
    "type": "server",
    "web_server_type": "nginx",
    "php_version": "8.1",
    "database_type": "mysql:8.0",
    "server_provider_id": null,
    "created_at": "2022-09-10T06:00:56.000000Z",
    "tags": []
}

Update server

Update a server.

PUT /api/server/{id}

Parameters :

Parameter Description
name The server name.
port The server port.
ip_address The server IP address.
private_ip_address The server private IP address.
tags Tags to server as array like ["a", "b", "c"].

Example request :

curl -X PUT "https://cloud.boxydev.com/api/server/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "name": "fiorella",
        "tags": ["a", "b", "c"]
    }'

Example response :

{
    "id": 1,
    "name": "fiorella",
    "region": "lon1",
    "size": "s-1vcpu-1gb",
    "status": "provisioned",
    "ip_address": "127.0.0.1",
    "private_ip_address": "10.0.0.1",
    "port": 22,
    "os": "ubuntu:20.04",
    "type": "server",
    "web_server_type": "nginx",
    "php_version": "8.1",
    "database_type": "mysql:8.0",
    "server_provider_id": 1,
    "created_at": "2022-09-10T06:00:56.000000Z",
    "tags": ["cloud"]
}

Delete server

Delete a server.

DELETE /api/server/{id}

Example request :

curl -X DELETE "https://cloud.boxydev.com/api/server/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"