Optional
realtime: RealtimeGets a list of KPIs (data point library entries) matching a given managed object
Response wrapped in [[IResultList]]
Adds an existing managed object as child addition to another managed object (parent)
Example
const childRef: number = 2;
const parentReferenceId: number = 1;
(async () => {
const {data, res} = await inventoryService.childAdditionsCreate(childRef, parentReferenceId);
})();
Response wrapped in [[IResult]]
Adds bulk of existing managed objects as child addition to another managed object (parent).
List of existing managed objects IDs that should be added to another managed object (parent).
Example
const childAdditionsRefIds: string[] = ['2', '3'];
const parentReferenceId: number = 1;
(async () => {
const {data, res} = await inventoryService.childAdditionsBulkAdd(childAdditionsRefIds, parentReferenceId);
})();
Response wrapped in array of [[IResult]]
Creates a new managed object as child addition to another managed object (parent)
Example
const mOAsChildAddition: Partial<IManagedObject> = {
name: 'Child addition MO',
type: 'new type',
...
};
// This is the identifier of the managed object which should be the parent of
// mOAsChildAddition, see above.
const parentReferenceId: number = 1;
(async () => {
const {data, res} = await inventoryService.childAdditionsCreate(mOAsChildAddition, parentReferenceId);
})();
Response wrapped in [[IResult]]
Gets a list of child additions from a given managed object (parent)
Example
const parentReferenceId: IdReference = 1;
const filter: object = {
pageSize: 100,
withTotalPages: true
};
(async () => {
const {data, res, paging} = await inventoryService.childAdditionsList(parentReferenceId, filter);
})();
Response wrapped in [[IResultList]]
Removes an existing managed object as child addition from another managed object (parent)
Example
const childRef: number = 2;
const parentReferenceId: number = 1;
(async () => {
const {data, res} = await inventoryService.childAdditionsRemove(childRef, parentReferenceId);
})();
Response wrapped in [[IResult]]
Adds an existing managed object as child asset to another managed object (parent)
Example
const childRef: number = 2;
const parentReferenceId: number = 1;
(async () => {
const {data, res} = await inventoryService.childAssetsAdd(childRef, parentReferenceId);
})();
Response wrapped in [[IResult]]
Adds bulk of existing managed objects as child assets to another managed object (parent).
List of existing managed objects IDs that should be added to another managed object (parent).
Example
const childAssetsRefIds: string[] = ['2', '3'];
const parentReferenceId: number = 1;
(async () => {
const {data, res} = await inventoryService.childAssetsBulkAdd(childAssetsRefIds, parentReferenceId);
})();
Response wrapped in array of [[IResult]]
Creates a new managed object as child asset to another managed object (parent)
Example
const mOAsChildAsset: Partial<IManagedObject> = {
name: 'Child asset MO',
type: 'new type',
...
};
// This is the identifier of the managed object which should be the parent of
// mOAsChildAsset, see above.
const parentReferenceId: number = 1;
(async () => {
const {data, res} = await inventoryService.childAdditionsCreate(mOAsChildAddition, parentReferenceId);
})();
Response wrapped in [[IResult]]
Gets a list of child assets from a given managed object (parent)
Example
const parentReferenceId: IdReference = 1;
const filter: object = {
pageSize: 100,
withTotalPages: true
};
(async () => {
const {data, res, paging} = await inventoryService.childAssetsList(parentReferenceId, filter);
})();
Response wrapped in [[IResultList]]
Removes an existing managed object as child asset from another managed object (parent)
Example
const childRef: number = 2;
const parentReferenceId: number = 1;
(async () => {
const {data, res} = await inventoryService.childAssetsRemove(childRef, parentReferenceId);
})();
Response wrapped in [[IResult]]
Adds an existing managed object as child device to another managed object (parent)
Example
const childRef: number = 2;
const parentReferenceId: number = 1;
(async () => {
const {data, res} = await inventoryService.childDevicesAdd(childRef, parentReferenceId);
})();
Response wrapped in [[IResult]]
Adds bulk of existing managed objects as child devices to another managed object (parent).
List of existing managed objects IDs that should be added to another managed object (parent).
Example
const childDevicesRefIds: string[] = ['2', '3'];
const parentReferenceId: number = 1;
(async () => {
const {data, res} = await inventoryService.childDevicesBulkAdd(childDevicesRefIds, parentReferenceId);
})();
Response wrapped in array of [[IResult]]
Creates a new managed object as child device to another managed object (parent)
Example
const mOAsChildDevice: Partial<IManagedObject> = {
name: 'Child device MO',
type: 'new type',
...
};
// This is the identifier of the managed object which should be the parent of
// mOAsChildDevice, see above.
const parentReferenceId: number = 1;
(async () => {
const {data, res} = await inventoryService.childDevicesCreate(mOAsChildDevice, parentReferenceId);
})();
Response wrapped in [[IResult]]
Gets a list of child devices from a given managed object (parent)
Example
const parentReferenceId: IdReference = 1;
const filter: object = {
pageSize: 100,
withTotalPages: true
};
(async () => {
const {data, res, paging} = await inventoryService.childDevicesList(parentReferenceId, filter);
})();
Response wrapped in [[IResultList]]
Removes an existing managed object as child device from another managed object (parent)
Example
const childRef: number = 2;
const parentReferenceId: number = 1;
(async () => {
const {data, res} = await inventoryService.childDevicesRemove(childRef, parentReferenceId);
})();
Response wrapped in [[IResult]]
Gets total count of managed objects filtered by parameters.
Object containing filters for querying managed objects.
Example
const filter: object = {
type: 'c8y_MQTTDevice'
};
(async () => {
const {data, res} = await inventoryService.count(filter);
})();
Response wrapped in [[IResultList]]
Creates a new managed object.
Response wrapped in [[IResult]]
Example
const partialManagedObj: Partial<IManagedObject> = {
customFragment: 'yourData'
};
(async () => {
const {data, res} = await inventoryService.create(partialManagedObj);
})();
Removes managed object with given id.
ManagedObject or Id of the ManagedObject.
Additional query params.
Example
const managedObjectId: number = 1;
const params: any = {
cascade: true
}
(async () => {
const {data, res} = await inventoryService.delete(managedObjectId, params);
})();
Response wrapped in [[IResult]]
Gets the details of managed object
ManagedObject or Id of the ManagedObject.
Filter object.
Response wrapped in [[IResult]]
Example
const managedObjId: number = 1;
const filter = { withChildren: false };
(async () => {
const {data, res} = await inventoryService.detail(managedObjId, filter);
})();
Gets an array of measurement series and fragments supported by the specified managedObject.
array of supported measurement series and fragments
Gets an array of measurement fragments supported by the specified managedObject. e.g. ["c8y_Temperature", "c8y_Humidity"]
array of supported measurement fragments
Gets an array of measurement series supported by the specified managedObject. e.g. ["c8y_Temperature.T", "c8y_Humidity.H"]
array of supported measurement series
Gets the list of managed objects filtered by parameters.
Object containing filters for querying managed objects.
Example
const filter: object = {
pageSize: 100,
withTotalPages: true
};
(async () => {
const {data, res, paging} = await inventoryService.list(filter);
})();
Response wrapped in [[IResultList]]
Gets the list of all managed objects filtered and sorted by given query.
Object containing filters for querying managed objects.
Example
const filter: object = {
pageSize: 100,
withTotalPages: true
};
const query = {
name: 'MY-NAM*'
}
(async () => {
const {data, res, paging} = await inventoryService.listQuery(query, filter);
})();
Response wrapped in [[IResultList]]
Gets the list of all devices filtered and sorted by given query.
Object containing filters for querying devices.
Example
const filter: object = {
pageSize: 100,
withTotalPages: true
};
const query = {
name: 'MY-NAM*'
}
(async () => {
const {data, res, paging} = await inventoryService.listQueryDevices(query, filter);
})();
Response wrapped in [[IResultList]]
Updates managed object data.
Managed object is partially updatable.
Response wrapped in [[IResult]]
Example
const partialUpdateObject: Partial<IManagedObject> = {
customFragment: 'Changed data',
name: 'Name'
};
(async () => {
const {data, res} = await inventoryService.update(partialUpdateObject);
})();
This class allows for managing managed objects and different child types, see [[ChildType]].