Insert check data
POST
/asset/<assetId>/collector/<collectorKey>/check/<checkKey>
Description
Insert check data.
Path parameters
Param | Description |
---|---|
assetId |
Asset Id. |
collectorKey |
Collector key. |
checkKey |
Check key. |
Query parameters
none
Body
Param | Type | Required | Description |
---|---|---|---|
data |
object | No | Object with check data (if not given, error must be provided). |
version |
string | Yes | Version of the collector. |
runtime |
float | No | Time it took for the check to run in seconds. |
no_count |
boolean | No | If true , the check result will not be "counted" by InfraSonar and therefore not affect "last-seen". |
timestamp |
integer | No | Unix timestamp in seconds. If omitted, InfraSonar will set the timestamp for the check data. |
error |
object | No | Object with error (see error) (if not given, error must be provided). |
At least one of
data
orerror
must be provided, and both can be included.
Error
An optional error might be provided which raises a check notification in InfraSonar. It is possible send both data and an error.
Param | Type | Required | Description |
---|---|---|---|
severity |
string | No | Severity of the error (LOW , MEDIUM or HIGH ). |
message |
string | Yes | Error message |
Example error object:
{
"severity": "MEDIUM",
"message": "this is an example error message"
}
Return codes
Error code | Reason |
---|---|
204 |
Success. |
400 |
Invalid body. |
401 |
Invalid or missing token. |
403 |
Insufficient permissions (required: API +INSERT_CHECK_DATA ). |
404 |
Asset or collector or check not found. |
409 |
Collector is not assigned to the asset. |
413 |
Body size too large (maximum 500 KB). |
Example
Curl request:
curl \
-X POST 'https://api.infrasonar.com/asset/123/collector/docker/check/network' \
-H 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-H 'Content-Type: application/json' \
--data-raw '{
"data": {
"networks": [
{
"name": "myNetwork",
"ipAddress": "1.2.3.4"
}
]
},
"version": "0.1.0"
}'