The Foglight REST API provides programmatic access to Foglight functionality, allowing you to integrate Foglight with external systems, automate operations, and build custom integrations. This RESTful API uses standard HTTP methods and returns responses in JSON or XML format.
Current API Version: v1
http://<foglight-server>:<port>/api/v1/
Default Ports:
The Foglight REST API uses token-based authentication. You must obtain an authentication token before accessing protected resources.
Endpoint: POST /api/v1/security/login
Request Parameters:
username
(string, required): User namepwd
(string, required): PasswordExample Request:
curl -X POST "http://localhost:8080/api/v1/security/login" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin&pwd=password"
Example Response:
{
"result": "OK",
"data": {
"access-token": "7d8e9f1a2b3c4d5e6f7g8h9i0j1k2l3m",
"user": {
"name": "admin",
"email": "admin@company.com"
}
}
}
Include the token in the Auth-Token
header for all subsequent requests:
curl -X GET "http://localhost:8080/api/v1/agent/allAgents" \
-H "Auth-Token: 7d8e9f1a2b3c4d5e6f7g8h9i0j1k2l3m" \
-H "Accept: application/json"
Endpoint: GET /api/v1/security/logout
Invalidates the current authentication token.
Example Request:
curl -X GET "http://localhost:8080/api/v1/security/logout" \
-H "Auth-Token: 7d8e9f1a2b3c4d5e6f7g8h9i0j1k2l3m"
Cloud vs On-Premises Authentication:
The API uses standard HTTP methods:
Required Headers:
Header | Value | Description |
---|---|---|
Auth-Token | Token string | Authentication token (except for login endpoint) |
Accept | application/json or application/xml | Response format preference |
Optional Headers:
Header | Value | Description |
---|---|---|
Content-Type | application/json or application/xml | Request body format |
The API supports two content types for request and response bodies:
{
"result": "OK",
"data": {
// Response data
}
}
{
"result": "ERROR",
"message": "Error description",
"errorCode": "ERROR_CODE"
}
Status Code | Description |
---|---|
200 | OK - Request succeeded |
201 | Created - Resource created successfully |
204 | No Content - Request succeeded with no response body |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Authentication required or failed |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Resource not found |
500 | Internal Server Error - Server-side error |
503 | Service Unavailable - Service temporarily unavailable |
This section describes the available REST API resources organized by functional area:
The Security API provides endpoints for authentication, authorization, and session management.
Endpoint: POST /api/v1/security/login
Authenticates a user and returns an authentication token.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
username | string | Yes | User name |
pwd | string | Yes | Password |
Response:
{
"result": "OK",
"data": {
"access-token": "string",
"user": {
"name": "string",
"email": "string"
}
}
}
Example:
curl -X POST "http://localhost:8080/api/v1/security/login" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin&pwd=password"
Endpoint: GET /api/v1/security/logout
Logs out the current user and invalidates the authentication token.
Response:
{
"result": "OK"
}
Example:
curl -X GET "http://localhost:8080/api/v1/security/logout" \
-H "Auth-Token: your-token-here"
The Agent API provides endpoints for managing and monitoring Foglight agents.
Endpoint: GET /api/v1/agent/allAgents
Retrieves information about all agents.
Response:
{
"result": "OK",
"data": [
{
"id": "agent-id",
"name": "Agent Name",
"host": "hostname",
"state": "RUNNING",
"version": "6.3.0"
}
]
}
Example:
curl -X GET "http://localhost:8080/api/v1/agent/allAgents" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: GET /api/v1/agent/active
Retrieves information about all active agents.
Response:
{
"result": "OK",
"data": [
{
"id": "agent-id",
"name": "Active Agent",
"host": "hostname",
"state": "COLLECTING_DATA",
"version": "6.3.0"
}
]
}
Example:
curl -X GET "http://localhost:8080/api/v1/agent/active" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: GET /api/v1/agent/inactive
Retrieves information about all inactive agents.
Response:
{
"result": "OK",
"data": [
{
"id": "agent-id",
"name": "Inactive Agent",
"host": "hostname",
"state": "NOT_RUNNING",
"version": "6.3.0"
}
]
}
Example:
curl -X GET "http://localhost:8080/api/v1/agent/inactive" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: GET /api/v1/agent/agentId/{agentId}
Retrieves information about a specific agent.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
agentId | string | Yes | The unique identifier of the agent |
Response:
{
"result": "OK",
"data": {
"id": "agent-id",
"name": "Agent Name",
"host": "hostname",
"state": "RUNNING",
"version": "6.3.0",
"cartridges": []
}
}
Example:
curl -X GET "http://localhost:8080/api/v1/agent/agentId/my-agent-id" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: POST /api/v1/agent/start/agentId/{agentId}
Starts a stopped agent.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
agentId | string | Yes | The unique identifier of the agent |
Response:
{
"result": "OK",
"message": "Agent started successfully"
}
Example:
curl -X POST "http://localhost:8080/api/v1/agent/start/agentId/my-agent-id" \
-H "Auth-Token: your-token-here"
The start operation may take up to 3 minutes to complete. The default timeout is 180 seconds.
Endpoint: POST /api/v1/agent/stop/agentId/{agentId}
Stops a running agent.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
agentId | string | Yes | The unique identifier of the agent |
Response:
{
"result": "OK",
"message": "Agent stopped successfully"
}
Example:
curl -X POST "http://localhost:8080/api/v1/agent/stop/agentId/my-agent-id" \
-H "Auth-Token: your-token-here"
Endpoint: DELETE /api/v1/agent/delete/agentId/{agentId}
Deletes an agent from the system.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
agentId | string | Yes | The unique identifier of the agent |
Response:
{
"result": "OK",
"message": "Agent deleted successfully"
}
Example:
curl -X DELETE "http://localhost:8080/api/v1/agent/delete/agentId/my-agent-id" \
-H "Auth-Token: your-token-here"
Deleting an agent is a permanent operation and cannot be undone. All associated data will be removed.
The Topology API provides access to the Foglight topology model, allowing you to query objects, retrieve properties, and access observations.
Endpoint: GET /api/v1/topology/{topologyId}
Retrieves a specific topology object by its ID.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
topologyId | string | Yes | The unique identifier of the topology object |
Response:
{
"result": "OK",
"data": {
"id": "topology-object-id",
"name": "Object Name",
"type": "ObjectType",
"properties": {}
}
}
Example:
curl -X GET "http://localhost:8080/api/v1/topology/my-topology-id" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: GET /api/v1/topology/topologyIds
Retrieves multiple topology objects by their IDs.
Query Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
Id | string[] | Yes | Array of topology object IDs |
Response:
{
"result": "OK",
"data": [
{
"id": "topology-object-id-1",
"name": "Object 1",
"type": "ObjectType"
},
{
"id": "topology-object-id-2",
"name": "Object 2",
"type": "ObjectType"
}
]
}
Example:
curl -X GET "http://localhost:8080/api/v1/topology/topologyIds?Id=obj1&Id=obj2&Id=obj3" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: GET /api/v1/topology/{topologyId}/{path}
Retrieves a property or nested property value using a path expression.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
topologyId | string | Yes | The unique identifier of the topology object |
path | string | Yes | Property path (e.g., “properties” or “properties/name”) |
Response:
{
"result": "OK",
"data": "property-value"
}
Example:
curl -X GET "http://localhost:8080/api/v1/topology/my-topology-id/properties/name" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: GET /api/v1/topology/{topologyId}/paths
Retrieves multiple property values using path expressions.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
topologyId | string | Yes | The unique identifier of the topology object |
path | string[] | Yes | Array of property paths |
Response:
{
"result": "OK",
"data": {
"properties/name": "Object Name",
"properties/state": "RUNNING",
"properties/cpu_usage": 45.5
}
}
Example:
curl -X GET "http://localhost:8080/api/v1/topology/my-topology-id/paths?path=properties/name&path=properties/state" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: POST /api/v1/topology/query
Executes a Foglight Query Language (FQL) query to retrieve topology objects.
Request Body:
{
"queryText": "!Host",
"caseSensitive": false
}
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
queryText | string | Yes | FQL query string |
caseSensitive | boolean | No | Whether the query is case-sensitive |
Response:
{
"result": "OK",
"data": [
{
"id": "topology-object-id",
"name": "Object Name",
"type": "Host",
"properties": {}
}
]
}
Example:
curl -X POST "http://localhost:8080/api/v1/topology/query" \
-H "Auth-Token: your-token-here" \
-H "Content-Type: application/json" \
-d '{
"queryText": "!Host",
"caseSensitive": false
}'
Common FQL Queries:
!Host
- All hosts!Database
- All databases!Agent
- All agents!Host where name = :hostname
- Host by nameEndpoint: POST /api/v1/topology/observationQuery
Retrieves observation data (metrics) for topology objects.
Request Body:
{
"includes": [
{
"ids": ["object-id-1", "object-id-2"],
"observationName": "cpu_usage"
}
],
"startTime": 1697452800000,
"endTime": 1697456400000,
"retrievalType": "LATEST"
}
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
includes | array | Yes | Array of observation requests |
startTime | long | No | Start timestamp (milliseconds since epoch) |
endTime | long | No | End timestamp (milliseconds since epoch) |
retrievalType | string | No | LATEST, LAST_N, AGGREGATE, AGGREGATE_AND_LAST |
granularity | long | No | Data granularity in milliseconds |
numberOfValue | integer | No | Number of values to retrieve |
Response:
{
"result": "OK",
"data": {
"lastValues": {
"object-id-1:cpu_usage": {
"value": 45.5,
"timestamp": 1697452800000
}
}
}
}
Example:
curl -X POST "http://localhost:8080/api/v1/topology/observationQuery" \
-H "Auth-Token: your-token-here" \
-H "Content-Type: application/json" \
-d '{
"includes": [
{
"ids": ["obj1", "obj2"],
"observationName": "cpu_usage"
}
],
"retrievalType": "LATEST"
}'
The Alarm API provides endpoints for querying, acknowledging, and managing alarms.
Endpoint: GET /api/v1/alarm/ack/{alarmId}
Acknowledges a specific alarm.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
alarmId | string | Yes | The unique identifier of the alarm |
Response:
{
"result": "OK",
"data": "success"
}
Example:
curl -X GET "http://localhost:8080/api/v1/alarm/ack/my-alarm-id" \
-H "Auth-Token: your-token-here"
Endpoint: GET /api/v1/alarm/clear/{alarmId}
Clears a specific alarm.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
alarmId | string | Yes | The unique identifier of the alarm |
Response:
{
"result": "OK",
"data": "success"
}
Example:
curl -X GET "http://localhost:8080/api/v1/alarm/clear/my-alarm-id" \
-H "Auth-Token: your-token-here"
Endpoint: GET /api/v1/alarm/{alarmId}
Retrieves a specific alarm by its ID.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
alarmId | string | Yes | The unique identifier of the alarm |
Response:
{
"result": "OK",
"data": {
"id": "alarm-id",
"message": "Alarm message",
"severity": "CRITICAL",
"state": "OUTSTANDING",
"timestamp": 1697452800000
}
}
Example:
curl -X GET "http://localhost:8080/api/v1/alarm/my-alarm-id" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: GET /api/v1/alarm/ruleId/{ruleId}
Retrieves all alarms associated with a specific rule.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
ruleId | string | Yes | The unique identifier of the rule |
startTimeMS | long | No | Start timestamp (milliseconds since epoch) |
durationMS | long | No | Duration in milliseconds |
Response:
{
"result": "OK",
"data": [
{
"id": "alarm-id",
"message": "Alarm message",
"severity": "WARNING",
"ruleID": "rule-id"
}
]
}
Example:
curl -X GET "http://localhost:8080/api/v1/alarm/ruleId/my-rule-id" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: GET /api/v1/alarm/current
Retrieves all current (active) alarms.
Response:
{
"result": "OK",
"data": [
{
"id": "alarm-id",
"message": "Alarm message",
"severity": "CRITICAL",
"state": "OUTSTANDING"
}
]
}
Example:
curl -X GET "http://localhost:8080/api/v1/alarm/current" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: GET /api/v1/alarm/current/{topologyId}
Retrieves all current alarms for a specific topology object.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
topologyId | string | Yes | The unique identifier of the topology object |
Response:
{
"result": "OK",
"data": [
{
"id": "alarm-id",
"message": "Alarm message",
"severity": "WARNING",
"state": "OUTSTANDING",
"topologyObjectId": "topology-id"
}
]
}
Example:
curl -X GET "http://localhost:8080/api/v1/alarm/current/my-topology-id" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: GET /api/v1/alarm/history
Retrieves historical alarms within the specified time range.
Query Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
startTimeMS | long | No | Start timestamp (milliseconds since epoch) |
durationMS | long | No | Duration in milliseconds |
Response:
{
"result": "OK",
"data": [
{
"id": "alarm-id",
"message": "Alarm message",
"severity": "WARNING",
"timestamp": 1697452800000
}
]
}
Example:
curl -X GET "http://localhost:8080/api/v1/alarm/history" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: GET /api/v1/alarm/history/{topologyId}
Retrieves historical alarms for a specific topology object.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
topologyId | string | Yes | The unique identifier of the topology object |
startTimeMS | long | No | Start timestamp (milliseconds since epoch) |
durationMS | long | No | Duration in milliseconds |
Response:
{
"result": "OK",
"data": [
{
"id": "alarm-id",
"message": "Alarm message",
"severity": "CRITICAL",
"topologyObjectId": "topology-id",
"timestamp": 1697452800000
}
]
}
Example:
curl -X GET "http://localhost:8080/api/v1/alarm/history/my-topology-id" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: POST /api/v1/alarm/pushAlarm
Pushes an alarm from an external system.
Request Body:
{
"severity": 5,
"message": "External alarm message",
"topologyObjectId": "topology-id"
}
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
severity | integer | Yes | Alarm severity (1-5) |
message | string | Yes | Alarm message |
topologyObjectId | string | Yes | Target topology object ID |
Response:
{
"result": "OK",
"message": "Alarm pushed successfully"
}
Example:
curl -X POST "http://localhost:8080/api/v1/alarm/pushAlarm" \
-H "Auth-Token: your-token-here" \
-H "Content-Type: application/json" \
-d '{
"severity": 5,
"message": "Critical error detected",
"topologyObjectId": "my-object-id"
}'
Endpoint: POST /api/v1/alarm/pushAlarmByQuery
Pushes an alarm to topology objects identified by an FQL query.
Request Body:
{
"severity": 4,
"message": "External alarm message",
"query": "!Host where name = :hostname"
}
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
severity | integer | Yes | Alarm severity (1-5) |
message | string | Yes | Alarm message |
query | string | Yes | FQL query to identify target object |
Response:
{
"result": "OK",
"message": "Alarm pushed successfully"
}
Example:
curl -X POST "http://localhost:8080/api/v1/alarm/pushAlarmByQuery" \
-H "Auth-Token: your-token-here" \
-H "Content-Type: application/json" \
-d '{
"severity": 4,
"message": "Database connection lost",
"query": "!Database where name = '\''production-db'\''"
}'
The Rule API provides access to Foglight rules for monitoring and alerting.
Endpoint: GET /api/v1/rule/allRules
Retrieves information about all rules.
Response:
{
"result": "OK",
"data": [
{
"id": "rule-id",
"name": "Rule Name",
"enabled": true,
"type": "RuleType"
}
]
}
Example:
curl -X GET "http://localhost:8080/api/v1/rule/allRules" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: GET /api/v1/rule/{ruleId}
Retrieves information about a specific rule.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
ruleId | string | Yes | The unique identifier of the rule |
Response:
{
"result": "OK",
"data": {
"id": "rule-id",
"name": "Rule Name",
"description": "Rule description",
"enabled": true,
"severity": "CRITICAL"
}
}
Example:
curl -X GET "http://localhost:8080/api/v1/rule/my-rule-id" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
The Cartridge API provides information about installed cartridges.
Endpoint: GET /api/v1/cartridge/allCartridges
Retrieves information about all installed cartridges.
Response:
{
"result": "OK",
"data": [
{
"name": "Cartridge Name",
"version": "1.0.0",
"type": "CORE",
"enabled": true
}
]
}
Example:
curl -X GET "http://localhost:8080/api/v1/cartridge/allCartridges" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: GET /api/v1/cartridge/allCartridges/core
Retrieves information about core cartridges only.
Response:
{
"result": "OK",
"data": [
{
"name": "Core Cartridge",
"version": "1.0.0",
"type": "CORE"
}
]
}
Example:
curl -X GET "http://localhost:8080/api/v1/cartridge/allCartridges/core" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
Endpoint: GET /api/v1/cartridge/allCartridges/nonCore
Retrieves information about non-core cartridges.
Response:
{
"result": "OK",
"data": [
{
"name": "Custom Cartridge",
"version": "2.0.0",
"type": "CUSTOM"
}
]
}
Example:
curl -X GET "http://localhost:8080/api/v1/cartridge/allCartridges/nonCore" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
The Registry API provides access to the Foglight configuration registry.
Endpoint: GET /api/v1/registry/allRegistries
Retrieves all registry entries.
Response:
{
"result": "OK",
"data": [
{
"key": "registry-key",
"value": "registry-value",
"type": "string"
}
]
}
Example:
curl -X GET "http://localhost:8080/api/v1/registry/allRegistries" \
-H "Auth-Token: your-token-here" \
-H "Accept: application/json"
All API errors return a consistent error response format:
{
"result": "ERROR",
"message": "Detailed error message",
"errorCode": "ERROR_CODE",
"details": {
"field": "Additional error context"
}
}
Error Code | HTTP Status | Description | Resolution |
---|---|---|---|
AUTH_FAILED | 401 | Authentication failed | Verify credentials and retry |
TOKEN_EXPIRED | 401 | Authentication token expired | Obtain a new token via login |
PERMISSION_DENIED | 403 | Insufficient permissions | Request necessary role assignment |
NOT_FOUND | 404 | Resource not found | Verify resource ID and retry |
INVALID_REQUEST | 400 | Invalid request parameters | Check request format and parameters |
SERVER_ERROR | 500 | Internal server error | Contact support with error details |
SERVICE_UNAVAILABLE | 503 | Service temporarily unavailable | Retry after a short delay |
Cloud Deployment: The Foglight Cloud API implements rate limiting to ensure fair usage and system stability.
Default Rate Limits:
Rate Limit Headers:
When rate limits are approaching, responses include the following headers:
X-RateLimit-Limit
: Maximum requests per time windowX-RateLimit-Remaining
: Remaining requests in current windowX-RateLimit-Reset
: Time when the rate limit resets (Unix timestamp)Rate Limit Exceeded Response:
{
"result": "ERROR",
"message": "Rate limit exceeded",
"errorCode": "RATE_LIMIT_EXCEEDED",
"details": {
"retryAfter": 60
}
}
The Foglight REST API uses URI versioning. The current version is v1 and is included in all API endpoint URLs:
http://<foglight-server>:<port>/api/v1/...
To check the available API version, access the base API endpoint:
curl -X GET "http://localhost:8080/api/" \
-H "Accept: application/json"
Response:
{
"version": "v1",
"supportedVersions": ["v1"]
}
For API support and questions:
When reporting API issues, include:
Get all hosts:
!Host
Get hosts by name pattern:
!Host where name like :pattern
Get databases with high CPU usage:
!Database where cpu_usage > :threshold
Get agents with specific state:
!Agent where state = :state
The API uses Unix timestamps (milliseconds since epoch) for all date and time values:
{
"timestamp": 1697452800000
}
To convert to human-readable format:
new Date(1697452800000).toISOString()
// "2023-10-16T12:00:00.000Z"
Complete list of HTTP status codes used by the API:
2xx Success
4xx Client Errors
5xx Server Errors
Last Updated: October 16, 2025
API Version: v1
Document Version: 8.0.0