Agents

Register agent

Register agent within a project. The project in which the agent is registered is parsed from the authorization token. Users are not allowed to register agents.

POSThttps://cloud-api.calyptia.com/v1/agents
Authorization
Body
fleetIDnullable string (uuid)
name*string (hostname)
Example: "new-agent"
machineID*string
type*enum
fluentbitfluentd
version*string
Example: "v1.8.6"
edition*enum
communityenterprise
flags*nullable array of string
rawConfig*string
metadatanullable object
environmentIDnullable string

environment ID to associate this agent with.

Response

Created

Body
id*string (uuid)
token*string
Example: "redacted"
name*string
Example: "my-agent"
createdAt*string (date-time)
environmentNamestring

environment name on which the agent belongs to.

Request
const response = await fetch('https://cloud-api.calyptia.com/v1/agents', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "name": "new-agent",
      "machineID": "text",
      "type": "fluentbit",
      "version": "v1.8.6",
      "edition": "community",
      "flags": [
        "text"
      ],
      "rawConfig": "text"
    }),
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "token": "redacted",
  "name": "my-agent",
  "createdAt": "2024-09-08T02:55:49.838Z",
  "environmentName": "default"
}

Agent

Agents by ID.

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

OK

Body
id*string (uuid)
fleetID*nullable string (uuid)
token*string
Example: "redacted"
name*string (hostname)
Example: "my-agent"
machineID*string
type*enum
fluentbitfluentd
version*string
Example: "v1.8.6"
edition*enum
communityenterprise
status*enum
healthyunhealthy
os*enum
unknownlinuxmacoswindowsfreebsdnetbsdopenbsd
arch*enum
unknownx86x86_64armarm64
flags*nullable array of string
tagsnullable array of string
rawConfig*string
metadata*nullable object
firstMetricsAddedAt*nullable string (date-time)
lastMetricsAddedAt*nullable string (date-time)
metricsCount*integer
createdAt*string (date-time)
updatedAt*string (date-time)
environmentName*string
Example: "default"
Request
const response = await fetch('https://cloud-api.calyptia.com/v1/agents/{agentID}', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer <token>"
    },
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "fleetID": "123e4567-e89b-12d3-a456-426614174000",
  "token": "redacted",
  "name": "my-agent",
  "machineID": "text",
  "type": "fluentbit",
  "version": "v1.8.6",
  "edition": "community",
  "status": "healthy",
  "os": "unknown",
  "arch": "unknown",
  "flags": [
    "text"
  ],
  "tags": [
    "text"
  ],
  "rawConfig": "text",
  "firstMetricsAddedAt": "2024-09-08T02:55:49.838Z",
  "lastMetricsAddedAt": "2024-09-08T02:55:49.838Z",
  "createdAt": "2024-09-08T02:55:49.838Z",
  "updatedAt": "2024-09-08T02:55:49.838Z",
  "environmentName": "default"
}

Delete agent

Delete agent by its ID.

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

No Content

Request
const response = await fetch('https://cloud-api.calyptia.com/v1/agents/{agentID}', {
    method: 'DELETE',
    headers: {
      "Authorization": "Bearer <token>"
    },
});
const data = await response.json();

Update agent

Update agent by its ID.

PATCHhttps://cloud-api.calyptia.com/v1/agents/{agentID}
Authorization
Path parameters
agentID*string (uuid)
Body
fleetIDnullable string (uuid)
namenullable string (hostname)
Example: "new-agent"
versionnullable string
Example: "v1.8.6"
editionnullable enum
communityenterprise
flagsnullable array of string
rawConfignullable string
metadatanullable object
environmentIDnullable string

environment ID to associate this agent with.

Response

No Content

Request
const response = await fetch('https://cloud-api.calyptia.com/v1/agents/{agentID}', {
    method: 'PATCH',
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();