Response wrapped in [[IResult]]
Example
const smartGroup = { name: 'newName', type: 'c8y_DynamicGroup', c8y_IsDynamicGroup: {} };
const deviceQueryString = 'c8y_DeviceQueryString: "$filter=(name eq 'test*') $orderby=c8y_Hardware.model asc';
const configurableColumns = [
{headerName: 'Status', active: false, key: 'status'},
{headerName: 'Name', active: true, key: 'name', filter: { externalFilterQuery: { name: { names: ['test*'] } } }},
{headerName: 'Model', active: true, key: 'model'}
];
(async () => {
await smartGroupsService.create({ smartGroup, deviceQueryString, configurableColumns });
})();
Note: filterConfig has been removed as a default property to the input object.
Now it is part of the configurable columns properties as it is shown above.
You can still pass it as an optional parameter.
( const filterConfig = [{ name: { names: ['test*'] } }] )
Removes managed object with given id.
Additional query params.
Response wrapped in [[IResult]]
const group = { id: '1' } as IManagedObject;
const params: any = {
withChildren: false
}
(async () => {
await smartGroupsService.delete(group, params);
})();
Gets the details of managed object
Entity or Id of the ManagedObject.
Filter object.
Response wrapped in [[IResult]]
const id: string = '1';
const filter: any = { withChildren: false };
(async () => {
const {data, res} = await smartGroupsService.detail(id, filter);
})();
Checks whether a given managed object is a smart group
Managed object to check.
boolean
const mo: IManagedObject = {id: 1, type: "c8y_DeviceGroup", c8y_IsDeviceGroup: {}} as IManagedObject;
(() => {
const isSmartGroup = smartGroupsService.isSmartGroup(mo);
})();
Updates smart group managed object with given id.
Partial managed object of the smart group.
Response wrapped in [[IResult]]
const smartGroup = { id: '1', name: 'newName' };
(async () => {
await smartGroupsService.update(smartGroup);
})();
Creates a smart group managed object with columns configuration.