Skip to content

bmctools.redfish.asusfish

AsusFish

ASUS Redfish implementation.

Parameters:

NameTypeDefaultDescription
fishapiRedfishAPI

get_boot_order

def get_boot_order() -> list

Get the current boot order from the ASUS system.

Returns: List of boot option references in order.

Raises: ValueError: If the boot order cannot be retrieved.

Returns: list

get_boot_options

def get_boot_options(nocache: bool = False) -> list

Get all available boot options.

Args: nocache: If True, bypass the cache and query the BMC directly.

Returns: List of boot option dictionaries.

Raises: ValueError: If boot options cannot be retrieved.

Parameters:

NameTypeDefaultDescription
nocacheboolFalse

Returns: list

get_boot_option_by_mac

def get_boot_option_by_mac(mac_address: str, type: Optional[str] = None, nocache: bool = False) -> dict

Get a boot option by MAC address.

Args: mac_address: MAC address to search for (format: XX:XX:XX:XX:XX:XX or XXXXXXXXXXXX) type: Optional boot option type to filter by (e.g., ‘PXE’) nocache: If True, force a fresh API call instead of using cached boot options

Returns: Dict containing the boot option data

Raises: ValueError: If no boot option is found with the specified MAC address or type

Parameters:

NameTypeDefaultDescription
mac_addressstr
typeOptional[str]None
nocacheboolFalse

Returns: dict

set_boot_order

def set_boot_order(boot_order: list) -> bool

Set the boot order for the system.

Args: boot_order: List of boot option references (e.g., [“Boot0003”, “Boot0004”, …]) Must include ALL boot options, not just a subset.

Returns: True if successful

Raises: ValueError: If the boot order doesn’t include all required boot options

Parameters:

NameTypeDefaultDescription
boot_orderlist

Returns: bool

get_pending_boot_order

def get_pending_boot_order() -> list

Get the pending boot order from the FutureState (SD) endpoint.

Returns: list

get_supported_reset_types

def get_supported_reset_types() -> dict

Get the list of supported reset types for this system.

Returns a dict with ‘types’ (list of allowed types) and ‘actions’ (full actions data for debugging)

Returns: dict

reset_system

def reset_system(reset_type: str = None) -> bool

Reset/reboot the system to apply pending boot order changes.

Args: reset_type: Type of reset. If None, will use the first supported type. Common values that may be supported: - “On”: Turn on the system - “ForceOff”: Immediate shutdown - “GracefulShutdown”: Graceful shutdown - “GracefulRestart”: Graceful reboot - “ForceRestart”: Immediate reboot - “PushPowerButton”: Simulate power button press

Returns: True if reset command was accepted

Parameters:

NameTypeDefaultDescription
reset_typestrNone

Returns: bool

get_boot_option_by_alias

def get_boot_option_by_alias(alias: str, nocache: bool = False) -> dict

Get a boot option by its alias name.

Args: alias: Alias name of the boot option to search for nocache: If True, force a fresh API call instead of using cached boot options

Returns: Dict containing the boot option data

Raises: ValueError: If no boot option is found with the specified alias

Parameters:

NameTypeDefaultDescription
aliasstr
nocacheboolFalse

Returns: dict

get_firmware_inventory

def get_firmware_inventory() -> dict

Get firmware inventory from the UpdateService.

Returns: Dict containing firmware inventory information including BIOS and BMC versions

Raises: ValueError: If the firmware inventory cannot be retrieved

Returns: dict

get_update_service_info

def get_update_service_info() -> dict

Get UpdateService information including current update status.

Returns: Dict containing UpdateService status and configuration

Raises: ValueError: If UpdateService cannot be accessed

Returns: dict

update_bmc_firmware

def update_bmc_firmware(firmware_path: str, preserve_config: bool = True) -> dict

Update BMC firmware using multipart HTTP push.

Args: firmware_path: Path to the BMC firmware file preserve_config: Whether to preserve BMC configuration (default: True)

Returns: Dict containing update status information

Raises: ValueError: If the firmware update fails to initiate

Parameters:

NameTypeDefaultDescription
firmware_pathstr
preserve_configboolTrue

Returns: dict

update_bios_firmware

def update_bios_firmware(firmware_path: str) -> dict

Update BIOS firmware using Asus OEM extension.

Args: firmware_path: Path to the BIOS firmware file

Returns: Dict containing update status information

Raises: ValueError: If the firmware update fails to initiate

Parameters:

NameTypeDefaultDescription
firmware_pathstr

Returns: dict

get_network_interfaces

def get_network_interfaces() -> list

Get NIC information including MAC addresses from the system.

Queries the EthernetInterfaces collection under /redfish/v1/Systems/Self and returns details for each interface.

Returns: List of dicts, each containing interface details (Id, Name, MACAddress, SpeedMbps, Status, etc.)

Raises: ValueError: If the interfaces cannot be retrieved

Returns: list

set_trusted_module_state

def set_trusted_module_state(state: str = 'Disabled') -> bool

Set the TrustedModules State (e.g., “Enabled” or “Disabled”) at /redfish/v1/Systems/Self. Uses PATCH with If-Match header (ETag). Args: state: The desired state for TrustedModules (“Enabled” or “Disabled”). Returns: True if successful. Raises: ValueError if the operation fails.

Parameters:

NameTypeDefaultDescription
statestr'Disabled'

Returns: bool