func (i *IDrac9) purgeJob(jobID string) (err error) {
	if !strings.Contains(jobID, "JID") {
		return errors.New("Invalid Job ID given, Job IDs should be prefixed with JID_")
	}
	endpoint := fmt.Sprintf("%s/%s", "redfish/v1/Managers/iDRAC.Embedded.1/Jobs", jobID)
	statusCode, _, err := i.queryRedfish("DELETE", endpoint, nil)
	if err != nil || statusCode != 200 {
		msg := fmt.Sprintf("DELETE request to purge job, returned code: %d", statusCode)
		return errors.New(msg)
	}
	return err
}
Given a Job ID, purge it from the job queue
package idrac9
import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/http/httputil"
	"net/url"
	"reflect"
	"strings"
	bmclibErrors "github.com/bmc-toolbox/bmclib/errors"
	"github.com/pkg/errors"
)
func diffBiosSettings(new *BiosSettings, current *BiosSettings) (diff *BiosSettings, err error) {
	diff = &BiosSettings{}
	struct1V := reflect.ValueOf(new).Elem()
	struct2V := reflect.ValueOf(current).Elem()
	diffV := reflect.ValueOf(diff).Elem()
	typeOfStruct := struct1V.Type()
	for i := 0; i < struct1V.NumField(); i++ {
		struct1fieldValue, ok := struct1V.Field(i).Interface().(string)
		if !ok {
			return diff, fmt.Errorf("BiosSettings struct field expected to be of type string: %v",
				typeOfStruct.Field(i).Name)
		}
		struct2fieldValue := struct2V.Field(i).Interface().(string)
		if !ok {
			return diff, fmt.Errorf("BiosSettings struct field expected to be of type string: %v",
				typeOfStruct.Field(i).Name)
		}
		if struct1fieldValue != struct2fieldValue {
			diffV.Field(i).Set(struct1V.Field(i))
		}
	}
	return diff, err
}
func (i *IDrac9) getBiosSettings() (biosSettings *BiosSettings, err error) {
	endpoint := "redfish/v1/Systems/System.Embedded.1/Bios"
	oData := Odata{}
	_, response, err := i.queryRedfish("GET", endpoint, nil)
	if err != nil {
		return biosSettings, err
	}
	err = json.Unmarshal(response, &oData)
	if err != nil {
		return biosSettings, err
	}
	return oData.Attributes, err
}
func (i *IDrac9) setBiosSettings(biosSettings *BiosSettings) (err error) {
	biosSettingsURI := "redfish/v1/Systems/System.Embedded.1/Bios/Settings"
	idracPayload := make(map[string]*BiosSettings)
	idracPayload["Attributes"] = biosSettings
	payload, err := json.Marshal(idracPayload)
	if err != nil {
		msg := fmt.Sprintf("Error marshalling biosAttributes payload: %s", err)
		return errors.New(msg)
	}
	statusCode, _, err := i.queryRedfish("PATCH", biosSettingsURI, payload)
	if err != nil || statusCode != 200 {
		msg := fmt.Sprintf("PATCH request to set Bios config, returned code: %d", statusCode)
		return errors.New(msg)
	}
	return i.queueJobs(biosSettingsURI)
}
func (i *IDrac9) queueJobs(jobURI string) (err error) {
	endpoint := "redfish/v1/Managers/iDRAC.Embedded.1/Jobs"
	if !strings.HasPrefix(jobURI, "/") {
		jobURI = fmt.Sprintf("/%s", jobURI)
	}
	targetSetting := TargetSettingsURI{
		TargetSettingsURI: jobURI,
	}
	payload, err := json.Marshal(targetSetting)
	if err != nil {
		msg := fmt.Sprintf("Error marshalling job queue payload for uri: %s, error: %s", jobURI, err)
		return errors.New(msg)
	}
	statusCode, _, err := i.queryRedfish("POST", endpoint, payload)
	if err != nil || statusCode != 200 {
		msg := fmt.Sprintf("POST request to queue job, returned code: %d", statusCode)
		return errors.New(msg)
	}
	return err
}