Skip to main content

Module for controlling entries in OSD.

Project description

[!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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mfd_osd_control-0.9.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file mfd_osd_control-0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mfd_osd_control-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee32a6a55431ca7901ef4f4675e3840fcc02af74938d6ac387901a8bc5d20a06
MD5 3162c5773f5d6fed34ff2f8e9bcd6964
BLAKE2b-256 818b427cfc0a032c3922816a155519b08ac8148e92258786684439e62cad39de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page