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

Automatically fix insight

This endpoint triggers the automatic fix for a specific insight. If the fix has already been applied, an error will be returned.

Request

POST
/api/servers/{server}/insights/{id}/automatically-fix
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"

Response

{
  "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"
  }
}

Error - Already processed

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