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

Support for VirtualMedia under ComputerSystem #269

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions redfish/computersystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,9 @@ type ComputerSystem struct {
// storage shall be a link to a collection
// of type StorageCollection.
storage string
// virtualMedia shall contain a reference to a collection of type
// VirtualMediaCollection which are for the use of this system.
virtualMedia string
// SubModel shall contain the information
// about the sub-model (or config) of the system. This shall not include
// the model/product name or the manufacturer name.
Expand Down Expand Up @@ -586,6 +589,7 @@ func (computersystem *ComputerSystem) UnmarshalJSON(b []byte) error {
MemoryDomains common.Link
PCIeDevices common.Links
PCIeFunctions common.Links
VirtualMedia common.Link
Links CSLinks
Settings common.Settings `json:"@Redfish.Settings"`
}
Expand All @@ -608,6 +612,7 @@ func (computersystem *ComputerSystem) UnmarshalJSON(b []byte) error {
computersystem.storage = t.Storage.String()
computersystem.logServices = t.LogServices.String()
computersystem.memoryDomains = t.MemoryDomains.String()
computersystem.virtualMedia = t.VirtualMedia.String()
computersystem.pcieDevices = t.PCIeDevices.ToStrings()
computersystem.pcieFunctions = t.PCIeFunctions.ToStrings()
computersystem.chassis = t.Links.Chassis.ToStrings()
Expand Down Expand Up @@ -955,6 +960,11 @@ func (computersystem *ComputerSystem) Storage() ([]*Storage, error) {
return ListReferencedStorages(computersystem.GetClient(), computersystem.storage)
}

// VirtualMedia gets the virtual media associated with this system.
func (computersystem *ComputerSystem) VirtualMedia() ([]*VirtualMedia, error) {
return ListReferencedVirtualMedias(computersystem.GetClient(), computersystem.virtualMedia)
}

// CSLinks are references to resources that are related to, but not contained
// by (subordinate to), this resource.
type CSLinks struct {
Expand Down