HPE OneView

checking firmware compliance with REST API

 
SOLVED
Go to solution
BradV
Respected Contributor

checking firmware compliance with REST API

The REST API for checking firmware compliance says to supply: 

{
   "firmwareBaselineId": "SPP2017101_2017_1027_10",
   "serverUUID": "36343537-3338-4E43-3735-31373034308"
}

I'm just not sure what it means by firmwareBaseLineId?  I know I can retrieve the current SPP bundles loaded to OneView with: 

curl --insecure \
     --header "auth: ${sessionID}" \
     --header "X-API-Version: ${currentVersion}" \
     --output firmware \
     --request GET ${OneView}/rest/firmware-drivers

and if I look at the output of that, I do not see firmwareBaselineId anywhere.  Is this possibly just the leaf part of the URI?

1 REPLY 1
BradV
Respected Contributor
Solution

Re: checking firmware compliance with REST API

OK, ran some tests and confirmed it is the basename of the bundle uri.  This is my process:

Get session credentials.  Store those in some variables.

Download the current SPP bundle listing.

Download a list of hardware from OneView.

# Get the  SPP basename:
SPP=\"$(/usr/bin/basename $(jq '.members[] | .uri' firmware-bundles))
SERVER=my-server-ilo
UUID=$(jq -r .members[] | select(.name == "'${SERVER}'") | "\(.uuid)"' ${HARDW})
DATA='{"firmwareBaselineId":'${SPP}',"serverUUID":"'${UUID}'"}'
# Make sure there aren't any errors in the data:
echo ${DATA} | jq -r '.'
curl --insecure \
      --header "content-type: aplication/json" \
      --header "auth: ${sessionID}" \
      --header "X-API-Version: ${currentVersion}" \
      --data "${DATA}" \
      --request POST ${OneView}/rest/server-hardware/firmware-compliance | jq -r '.'