greenpau / go-redfish-api-idrac

iDRAC Redfish API client library written in Go.
MIT License
11 stars 2 forks source link

Get systems output showing an error #2

Open rajinator opened 3 years ago

rajinator commented 3 years ago

Here is what happens when I run --operation get-systems, unsure if this is due to the version of the iDRAC/redfish or an actual issue

Single line output

❯ ./go-redfish-api-idrac-client --operation get-systems                                                                                                        ─╯
FATA[0011] parsing error: json: cannot unmarshal string into Go struct field .Links.Oem.Dell of type client.ODataAnnotation, server response: {"@odata.context":"/redfish/v1/$metadata#ComputerSystem.ComputerSystem","@odata.id":"/redfish/v1/Systems/System.Embedded.1","@odata.type":"#ComputerSystem.v1_4_0.ComputerSystem","Actions":{"#ComputerSystem.Reset":{"ResetType@Redfish.AllowableValues":["On","ForceOff","GracefulRestart","GracefulShutdown","PushPowerButton","Nmi"],"target":"/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset"}},"AssetTag":"","Bios":{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/Bios"},"BiosVersion":"2.9.0","Boot":{"BootSourceOverrideEnabled":"Once","BootSourceOverrideTarget":"None","BootSourceOverrideTarget@Redfish.AllowableValues":["None","Pxe","Cd","Floppy","Hdd","BiosSetup","Utilities","UefiTarget","SDCard"]},"Description":"Computer System which represents a machine (physical or virtual) and the local resources such as memory, cpu and other devices that can be accessed from that machine.","EthernetInterfaces":{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/EthernetInterfaces"},"HostName":"","Id":"System.Embedded.1","IndicatorLED":"Off","Links":{"Chassis":[{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1"}],"Chassis@odata.count":1,"CooledBy":[{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.1A"},{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.2A"},{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.3A"},{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.4A"},{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.5A"},{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.6A"},{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.7A"},{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.1B"},{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.2B"},{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.3B"},{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.4B"},{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.5B"},{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.6B"},{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.7B"}],"CooledBy@odata.count":14,"ManagedBy":[{"@odata.id":"/redfish/v1/Managers/iDRAC.Embedded.1"}],"ManagedBy@odata.count":1,"Oem":{"DELL":{"@odata.type":"#DellComputerSystem.v1_0_0.DellComputerSystem","BootOrder":{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/BootSources"}}},"PoweredBy":[{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Power/PowerSupplies/PSU.Slot.1"},{"@odata.id":"/redfish/v1/Chassis/System.Embedded.1/Power/PowerSupplies/PSU.Slot.2"}],"PoweredBy@odata.count":2},"Manufacturer":"Dell Inc.","Memory":{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/Memory"},"MemorySummary":{"Status":{"Health":"OK","HealthRollup":"OK","State":"Enabled"},"TotalSystemMemoryGiB":238.4186880},"Model":"PowerEdge R620","Name":"System","NetworkInterfaces":{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/NetworkInterfaces"},"PartNumber":"<PN>","PowerState":"On","ProcessorSummary":{"Count":2,"Model":"Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz","Status":{"Health":"OK","HealthRollup":"OK","State":"Enabled"}},"Processors":{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/Processors"},"SKU":"<SKU>","SerialNumber":"<SN>","SimpleStorage":{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/SimpleStorage/Controllers"},"Status":{"Health":"OK","HealthRollup":"OK","State":"Enabled"},"Storage":{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/Storage"},"SystemType":"Physical","UUID":"<uuid>"}

Prettified

FATA[0017] parsing error: json: cannot unmarshal string into Go struct field .Links.Oem.Dell of type client.ODataAnnotation,
server response:
{
    "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",
    "@odata.id": "/redfish/v1/Systems/System.Embedded.1",
    "@odata.type": "#ComputerSystem.v1_4_0.ComputerSystem",
    "Actions": {
        "#ComputerSystem.Reset": {
            "ResetType@Redfish.AllowableValues": [
                "On",
                "ForceOff",
                "GracefulRestart",
                "GracefulShutdown",
                "PushPowerButton",
                "Nmi"
            ],
            "target": "/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset"
        }
    },
    "AssetTag": "",
    "Bios": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Bios"
    },
    "BiosVersion": "2.9.0",
    "Boot": {
        "BootSourceOverrideEnabled": "Once",
        "BootSourceOverrideTarget": "None",
        "BootSourceOverrideTarget@Redfish.AllowableValues": [
            "None",
            "Pxe",
            "Cd",
            "Floppy",
            "Hdd",
            "BiosSetup",
            "Utilities",
            "UefiTarget",
            "SDCard"
        ]
    },
    "Description": "Computer System which represents a machine (physical or virtual) and the local resources such as memory, cpu and other devices that can be accessed from that machine.",
    "EthernetInterfaces": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/EthernetInterfaces"
    },
    "HostName": "",
    "Id": "System.Embedded.1",
    "IndicatorLED": "Off",
    "Links": {
        "Chassis": [
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1"
            }
        ],
        "Chassis@odata.count": 1,
        "CooledBy": [
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.1A"
            },
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.2A"
            },
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.3A"
            },
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.4A"
            },
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.5A"
            },
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.6A"
            },
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.7A"
            },
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.1B"
            },
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.2B"
            },
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.3B"
            },
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.4B"
            },
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.5B"
            },
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.6B"
            },
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17%7C%7CFan.Embedded.7B"
            }
        ],
        "CooledBy@odata.count": 14,
        "ManagedBy": [
            {
                "@odata.id": "/redfish/v1/Managers/iDRAC.Embedded.1"
            }
        ],
        "ManagedBy@odata.count": 1,
        "Oem": {
            "DELL": {
                "@odata.type": "#DellComputerSystem.v1_0_0.DellComputerSystem",
                "BootOrder": {
                    "@odata.id": "/redfish/v1/Systems/System.Embedded.1/BootSources"
                }
            }
        },
        "PoweredBy": [
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Power/PowerSupplies/PSU.Slot.1"
            },
            {
                "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Power/PowerSupplies/PSU.Slot.2"
            }
        ],
        "PoweredBy@odata.count": 2
    },
    "Manufacturer": "Dell Inc.",
    "Memory": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Memory"
    },
    "MemorySummary": {
        "Status": {
            "Health": "OK",
            "HealthRollup": "OK",
            "State": "Enabled"
        },
        "TotalSystemMemoryGiB": 238.418688
    },
    "Model": "PowerEdge R620",
    "Name": "System",
    "NetworkInterfaces": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/NetworkInterfaces"
    },
    "PartNumber": "<PN>",
    "PowerState": "On",
    "ProcessorSummary": {
        "Count": 2,
        "Model": "Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz",
        "Status": {
            "Health": "OK",
            "HealthRollup": "OK",
            "State": "Enabled"
        }
    },
    "Processors": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Processors"
    },
    "SKU": "<SKU>",
    "SerialNumber": "<SN>",
    "SimpleStorage": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/SimpleStorage/Controllers"
    },
    "Status": {
        "Health": "OK",
        "HealthRollup": "OK",
        "State": "Enabled"
    },
    "Storage": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Storage"
    },
    "SystemType": "Physical",
    "UUID": "<UUID>"
}

