📕
API Reference
  • SpaceOne APIs
  • Common V1
    • Search Query
      • Filter Operators
    • Statistics Query
      • Ex.1 case: Project
  • Statistics V1
    • Stat API
      • Ex.1 case: Service Account
      • Ex.2 case: Project
Powered by GitBook
On this page

Was this helpful?

  1. Common V1
  2. Search Query

Filter Operators

Default filter and Custom filter operator and its descriptions

PreviousSearch QueryNextStatistics Query

Last updated 4 years ago

Was this helpful?

Default Operators

NO

KEY

TYPE

DESC

SYMBOLIC SQL

1

lt

string

less than

<

2

lte

string

less than or equal to

≤

3

gt

string

greater than

>

4

gte

string

greater than or equal to

≥

5

eq

string

equal to

=

6

not

string

!=

7

exists

string

exists

EXISTS

8

contain

string

contains

%str%

9

not_contain

string

not contains

NOT LIKE '%str%';

10

in

string

include

IN ("a","b","c")

11

not_in

string

not include

NOT IN ("a", "b", "c")

12

not_contain_in

string

no contain in

NOT IN ('%A%', '%B%', '%C%')

13

match

string

WHERE T.A='a' AND T.B='b'

FILTER REGULATIONS:

  • Match

    • Search field with k (key) MUST be list of dict

    • Only offers dict type in value

    • Case-sensitive in value

    • Full-match only

      • refers to

Sample Input

{
    "domain_id": "{domain_id}",
    "query": {
        "filter": [
            {
                "k": "data.disk.core",
                "v": 4,
                "o": "gte"
            },
            {
                "k": "tags.spaceone:plugin_name",
                "v": "aws-health",
                "o": "eq"
            },
            {
                "k": "data.softwares", 
                "v": { "version": "1.0.0", "name": "mysql" }, 
                "o": "match"
             }
        ]
    }
}

Custom Operators

NO

KEY

TYPE

DESC

SYMBOLIC SQL

1

datetime_lt

string

date time less than

<

2

datetime_lte

string

date time less than or equal to

≤

3

datetime_gt

string

date time greater than

>

4

datetime_gte

string

date time greater than or equal to

≥

5

timediff_lt

string

time difference less than

<

6

timediff_lte

string

time difference less than or equal to

≤

7

timediff_gt

string

time difference greater than

>

8

timediff_gte

string

time difference greater than or equal to

≥

datetime or timediff builder

  1. With ISO8601

    {
    	"name": "spaceone",
    	"query": {
    		"filter": [
    			{
    				"k": "created_at",
    				"v": "2020-05-06T10:49:44Z",
    				"o": "timediff_gt"
    			}
    		]
    	}
    }
    
  2. With operators

    {
    	"name": "spaceone",
    	"query": {
    		"filter": [
    			{
    				"k": "created_at",
    				"v": "now + 24",
    				"o": "timediff_gt"
    			}
    		]
    	}
    }

    Item

    CANDIDATE

    DESC

    time

    now, now/d, now/w

    time values

    operator

    +, -

    operator for sum and subtraction

    deltas

    24 (s, m, h, d, w)

    value to operate with s: second

    m: minute

    h: hour

    d: day

    w: week

Please refer to for more

$elemMatch (query)
ISO8601