Skip to content

Query container notifications

GET /container/<containerId>/notifications?fields=...

Description

Query all open notifications for a given container.

With the current API it is not possible to query for closed notifications, except when you have an explicit notification key string.

Path parameters

Param Description
containerId Container Id.

Query parameters

Param Default Description
fields ks Fields to return (see Fields below for all available fields).

Fields

Field Return type Description
ks string Key string of the notification.
message string Notification message.
severity integer Notification severity (value between 0=highest and 2=lowest severity).
timestamp integer Unix timestamp in seconds when the notification was opened.
lastTimestamp integer Unix timestamp in seconds of the last hit (equal to "timestamp" with only a single hit).
kind string One of ConnectionStatus, ConnectionTimeDelta, ProbeVersion, ProbeMissing, ProbeTimeDelta, ProbeNoHeartbeat, CheckMissing, CheckError, CheckAged, CheckInvalidResult, CheckInvalidTimestamp, CheckInvalidData, ContainerMaintenance, AgentcoreMissing or ConditionError.
status string Notification status. One of Open, Closed or Resolved.
hits integer Number of consecutive hits.
assetId integer/null Id of the associated asset. Only applicable for CheckMissing, CheckError, CheckAged, CheckInvalidResult, CheckInvalidTimestamp or CheckInvalidData notifications.
collector string/null Key of the associated collector. Only applicable for CheckMissing, CheckError, CheckAged, CheckInvalidResult, CheckInvalidTimestamp or CheckInvalidData notifications.
check string/null Key of the associated check. Only applicable for CheckMissing, CheckError, CheckAged, CheckInvalidResult, CheckInvalidTimestamp or CheckInvalidData notifications.
closedTimestamp integer/null Unix timestamp in seconds when the notification was closed or null if not closed.
closedBy integer/null Id of the user who closed the notification or null if not closed.

Return codes

Error code Reason
200 Success.
400 Unknown field.
401 Invalid or missing token.
403 Insufficient permissions (required: API+READ).
404 Container not found.

Example

Curl request:

curl \
    -X GET 'https://api.infrasonar.com/container/123/notifications?fields=ks,message,severity' \
    -H 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

Response:

[
    {
        "ks": "<a-unique-key-string>",
        "message": "Check is missing _(can happen if the check is new for this asset)_",
        "severity": 2
    }
]