Networks

List networks

List networks on a server.

GET /api/server/{id}/networks

Example request :

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

Example response :

{
    "data": [
        {
            "id": 1,
            "name": "HTTP",
            "type": "allow",
            "port": "80",
            "ip_address": "127.0.0.1",
            "status": "installed",
            "created_at": "2022-08-23T16:54:12.000000Z"
        }
    ],
    "links": {
        "first": "https://cloud.boxydev.com/api/server/1/networks?page=1",
        "last": "https://cloud.boxydev.com/api/server/1/networks?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://cloud.boxydev.com/api/server/1/networks",
        "per_page": 20,
        "to": 1,
        "total": 1
    }
}

Get network

Show a network.

GET /api/network/{id}

Example request :

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

Example response :

{
    "id": 1,
    "name": "HTTP",
    "type": "allow",
    "port": "80",
    "ip_address": "127.0.0.1",
    "status": "installed",
    "created_at": "2022-08-23T16:54:12.000000Z"
}

Create network

Create a network.

POST /api/server/{id}/network

Parameters :

Parameter Description
name The network name.
type Allow or deny connection.
port The port.
ip_address The IP address (Optional).

Example request :

curl "https://cloud.boxydev.com/api/server/1/network" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "name": "fio",
        "type": "allow",
        "port": 8080,
        "ip_address": "127.0.0.1"
    }'

Example response :

{
    "id": 1,
    "name": "fio",
    "type": "allow",
    "port": 8080,
    "ip_address": "127.0.0.1",
    "status": "installing",
    "created_at": "2022-08-26T20:19:01.000000Z"
}

List networking

List connected servers on a server.

GET /api/server/{id}/networking

Example request :

curl "https://cloud.boxydev.com/api/server/1/networking" \
    -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": "cache",
        "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"]
    },
    {
        "id": 2,
        "name": "marina",
        "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": "database",
        "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"]
    }
]

Update networking

Update connected servers on a server.

PUT /api/server/{id}/networking

Parameters :

Parameter Description
servers.* The servers who can be connected to server.

Example request :

curl -X PUT "https://cloud.boxydev.com/api/server/1/networking" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "servers": [2, 3]
    }'

Delete network

Delete a network.

DELETE /api/network/{id}

Example request :

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