Skip to main content

Inventory

Create​

Create a new group, and device and assign the device to the group​

$Group = c8y devicegroups create --name "AU_Group" -o csv --select id
c8y devices create --name "myDevice01" |
c8y devicegroups assignDevice --group $Group

Update​

Find a managed object by name, and then update it's name​

c8y inventory find --query "name eq 'AU_Group'" --pageSize 1 |
c8y inventory update --newName "AUS_Group"

Adding update firmware and software capabilities (using supported operations)​

c8y devices list --query "name eq 'myDevice*'" |
c8y inventory update \
--template "{c8y_SupportedOperations: ['c8y_Firmware', 'c8y_SoftwareList']}"

Remove a fragment​

c8y inventory find --query "name eq 'myDevice*'" |
c8y inventory update --template "{c8y_Hardware: null}"

Child Assets and Devices​

Get a list of child assets of a group​

c8y devicegroups listAssets --id "AUS_Group"