- Community Home
- >
- Software
- >
- HPE OneView
- >
- Uploading SPP
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019 05:56 AM
06-12-2019 05:56 AM
Trying to upload the latest SPP to OneView using the REST API:
ISO=spp-2019.03.0-SPP2019030.2019_0206.85.iso
curl --insecure \
--max-time 1200 \
--header "accept: application/json" \
--header "X-API-Version: ${currentVersion}" \
--header "auth: ${sessionID}" \
--header "uploadfilename:${ISO}" \
--form "file=\"@/var/tmp/${ISO}\"" \
--request POST ${OneView}/rest/firmware-bundles | jq -r '.'
It is failing and I'm getting back:
{
"data": {},
"nestedErrors": [],
"erroSource": null,
"recommendedActions": [],
"details": null,
"message": "Parsed multipart servlet request file is empty; nested exception is com.hp.ci.mgmt.fwdrivers.exceptions.FileUploadException: Emtpy file was found in the request.",
"errorCode": null
}
Anyone have an idea what I am doing wrong? I don't have any scopes defined. So, did not include the scopeuri header.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019 07:20 AM
06-12-2019 07:20 AM
Re: Uploading SPP
The form attribute name is called filename, not file.
I am an HPE employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019 08:21 AM
06-12-2019 08:21 AM
Re: Uploading SPP
Hi Chris,
Then the REST API reference needs updated. At least my version shows: '-F file="@/var/tmp/.." I did change to filename instead of file, but got back the same error. I tried including the initialScopeUris header as just blank thinking maybe that was required, but still same error. I do see the words, "a form with the Content-Type multipart/form-data and submit action as https://{app1}/rest/firmware-bundles." So, I added:
--header "content-type: multipart/form-data" \
to the call, but still did not work. None of the examples show that option however.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2019 09:34 AM - edited 06-12-2019 09:35 AM
06-12-2019 09:34 AM - edited 06-12-2019 09:35 AM
Re: Uploading SPP
This is straight from the REST API Documentation for POST /rest/firmware-bundles:
And sorry, the form attribute you have is correct. I was looking at another part of my code for the PowerShell library, which does the exact same thing you are trying to do, and has not changed in a long time.
I am an HPE employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 05:15 AM
06-13-2019 05:15 AM
Re: Uploading SPP
Hi Chris,
Yes, that is exactly what I saw. In the examples, they don't show an api version header, nor do they show anything about a content-type header. In the last bullet above that section, it talks about a content-type multipart/form-data. So, should that header also be included? I used the long form of switches. -m is the same as --max-time. -k is the same as --insecure. -X is the same as --request. -H is the same as --header. -F is the same as --form. I also don't have any scopes defined. Is the header intialscopeuris mandatory, or optional? Are you sure the form parameter for the file name is "file?" Just want to make sure it's not something like that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 05:32 AM
06-13-2019 05:32 AM
Re: Uploading SPP
Also, I don't see in the api reference firmware bundles section anything about retrieving a list of currently uploaded bundles nor deleting a currently uploaded bundle. Are those functions available, but just not documented?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2019 03:38 AM
07-02-2019 03:38 AM
SolutionFinally got back to this and got it working. I had to many quotes in the form line. This code is working:
# Upload SPP:
DIR=/var/tmp
ISO=spp-2019.03.0-SPP2019030.2019_0206.85.iso
curl --insecure \
--max-time 1200 \
--header "accept: application/json" \
--header "auth: ${sessionID}" \
--header "X-API-Version: ${currentVersion}" \
--header "content-type: multipart/form-data" \
--header "uploadfilename:${ISO}" \
--form file="@${DIR}/${ISO}" \
--request POST ${OneView}/rest/firmware-bundles | jq -r '.'
So, now just need to see if there is an API for getting the current list of uploaded bundles and how to delete an uploaded bundle. I don't see those in the API reference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2019 09:35 AM
07-02-2019 09:35 AM
Re: Uploading SPP
@BradV wrote:Finally got back to this and got it working. I had to many quotes in the form line. This code is working:
So, now just need to see if there is an API for getting the current list of uploaded bundles and how to delete an uploaded bundle. I don't see those in the API reference.
GET /rest/firmware-drivers and DELETE /rest/firmware-drivers/{GUID} are the two API's that are documented to perform the operations you want to do.
I am an HPE employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 04:34 AM - edited 07-03-2019 04:40 AM
07-03-2019 04:34 AM - edited 07-03-2019 04:40 AM
Re: Uploading SPP
Hi Chris,
Thanks! I see it was the next group in the API reference.
# To check existing firmware bundles, run:
curl --insecure \
--header "auth: ${sessionID}" \
--header "X-API-Version: ${currentVersion}" \
--output firmware \
--request GET ${OneView}/rest/firmware-drivers
#
# Then to see a summary of the information, run:
cat firmware | jq '.members[] | {baselineShortName,bundleType,hpsumVersion,isoFileName,releaseDate,resourceState,status,type,uri,uuid,version}'
To delete, I should use the value returned with 'uri,' correct? For example,
URI=/rest/firmware-drivers/SPP_Gen9_10_11
curl --insecure \
--header "auth: ${sessionID}" \
--header "X-API-Version: ${currentVersion}" \
--header "content-type: application/json" \
--include \
--request DELETE ${OneView}${URI}
Does that look correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 09:41 AM
07-03-2019 09:41 AM
Re: Uploading SPP
Correct.
I am an HPE employee