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:
| Name | Type | Default | Description |
|---|---|---|---|
fishapi | RedfishAPI | — |
get_boot_order
def get_boot_order() -> listGet 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) -> listGet 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:
| 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
get_boot_option_by_alias
def get_boot_option_by_alias(alias: str, nocache: bool = False) -> dictGet 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:
| Name | Type | Default | Description |
|---|---|---|---|
alias | str | — | |
nocache | bool | False |
Returns: dict
set_boot_order
def set_boot_order(boot_order: list) -> boolSet 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:
| Name | Type | Default | Description |
|---|---|---|---|
boot_order | list | — |
Returns: bool
set_boot_first_by_mac
def set_boot_first_by_mac(mac_address: str, boot_type: str = None) -> dictMove 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:
| Name | Type | Default | Description |
|---|---|---|---|
mac_address | str | — | |
boot_type | str | None |
Returns: dict
setup_pxe_boot
def setup_pxe_boot(mac_address: str, protocol: str = 'IPv4', reboot: bool = True) -> dictEnable 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:
| Name | Type | Default | Description |
|---|---|---|---|
mac_address | str | — | |
protocol | str | 'IPv4' | |
reboot | bool | True |
Returns: dict
set_next_onetime_boot
def set_next_onetime_boot(boot_source: str) -> boolSet 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:
| Name | Type | Default | Description |
|---|---|---|---|
boot_source | str | — |
Returns: bool
get_supported_reset_types
def get_supported_reset_types() -> dictGet 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) -> boolReset/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:
| Name | Type | Default | Description |
|---|---|---|---|
reset_type | str | None |
Returns: bool
create_user_group
def create_user_group(role_name: str, privileges: int) -> dictCreate 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:
| Name | Type | Default | Description |
|---|---|---|---|
role_name | str | — | |
privileges | int | — |
Returns: dict
toggle_local_idrac_access
def toggle_local_idrac_access(disable: bool) -> dictToggle 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:
| Name | Type | Default | Description |
|---|---|---|---|
disable | bool | — |
Returns: dict
get_network_interfaces
def get_network_interfaces() -> listGet 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) -> dictGet 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:
| Name | Type | Default | Description |
|---|---|---|---|
mac_address | str | — |
Returns: dict
check_pxe_status
def check_pxe_status(mac_address: str) -> dictCheck whether PXE is enabled for a NIC identified by MAC address.
Checks two things:
- Whether a PXE boot option exists in BootOptions for this MAC
- 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:
| Name | Type | Default | Description |
|---|---|---|---|
mac_address | str | — |
Returns: dict
enable_nic_pxe
def enable_nic_pxe(mac_address: str, protocol: str = 'IPv4') -> dictEnable 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:
| Name | Type | Default | Description |
|---|---|---|---|
mac_address | str | — | |
protocol | str | 'IPv4' |
Returns: dict