Get the alert expression field catalog
const url = 'http://localhost:3000/api/v1/alert-rules/metric-catalog';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:3000/api/v1/alert-rules/metric-catalog \ --header 'X-API-Key: <X-API-Key>'Every field an alert expression may name, with its value type, unit, admitted operators and allowed values, plus one entry per device label key in the caller’s organization. The builder in the web UI composes expressions from this list.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”UUID of the organization (tenant) the request acts in. It selects the tenant and grants nothing: the server checks membership or an open tenant switch. Not needed for global operations. A malformed value returns 400. API keys are fixed to their own organization; another organization returns 403. The x-organization-source header grants nothing.
Responses
Section titled “Responses”object
Every field an expression may name, including one device.label.<key> entry per label key the caller’s organization’s devices carry.
object
The DSL identifier, exactly as written in an expression.
metric: a telemetry value; attribute: a device property.
percent fields (cpu, memory, disk) compare against 0–100, never bytes.
The comparison operators the parser accepts for this field.
For enumerated attributes (device.status): the only values that can match.
Set on the device.label.<key> entries: the prefix the label key follows. Any key under this prefix is accepted on write, not only the ones listed.
The caller’s organization’s device label keys, as used in the label entries.
Example
{ "fields": [ { "field": "cpu", "kind": "metric", "valueType": "number", "unit": "percent", "operators": [ "=", "!=" ], "allowedValues": [ "ONLINE", "OFFLINE", "PENDING", "ERROR" ], "keyPrefix": "device.label." } ], "labelKeys": [ "environment", "site" ]}