Stat API
Query for statistics
Statistic query format
NO
KEY
TYPE
REQUIRED
DESC
1
resource_type
string
β
Main resource type to select with grouping
2
query
dict
β
Aggregate for grouping and its specification
3
join
list
β
Joining resource which implements
4
formulas
list
β
calculation for formula which stands
Full specification of Stat query
{
"resource_type": ...,
"query": {...},
"join": [...],
"formulas": [...]
}{
"resource_type": "identity.ServiceAccount",
"query": {
"aggregate": {
"group": {
"keys": [
{
"key": "provider",
"name": "provider"
},
{
"key": "service_account_id",
"name": "service_account_id"
},
{
"key": "name",
"name": "service_account_name"
}
]
}
},
"sort": {
"name": "resource_count",
"desc": true
},
"limit": 5
}
}query specification : (type: dict)
NO
KEY
TYPE
REQUIRED
DESC
1
resource_type
string
β
Main resource type to select with grouping
2
query
dict
β
query for grouping statistic main select item
Note: join has a dependencies on main resource_type, and query must pair with resource_type & query
join specification ( type: list )
NO
KEY
TYPE
REQUIRED
DESC
1
keys
list
β
Primary columns or keys to join with main resource of query and index join will be performed if keys hasn't given
2
type
string
β
Type of join in SQL
LEFT (default)
RIGHT
INNER
OUTER
3
resource_type
string
β
Resource type to join with
4
query
dict
β
Select query for joining with primary resources

Note: formulas has a dependencies on main resource_type, and query must pair with resource_type & query and join(if needed)
formula specification : ( type: list )
NO
KEY
TYPE
REQUIRED
DESC
1
name
string
β
name of variable that stores performed formula
2
formula
string
β
algebraic formulas to calculate given form
3
operator
string
β
optional values in EVAL(default), QUERY
formula use case
Last updated
Was this helpful?