Ploi API
Ploi API

Automatically fix insight

Runs the fix for the insight available, if it has already been run it will return an error.

POST api/servers/{server}/insights/{id}/automatically-fix

Example request:

curl -X POST "https://ploi.io/api/servers/{server}/insights/{id}/automatically-fix" \
-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": 1,
        "status": "processed",
        "description": "Your **supervisor** service is running, but you do not seem to use it. You can save resources by stopping this service, you can always start it when you need it.",
        "log_file": "/var/log/supervisor/supervisor.log",
        "priority": "medium",
        "meta": null,
        "is_fixable": true,
        "processed_at": "2021-11-09 13:06:45",
        "created_at": "2021-11-09 12:50:40"
    }
}

Example response if it has already run before:

HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json

{
    "message": "The given data was invalid.",
    "errors": [
        "This insight has already been processed before"
    ],
    "links": []
}