Skip to main content

Python SDK for managing Kaytus BMC servers via the Redfish API

Project description

kaytus-bmc-sdk

A Python SDK for managing Kaytus BMC servers via the Redfish API.

Tested Environment

Component Version
Hardware Kaytus KR2280-X3
BMC Firmware 4.35.00 (2026-02-12)
BIOS 04.03.00 (2026-01-29)
Redfish 1.18.0
Python 3.10+

Installation

pip install kaytus-bmc-sdk

Requirements: requests >= 2.28


Quick Start

from kaytus_sdk import KaytusClient

with KaytusClient("192.168.40.100", "admin", "password") as bmc:
    print(bmc.system.overview())
    print(bmc.system.fan_summary())
    print(bmc.network.summary())

Bulk Operations

Run any operation across a range of servers concurrently:

from kaytus_sdk import bulk_run, ip_range, bulk_summary

results = bulk_run(
    hosts     = ip_range("10.255.40", 100, 130),
    username  = "admin",
    password  = "password",
    operation = lambda c: c.system.overview(),
)
print(bulk_summary(results))

Modules

bmc.system

bmc.system.overview()               # Single-request health/status summary
bmc.system.power_state()            # "On" | "Off" | "PoweringOn" | "PoweringOff"
bmc.system.power_on()
bmc.system.power_off()
bmc.system.shutdown()               # GracefulShutdown
bmc.system.reboot()                 # GracefulRestart
bmc.system.force_reboot()
bmc.system.power_cycle()
bmc.system.power_summary()          # Watts, PSU details, efficiency
bmc.system.fan_summary()            # RPM and ratio% for all fans
bmc.system.fan_control_info()       # FanControlMode, SmartCooling config
bmc.system.temperature_summary()    # All temperature sensors with thresholds
bmc.system.set_fan_mode("Auto")     # "Auto" | "Manual"
bmc.system.set_fan_speed(40)        # Manual mode: 0-100%
bmc.system.set_cooling_mode("LowNoise")   # "LowNoise" | "HighPerformance" | "Custom"
bmc.system.set_cpu_temp_target(85)  # SmartCooling CPU target temperature (°C)
bmc.system.set_boot_source("Pxe", enabled="Once")
bmc.system.set_indicator_led("Lit") # "Lit" | "Off" | "Blinking"

bmc.network

bmc.network.summary()
bmc.network.set_hostname("server-01")
bmc.network.set_dns(["1.1.1.1", "8.8.8.8"])
bmc.network.set_hostname_and_dns("server-01", ["1.1.1.1", "8.8.8.8"])
bmc.network.set_static_ip("10.0.0.100", "255.255.255.0", "10.0.0.1")
bmc.network.enable_dhcp()
bmc.network.ntp_summary()
bmc.network.set_ntp("ntp1.example.com", "ntp2.example.com")
bmc.network.set_https_timeout(1800)
bmc.network.set_ipmi_enabled(True)

bmc.snmp

bmc.snmp.summary()
bmc.snmp.configure(
    v1_enable=False, v2_enable=True, v3_enable=False,
    read_community="public", write_community="private"
)
bmc.snmp.add_trap_server(0, "10.0.0.50", 162, version="V2C")
bmc.snmp.remove_trap_server(0)
bmc.snmp.test_trap()

bmc.syslog

bmc.syslog.summary()
bmc.syslog.set_server(0, "10.0.0.50", 514,
    protocol="UDP",         # "UDP" | "TCP" | "TLS"
    log_type="Audit+IDL",   # "SEL" | "IDL" | "Audit" | combinations
    severity="Warning"      # "Critical" | "Warning" | "Info"
)
bmc.syslog.disable_server(0)
bmc.syslog.test()

bmc.logs

bmc.logs.sel(limit=50)          # System Event Log
bmc.logs.idl()                   # Intelligent Diagnose Log
bmc.logs.audit()                 # Audit log (config changes, logins)
bmc.logs.alarms()                # Active alarms
bmc.logs.all_logs()              # All services at once
bmc.logs.sel_summary()           # Count by severity
bmc.logs.recent_sel(10)
bmc.logs.recent_audit(20)
bmc.logs.search_idl("PSU")
bmc.logs.clear("SEL")           # "SEL" | "IDL" | "AuditLog"

bmc.accounts

bmc.accounts.summary()
bmc.accounts.create("ops", "SecurePass1!", role="Operator")
bmc.accounts.set_password("3", "NewPass!")
bmc.accounts.set_role("3", "ReadOnly")
bmc.accounts.set_enabled("3", False)
bmc.accounts.delete("3")

