Rest...args: [string, CDFHttpClient, MetadataMap]The aggregation API allows you to compute aggregated results on events like getting the count of all events in a project or checking what are all the different types and subtypes of events in your project, along with the count of events in each of those aggregations. By specifying an additional filter, you can also aggregate only among events matching the specified filter.
const events = [
{ description: 'Workorder pump abc', startTime: new Date('22 jan 2019') },
{ description: 'Broken rule', externalId: 'rule123', startTime: 1557346524667000 },
];
const createdEvents = await client.events.create(events);
await client.events.delete([{id: 123}, {externalId: 'abc'}]);
const events = await client.events.list({ filter: { startTime: { min: new Date('1 jan 2018') }, endTime: { max: new Date('1 jan 2019') } } });
Optionalscope: EventFilterRequestconst events = await client.events.retrieve([{id: 123}, {externalId: 'abc'}]);
const events = await client.events.search({
filter: {
assetIds: [1, 2]
},
search: {
description: 'Pump'
}
});
const events = await client.events.update([{id: 123, update: {description: {set: 'New description'}}}]);
Deprecated
Asset-centric API, deprecated 2026-10-15 and retired 2027-12-31. Will be removed or moved in a future major release. See https://docs.cognite.com/cdf/deprecated and https://github.com/cognitedata/cognite-sdk-js/blob/master/guides/DEPRECATIONS.md.