HewlettPackard / python-ilorest-library

Python library for interacting with devices which support a Redfish Service
Apache License 2.0
189 stars 92 forks source link

Expanding multiple levels possible? #161

Closed Dynatrace-James-Kitson closed 3 months ago

Dynatrace-James-Kitson commented 6 months ago

I know this may not be the best place to ask but https://developer.hpe.com/platform/ilo-restful-api/home/ references https://slack.hpedev.io/ for asking questions but it has a certificate error and the redfish channel link on that page won't let me access it.

The documentation for expand is a bit confusing. It seems to start by describing what you can due with OData (expand multiple levels/specific fields) but then it describes the iLO expand implementation and it seems much more limited (e.g. only expanding 1 level).

I wasn't sure of my reading of this but all my tests seem to support this (either getting bad query responses or only ever seeing one level of expansion).

So is there a way to do any form of multi-level expand if I know specifically what I want?

For example, accessing drive data without expanding multiple levels I have to call /redfish/v1/Systems/1/Storage/ ($expand=.) then go through each of Members and access the Drives and call their individual URLs (e.g. one call per drive).

Similarly for network interfaces I have to call /redfish/v1/Systems/1/NetworkInterfaces/ ($expand=.) and go down through each member and make a call to get their Ports and NetworkPorts and then do additional calls per each port. So a ton of calls to get Port level data.

This isn't a big deal for one-off things but for me I'm trying to do monitoring and this is a lot of calls to be making frequently. Essentially, I'm trying to get data similar to this which was exposed on the old XML API and doing this with the current Redfish implementation seems possible (mainly looking for statuses) but very heavy.

{
    "@odata.context": "/redfish/v1/$metadata#StorageCollection.StorageCollection",
    "@odata.etag": """,
    "@odata.id": "/redfish/v1/Systems/1/Storage/",
    "@odata.type": "#StorageCollection.StorageCollection",
    "Description": "Storage subsystems known to this system",
    "Name": "Storage",
    "Members": [
        {
            "@odata.id": "/redfish/v1/Systems/1/Storage/ABC07C123",
            "@odata.type": "#Storage.v1_12_0.Storage",
            "Actions": {
                "#Storage.ResetToDefaults": {
                    "target": "/redfish/v1/Systems/1/Storage/ABC07C123/Actions/Storage.ResetToDefaults",
                    "ResetType@Redfish.AllowableValues": [
                        "ResetAll",
                        "PreserveVolumes"
                    ]
                }
            },
            "Id": "ABC07C123",
            "Name": "HPE Smart Array P408i-a SR Gen10",
            "Status": {
                "HealthRollup": "OK",
                "State": "Enabled"
            },
            "Controllers": {
                "@odata.id": "/redfish/v1/Systems/1/Storage/ABC07C123/Controllers"
            },
            "Drives@odata.count": 2,
            "Drives": [
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storage/ABC07C123/Drives/0"
                },
                {
                    "@odata.id": "/redfish/v1/Systems/1/Storage/ABC07C123/Drives/1"
                }
            ],
            "Volumes": {
                "@odata.id": "/redfish/v1/Systems/1/Storage/ABC07C123/Volumes"
            },
            "@odata.etag": "\"XXXXX\""
        }
    ],
    "Members@odata.count": 1
}
rajeevkallur commented 6 months ago

Expand is mainly handled by iLO (I mean server). Need to check with iLO team if they can implement this.

commonism commented 6 months ago

This would be an Oem extension to the StorageCollection data type (DSP0268 - 5 Resource collections).

rajeevkallur commented 3 months ago

Closing. it is a limitation from iLO.