Skip to content

Commit

Permalink
Support for VirtualMedia under ComputerSystem (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
prajwalpatil25 authored Aug 14, 2023
1 parent 6e8a290 commit 46b1b33
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit 46b1b33

Please sign in to comment.