Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding BootOptionReference as a mandatory parameter #1221

Merged
13 changes: 13 additions & 0 deletions svc-systems/systems/getresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,19 @@ func (p *PluginContact) GetSystemResource(ctx context.Context, req *systemsproto
return resp

}
// Adding the mandatory parameter 'BootOptionReference' as null if there is no such key present in response
// for  URI   :  /redfish/v1/Systems<systemID>/BootOptions/<BootOptionID>
urlInfo := req.URL
res := strings.Split(urlInfo, "/")
//
if res[5] == "BootOptions" && len(res) == 7 {
_, ok := resource["BootOptionReference"]
if !ok {
resource["BootOptionReference"] = "null"
}

}

resp.Body = resource
resp.StatusCode = http.StatusOK
resp.StatusMessage = response.Success
Expand Down