ProLiant Servers (ML,DL,SL)
1826373 Members
4132 Online
109692 Solutions
New Discussion

iLO Redfish API get PCIe empty slots

 
BradV
Esteemed Contributor

iLO Redfish API get PCIe empty slots

I have some racks of DL380 and DL560 G10 servers.  I need to figure out if any PCIe slots are open on each server.  I believe a query like:

# Get PCIe Devices
SERVER=<server name>
ACTV=$(python -c "import urllib, sys; print urllib.quote(sys.argv[1])" "filter=\"'name' = '${SERVER}'\"')
UUID=$(curl --silent --insecure --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" --request GET ${OneView}/rest/server-hardware?${ACTV} | jq -r '.members[] | .uuid')
read iLOSSO iLOAuth <<< $(curl --silent --insecure --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" --request GET ${OneView}/rest/server-hardware/${UUID}/remoteConsoleUrl | \
   jq -r '.remoteConsoleUrl' | sed -e 's|hplocons|https|' -e 's|addr=||' -e 's|^\(.*\)&sessionkey=\(.*\)$|\1 \2|')
curl --silent --insecure --header "X-Auth-Token: ${iLOAuth}" --request GET ${iLOSSO}/redfish/v1/Chassis/1/PCIeDevices | jq -r '.'

is only going to list the actual devices.  Does anyone know if there is a way to query the status of each slot?

3 REPLIES 3
TVVJ
HPE Pro

Re: iLO Redfish API get PCIe empty slots

Hello,

You may refer to documents "Managing Hewlett Packard Enterprise Servers Using the RESTful API", and "RESTful Interface Tool 1.50 User Guide" for further reference.

Regards,



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[All opinions expressed here are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
BradV
Esteemed Contributor

Re: iLO Redfish API get PCIe empty slots

Neither one of those help to answer my question.

BPSingh
HPE Pro

Re: iLO Redfish API get PCIe empty slots

Greetings!

Please check with below:

/redfish/v1/Chassis/1/PCIeSlots
 
This should return "Enabled" for the occupied slot, and empty slots should return as "Absent".



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo