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.2.tar.gz (37.1 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.2-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kaytus_bmc_sdk-2.0.2.tar.gz
  • Upload date:
  • Size: 37.1 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.2.tar.gz
Algorithm Hash digest
SHA256 e14b53175e29154f01ef39bee344f549934abd84e7f02a769e4f64653f34feae
MD5 aba4a46577440b17b6d6856482163de0
BLAKE2b-256 7df4c4ecfab07a004ee9c84495ed3720584c3ebd8d595c8b134990881bf388f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kaytus_bmc_sdk-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 22.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3a08c4e03b53dd82f0809d1fcf4c0f62e9b374b7a3e389deb48025fe6b20f438
MD5 c65616e58c795c59debdef3c9fb93ac2
BLAKE2b-256 2d3b69bdcf0bf427d0ee3206a9d287606b86b0924ff8f6ab28a15524b04030f2

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