Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d8e2887
fix(chassis): gracefully handle missing NetworkAdapters link (#437)
T-jegou Jun 24, 2025
806589a
Initialize TLSClientConfig when using default transport (#438)
stmcginnis Jun 28, 2025
3fc8506
handle etag properly on CreateAccount call (#439)
joeyberkovitz Jul 11, 2025
d85d805
Complete support for Thermal.v1_7_1 schema (#440)
Muyk33rus Jul 23, 2025
47c0f30
Allow non standard transports to reuse connections. (#441)
thespags Jul 23, 2025
237d79c
Handle empty arrays for PCIeInterfaces (#443)
thespags Jul 23, 2025
7ddc0c2
adaptation to the specification https://redfish.dmtf.org/schemas/v1/P…
Muyk33rus Jul 24, 2025
792ab60
Refactor Update method to reduce boilerplate (#446)
stmcginnis Jul 24, 2025
aa074ce
adaptation to the specification https://redfish.dmtf.org/schemas/v1/…
Muyk33rus Jul 28, 2025
ce21816
Update PartLocation to handle string int (#448)
thespags Jul 29, 2025
c58ad0a
UP to VirtualMedia.v1_6_5.json (#449)
Muyk33rus Aug 6, 2025
4fef0ea
add WithContext function to client (#452)
joeyberkovitz Aug 7, 2025
05c5402
Bump actions/checkout from 4 to 5 (#454)
dependabot[bot] Aug 12, 2025
fbed909
Add support for ActionInfo to common and redfish.VirtualMedia (#423)
mmlb Aug 13, 2025
f8db73c
Add AllowableBootSourceOverrideTargetValues + AllowableUefiTargetBoot…
ungureanuvladvictor Aug 26, 2025
f982f94
Bump actions/setup-go from 5 to 6 (#457)
dependabot[bot] Sep 8, 2025
2f27adc
Return Task if available for SPDMGetSignedMeasurements (#458)
dukovac Sep 10, 2025
b69ab2a
Add Reset action to the PowerSupply type (#460)
smiller248 Sep 17, 2025
45ef8c6
Add RawData to PowerSubsystem type (#461)
smiller248 Sep 18, 2025
1c582c4
feat(powersupplyunit): add a RawData() function
bbrown-cw Apr 16, 2025
2e5d56e
temp fix: use 'any' type for RackOffset field
bbrown-cw Jul 23, 2025
4bc792d
add raw data to power distribution metrics (#12)
joeyberkovitz Aug 1, 2025
d0527ea
Merge branch 'main' into rebase-9-18
bbrown-cw Sep 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

# Setup our go environment
- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: '1.21'

Expand All @@ -37,7 +37,7 @@ jobs:

# Setup our go environment
- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: '1.21'

Expand Down
17 changes: 13 additions & 4 deletions redfish/componentintegrity.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package redfish

import (
"encoding/json"
"net/http"

"github.com/stmcginnis/gofish/common"
)
Expand Down Expand Up @@ -324,21 +325,29 @@ func (spdmgetsignedmeasurementsresponse *SPDMGetSignedMeasurementsResponse) setC
}

// SPDMGetSignedMeasurements generates an SPDM cryptographic signed statement over the given nonce and measurements of the SPDM Responder.
func (componentintegrity *ComponentIntegrity) SPDMGetSignedMeasurements(request *SPDMGetSignedMeasurementsRequest) (*SPDMGetSignedMeasurementsResponse, error) {
func (componentintegrity *ComponentIntegrity) SPDMGetSignedMeasurements(request *SPDMGetSignedMeasurementsRequest) (*SPDMGetSignedMeasurementsResponse, *Task, error) {
resp, err := componentintegrity.PostWithResponse(componentintegrity.spdmGetSignedMeasurementsTarget, request)
if err != nil {
return nil, err
return nil, nil, err
}
defer resp.Body.Close()

// Return Task if applicable
if resp.StatusCode == http.StatusAccepted {
if location := resp.Header["Location"]; len(location) > 0 {
task, err := GetTask(componentintegrity.GetClient(), location[0])
return nil, task, err
}
}

var response SPDMGetSignedMeasurementsResponse
err = json.NewDecoder(resp.Body).Decode(&response)
if err != nil {
return nil, err
return nil, nil, err
}

response.setClient(componentintegrity.GetClient())
return &response, nil
return &response, nil, nil
}

// TPMGetSignedMeasurements generates a TPM cryptographic signed statement over the given nonce and PCRs of the TPM for TPM 2.0 devices.
Expand Down
6 changes: 4 additions & 2 deletions redfish/computersystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,8 @@ type Boot struct {
// boot from the UEFI BootOptionReference found in BootNext. Changes to
// this property do not alter the BIOS persistent boot order
// configuration.
BootSourceOverrideTarget BootSourceOverrideTarget `json:",omitempty"`
BootSourceOverrideTarget BootSourceOverrideTarget `json:",omitempty"`
AllowableBootSourceOverrideTargetValues []BootSourceOverrideTarget `json:"[email protected],omitempty"`
// The link to a collection of certificates used for booting through HTTPS by this computer system.
certificates string
// The URI to boot from when BootSourceOverrideTarget is set to UefiHttp.
Expand All @@ -531,7 +532,8 @@ type Boot struct {
// for UEFI Boot Source Override as this setting is defined in UEFI as a
// one time boot only. Changes to this property do not alter the BIOS
// persistent boot order configuration.
UefiTargetBootSourceOverride string `json:",omitempty"`
UefiTargetBootSourceOverride string `json:",omitempty"`
AllowableUefiTargetBootSourceOverrideValues []string `json:"[email protected],omitempty"`
}

// UnmarshalJSON unmarshals a Boot object from the raw JSON.
Expand Down
10 changes: 10 additions & 0 deletions redfish/computersystem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ var computerSystemBody = `{
"Boot0002"
],
"UefiTargetBootSourceOverride": "uefi device path",
"[email protected]": [
"UsbClass(0xFFFF,0xFFFF,0xFF,0xFF,0xFF)",
"PciRoot(0x1)/Pci(0x1,0x0)/Pci(0x0,0x3)/MAC(00CDE21FAC3D,0x1)/IPv4(0.0.0.0)"
],
"HttpBootUri": "http://localhost/boot.efi"
},
"BiosVersion": "P79 v1.00 (09/20/2013)",
Expand Down Expand Up @@ -325,6 +329,12 @@ func TestComputerSystem(t *testing.T) { //nolint
if result.operatingSystem != "/redfish/v1/Systems/1/OperatingSystem" {
t.Errorf("Received invalid OperatingSystem reference: %s", result.operatingSystem)
}
if result.Boot.AllowableBootSourceOverrideTargetValues[0] != NoneBootSourceOverrideTarget {
t.Errorf("Received invalid AllowablebootSourceOverrideTargetValue: %s", result.Boot.AllowableBootSourceOverrideTargetValues[0])
}
if result.Boot.AllowableUefiTargetBootSourceOverrideValues[0] != "UsbClass(0xFFFF,0xFFFF,0xFF,0xFF,0xFF)" {
t.Errorf("Received invalid AllowableUefiTargetBootSourceOverrideValues: %s", result.Boot.AllowableUefiTargetBootSourceOverrideValues[0])
}
}

// TestComputerSystemUpdate tests the Update call.
Expand Down
23 changes: 23 additions & 0 deletions redfish/power.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package redfish

import (
"encoding/json"
"errors"
"fmt"
"strconv"

Expand Down Expand Up @@ -383,17 +384,23 @@ type PowerSupply struct {
rawData []byte
redundancyLinks []string
relateditemLinks []string

resetTarget string
}

// UnmarshalJSON unmarshals a PowerSupply object from the raw JSON.
func (powersupply *PowerSupply) UnmarshalJSON(b []byte) error {
type ps PowerSupply
type actions struct {
Reset common.ActionTarget `json:"#PowerSupply.Reset"`
}
var t struct {
ps
Assembly common.Link `json:"Assembly"`
Metrics common.Link `json:"Metrics"`
Redundancy common.Links `json:"Redundancy"`
RelatedItem common.Links `json:"RelatedItem"`
Actions actions
}

err := json.Unmarshal(b, &t)
Expand All @@ -407,6 +414,7 @@ func (powersupply *PowerSupply) UnmarshalJSON(b []byte) error {
powersupply.redundancyLinks = t.Redundancy.ToStrings()
powersupply.relateditemLinks = t.RelatedItem.ToStrings()
powersupply.rawData = b
powersupply.resetTarget = t.Actions.Reset.Target

return nil
}
Expand All @@ -422,6 +430,21 @@ func ListReferencedPowerSupplies(c common.Client, link string) ([]*PowerSupply,
return common.GetCollectionObjects[PowerSupply](c, link)
}

// Reset is an action that resets a power supply. A GracefulRestart ResetType
// shall reset the power supply but shall not affect the power output. A
// ForceRestart ResetType can affect the power supply output.
func (powersupply *PowerSupply) Reset(resetType ResetType) error {
if powersupply.resetTarget == "" {
return errors.New("reset is not supported") //nolint:golint
}

t := struct {
ResetType ResetType
}{ResetType: resetType}

return powersupply.Post(powersupply.resetTarget, t)
}

// Update commits updates to this object's properties to the running system.
func (powersupply *PowerSupply) Update() error {
readWriteFields := []string{"IndicatorLED"}
Expand Down
4 changes: 4 additions & 0 deletions redfish/powersubsystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ type PowerSubsystem struct {
PowerSupplyRedundancy []RedundantGroup
// Status shall contain any status or health properties of the resource.
Status common.Status
// RawData holds the original serialized JSON.
RawData []byte
}

// UnmarshalJSON unmarshals a PowerSubsystem object from the raw JSON.
Expand Down Expand Up @@ -83,6 +85,8 @@ func (powersubsystem *PowerSubsystem) UnmarshalJSON(b []byte) error {
powersubsystem.batteries = t.Batteries.String()
powersubsystem.powerSupplies = t.PowerSupplies.String()

powersubsystem.RawData = b

return nil
}

Expand Down