Get Info output

❯ ./go-redfish-api-idrac-client --operation get-info                                                                                                           ─╯
Host: <IP>
Product:
Service Tag: <tag>
Manager MAC Address: <Mac-address>
Redfish API Version: 1.0.2

Happy to provide more information if needed!

greenpau commented 3 years ago

@rajinator , here is what is expected.

https://github.com/greenpau/go-redfish-api-idrac/blob/69dfd9834f399c98b8a327db507fea4d6282a9d8/assets/responses/computer_system_1.json#L130-L134

Your output has slightly different format (which is not accounted for), e.g. Dell vs DELL, @odata.type present.

        "Oem": {
            "DELL": {
                "@odata.type": "#DellComputerSystem.v1_0_0.DellComputerSystem",
                "BootOrder": {
                    "@odata.id": "/redfish/v1/Systems/System.Embedded.1/BootSources"
                }
            }
        },

I tested it with Integrated Dell Remote Access Controller, Redfish API Version: 1.4.0

What is the end device? iDRAC on which system?

rajinator commented 3 years ago

Ah I see.

It is iDRAC on a PowerEdge R620 1U server. Redfish API version is also quite old so could be both of these I'll try find an upgrade path, if there is one, and then check with updated API

greenpau commented 3 years ago

I'll try find an upgrade path, if there is one, and then check with updated API

@rajinator , if you find an upgrade path, please let me know.

SuperQ commented 1 year ago

I have the same issue with a Dell R240, iDRAC 9, on the latest release (7.00.00.00).

Redfish API Version: 1.17.0

Error:

level=fatal msg="parsing error: json: cannot unmarshal string into Go struct field .Links.Oem.Dell of type client.ODataAnnotation, server response: ...

Here's the jq .Links contents:

{
  "Chassis": [
    {
      "@odata.id": "/redfish/v1/Chassis/System.Embedded.1"
    }
  ],
  "Chassis@odata.count": 1,
  "CooledBy": [
    {
      "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Thermal#/Fans/0"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Thermal#/Fans/1"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Thermal#/Fans/2"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Thermal#/Fans/3"
    }
  ],
  "CooledBy@odata.count": 4,
  "ManagedBy": [
    {
      "@odata.id": "/redfish/v1/Managers/iDRAC.Embedded.1"
    }
  ],
  "ManagedBy@odata.count": 1,
  "Oem": {
    "Dell": {
      "@odata.type": "#DellOem.v1_3_0.DellOemLinks",
      "BootOrder": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellBootSources"
      },
      "DellBootSources": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellBootSources"
      },
      "DellSoftwareInstallationService": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellSoftwareInstallationService"
      },
      "DellVideoCollection": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellVideo"
      },
      "DellChassisCollection": {
        "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Oem/Dell/DellChassis"
      },
      "DellPresenceAndStatusSensorCollection": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellPresenceAndStatusSensors"
      },
      "DellSensorCollection": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellSensors"
      },
      "DellRollupStatusCollection": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellRollupStatus"
      },
      "DellPSNumericSensorCollection": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellPSNumericSensors"
      },
      "DellVideoNetworkCollection": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellVideoNetwork"
      },
      "DellOSDeploymentService": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellOSDeploymentService"
      },
      "DellMetricService": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellMetricService"
      },
      "DellGPUSensorCollection": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellGPUSensors"
      },
      "DellRaidService": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellRaidService"
      },
      "DellNumericSensorCollection": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellNumericSensors"
      },
      "DellBIOSService": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellBIOSService"
      },
      "DellSlotCollection": {
        "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellSlots"
      }
    }
  },
  "PoweredBy": [],
  "PoweredBy@odata.count": 0
}