Ssh Keys

List Ssh keys

List Ssh keys on a server.

GET /api/server/{id}/keys

Example request :

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

Example response :

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

Get Ssh key

Show a Ssh key.

GET /api/server-key/{id}

Example request :

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

Example response :

{
    "id": 1,
    "name": "Me",
    "server_user": "cloud",
    "fingerprint": "...",
    "status": "installed",
    "created_at": "2022-08-23T16:54:12.000000Z"
}

Create Ssh key

Create a Ssh key.

POST /api/server/{id}/key

Parameters :

Parameter Description
name The key name.
user The user that own key.
public_key The key content.

Example request :

curl "https://cloud.boxydev.com/api/server/1/key" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "name": "fio",
        "user": "cloud",
        "public_key": "KEY"
    }'

Example response :

{
    "id": 1,
    "name": "fio",
    "server_user": "cloud",
    "fingerprint": "...",
    "status": "installing",
    "created_at": "2022-08-24T22:14:51.000000Z"
}

Delete Ssh key

Delete a Ssh key.

DELETE /api/server-key/{id}

Example request :

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