Skip to content

bmctools.redfish.dellfish

DellFish

Dell Redfish implementation.

Dell systems typically use ‘System.Embedded.1’ as the system ID. This implementation supports Dell-specific Redfish endpoints and OEM extensions.

Parameters:

NameTypeDefaultDescription
fishapiRedfishAPI

get_boot_order

def get_boot_order() -> list

Get the current boot order from the Dell system.

Returns: List of boot option references in order (e.g., [‘Boot0001’, ‘Boot0002’, …])

Raises: ValueError: If boot order cannot be retrieved

Returns: list

get_boot_options

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

Get all available boot options from the Dell system.

Args: nocache: If True, force a fresh API call instead of using cached boot options

Returns: List of boot option dictionaries containing details for each boot device

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

get_boot_option_by_alias

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

Get a boot option by its display name or alias.

Args: alias: The display name or alias to search for (case-insensitive) 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

set_boot_order

def set_boot_order(boot_order: list) -> bool

Set the boot order for the Dell system.

Dell systems use PATCH operations on the System resource to update boot order.

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 or update fails

Parameters:

NameTypeDefaultDescription
boot_orderlist

Returns: bool

set_boot_first_by_mac

def set_boot_first_by_mac(mac_address: str, boot_type: str = None) -> dict

Move the boot option matching a MAC address to the front of the boot order.

Args: mac_address: MAC address of the target NIC boot_type: Optional boot option type filter (e.g., ‘PXE’)

Returns: Dict with the new boot order and the promoted option

Raises: ValueError: If no matching boot option or set fails

Parameters:

NameTypeDefaultDescription
mac_addressstr
boot_typestrNone

Returns: dict

setup_pxe_boot

def setup_pxe_boot(mac_address: str, protocol: str = 'IPv4', reboot: bool = True) -> dict

Enable PXE boot on a NIC and set it first in boot order.

If the NIC already has a PXE boot option, just moves it to the front of the boot order (no reboot needed). If PXE is not yet enabled, stages the BIOS setting and optionally reboots to apply.

Args: mac_address: MAC address of the target NIC protocol: PXE protocol - ‘IPv4’, ‘IPv6’, or ‘IPv4andIPv6’ reboot: If True and PXE needs enabling, reboot to apply

Returns: Dict with action taken and details

Parameters:

NameTypeDefaultDescription
mac_addressstr
protocolstr'IPv4'
rebootboolTrue

Returns: dict

set_next_onetime_boot

def set_next_onetime_boot(boot_source: str) -> bool

Set the next one-time boot source for the Dell system.

Args: boot_source: Boot source target (e.g., ‘Pxe’, ‘Cd’, ‘Hdd’, ‘BiosSetup’, ‘None’, etc.)

Returns: True if successful

Raises: ValueError: If the update fails

Parameters:

NameTypeDefaultDescription
boot_sourcestr

Returns: bool

get_supported_reset_types

def get_supported_reset_types() -> dict

Get the list of supported reset types for this Dell system.

Returns: Dict with ‘types’ (list of allowed types) and ‘actions’ (full actions data)

Returns: dict

reset_system

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

Reset/reboot the Dell system.

Common Dell reset types: On, ForceOff, GracefulShutdown, GracefulRestart, ForceRestart, Nmi, PushPowerButton

Args: reset_type: Type of reset. If None, will use ‘GracefulRestart’ as default. Common values: ‘GracefulRestart’, ‘ForceRestart’, ‘On’, ‘ForceOff’

Returns: True if successful

Raises: ValueError: If reset fails or reset_type is not supported

Parameters:

NameTypeDefaultDescription
reset_typestrNone

Returns: bool

create_user_group

def create_user_group(role_name: str, privileges: int) -> dict

Create a Dell iDRAC user group (role) by updating DellAttributes.

This finds the manager id (e.g. iDRAC.Embedded.1), reads existing Roles.N.Name keys and picks the next available index (starting at 4) then PATCHes /redfish/v1/Managers/{mgr}/Oem/Dell/DellAttributes/{mgr}

Args: role_name: Display name for the new role. privileges: Integer privileges bitmask.

Returns: Dict with role_index and the response data (if any).

Raises: ValueError: on failure to apply the change.

Parameters:

NameTypeDefaultDescription
role_namestr
privilegesint

Returns: dict

toggle_local_idrac_access

def toggle_local_idrac_access(disable: bool) -> dict

Toggle local iDRAC access via DellAttributes.

NOTE: Dell’s semantics are inverted — setting these attributes to “Enabled” actually disables local iDRAC access. Therefore this function accepts disable: bool where True will set the attributes to “Enabled” (disabling local access) and False will set them to “Disabled” (enabling local access).

This patches the DellAttributes endpoint for the first Manager (iDRAC) and sets the following attributes:

  • LocalSecurity.1.PrebootConfig: “Enabled” / “Disabled”
  • LocalSecurity.1.LocalConfig: “Enabled” / “Disabled”

Args: disable: True to disable local access, False to enable it.

Returns: Dict with the response JSON (if any) and the applied values.

Raises: ValueError: on failure to apply the change.

Parameters:

NameTypeDefaultDescription
disablebool

Returns: dict

get_network_interfaces

def get_network_interfaces() -> list

Get NIC information including MAC addresses from the Dell system.

Queries the EthernetInterfaces collection under the system resource 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

get_nic_attributes

def get_nic_attributes(mac_address: str) -> dict

Get Dell OEM network attributes for a NIC by MAC address.

Args: mac_address: MAC address (e.g., ‘04:32:01:D8:C0:B0’)

Returns: Dict with nic_id and the OEM attributes

Raises: ValueError: If the NIC or attributes cannot be retrieved

Parameters:

NameTypeDefaultDescription
mac_addressstr

Returns: dict

check_pxe_status

def check_pxe_status(mac_address: str) -> dict

Check whether PXE is enabled for a NIC identified by MAC address.

Checks two things:

  1. Whether a PXE boot option exists in BootOptions for this MAC
  2. Whether a PxeDev BIOS slot is configured for this NIC

Args: mac_address: MAC address (e.g., ‘04:32:01:D8:C0:B0’)

Returns: Dict with pxe_boot_option_exists, pxe_bios_slot_configured, and details

Parameters:

NameTypeDefaultDescription
mac_addressstr

Returns: dict

enable_nic_pxe

def enable_nic_pxe(mac_address: str, protocol: str = 'IPv4') -> dict

Enable PXE boot on a NIC identified by MAC address.

Finds the NIC, then configures a PxeDev slot in the BIOS Settings to enable PXE boot on that interface. Uses PxeDev1-4 slots.

Args: mac_address: MAC address (e.g., ‘04:32:01:D8:C0:B0’) protocol: PXE protocol - ‘IPv4’, ‘IPv6’, or ‘IPv4andIPv6’

Returns: Dict with nic_id, pxe_slot, and result message

Raises: ValueError: If the NIC cannot be found, no free PXE slot, or PATCH fails

Parameters:

NameTypeDefaultDescription
mac_addressstr
protocolstr'IPv4'

Returns: dict