Modify firmware updating function with HTTP

This commit is contained in:
David J. Allen 2023-10-03 10:17:46 -06:00
parent 372f68e2ff
commit 10ba18ade4

View file

@ -730,12 +730,12 @@ func UpdateFirmware(client bmclib.Client, l log.Logger, q *QueryParams) error {
return nil return nil
} }
func UpdateFirmwareRemote(imageURI string, q *QueryParams) error { func UpdateFirmwareV2(serverIP string, imageURI string, component string, q *QueryParams) error {
url := baseUrl(q) + "UpdateService/Actions/SimpleUpdate" url := baseUrl(q) + "UpdateService/Actions/SimpleUpdate"
b := map[string]any{ b := map[string]any{
"UpdateComponent": "BMC", "UpdateComponent": component, // BMC, BIOS
"TransferProtocol": "HTTP", "TransferProtocol": "HTTP",
"ImageURI": imageURI, "ImageURI": "http://" + serverIP + "/" + imageURI,
} }
data, err := json.Marshal(b) data, err := json.Marshal(b)
if err != nil { if err != nil {