I created two checks via the Influxdb v2 API. For the first check, I didn’t save the check ID. For the second check, I saved the check ID. Both requests were successful with a 201.
When I query for all checks via /api/v2/checks, other checks I created through the builder show up but the two checks that I created via endpoint don’t show up. When I query for latter of the two checks I made w/ the API via check ID (/api/v2/checks/{check_id}), the endpoint returns the check.
Here’s the request body I used in the post call:
{
"name": "Pavilion A Floor Switches",
"ownerID": "OWNER_ID", // swapped these values out
"orgID": "ORG_ID", // swapped these values out
"query": {
"text": "import \"influxdata\/influxdb\/monitor\"\r\nimport \"experimental\"\r\n\r\nfrom(bucket: \"site_metrics\")\r\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\r\n |> filter(fn: (r) => r._measurement == \"ping_metrics\")\r\n |> filter(fn: (r) => r._field == \"ping_time\")\r\n |> filter(fn: (r) => r.dest_addr == \"192.168.11.2\" or r.dest_addr == \"192.168.10.2\" or r.dest_addr == \"192.168.12.2\" or r.dest_addr == \"192.168.13.2\" or r.dest_addr == \"192.168.14.2\" or r.dest_addr == \"192.168.16.2\" or r.dest_addr == \"192.168.15.2\" or r.dest_addr == \"192.168.17.2\" or r.dest_addr == \"192.168.18.2\" or r.dest_addr == \"192.168.19.2\" or r.dest_addr == \"192.168.20.2\" or r.dest_addr == \"192.168.21.2\" or r.dest_addr == \"192.168.22.2\" or r.dest_addr == \"192.168.3.2\" or r.dest_addr == \"192.168.4.2\" or r.dest_addr == \"192.168.5.2\" or r.dest_addr == \"192.168.6.2\" or r.dest_addr == \"192.168.7.2\" or r.dest_addr == \"192.168.8.2\" or r.dest_addr == \"192.168.9.2\")\r\n |> filter(fn: (r) => r.service_area == \"newark\")\r\n |> filter(fn: (r) => r.site_name == \"pavilion_a\")\r\n |> group(columns: [\"pavilion_a\"])\r\n",
"editMode": "advanced",
"name": "",
"builderConfig": {
"buckets": [
"site_metrics"
],
"tags": [
{
"key": "_measurement",
"values": [
"ping_metrics"
],
"aggregateFunctionType": "filter"
},
{
"key": "_field",
"values": [
"ping_time"
],
"aggregateFunctionType": "filter"
},
{
"key": "site_name",
"values": [
"pavilion_a"
],
"aggregateFunctionType": "filter"
},
{
"key": "dest_addr",
"values": [
"192.168.3.2",
"192.168.4.2",
"192.168.5.2",
"192.168.6.2",
"192.168.7.2",
"192.168.8.2",
"192.168.9.2",
"192.168.10.2",
"192.168.11.2",
"192.168.12.2",
"192.168.13.2",
"192.168.14.2",
"192.168.15.2",
"192.168.16.2",
"192.168.17.2",
"192.168.18.2",
"192.168.19.2",
"192.168.20.2",
"192.168.21.2",
"192.168.22.2"
],
"aggregateFunctionType": "filter"
}
],
"functions": [],
"aggregateWindow": {
"period": ""
}
}
},
"statusMessageTemplate": "Check: ${ r._check_name } is: ${ r._level }",
"every": "1m",
"offset": "0s",
"tags": [],
"timeSince": "90s",
"staleTime": "10m",
"reportZero": false,
"level": "CRIT",
"type": "deadman",
"status": "active"
}
Any idea what might be wrong here? I have no way of checking the status of either check in the UI and no way of viewing the initial check I created since I lost the ID and it doesn’t show up in the get endpoint for all checks.
UPDATE
I realized it was a pagination issue. The API endpoint returns the first 20 checks, as displayed in the docs. However, I realized there aren’t any pagination options in the UI. Will this be built in at some point?