Closed sosodev closed 3 years ago
Oops, thanks for pointing out that print statement. Definitely a leftover mistake. :)
The call is fully implemented, but not all Redfish implementations actually return associated drives for their Chassis
objects. There are ComputerSystem
and I think one or two other objects that can also have associated drives that I need to implement yet. I haven't been able to compare a wide variety of implementations, but I think some report the drives in some places but not others.
Hmm. It doesn't seem to work for me.
chassis.Drives()
returns an empty slice for the following chassis entity which links its drives
{
"@odata.type": "#Chassis.v1_9_1.Chassis",
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane",
"Id": "NVMeSSD.0.Group.0.StorageBackplane",
"Name": "Backplane",
"ChassisType": "Enclosure",
"Model": "Backplane",
"SerialNumber": "",
"PartNumber": "",
"Links": {
"ManagedBy": [
{
"@odata.id": "/redfish/v1/Managers/1"
}
],
"Storage": [
{
"@odata.id": "/redfish/v1/Systems/1/Storage/NVMeSSD"
}
],
"Drives": [
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.0"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.1"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.2"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.3"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.4"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.5"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.6"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.7"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.8"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.9"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.10"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.11"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.12"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.13"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.14"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.15"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.16"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.17"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.18"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.19"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.20"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.21"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.22"
},
{
"@odata.id": "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.23"
}
]
},
"Oem": {}
}
Ah, looks like this has morphed a bit over time.
http://redfish.dmtf.org/schemas/v1/Chassis.v1_15_0.json
In version v1.2.0 of the spec, Drives
were added to the Chassis.Links
property. But in v1.14.0 of the spec, Chassis.Drives
was added as a direct property. So this is complete for any implementations v1.14.0 and later.
I think we can handle this in the library. The Drives()
call can be updated to check both places for references to drives and extract whichever is present. Should be easy enough (famous last words). ;)
Thanks for the json output by the way, that helps a lot!
No problem. :) Thanks for taking another look at this
chassis.Drives()
seems to always return an empty drives slice. Also, it looks like creating the chassis itself hits what looks like a leftover debugging print.