Skip to main content

[!IMPORTANT] This project is under development. All source code and features on the main branch are for the purpose of testing or evaluation and not production ready.

MFD OSD Control

Module for controlling entries in OSD.

Available methods

  • check if host exists

    does_host_exist(mac: str)
    
    • mac: MAC address
    • return bool value indicating whether host exists or not
  • get host details

    get_host_details(mac: str)
    
    • mac: MAC address
    • return dict with host information
  • add host

    add_host(mac: str, os: str, active_boot_type: ActiveBootType, refresh: RefreshMode, description: str)
    
    • mac: MAC address
    • os: OS key
    • active_boot_type: active boot type
    • refresh: refresh mode
    • description: optional description for host
  • alter host

    alter_host(mac: str, diskless_os: str, imageloader_os: str, iso_os: str, active_boot_type: ActiveBootType, refresh: RefreshMode, description: str)
    
    • mac: MAC address
    • diskless_os: Diskless OS key
    • imageloader_os: ImageLoader OS key
    • iso_os: ISO OS key
    • active_boot_type: active boot type
    • refresh: refresh mode
    • description: optional description for host
  • delete host

    delete_host(mac: str)
    
    • mac: MAC address
  • get available OSes

    get_available_oses(mac: str, os_type: OsType)
    
    • mac: MAC address
    • os_type: OS type
    • return list of available OSes
  • get host IP

    get_host_ip(mac: str)
    
    • mac: MAC address
    • return IPv4Address object with retrieved IP address

Usage

import logging

from mfd_osd_control import OsdController, RefreshMode, OsType, ActiveBootType

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)

osd = OsdController(base_url="osd.example.com")

list_of_oses = osd.get_available_oses(mac="00:11:22:AA:BB:CC", os_type=OsType.DISKLESS)
logger.log(level=logging.DEBUG, msg=list_of_oses)

if not osd.does_host_exist(mac="00:11:22:AA:BB:CC"):
    osd.add_host(mac="00:11:22:AA:BB:CC", os=list_of_oses[0], active_boot_type=ActiveBootType.DISKLESS, refresh=RefreshMode.ONCE)
    host_details = osd.get_host_details(mac="00:11:22:AA:BB:CC")
    logger.log(level=logging.DEBUG, msg=host_details)
    osd.alter_host(mac="00:11:22:AA:BB:CC", diskless_os=list_of_oses[1])
    ip_addr = osd.get_host_ip(mac="00:11:22:AA:BB:CC")
    logger.log(level=logging.DEBUG, msg=ip_addr)
    osd.delete_host(mac="00:11:22:AA:BB:CC")

OS supported:

  • Linux
  • Windows
  • ESXi
  • FreeBSD

Issue reporting

If you encounter any bugs or have suggestions for improvements, you're welcome to contribute directly or open an issue here.

Metadata

Release files for mfd-osd-control 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for mfd-osd-control 0.9.0
File Interpreter ABI Platform
mfd_osd_control-0.9.0-py3-none-any.whl Python 3 none any Details

Release files / mfd_osd_control-0.9.0-py3-none-any.whl

Download URL mfd_osd_control-0.9.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee32a6a55431ca7901ef4f4675e3840fcc02af74938d6ac387901a8bc5d20a06
BLAKE2b-256 checksum
How to use checksums
818b427cfc0a032c3922816a155519b08ac8148e92258786684439e62cad39de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.9.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page