Aggregate assets
Required capabilities:
assetsAcl:READ
The aggregation API lets you compute aggregated results on assets, such as getting the count of all assets in a project, checking different names and descriptions of assets in your project, etc.
Aggregate filtering
Filter (filter & advancedFilter) data for aggregates
Filters behave the same way as for the Filter assets endpoint.
In text properties, the values are aggregated in a case-insensitive manner.
aggregateFilter to filter aggregate results
aggregateFilter works similarly to advancedFilter but always applies to aggregate properties.
For instance, in case of an aggregation for the source property, only the values (aka buckets) of the source property can be filtered out.
Request throttling
This endpoint is meant for data analytics/exploration usage and is not suitable for high load data retrieval usage.
It is a subject of the new throttling schema (limited request rate and concurrency).
Please check Assets resource description for more information.
Documentation Index
Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.
Body
- AssetCount
- AssetWithPropertyCount
- ApproximateCardinalityForValues
- ApproximateCardinalityForProperties
- UniqueValues
- UniqueProperties
- MetadataKeys
- MetadataValues
Aggregation request of assets. Filters behave the same way as for the filter endpoint. Default aggregation is count.
Type of aggregation to apply.
count: Get approximate number of Assets matching the filters.
count A query that matches items matching boolean combinations of other queries.
It is built using one or more boolean clauses of the following types: and, or, or not.
- and
- or
- not
- equals
- in
- range
- prefix
- exists
- containsAny
- containsAll
- search
{
"or": [
{
"not": {
"and": [
{
"equals": {
"property": ["metadata", "asset_type"],
"value": "gas pump"
}
},
{
"in": {
"property": ["source"],
"values": ["blueprint", "inventory"]
}
},
{
"range": {
"property": ["dataSetId"],
"gte": 1,
"lt": 10
}
}
]
}
},
{
"and": [
{
"containsAny": {
"property": ["labels"],
"values": ["pump", "cooler"]
}
},
{
"equals": {
"property": ["parentId"],
"value": 95867294876
}
}
]
},
{
"search": {
"property": ["description"],
"value": "My favorite pump"
}
}
]
}Filter on assets with strict matching.
Response
Response with a list of aggregation results.
- CountResult
- BucketsResult
Common aggregate structure to represent aggregate result which have one count for filter resultset (Documents Count, Property Cardinality, etc).
1 element