bmc.hardware

bmc.hardware.cpu_summary()      # Model, cores, threads, live MHz, TDP, cache, microcode
bmc.hardware.memory_summary()   # Populated DIMMs: capacity, type, speed, manufacturer
bmc.hardware.memory_total_gib()
bmc.hardware.nic_adapters()     # Network adapter cards
bmc.hardware.nic_ports("outboardPCIeCard25")
bmc.hardware.pcie_devices()     # All PCIe devices
bmc.hardware.boards()           # Chassis boards / FRU data

bmc.virtualmedia

Requires: pip install 'kaytus-bmc-sdk[virtualmedia]' (or pip install websockets>=14)

# One-shot: set boot source, reboot, and stream ISO until boot completes
bmc.virtualmedia.boot_cd("/path/to/proxmox-ve_9.2-1.iso")

# Step-by-step:
bmc.virtualmedia.set_boot_cd()              # set boot override → CD (Once, UEFI)
bmc.system.force_reboot()
bmc.virtualmedia.stream("/path/to/file.iso") # blocks until BMC disconnects

# Options:
bmc.virtualmedia.set_boot_cd(enabled="Continuous", mode="Legacy")
bmc.virtualmedia.boot_cd("/path/to/file.iso", boot_mode="Legacy", graceful=True)

bmc.bios

bmc.bios.version()
bmc.bios.info()
bmc.bios.set_attributes({"AttributeName": "Value"})
bmc.bios.reset_to_defaults()
bmc.bios.switch_active_bios("Bios-0")   # Dual BIOS slot switch
bmc.bios.export_config()

bmc.firmware

bmc.firmware.summary()          # All components: FanCPLD, PSU, VR, BIOS, BMC, CPLD
bmc.firmware.bmc_version()
bmc.firmware.bios_version()
bmc.firmware.tftp_update("tftp://10.0.0.1/bmc.bin")
bmc.firmware.update_status("task-id")

Error Handling

from kaytus_sdk import (
    KaytusAuthError,
    KaytusConnectionError,
    KaytusHTTPError,
    KaytusETagError,
    KaytusNotFoundError,
)

try:
    with KaytusClient("192.168.40.100", "admin", "password") as bmc:
        bmc.system.overview()
except KaytusConnectionError:
    print("Host unreachable or timed out")
except KaytusAuthError:
    print("Invalid credentials")
except KaytusHTTPError as e:
    print(f"HTTP error: {e.status_code}")

Notes

  • All PATCH operations are ETag-aware. The client handles ETag retrieval and stale-ETag retries automatically.
  • Some BMC firmware versions return HTTP 400 for successful PATCH/POST operations. The SDK detects and handles this known firmware behaviour.
  • SSL certificate verification is disabled by default (verify_ssl=False). Pass verify_ssl=True to enforce it.

License

MIT


Acknowledgements

Special thanks to Muhammed Musa Güngör — our Infrastructure Hero — for providing hardware access, testing support, and keeping the servers running throughout the development and validation of this SDK.

Special thanks to Serdar Sarıkaya for valuable support and contributions during the development and testing of this SDK.


Contributing

Pull requests are welcome. Please test changes against a real Kaytus BMC before submitting.

Project details


Download files

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

Source Distribution

kaytus_bmc_sdk-2.1.0.tar.gz (106.0 kB view details)

Uploaded Source

Built Distribution

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

kaytus_bmc_sdk-2.1.0-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file kaytus_bmc_sdk-2.1.0.tar.gz.

File metadata

  • Download URL: kaytus_bmc_sdk-2.1.0.tar.gz
  • Upload date:
  • Size: 106.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for kaytus_bmc_sdk-2.1.0.tar.gz
Algorithm Hash digest
SHA256 3612029eb6fe282baf0318544f6a3d387fb23286da1966b93644b2b5f4196391
MD5 f5eca70361d08441fe7660ba996b27da
BLAKE2b-256 8636bbd795b13bf4eccfcf5be420c6eef62638a237d3b39f3a1159ce333a3f78

See more details on using hashes here.

File details

Details for the file kaytus_bmc_sdk-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: kaytus_bmc_sdk-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for kaytus_bmc_sdk-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b3b6636352907e97cc4d3d23d0cc81338951cdef08c42fa7442f4ea24d297f0
MD5 02055fbea951744c0881a80fd60c9f70
BLAKE2b-256 55c8f218cec73a47f80deb7ae3d0db3f9f52767458a5bdb2bec9119803f77346

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