Server

List servers

List all the servers in your account

GET api/servers

Example request:

curl -X GET "https://ploi.io/api/servers" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": [
        {
            "id": 74,
            "name": "selfish-sardine",
            "ip_address": "127.0.0.1",
            "php_version": 7.1,
            "mysql_version": 5.7,
            "sites_count": 3,
            "status": "Server active",
            "created_at": "2018-01-01 00:00:00"
        }
    ]
}

Get server

Show a server in your account

GET api/servers/{id}

Example request

curl -X GET "https://ploi.io/api/servers/{id}" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": {
        "id": 74,
        "name": "selfish-sardine",
        "ip_address": "127.0.0.1",
        "php_version": 7.1,
        "mysql_version": 5.7,
        "sites_count": 3,
        "status": "Server active",
        "created_at": "2018-01-01 00:00:00"
    }
}

Logs server

Get all the server logs from this server

GET api/servers/{id}/logs

Example request

curl -X GET "https://ploi.io/api/servers/{id}/logs" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": [
        {
            "description": "Delete database user (database_user)",
            "content": "",
            "site_id": null,
            "server_id": 74,
            "created_at": "2018-11-12 13:08:48"
        },
        {
            "description": "Add user (database_user) to database ploi",
            "content": "",
            "site_id": null,
            "server_id": 74,
            "created_at": "2018-11-12 13:08:33"
        },
        
        ...more results here if present...
    ],
    "links": {
        "first": "https://ploi.io/api/servers/74/logs?page=1",
        "last": "https://ploi.io/api/servers/74/logs?page=7",
        "prev": null,
        "next": "https://ploi.io/api/servers/74/logs?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 7,
        "path": "https://ploi.io/api/servers/74/logs",
        "per_page": 15,
        "to": 15,
        "total": 104
    }
}