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.

Developed and tested against production hardware at Turksat data center infrastructure.


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("10.255.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.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("10.255.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.


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.0.1.tar.gz (18.2 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.0.1-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kaytus_bmc_sdk-2.0.1.tar.gz
  • Upload date:
  • Size: 18.2 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.0.1.tar.gz
Algorithm Hash digest
SHA256 baee5550671a9a59de583255c384ac2e2dc5ef6dc683b69a397f17fe8035b0d6
MD5 362a7d10b01a855fbbb081e769b71340
BLAKE2b-256 c500b23ad053e955e9ad8e6a7d5c283f9891b95aa01da14484e58a023645a046

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kaytus_bmc_sdk-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 22.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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e278071bd170ee9f623bf09f88debe9fe9c6ebfc323924998e7a2a3901f52862
MD5 37fd99de96c3b304bab5c2b6f8578c1c
BLAKE2b-256 95f50dfef999adbe8131a6346ea6502ed75812d9840ccbf7f6cda455ea21d072

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