HPE OneView
1753537 Members
5134 Online
108795 Solutions
New Discussion

Re: Is this possible?

 
BradV
Esteemed Contributor

Re: Is this possible?

Hi Chris,

That was my main reason for putting the data in a variable.  I did 

echo "${DATA}" | jq -r '.'

and it came out with no errors.   

BradV
Esteemed Contributor

Re: Is this possible?

Hi Chris, I just added a little over 70 DL380s and DL560s to OneView using the rest API.  That worked.  I then tried to create a server profile template for the DL560s at that location.  Put all of the data in a variable.  Echo'd that to jq and did not get any errors.  Uploaded with: 

curl --insecure \
     --header "content-type: application/json" \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --data "${DATA}" \
     --request POST ${OneView}/rest/server-profile-templates | jq -r '.'

Did not get any errors, but did not get any output.  Checked through the gui and no new server profile template was created.  Aren't I supposed to get a task uri returned?

BradV
Esteemed Contributor

Re: Is this possible?

Does anyone have a clue why I am not getting any output?  No error message or success message.  I think I should get one or the other?

BradV
Esteemed Contributor

Re: Is this possible?

Still not working.  Not getting output.  No success nor error message.

ChrisLynch
HPE Pro

Re: Is this possible?

Async task success is noted by an HTTP 202 response code, and with a Location HTTP header.  Take a look at this StackExchange thread on getting the HTTP resonse code back from cURL.


I am an HPE employee

Accept or Kudo

BradV
Esteemed Contributor

Re: Is this possible?

Thanks Chris!  That helped.  Adding '--include' to the curl command got me back the task uri.  For this particular attempt, I am getting back: "Argument \"directoryServerAddress\" is below the minimum bound of 1 for iLO setting \"Manage directory configuration\"."  I'll have to figure out what I am doing wrong there.