Add parsers for the Redfish resources in redfish-map.md

Pure functions for ServiceRoot, ComputerSystem (facts, power state, reset action and ActionInfo), Processors, Memory, Storage/Drives/SimpleStorage, Chassis Thermal and Power as well as ThermalSubsystem/PowerSubsystem/Sensors (with environment_sources to pick whichever exists), Manager, EthernetInterfaces, ManagerNetworkProtocol, accounts, firmware inventory and log services/entries.
This commit is contained in:
Christian Manivong committed 2026-10-12 23:42:14 +00:00
1 parent 8998e1342e
commit cab1c84cba
18 files changed
+1926

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
"""UpdateService firmware inventory (``UpdateService/FirmwareInventory/*``)."""
from __future__ import annotations
from typing import Any, Mapping
from .common import boolean, link_list, status, text
def parse_firmware(item: Mapping[str, Any]) -> dict[str, Any]:
"""One SoftwareInventory member: what it is, its version, whether it can be updated."""
state, health = status(item)
return {
"id": text(item.get("Id")),
"name": text(item.get("Name")),
"version": text(item.get("Version")),
"updateable": boolean(item.get("Updateable")),
"manufacturer": text(item.get("Manufacturer")),
"release_date": text(item.get("ReleaseDate")),
"state": state,
"health": health,
"related": link_list(item, "RelatedItem"),
}