DMTF / Redfishtool

A Python34 program that implements a command line tool for accessing the Redfish API.
Other
224 stars 68 forks source link

how do we send multipart/form-data and file information via redfishtool.py ? #84

Open mungayree opened 4 years ago

mungayree commented 4 years ago

via redfishtool.py, I would like to send content-type as multipart/form-data and file information. I have this command via CURL, but how can we send this via redfishtool.py ?

time curl -k -u Administrator:superuser -X POST -H 'content-type: multipart/form-data' -F 
image_file=@$(pwd)/afile-v130.tgz 
https://<IP>/redfish/v1/UpdateService/Actions/Oem/UpdateService.FwUpldBundle
mraineri commented 4 years ago

Currently that's not really possible. We could accommodate having the tool send a multipart request for something like an operation to the UpdateService when trying to perform an update, but all raw types of requests in the tool currently expect JSON encoding.

mungayree commented 4 years ago

Thanks Mike. CURL supports a -F option, Can the -F option to redfishtool.py support this similar way ? Some OpenBMC implementations doing redfish can take advantage of this for doing vendor firmware/software updates.

On Fri, Jun 26, 2020 at 6:23 AM Mike Raineri notifications@github.com wrote:

Currently that's not really possible. We could accommodate having the tool send a multipart request for something like an operation to the UpdateService when trying to perform an update, but all raw types of requests in the tool currently expect JSON encoding.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DMTF/Redfishtool/issues/84#issuecomment-650176690, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUKBFRW6GBAD7DVPGJQT73RYSOOLANCNFSM4OGCPUAQ .

rosedahl commented 4 years ago

Short Term