Skip to main content

BPQL Object Syntax

BigPanda uses a JSON Object form of its BPQL string for API body parameters. When using the API, this format needs to be followed where appropriate.

BigPanda's APIs utilizes the BPQL object syntax when used for querying, which should not be confused with the string formatted BPQL when searching or filtering inside the UI itself.

The below BPQL object cheatsheets explain how a conventional BPQL string is represented as a JSON object instead. Again, use this format whenever a certain API requires filling in a bpql parameter, like Create a Plan.

```a Basic Query
{<operator>: [<tag>, <value/values>]}
```

Command

BPQL String

BPQL Object

equal =

host = prod-api-1

{ "=": [ "host", "prod-api-1" ]}

not equal !=

host != prod-api-1

{ "!=": [ "host", "prod-api-1" ]}

strong equal ===

host === prod-api-1

{ "===": [ "host", "prod-api-1" ]}

in operator IN

host IN [prod-api-1,prod-api-2]

{ "IN": [ "host", [ "prod-api-1", "prod-api-2" ]]}

not in operator NOT IN

host NOT IN [prod-api-1,prod-api-2]

{ "NOT IN": [ "host", [ "prod-api-1", "prod-api-2" ]]}

```a Complex Query
{<operator>: [<sub_query#1>,<sub_query#2>,...]}
```

Command

BPQL String

BPQL Object

AND

host = prod-api-1 AND check = cpu

{ "AND": [{ "=": [ "host", "prod-api-1" ]}, { "=": [ "check", "cpu" ]}]}

OR

host = prod-api-1 OR check = cpu

{ "OR": [{ "=": [ "host", "prod-api-1" ]}, { "=": [ "check", "cpu" ]}]}

Special Values

For commands with special values, the value will be represented inside an object. Here are two examples.

Command

BPQL String

BPQL Object

wildcard *

host = prod-api-*

{ "=": [ "host", { "type": "regex", "value": "prod-api-*" }]}

Formal Regex Search

host = /prod-api-.*/

{ "=": [ "host", { "type": "formal-regex", "value": "prod-api-.*" }]}