HPE OneView
1819974 Members
3456 Online
109607 Solutions
New Discussion

getting firmware with a filter

 
BradV
Esteemed Contributor

getting firmware with a filter

I can retrieve the entire firmware list with the REST API, but wanted to try to apply some filters.  That is not working.  I'm getting back:

400 Bad Request
Your browser sent a request that this server could not understand.

Additionaly, a 400 Bad Reqest
error was encountered while trying ot use an ErrorDocument to handle the request.

I'm following the document API reference.  Here are two attempts (Note: currentVersion is set to 1200; sessionID is set to my current session ID; and OneView is set to https://server.fqdn

Retrieve firmware for DL380 Gen10s:

MODEL="ProLiant DL380 Gen10"
curl --insecure \
   --header "X-API-Version: ${currentVersion}" \
   --header "auth: ${sessionID}" \
   --request GET ${OneView}/rest/server-hardware/*/firmware?filter=serverModel="${MODEL}"

 Retrieve BIOS firmware information:

BIOS="System ROM"
curl --insecure \
   --header "X-API-Version: ${currentVersion}" \
   --header "auth: ${sessionID}" \
   --request GET ${OneView}/rest/server-hardware/*/firmware?filter=components.componentName="${BIOS}"

I then want to combine those to just get the BIOS version for DL380s, for example.  Can anyone point out what I am doing wrong?

4 REPLIES 4
ChrisLynch
HPE Pro

Re: getting firmware with a filter

I don't think the Filter option works here.  You will find that in the Common Parameters section of the API documentation states that not all endpoints implement either Filter, Query or UserQuery.  I'll dig into this a bit more and reply back to the thread.

I work at HPE
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
BradV
Esteemed Contributor

Re: getting firmware with a filter

Hi Chris,

The documentation seems to imply that it does?  We are running version 5.30.  In the API Reference -> Servers -> Server Hardware -> GET /rest/server-hardware/*/firmware the first example shows using filters.  Am I miss-reading it, or is there an error in the documentation?

BradV
Esteemed Contributor

Re: getting firmware with a filter

Hi Chris,

Did you ever find an answer to this?  I get back:

400 Bad Request
Your browser sent a request that tis server could not understand.
Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the request.

but the 5.3 REST API documentation specifically states that one should be able to filter based on serverModel. 

ChrisLynch
HPE Pro

Re: getting firmware with a filter

I had no issues using the URI.  This is NOT a URL that you can access from a web browser.  It is a REST API URI.

I work at HPE
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo