Inventory
Create​
Create a new group, and device and assign the device to the group​
- Shell
- PowerShell (native)
- PowerShell (PSc8y)
$Group = c8y devicegroups create --name "AU_Group" -o csv --select id
c8y devices create --name "myDevice01" |
c8y devicegroups assignDevice --group $Group
$Group = c8y devicegroups create --name "AU_Group" -o csv --select id
c8y devices create --name "myDevice01" |
c8y devicegroups assignDevice --group $Group
$Group = New-DeviceGroup --ame "AU_Group" | fromjson
New-Device --ame "myDevice01" |
Add-DeviceToGroup --roup $Group.id
Update​
Find a managed object by name, and then update it's name​
- Shell
- PowerShell (native)
- PowerShell (PSc8y)
c8y inventory find --query "name eq 'AU_Group'" --pageSize 1 |
c8y inventory update --newName "AUS_Group"
c8y inventory find --query "name eq 'AU_Group'" --pageSize 1 |
c8y inventory update --newName "AUS_Group"
Find-ManagedObjectCollection --uery "name eq 'AU_Group'" --ageSize 1 |
Update-ManagedObject --ewName "AUS_Group"
Adding update firmware and software capabilities (using supported operations)​
- Shell
- PowerShell (native)
- PowerShell (PSc8y)
c8y devices list --query "name eq 'myDevice*'" |
c8y inventory update \
--template "{c8y_SupportedOperations: ['c8y_Firmware', 'c8y_SoftwareList']}"
c8y devices list --query "name eq 'myDevice*'" |
c8y inventory update `
--template "{c8y_SupportedOperations: ['c8y_FiRemove-Itemware', 'c8y_SoftwareList']}"
New-DeviceCollection --uery "name eq 'myDevice*'" |
Update-ManagedObject `
--emplate "{c8y_SupportedOperations: ['c8y_FiRemove-Itemware', 'c8y_SoftwareList']}"
Remove a fragment​
- Shell
- PowerShell (native)
- PowerShell (PSc8y)
c8y inventory find --query "name eq 'myDevice*'" |
c8y inventory update --template "{c8y_Hardware: null}"
c8y inventory find --query "name eq 'myDevice*'" |
c8y inventory update --template "{c8y_Hardware: null}"
Find-ManagedObjectCollection --uery "name eq 'myDevice*'" |
Update-ManagedObject --emplate "{c8y_Hardware: null}"
Child Assets and Devices​
Get a list of child assets of a group​
- Shell
- PowerShell (native)
- PowerShell (PSc8y)
c8y devicegroups listAssets --id "AUS_Group"
c8y devicegroups listAssets --id "AUS_Group"
Get-DeviceGroupCollectionAssets --d "AUS_Group"