Errors

Agent errors

List all agent errors in descending order with backward pagination. You can optionally filter dismissed or not dismissed errors.

GEThttps://cloud-api.calyptia.com/v1/agents/{agentID}/errors
Authorization
Path parameters
agentID*string (uuid)
Query parameters
Response

OK

Headers
Body
id*string (uuid)
agentID*string (uuid)
error*string
Example: "[config] section 'foo' tried to instance a plugin name that don't exists"
dismissedAt*nullable string (date-time)
dismissReason*nullable string
createdAt*string (date-time)
Request
const response = await fetch('https://cloud-api.calyptia.com/v1/agents/{agentID}/errors', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer <token>"
    },
});
const data = await response.json();
Response
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "agentID": "123e4567-e89b-12d3-a456-426614174000",
    "error": "[config] section 'foo' tried to instance a plugin name that don't exists",
    "dismissedAt": "2024-10-06T10:42:06.474Z",
    "dismissReason": "text",
    "createdAt": "2024-10-06T10:42:06.474Z"
  }
]

Create agent error

Create a new agent error. This endpoint should be called directly by agents themselves. Notice that if there is an error that matches exactly and has not been dismissed yet since the last time the config was updated, then the error will be simply ignored and not persisted.

POSThttps://cloud-api.calyptia.com/v1/agents/{agentID}/errors
Authorization
Path parameters
agentID*string (uuid)
Body
error*string
Example: "[config] section 'foo' tried to instance a plugin name that don't exists"
Response

Created

Body
id*string (uuid)
createdAt*string (date-time)
Request
const response = await fetch('https://cloud-api.calyptia.com/v1/agents/{agentID}/errors', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "error": "[config] section 'foo' tried to instance a plugin name that don't exists"
    }),
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2024-10-06T10:42:06.474Z"
}