bmctools.redfish.asusfish
AsusFish
ASUS Redfish implementation.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
fishapi | RedfishAPI | — |
get_boot_order
def get_boot_order() -> listGet 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) -> listGet 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:
| Name | Type | Default | Description |
|---|---|---|---|
nocache | bool | False |
Returns: list
get_boot_option_by_mac
def get_boot_option_by_mac(mac_address: str, type: Optional[str] = None, nocache: bool = False) -> dictGet 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:
| Name | Type | Default | Description |
|---|---|---|---|
mac_address | str | — | |
type | Optional[str] | None | |
nocache | bool | False |
Returns: dict
set_boot_order
def set_boot_order(boot_order: list) -> boolSet 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:
| Name | Type | Default | Description |
|---|---|---|---|
boot_order | list | — |
Returns: bool
get_pending_boot_order
def get_pending_boot_order() -> listGet the pending boot order from the FutureState (SD) endpoint.
Returns: list
get_supported_reset_types
def get_supported_reset_types() -> dictGet 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) -> boolReset/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:
| Name | Type | Default | Description |
|---|---|---|---|
reset_type | str | None |
Returns: bool
get_boot_option_by_alias
def get_boot_option_by_alias(alias: str, nocache: bool = False) -> dictGet 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:
| Name | Type | Default | Description |
|---|---|---|---|
alias | str | — | |
nocache | bool | False |
Returns: dict
get_firmware_inventory
def get_firmware_inventory() -> dictGet 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() -> dictGet 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) -> dictUpdate 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:
| Name | Type | Default | Description |
|---|---|---|---|
firmware_path | str | — | |
preserve_config | bool | True |
Returns: dict
update_bios_firmware
def update_bios_firmware(firmware_path: str) -> dictUpdate 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:
| Name | Type | Default | Description |
|---|---|---|---|
firmware_path | str | — |
Returns: dict
get_network_interfaces
def get_network_interfaces() -> listGet 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') -> boolSet 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:
| Name | Type | Default | Description |
|---|---|---|---|
state | str | 'Disabled' |
Returns: bool