HPE OneView
1752637 Members
5910 Online
108788 Solutions
New Discussion

Re: Add a license has changed?

 
SOLVED
Go to solution
BradV
Esteemed Contributor

Add a license has changed?

Just installed a new OneView 6.10 appliance.  Was trying to upload the licenses, but the API must have changed?  I had used previously:

for FIL in HPE_OneView_Sof_*.txt; do
   KEY=$(/bin/sed -e 's|^\(.*\) ".*"$|\1' ${FIL})
   LIC='"key": "'${KEY}'"'
   curl --insecure \
      --header "content-type: application/json" \
      --header "X-API-Version: ${currentVersion}" \
      --header "auth: ${sessionID}" \
      --data '{ '"${LIC}"',"type":"LicenseV500" }' \
      --request POST ${OneView}/rest/licenses | jq -r '.'
done

That is giving me Invalid license key format.  The key is a series of four characters.  Any ideas what is wrong?

4 REPLIES 4
ChrisLynch
HPE Pro
Solution

Re: Add a license has changed?

The REST API has not changed for licenses.  What has changed in some cases is the generated license file can be in an XML format.  Are you sure you have examined the license key format on your input?


I am an HPE employee

Accept or Kudo

BradV
Esteemed Contributor

Re: Add a license has changed?

I think I was just to eager.  After I tried to add the licenses, I realized I was using the licenses from our other OneView.  Our sales manager is still generating the licenses for this one.  Hopefully when he provides them, it will go smoothly. 

bradawk1
Trusted Contributor

Re: Add a license has changed?

Finally got this to work:

KEY="$(cat HPE_OneView_Sof_33274666.txt | sed -e 's|\"|\\"|g')"
LIC='"key":"'${KEY}'"'
DATA='{'${LIC}',"type":"LicenseV500"}'
curl --insecure --silent --header "content-type: application/json" --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" --data '${DATA}" --request POST ${OneView}/rest/licenses | jq -r '.'

will get a JSON output.  the "state" key should have value"Added" if successful.

Sunitha_Mod
Moderator

Re: Add a license has changed?

Hello @bradawk1,

That's awesome! 

We are extremely glad to know you were able to find the solution and thank you for keeping us informed. 

Thanks,
Sunitha G
I'm an HPE employee.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo