Forum Discussion
mnagel
2 years agoProfessor
Sorry, one more point -- I was checking our backup script and we don’t actually use /properties there except for grouping results (/properties gives you all properties in a list, so it is appropriate if you don’t know where to look for an input property name). Within device results, there are keys to arrays for systemProperties, customProperties, autoProperties inheritedProperties. So you just have to get the device (possibly filtered by one property/value pair) and then extract what you need from those lists, like so:
sub getprop {
my $properties = shift;
my $name = shift;
my $pval = (map { $_->{value} } grep { $_->{name} eq $name } @{$properties})[0];
return $pval;
}
So for system.groups, that would be getprop($device->{systemProperties}, ‘system.groups’).