Server Automation Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

findDeviceGroupRefs filter method

Trusted Contributor

findDeviceGroupRefs filter method

I am trying to do the below in a bash shell script.

 

deviceGroupShortName=$1

deviceGroupShortNameIDs=`./.findDeviceGroupRefs:i filter='{ DeviceGroupVO.shortName = $deviceGroupShortName }' | cut -d ":" -f2 | tr "\n\r" " "`

It doesn't recognize the $deviceGroupShortName variable.

 

If I had code the value it works.  Is there a workaround for this?

 

Thanks,

Don

 

3 REPLIES
HPE Expert

Re: findDeviceGroupRefs filter method

Hi Don,

I tried looking in latest dev reference guide and at the moment could not find anything useful. Can you please let me know the purpose of the script and in which SA version are you working with?

And how exactly are you coding the value so this can work.

Thanks!


Ed Molina
HP Cloud Solution Support Engineer

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution. Also, if you liked this post please consider providing Kudos on the left side.
Highlighted
Trusted Contributor

Re: findDeviceGroupRefs filter method

Eduardo,

 

We are running version 9.14 on Linux.

 

You can create a real simple bash script.

 

#!/bin//bash

 

deviceGroupShortName=$1

deviceGroupShortNameIDs=`./.findDeviceGroupRefs:i filter='{ DeviceGroupVO.shortName = $deviceGroupShortName }' | cut -d ":" -f2 | tr "\n\r" " "`

 

Save the script and chmod 755.  When you run the script just pass into it a short name of a device group in "".

./don.ksh "Test Device Group"

 

Let me know if you have any more questions.

 

Thanks,

Don

 

Trusted Contributor

Re: findDeviceGroupRefs filter method

Eduardo,

The purpose is to find all device groups that have the name passed into the script.

Thanks,
Don